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

Unified Diff: petitparser/lib/src/json/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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « petitparser/lib/src/json/grammar.dart ('k') | petitparser/lib/src/lisp/cons.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: petitparser/lib/src/json/parser.dart
diff --git a/petitparser/lib/src/json/parser.dart b/petitparser/lib/src/json/parser.dart
deleted file mode 100644
index 340ac7edde5270ad540fee512bf8edfbff990d11..0000000000000000000000000000000000000000
--- a/petitparser/lib/src/json/parser.dart
+++ /dev/null
@@ -1,47 +0,0 @@
-part of json;
-
-/**
- * JSON parser.
- */
-class JsonParser extends GrammarParser {
- JsonParser() : super(const JsonParserDefinition());
-}
-
-/**
- * JSON parser definition.
- */
-class JsonParserDefinition extends JsonGrammarDefinition {
- const JsonParserDefinition();
-
- array() => super.array().map((each) => each[1] != null ? each[1] : new List());
- object() => super.object().map((each) {
- var result = new LinkedHashMap();
- if (each[1] != null) {
- for (var element in each[1]) {
- result[element[0]] = element[2];
- }
- }
- return result;
- });
-
- trueToken() => super.trueToken().map((each) => true);
- falseToken() => super.falseToken().map((each) => false);
- nullToken() => super.nullToken().map((each) => null);
- stringToken() => ref(stringPrimitive).trim();
- numberToken() => super.numberToken().map((each) {
- var floating = double.parse(each);
- var integral = floating.toInt();
- if (floating == integral && each.indexOf('.') == -1) {
- return integral;
- } else {
- return floating;
- }
- });
-
- stringPrimitive() => super.stringPrimitive().map((each) => each[1].join());
- characterEscape() => super.characterEscape().map((each) => JSON_ESCAPE_CHARS[each[1]]);
- characterOctal() => super.characterOctal().map((each) {
- throw new UnsupportedError('Octal characters not supported yet');
- });
-
-}
« no previous file with comments | « petitparser/lib/src/json/grammar.dart ('k') | petitparser/lib/src/lisp/cons.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698