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

Side by Side Diff: packages/petitparser/lib/src/lisp/parser.dart

Issue 1400473008: Roll Observatory packages and add a roll script (Closed) Base URL: git@github.com:dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 years, 2 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
OLDNEW
1 part of lisp; 1 part of petitparser.lisp;
2 2
3 /** 3 /// LISP parser.
4 * LISP parser.
5 */
6 class LispParser extends GrammarParser { 4 class LispParser extends GrammarParser {
7 LispParser() : super(new LispParserDefinition()); 5 LispParser() : super(new LispParserDefinition());
8 } 6 }
9 7
10 /** 8 /// LISP parser definition.
11 * LISP parser definition.
12 */
13 class LispParserDefinition extends LispGrammarDefinition { 9 class LispParserDefinition extends LispGrammarDefinition {
14 10
15 list() => super.list().map((each) => each[1]); 11 list() => super.list().map((each) => each[1]);
16 12
17 cell() => super.cell().map((each) => new Cons(each[0], each[1])); 13 cell() => super.cell().map((each) => new Cons(each[0], each[1]));
18 empty() => super.empty().map((each) => null); 14 empty() => super.empty().map((each) => null);
19 15
20 string() => super.string().map((each) => new String.fromCharCodes(each[1])); 16 string() => super.string().map((each) => new String.fromCharCodes(each[1]));
21 characterEscape() => super.characterEscape().map((each) => each[1].codeUnitAt( 0)); 17 characterEscape() => super.characterEscape().map((each) => each[1].codeUnitAt( 0));
22 characterRaw() => super.characterRaw().map((each) => each.codeUnitAt(0)); 18 characterRaw() => super.characterRaw().map((each) => each.codeUnitAt(0));
23 19
24 symbol() => super.symbol().map((each) => new Name(each)); 20 symbol() => super.symbol().map((each) => new Name(each));
25 number() => super.number().map((each) { 21 number() => super.number().map((each) {
26 var floating = double.parse(each); 22 var floating = double.parse(each);
27 var integral = floating.toInt(); 23 var integral = floating.toInt();
28 if (floating == integral && each.indexOf('.') == -1) { 24 if (floating == integral && each.indexOf('.') == -1) {
29 return integral; 25 return integral;
30 } else { 26 } else {
31 return floating; 27 return floating;
32 } 28 }
33 }); 29 });
34 30
35 quote() => super.quote().map((each) => new Cons(Natives._quote, each[1])); 31 quote() => super.quote().map((each) => new Cons(Natives._quote, each[1]));
36 32
37 } 33 }
OLDNEW
« no previous file with comments | « packages/petitparser/lib/src/lisp/natives.dart ('k') | packages/petitparser/lib/src/lisp/standard.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698