Skip to content

Commit f079036

Browse files
committed
---
yaml --- r: 177070 b: refs/heads/auto c: 888a149 h: refs/heads/master v: v3
1 parent 8d060d7 commit f079036

File tree

2 files changed

+69
-69
lines changed

2 files changed

+69
-69
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: 7faffbef68faf268bd310d07df1c24368379dfb9
13+
refs/heads/auto: 888a14908806d8f0fc60ff4df44aad6e761d3d00
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/etc/extract_grammar.py

Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414

1515
import fileinput
1616

17-
collections = { "gram": [],
18-
"keyword": [],
19-
"reserved": [],
20-
"binop": [],
21-
"unop": [] }
17+
collections = {"gram": [],
18+
"keyword": [],
19+
"reserved": [],
20+
"binop": [],
21+
"unop": []}
2222

2323

2424
in_coll = False
@@ -47,66 +47,66 @@
4747
# Define operator symbol-names here
4848

4949
tokens = ["non_star", "non_slash", "non_eol",
50-
"non_single_quote", "non_double_quote", "ident" ]
50+
"non_single_quote", "non_double_quote", "ident"]
5151

5252
symnames = {
53-
".": "dot",
54-
"+": "plus",
55-
"-": "minus",
56-
"/": "slash",
57-
"*": "star",
58-
"%": "percent",
59-
60-
"~": "tilde",
61-
"@": "at",
62-
63-
"!": "not",
64-
"&": "and",
65-
"|": "or",
66-
"^": "xor",
67-
68-
"<<": "lsl",
69-
">>": "lsr",
70-
">>>": "asr",
71-
72-
"&&": "andand",
73-
"||": "oror",
74-
75-
"<" : "lt",
76-
"<=" : "le",
77-
"==" : "eqeq",
78-
">=" : "ge",
79-
">" : "gt",
80-
81-
"=": "eq",
82-
83-
"+=": "plusequal",
84-
"-=": "minusequal",
85-
"/=": "divequal",
86-
"*=": "starequal",
87-
"%=": "percentequal",
88-
89-
"&=": "andequal",
90-
"|=": "orequal",
91-
"^=": "xorequal",
92-
93-
">>=": "lsrequal",
94-
">>>=": "asrequal",
95-
"<<=": "lslequal",
96-
97-
"::": "coloncolon",
98-
99-
"->": "rightarrow",
100-
"<-": "leftarrow",
101-
"<->": "swaparrow",
102-
103-
"//": "linecomment",
104-
"/*": "openblockcomment",
105-
"*/": "closeblockcomment",
106-
"macro_rules": "macro_rules",
107-
"=>" : "eg",
108-
".." : "dotdot",
109-
"," : "comma"
53+
".": "dot",
54+
"+": "plus",
55+
"-": "minus",
56+
"/": "slash",
57+
"*": "star",
58+
"%": "percent",
59+
60+
"~": "tilde",
61+
"@": "at",
62+
63+
"!": "not",
64+
"&": "and",
65+
"|": "or",
66+
"^": "xor",
67+
68+
"<<": "lsl",
69+
">>": "lsr",
70+
">>>": "asr",
71+
72+
"&&": "andand",
73+
"||": "oror",
74+
75+
"<": "lt",
76+
"<=": "le",
77+
"==": "eqeq",
78+
">=": "ge",
79+
">": "gt",
80+
81+
"=": "eq",
82+
83+
"+=": "plusequal",
84+
"-=": "minusequal",
85+
"/=": "divequal",
86+
"*=": "starequal",
87+
"%=": "percentequal",
88+
89+
"&=": "andequal",
90+
"|=": "orequal",
91+
"^=": "xorequal",
92+
93+
">>=": "lsrequal",
94+
">>>=": "asrequal",
95+
"<<=": "lslequal",
96+
97+
"::": "coloncolon",
98+
99+
"->": "rightarrow",
100+
"<-": "leftarrow",
101+
"<->": "swaparrow",
102+
103+
"//": "linecomment",
104+
"/*": "openblockcomment",
105+
"*/": "closeblockcomment",
106+
"macro_rules": "macro_rules",
107+
"=>": "eg",
108+
"..": "dotdot",
109+
",": "comma"
110110
}
111111

112112
lines = []
@@ -126,8 +126,8 @@
126126
+ word)
127127
if word not in tokens:
128128
if (word in collections["keyword"] or
129-
word in collections["reserved"]):
130-
tokens.append(word)
129+
word in collections["reserved"]):
130+
tokens.append(word)
131131
else:
132132
raise Exception("unknown keyword/reserved word: "
133133
+ word)
@@ -149,8 +149,8 @@
149149
print("%start parser, token;")
150150
print("%%token %s ;" % ("\n\t, ".join(tokens)))
151151
for coll in ["keyword", "reserved"]:
152-
print("%s: %s ; " % (coll, "\n\t| ".join(collections[coll])));
152+
print("%s: %s ; " % (coll, "\n\t| ".join(collections[coll])))
153153
for coll in ["binop", "unop"]:
154154
print("%s: %s ; " % (coll, "\n\t| ".join([symnames[x]
155-
for x in collections[coll]])));
156-
print("\n".join(lines));
155+
for x in collections[coll]])))
156+
print("\n".join(lines))

0 commit comments

Comments
 (0)