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

Side by Side Diff: utils/pub/yaml/parser.dart

Issue 10919024: - Change "static final" to "static const" in the (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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
« no previous file with comments | « utils/pub/yaml/model.dart ('k') | utils/template/codegen.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 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 /** 5 /**
6 * Translates a string of characters into a YAML serialization tree. 6 * Translates a string of characters into a YAML serialization tree.
7 * 7 *
8 * This parser is designed to closely follow the spec. All productions in the 8 * This parser is designed to closely follow the spec. All productions in the
9 * spec are numbered, and the corresponding methods in the parser have the same 9 * spec are numbered, and the corresponding methods in the parser have the same
10 * numbers. This is certainly not the most efficient way of parsing YAML, but it 10 * numbers. This is certainly not the most efficient way of parsing YAML, but it
11 * is the easiest to write and read in the context of the spec. 11 * is the easiest to write and read in the context of the spec.
12 * 12 *
13 * Methods corresponding to productions are also named as in the spec, 13 * Methods corresponding to productions are also named as in the spec,
14 * translating the name of the method (although not the annotation characters) 14 * translating the name of the method (although not the annotation characters)
15 * into camel-case for dart style.. For example, the spec has a production named 15 * into camel-case for dart style.. For example, the spec has a production named
16 * `nb-ns-plain-in-line`, and the method implementing it is named 16 * `nb-ns-plain-in-line`, and the method implementing it is named
17 * `nb_ns_plainInLine`. The exception to that rule is methods that just 17 * `nb_ns_plainInLine`. The exception to that rule is methods that just
18 * recognize character classes; these are named `is*`. 18 * recognize character classes; these are named `is*`.
19 */ 19 */
20 class _Parser { 20 class _Parser {
21 static final TAB = 0x9; 21 static const TAB = 0x9;
22 static final LF = 0xA; 22 static const LF = 0xA;
23 static final CR = 0xD; 23 static const CR = 0xD;
24 static final SP = 0x20; 24 static const SP = 0x20;
25 static final TILDE = 0x7E; 25 static const TILDE = 0x7E;
26 static final NEL = 0x85; 26 static const NEL = 0x85;
27 static final PLUS = 0x2B; 27 static const PLUS = 0x2B;
28 static final HYPHEN = 0x2D; 28 static const HYPHEN = 0x2D;
29 static final QUESTION_MARK = 0x3F; 29 static const QUESTION_MARK = 0x3F;
30 static final COLON = 0x3A; 30 static const COLON = 0x3A;
31 static final COMMA = 0x2C; 31 static const COMMA = 0x2C;
32 static final LEFT_BRACKET = 0x5B; 32 static const LEFT_BRACKET = 0x5B;
33 static final RIGHT_BRACKET = 0x5D; 33 static const RIGHT_BRACKET = 0x5D;
34 static final LEFT_BRACE = 0x7B; 34 static const LEFT_BRACE = 0x7B;
35 static final RIGHT_BRACE = 0x7D; 35 static const RIGHT_BRACE = 0x7D;
36 static final HASH = 0x23; 36 static const HASH = 0x23;
37 static final AMPERSAND = 0x26; 37 static const AMPERSAND = 0x26;
38 static final ASTERISK = 0x2A; 38 static const ASTERISK = 0x2A;
39 static final EXCLAMATION = 0x21; 39 static const EXCLAMATION = 0x21;
40 static final VERTICAL_BAR = 0x7C; 40 static const VERTICAL_BAR = 0x7C;
41 static final GREATER_THAN = 0x3E; 41 static const GREATER_THAN = 0x3E;
42 static final SINGLE_QUOTE = 0x27; 42 static const SINGLE_QUOTE = 0x27;
43 static final DOUBLE_QUOTE = 0x22; 43 static const DOUBLE_QUOTE = 0x22;
44 static final PERCENT = 0x25; 44 static const PERCENT = 0x25;
45 static final AT = 0x40; 45 static const AT = 0x40;
46 static final GRAVE_ACCENT = 0x60; 46 static const GRAVE_ACCENT = 0x60;
47 47
48 static final NULL = 0x0; 48 static const NULL = 0x0;
49 static final BELL = 0x7; 49 static const BELL = 0x7;
50 static final BACKSPACE = 0x8; 50 static const BACKSPACE = 0x8;
51 static final VERTICAL_TAB = 0xB; 51 static const VERTICAL_TAB = 0xB;
52 static final FORM_FEED = 0xC; 52 static const FORM_FEED = 0xC;
53 static final ESCAPE = 0x1B; 53 static const ESCAPE = 0x1B;
54 static final SLASH = 0x2F; 54 static const SLASH = 0x2F;
55 static final BACKSLASH = 0x5C; 55 static const BACKSLASH = 0x5C;
56 static final UNDERSCORE = 0x5F; 56 static const UNDERSCORE = 0x5F;
57 static final NBSP = 0xA0; 57 static const NBSP = 0xA0;
58 static final LINE_SEPARATOR = 0x2028; 58 static const LINE_SEPARATOR = 0x2028;
59 static final PARAGRAPH_SEPARATOR = 0x2029; 59 static const PARAGRAPH_SEPARATOR = 0x2029;
60 60
61 static final NUMBER_0 = 0x30; 61 static const NUMBER_0 = 0x30;
62 static final NUMBER_9 = 0x39; 62 static const NUMBER_9 = 0x39;
63 63
64 static final LETTER_A = 0x61; 64 static const LETTER_A = 0x61;
65 static final LETTER_B = 0x62; 65 static const LETTER_B = 0x62;
66 static final LETTER_E = 0x65; 66 static const LETTER_E = 0x65;
67 static final LETTER_F = 0x66; 67 static const LETTER_F = 0x66;
68 static final LETTER_N = 0x6E; 68 static const LETTER_N = 0x6E;
69 static final LETTER_R = 0x72; 69 static const LETTER_R = 0x72;
70 static final LETTER_T = 0x74; 70 static const LETTER_T = 0x74;
71 static final LETTER_U = 0x75; 71 static const LETTER_U = 0x75;
72 static final LETTER_V = 0x76; 72 static const LETTER_V = 0x76;
73 static final LETTER_X = 0x78; 73 static const LETTER_X = 0x78;
74 74
75 static final LETTER_CAP_A = 0x41; 75 static const LETTER_CAP_A = 0x41;
76 static final LETTER_CAP_F = 0x46; 76 static const LETTER_CAP_F = 0x46;
77 static final LETTER_CAP_L = 0x4C; 77 static const LETTER_CAP_L = 0x4C;
78 static final LETTER_CAP_N = 0x4E; 78 static const LETTER_CAP_N = 0x4E;
79 static final LETTER_CAP_P = 0x50; 79 static const LETTER_CAP_P = 0x50;
80 static final LETTER_CAP_U = 0x55; 80 static const LETTER_CAP_U = 0x55;
81 static final LETTER_CAP_X = 0x58; 81 static const LETTER_CAP_X = 0x58;
82 82
83 static final C_SEQUENCE_ENTRY = 4; 83 static const C_SEQUENCE_ENTRY = 4;
84 static final C_MAPPING_KEY = 5; 84 static const C_MAPPING_KEY = 5;
85 static final C_MAPPING_VALUE = 6; 85 static const C_MAPPING_VALUE = 6;
86 static final C_COLLECT_ENTRY = 7; 86 static const C_COLLECT_ENTRY = 7;
87 static final C_SEQUENCE_START = 8; 87 static const C_SEQUENCE_START = 8;
88 static final C_SEQUENCE_END = 9; 88 static const C_SEQUENCE_END = 9;
89 static final C_MAPPING_START = 10; 89 static const C_MAPPING_START = 10;
90 static final C_MAPPING_END = 11; 90 static const C_MAPPING_END = 11;
91 static final C_COMMENT = 12; 91 static const C_COMMENT = 12;
92 static final C_ANCHOR = 13; 92 static const C_ANCHOR = 13;
93 static final C_ALIAS = 14; 93 static const C_ALIAS = 14;
94 static final C_TAG = 15; 94 static const C_TAG = 15;
95 static final C_LITERAL = 16; 95 static const C_LITERAL = 16;
96 static final C_FOLDED = 17; 96 static const C_FOLDED = 17;
97 static final C_SINGLE_QUOTE = 18; 97 static const C_SINGLE_QUOTE = 18;
98 static final C_DOUBLE_QUOTE = 19; 98 static const C_DOUBLE_QUOTE = 19;
99 static final C_DIRECTIVE = 20; 99 static const C_DIRECTIVE = 20;
100 static final C_RESERVED = 21; 100 static const C_RESERVED = 21;
101 101
102 static final BLOCK_OUT = 0; 102 static const BLOCK_OUT = 0;
103 static final BLOCK_IN = 1; 103 static const BLOCK_IN = 1;
104 static final FLOW_OUT = 2; 104 static const FLOW_OUT = 2;
105 static final FLOW_IN = 3; 105 static const FLOW_IN = 3;
106 static final BLOCK_KEY = 4; 106 static const BLOCK_KEY = 4;
107 static final FLOW_KEY = 5; 107 static const FLOW_KEY = 5;
108 108
109 static final CHOMPING_STRIP = 0; 109 static const CHOMPING_STRIP = 0;
110 static final CHOMPING_KEEP = 1; 110 static const CHOMPING_KEEP = 1;
111 static final CHOMPING_CLIP = 2; 111 static const CHOMPING_CLIP = 2;
112 112
113 /** The source string being parsed. */ 113 /** The source string being parsed. */
114 final String s; 114 final String s;
115 115
116 /** The current position in the source string. */ 116 /** The current position in the source string. */
117 int pos = 0; 117 int pos = 0;
118 118
119 /** The length of the string being parsed. */ 119 /** The length of the string being parsed. */
120 final int len; 120 final int len;
121 121
(...skipping 1772 matching lines...) Expand 10 before | Expand all | Expand 10 after
1894 1894
1895 /** The information in the header for a block scalar. */ 1895 /** The information in the header for a block scalar. */
1896 class _BlockHeader { 1896 class _BlockHeader {
1897 final int additionalIndent; 1897 final int additionalIndent;
1898 final int chomping; 1898 final int chomping;
1899 1899
1900 _BlockHeader(this.additionalIndent, this.chomping); 1900 _BlockHeader(this.additionalIndent, this.chomping);
1901 1901
1902 bool get autoDetectIndent => additionalIndent == null; 1902 bool get autoDetectIndent => additionalIndent == null;
1903 } 1903 }
OLDNEW
« no previous file with comments | « utils/pub/yaml/model.dart ('k') | utils/template/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698