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

Side by Side Diff: frog/frogsh

Issue 8591010: fix $this in string interpolation (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 1 month 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
« no previous file with comments | « no previous file | frog/parser.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env node 1 #!/usr/bin/env node
2 // ********** Library dart:core ************** 2 // ********** Library dart:core **************
3 // ********** Natives dart:core ************** 3 // ********** Natives dart:core **************
4 /** 4 /**
5 * Generates a dynamic call stub for a function. 5 * Generates a dynamic call stub for a function.
6 * Our goal is to create a stub method like this on-the-fly: 6 * Our goal is to create a stub method like this on-the-fly:
7 * function($0, $1, capture) { this($0, $1, true, capture); } 7 * function($0, $1, capture) { this($0, $1, true, capture); }
8 * 8 *
9 * This stub then replaces the dynamic one on Function, with one that is 9 * This stub then replaces the dynamic one on Function, with one that is
10 * specialized for that particular function, taking into account its default 10 * specialized for that particular function, taking into account its default
(...skipping 17333 matching lines...) Expand 10 before | Expand all | Expand 10 after
17344 text = $add(text.substring$2(0, text.length - 1), endQuote); 17344 text = $add(text.substring$2(0, text.length - 1), endQuote);
17345 } 17345 }
17346 else { 17346 else {
17347 text = $add($add(startQuote, text.substring$2(0, text.length - 1)), endQuo te); 17347 text = $add($add(startQuote, text.substring$2(0, text.length - 1)), endQuo te);
17348 } 17348 }
17349 lits.add$1(this.makeStringLiteral($assert_String(text), token.get$span())); 17349 lits.add$1(this.makeStringLiteral($assert_String(text), token.get$span()));
17350 if ($notnull_bool(this._maybeEat(6/*TokenKind.LBRACE*/))) { 17350 if ($notnull_bool(this._maybeEat(6/*TokenKind.LBRACE*/))) {
17351 lits.add$1(this.expression()); 17351 lits.add$1(this.expression());
17352 this._eat(7/*TokenKind.RBRACE*/); 17352 this._eat(7/*TokenKind.RBRACE*/);
17353 } 17353 }
17354 else if ($notnull_bool(this._maybeEat(108/*TokenKind.THIS*/))) {
17355 lits.add$1(new ThisExpression(this._previousToken.get$span()));
17356 }
17354 else { 17357 else {
17355 var id = this.identifier(); 17358 var id = this.identifier();
17356 lits.add$1(new VarExpression(id, id.get$span())); 17359 lits.add$1(new VarExpression(id, id.get$span()));
17357 } 17360 }
17358 } 17361 }
17359 var tok = this._lang_next(); 17362 var tok = this._lang_next();
17360 if ($notnull_bool($ne(tok.kind, 58/*TokenKind.STRING*/))) { 17363 if ($notnull_bool($ne(tok.kind, 58/*TokenKind.STRING*/))) {
17361 this._errorExpected('interpolated string'); 17364 this._errorExpected('interpolated string');
17362 } 17365 }
17363 var text = $add(startQuote, tok.get$text()); 17366 var text = $add(startQuote, tok.get$text());
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
17511 } 17514 }
17512 else { 17515 else {
17513 return -1; 17516 return -1;
17514 } 17517 }
17515 } 17518 }
17516 lang_Parser.parseHex = function(hex) { 17519 lang_Parser.parseHex = function(hex) {
17517 var result = 0; 17520 var result = 0;
17518 for (var i = 0; 17521 for (var i = 0;
17519 i < hex.length; i++) { 17522 i < hex.length; i++) {
17520 var digit = lang_Parser._hexDigit(hex.charCodeAt(i)); 17523 var digit = lang_Parser._hexDigit(hex.charCodeAt(i));
17521 $assert($ne(digit, -1), "digit != -1", "parser.dart", 1259, 14); 17524 $assert($ne(digit, -1), "digit != -1", "parser.dart", 1261, 14);
17522 result = (result << 4) + $assert_num(digit); 17525 result = (result << 4) + $assert_num(digit);
17523 } 17526 }
17524 return $assert_num(result); 17527 return $assert_num(result);
17525 } 17528 }
17526 lang_Parser.prototype.finishNewExpression = function(start, isConst) { 17529 lang_Parser.prototype.finishNewExpression = function(start, isConst) {
17527 var type = this.type(0); 17530 var type = this.type(0);
17528 var name = null; 17531 var name = null;
17529 if ($notnull_bool(this._maybeEat(14/*TokenKind.DOT*/))) { 17532 if ($notnull_bool(this._maybeEat(14/*TokenKind.DOT*/))) {
17530 name = this.identifier(); 17533 name = this.identifier();
17531 } 17534 }
(...skipping 4200 matching lines...) Expand 10 before | Expand all | Expand 10 after
21732 INTERFACE, 21735 INTERFACE,
21733 LIBRARY, 21736 LIBRARY,
21734 NATIVE, 21737 NATIVE,
21735 NEGATE, 21738 NEGATE,
21736 OPERATOR, 21739 OPERATOR,
21737 SET, 21740 SET,
21738 SOURCE, 21741 SOURCE,
21739 STATIC, 21742 STATIC,
21740 TYPEDEF ]*/; 21743 TYPEDEF ]*/;
21741 main(); 21744 main();
OLDNEW
« no previous file with comments | « no previous file | frog/parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698