Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1258)

Side by Side Diff: dart/frog/leg/tree/nodes.dart

Issue 9309061: Implement script tags. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 interface Visitor<R> { 5 interface Visitor<R> {
6 R visitBlock(Block node); 6 R visitBlock(Block node);
7 R visitBreakStatement(BreakStatement node); 7 R visitBreakStatement(BreakStatement node);
8 R visitCatchBlock(CatchBlock node); 8 R visitCatchBlock(CatchBlock node);
9 R visitClassNode(ClassNode node); 9 R visitClassNode(ClassNode node);
10 R visitConditional(Conditional node); 10 R visitConditional(Conditional node);
(...skipping 1338 matching lines...) Expand 10 before | Expand all | Expand 10 after
1349 final LiteralString argument; 1349 final LiteralString argument;
1350 final Identifier prefixIdentifier; 1350 final Identifier prefixIdentifier;
1351 final LiteralString prefix; 1351 final LiteralString prefix;
1352 1352
1353 final Token beginToken; 1353 final Token beginToken;
1354 final Token endToken; 1354 final Token endToken;
1355 1355
1356 ScriptTag(this.tag, this.argument, this.prefixIdentifier, this.prefix, 1356 ScriptTag(this.tag, this.argument, this.prefixIdentifier, this.prefix,
1357 this.beginToken, this.endToken); 1357 this.beginToken, this.endToken);
1358 1358
1359 bool isImport() => tag.source == const SourceString("import");
1360 bool isSource() => tag.source == const SourceString("source");
1361 bool isLibrary() => tag.source == const SourceString("library");
1362
1359 ScriptTag asScriptTag() => this; 1363 ScriptTag asScriptTag() => this;
1360 1364
1361 accept(Visitor visitor) => visitor.visitScriptTag(this); 1365 accept(Visitor visitor) => visitor.visitScriptTag(this);
1362 1366
1363 visitChildren(Visitor visitor) { 1367 visitChildren(Visitor visitor) {
1364 tag.accept(visitor); 1368 tag.accept(visitor);
1365 argument.accept(visitor); 1369 argument.accept(visitor);
1366 if (prefixIdentifier !== null) prefixIdentifier.accept(visitor); 1370 if (prefixIdentifier !== null) prefixIdentifier.accept(visitor);
1367 if (prefix !== null) prefix.accept(visitor); 1371 if (prefix !== null) prefix.accept(visitor);
1368 } 1372 }
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
1443 1447
1444 visitChildren(Visitor visitor) { 1448 visitChildren(Visitor visitor) {
1445 formals.accept(visitor); 1449 formals.accept(visitor);
1446 block.accept(visitor); 1450 block.accept(visitor);
1447 } 1451 }
1448 1452
1449 Token getBeginToken() => catchKeyword; 1453 Token getBeginToken() => catchKeyword;
1450 1454
1451 Token getEndToken() => block.getEndToken(); 1455 Token getEndToken() => block.getEndToken();
1452 } 1456 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698