Browse Source

Sol Part 12: It Probably Builds This Time!

master
Grissess 7 years ago
parent
commit
76cea44e46
  1. 313
      parser.output
  2. 564
      parser.tab.c
  3. 30
      parser.y
  4. 2
      solrun.c

313
parser.output

@ -49,9 +49,8 @@ State 151 conflicts: 2 shift/reduce
State 152 conflicts: 2 shift/reduce
State 153 conflicts: 2 shift/reduce
State 161 conflicts: 1 shift/reduce
State 164 conflicts: 1 shift/reduce
State 167 conflicts: 13 shift/reduce
State 181 conflicts: 1 shift/reduce
State 165 conflicts: 13 shift/reduce
State 178 conflicts: 1 shift/reduce
Grammar
@ -165,18 +164,18 @@ Grammar
85 expr_list: %empty
86 | expr
87 | expr_list expr
88 | expr_list COMMA expr
87 | expr_list COMMA
88 | expr_list expr
89 ident_list: %empty
90 | IDENT
91 | ident_list IDENT
92 | ident_list COMMA IDENT
91 | ident_list COMMA
92 | ident_list IDENT
93 assoc_list: %empty
94 | assoc_item
95 | assoc_list assoc_item
96 | assoc_list COMMA assoc_item
95 | assoc_list COMMA
96 | assoc_list assoc_item
97 assoc_item: LBRACKET expr RBRACKET ASSIGN expr
98 | IDENT ASSIGN expr
@ -199,7 +198,7 @@ BREAK (267) 11
CONTINUE (268) 12
END (269) 5 6 7 8 65 66
NONE (270) 79
IDENT (271) 8 14 15 16 17 18 19 20 21 22 63 65 69 72 73 90 91 92 98
IDENT (271) 8 14 15 16 17 18 19 20 21 22 63 65 69 72 73 90 92 98
INT (272) 75 76
FLOAT (273) 77
STRING (274) 78
@ -240,7 +239,7 @@ RBRACKET (308) 68 71 81 97
DOT (309) 69 72
COLON (310) 63
SEMICOLON (311) 13
COMMA (312) 88 92 96
COMMA (312) 87 91 95
POUND (313) 60
@ -257,7 +256,7 @@ stmt (62)
expr (63)
on left: 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
32, on right: 4 5 6 7 8 9 14 15 16 17 18 19 20 21 22 23 24 25 26
27 28 29 30 31 68 69 71 72 84 86 87 88 97 98
27 28 29 30 31 68 69 71 72 84 86 88 97 98
logic_expr (64)
on left: 33 34 35, on right: 32 33 34
ulogic_expr (65)
@ -299,7 +298,7 @@ ident_list (82)
assoc_list (83)
on left: 93 94 95 96, on right: 82 95 96
assoc_item (84)
on left: 97 98, on right: 94 95 96
on left: 97 98, on right: 94 96
State 0
@ -1116,8 +1115,8 @@ State 19
82 gen_expr: LBRACE . assoc_list RBRACE
93 assoc_list: . %empty [IDENT, RBRACE, LBRACKET, COMMA]
94 | . assoc_item
95 | . assoc_list assoc_item
96 | . assoc_list COMMA assoc_item
95 | . assoc_list COMMA
96 | . assoc_list assoc_item
97 assoc_item: . LBRACKET expr RBRACKET ASSIGN expr
98 | . IDENT ASSIGN expr
@ -1317,8 +1316,8 @@ State 21
84 paren_expr: . LPAREN expr RPAREN
85 expr_list: . %empty [FUNC, NONE, IDENT, INT, FLOAT, STRING, MINUS, BNOT, LNOT, LBRACE, LPAREN, LBRACKET, RBRACKET, COMMA, POUND]
86 | . expr
87 | . expr_list expr
88 | . expr_list COMMA expr
87 | . expr_list COMMA
88 | . expr_list expr
FUNC shift, and go to state 7
NONE shift, and go to state 11
@ -1732,8 +1731,8 @@ State 46
66 funcdecl_expr: FUNC LPAREN . ident_list RPAREN stmt_list END
89 ident_list: . %empty [IDENT, RPAREN, COMMA]
90 | . IDENT
91 | . ident_list IDENT
92 | . ident_list COMMA IDENT
91 | . ident_list COMMA
92 | . ident_list IDENT
IDENT shift, and go to state 104
@ -2938,8 +2937,8 @@ State 62
State 63
82 gen_expr: LBRACE assoc_list . RBRACE
95 assoc_list: assoc_list . assoc_item
96 | assoc_list . COMMA assoc_item
95 assoc_list: assoc_list . COMMA
96 | assoc_list . assoc_item
97 assoc_item: . LBRACKET expr RBRACKET ASSIGN expr
98 | . IDENT ASSIGN expr
@ -3060,8 +3059,8 @@ State 67
82 | . LBRACE assoc_list RBRACE
83 | . paren_expr
84 paren_expr: . LPAREN expr RPAREN
87 expr_list: expr_list . expr
88 | expr_list . COMMA expr
87 expr_list: expr_list . COMMA
88 | expr_list . expr
FUNC shift, and go to state 7
NONE shift, and go to state 11
@ -5199,8 +5198,8 @@ State 89
84 paren_expr: . LPAREN expr RPAREN
85 expr_list: . %empty [FUNC, NONE, IDENT, INT, FLOAT, STRING, MINUS, BNOT, LNOT, LBRACE, LPAREN, RPAREN, LBRACKET, COMMA, POUND]
86 | . expr
87 | . expr_list expr
88 | . expr_list COMMA expr
87 | . expr_list COMMA
88 | . expr_list expr
FUNC shift, and go to state 7
NONE shift, and go to state 11
@ -6377,8 +6376,8 @@ State 103
65 funcdecl_expr: FUNC IDENT LPAREN . ident_list RPAREN stmt_list END
89 ident_list: . %empty [IDENT, RPAREN, COMMA]
90 | . IDENT
91 | . ident_list IDENT
92 | . ident_list COMMA IDENT
91 | . ident_list COMMA
92 | . ident_list IDENT
IDENT shift, and go to state 104
@ -6398,8 +6397,8 @@ State 104
State 105
66 funcdecl_expr: FUNC LPAREN ident_list . RPAREN stmt_list END
91 ident_list: ident_list . IDENT
92 | ident_list . COMMA IDENT
91 ident_list: ident_list . COMMA
92 | ident_list . IDENT
IDENT shift, and go to state 158
RPAREN shift, and go to state 159
@ -6681,21 +6680,16 @@ State 117
State 118
96 assoc_list: assoc_list COMMA . assoc_item
97 assoc_item: . LBRACKET expr RBRACKET ASSIGN expr
98 | . IDENT ASSIGN expr
IDENT shift, and go to state 61
LBRACKET shift, and go to state 62
95 assoc_list: assoc_list COMMA .
assoc_item go to state 163
$default reduce using rule 95 (assoc_list)
State 119
95 assoc_list: assoc_list assoc_item .
96 assoc_list: assoc_list assoc_item .
$default reduce using rule 95 (assoc_list)
$default reduce using rule 96 (assoc_list)
State 120
@ -6714,111 +6708,9 @@ State 121
State 122
14 expr: . IDENT ASSIGN expr
15 | . IDENT ASSIGNPLUS expr
16 | . IDENT ASSIGNMINUS expr
17 | . IDENT ASSIGNSTAR expr
18 | . IDENT ASSIGNSLASH expr
19 | . IDENT ASSIGNDSTAR expr
20 | . IDENT ASSIGNBAND expr
21 | . IDENT ASSIGNBOR expr
22 | . IDENT ASSIGNBXOR expr
23 | . ex_index_expr ASSIGN expr
24 | . ex_index_expr ASSIGNPLUS expr
25 | . ex_index_expr ASSIGNMINUS expr
26 | . ex_index_expr ASSIGNSTAR expr
27 | . ex_index_expr ASSIGNSLASH expr
28 | . ex_index_expr ASSIGNDSTAR expr
29 | . ex_index_expr ASSIGNBAND expr
30 | . ex_index_expr ASSIGNBOR expr
31 | . ex_index_expr ASSIGNBXOR expr
32 | . logic_expr
33 logic_expr: . logic_expr LAND logic_expr
34 | . logic_expr LOR logic_expr
35 | . ulogic_expr
36 ulogic_expr: . LNOT ulogic_expr
37 | . rel_expr
38 rel_expr: . rel_expr EQUAL rel_expr
39 | . rel_expr LESS rel_expr
40 | . rel_expr GREATER rel_expr
41 | . rel_expr LESSEQ rel_expr
42 | . rel_expr GREATEREQ rel_expr
43 | . term_expr
44 term_expr: . term_expr PLUS term_expr
45 | . term_expr MINUS term_expr
46 | . factor_expr
47 factor_expr: . factor_expr STAR factor_expr
48 | . factor_expr SLASH factor_expr
49 | . power_expr
50 power_expr: . power_expr DSTAR power_expr
51 | . binary_expr
52 binary_expr: . binary_expr BAND binary_expr
53 | . binary_expr BOR binary_expr
54 | . binary_expr BXOR binary_expr
55 | . binary_expr LSHIFT binary_expr
56 | . binary_expr RSHIFT binary_expr
57 | . ubinary_expr
58 ubinary_expr: . BNOT ubinary_expr
59 | . ulen_expr
60 ulen_expr: . POUND ulen_expr
61 | . call_expr
62 call_expr: . call_expr LPAREN expr_list RPAREN
63 | . call_expr COLON IDENT LPAREN expr_list RPAREN
64 | . funcdecl_expr
65 funcdecl_expr: . FUNC IDENT LPAREN ident_list RPAREN stmt_list END
66 | . FUNC LPAREN ident_list RPAREN stmt_list END
67 | . index_expr
68 index_expr: . expr LBRACKET expr RBRACKET
69 | . expr DOT IDENT
70 | . ref_expr
71 ex_index_expr: . expr LBRACKET expr RBRACKET
72 | . expr DOT IDENT
73 ref_expr: . IDENT
74 | . lit_expr
75 lit_expr: . INT
76 | . MINUS INT
77 | . FLOAT
78 | . STRING
79 | . NONE
80 | . gen_expr
81 gen_expr: . LBRACKET expr_list RBRACKET
82 | . LBRACE assoc_list RBRACE
83 | . paren_expr
84 paren_expr: . LPAREN expr RPAREN
88 expr_list: expr_list COMMA . expr
FUNC shift, and go to state 7
NONE shift, and go to state 11
IDENT shift, and go to state 12
INT shift, and go to state 13
FLOAT shift, and go to state 14
STRING shift, and go to state 15
MINUS shift, and go to state 16
BNOT shift, and go to state 17
LNOT shift, and go to state 18
LBRACE shift, and go to state 19
LPAREN shift, and go to state 20
LBRACKET shift, and go to state 21
POUND shift, and go to state 22
87 expr_list: expr_list COMMA .
expr go to state 164
logic_expr go to state 25
ulogic_expr go to state 26
rel_expr go to state 27
term_expr go to state 28
factor_expr go to state 29
power_expr go to state 30
binary_expr go to state 31
ubinary_expr go to state 32
ulen_expr go to state 33
call_expr go to state 34
funcdecl_expr go to state 35
index_expr go to state 36
ex_index_expr go to state 37
ref_expr go to state 38
lit_expr go to state 39
gen_expr go to state 40
paren_expr go to state 41
$default reduce using rule 87 (expr_list)
State 123
@ -6827,13 +6719,13 @@ State 123
69 | expr . DOT IDENT
71 ex_index_expr: expr . LBRACKET expr RBRACKET
72 | expr . DOT IDENT
87 expr_list: expr_list expr . [FUNC, NONE, IDENT, INT, FLOAT, STRING, MINUS, BNOT, LNOT, LBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, COMMA, POUND]
88 expr_list: expr_list expr . [FUNC, NONE, IDENT, INT, FLOAT, STRING, MINUS, BNOT, LNOT, LBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, COMMA, POUND]
LBRACKET shift, and go to state 70
DOT shift, and go to state 71
LBRACKET [reduce using rule 87 (expr_list)]
$default reduce using rule 87 (expr_list)
LBRACKET [reduce using rule 88 (expr_list)]
$default reduce using rule 88 (expr_list)
State 124
@ -6846,7 +6738,7 @@ State 124
72 | expr . DOT IDENT
LBRACKET shift, and go to state 70
RBRACKET shift, and go to state 165
RBRACKET shift, and go to state 163
DOT shift, and go to state 71
@ -7577,8 +7469,8 @@ State 143
82 | . LBRACE assoc_list RBRACE
83 | . paren_expr
84 paren_expr: . LPAREN expr RPAREN
87 expr_list: expr_list . expr
88 | expr_list . COMMA expr
87 expr_list: expr_list . COMMA
88 | expr_list . expr
FUNC shift, and go to state 7
NONE shift, and go to state 11
@ -7591,7 +7483,7 @@ State 143
LNOT shift, and go to state 18
LBRACE shift, and go to state 19
LPAREN shift, and go to state 20
RPAREN shift, and go to state 166
RPAREN shift, and go to state 164
LBRACKET shift, and go to state 21
COMMA shift, and go to state 122
POUND shift, and go to state 22
@ -7620,7 +7512,7 @@ State 144
63 call_expr: call_expr COLON IDENT . LPAREN expr_list RPAREN
LPAREN shift, and go to state 167
LPAREN shift, and go to state 165
State 145
@ -7855,14 +7747,14 @@ State 154
84 paren_expr: . LPAREN expr RPAREN
IF shift, and go to state 4
ELSE shift, and go to state 168
ELSE shift, and go to state 166
WHILE shift, and go to state 5
FOR shift, and go to state 6
FUNC shift, and go to state 7
RETURN shift, and go to state 8
BREAK shift, and go to state 9
CONTINUE shift, and go to state 10
END shift, and go to state 169
END shift, and go to state 167
NONE shift, and go to state 11
IDENT shift, and go to state 12
INT shift, and go to state 13
@ -7990,7 +7882,7 @@ State 155
RETURN shift, and go to state 8
BREAK shift, and go to state 9
CONTINUE shift, and go to state 10
END shift, and go to state 170
END shift, and go to state 168
NONE shift, and go to state 11
IDENT shift, and go to state 12
INT shift, and go to state 13
@ -8033,7 +7925,7 @@ State 156
71 ex_index_expr: expr . LBRACKET expr RBRACKET
72 | expr . DOT IDENT
DO shift, and go to state 171
DO shift, and go to state 169
LBRACKET shift, and go to state 70
DOT shift, and go to state 71
@ -8041,19 +7933,19 @@ State 156
State 157
65 funcdecl_expr: FUNC IDENT LPAREN ident_list . RPAREN stmt_list END
91 ident_list: ident_list . IDENT
92 | ident_list . COMMA IDENT
91 ident_list: ident_list . COMMA
92 | ident_list . IDENT
IDENT shift, and go to state 158
RPAREN shift, and go to state 172
RPAREN shift, and go to state 170
COMMA shift, and go to state 160
State 158
91 ident_list: ident_list IDENT .
92 ident_list: ident_list IDENT .
$default reduce using rule 91 (ident_list)
$default reduce using rule 92 (ident_list)
State 159
@ -8064,14 +7956,14 @@ State 159
$default reduce using rule 3 (stmt_list)
stmt_list go to state 173
stmt_list go to state 171
State 160
92 ident_list: ident_list COMMA . IDENT
91 ident_list: ident_list COMMA .
IDENT shift, and go to state 174
$default reduce using rule 91 (ident_list)
State 161
@ -8093,33 +7985,11 @@ State 162
97 assoc_item: LBRACKET expr RBRACKET . ASSIGN expr
ASSIGN shift, and go to state 175
ASSIGN shift, and go to state 172
State 163
96 assoc_list: assoc_list COMMA assoc_item .
$default reduce using rule 96 (assoc_list)
State 164
68 index_expr: expr . LBRACKET expr RBRACKET
69 | expr . DOT IDENT
71 ex_index_expr: expr . LBRACKET expr RBRACKET
72 | expr . DOT IDENT
88 expr_list: expr_list COMMA expr . [FUNC, NONE, IDENT, INT, FLOAT, STRING, MINUS, BNOT, LNOT, LBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, COMMA, POUND]
LBRACKET shift, and go to state 70
DOT shift, and go to state 71
LBRACKET [reduce using rule 88 (expr_list)]
$default reduce using rule 88 (expr_list)
State 165
68 index_expr: expr LBRACKET expr RBRACKET . [$end, IF, THEN, ELSE, WHILE, FOR, DO, FUNC, RETURN, BREAK, CONTINUE, END, NONE, IDENT, INT, FLOAT, STRING, PLUS, MINUS, STAR, SLASH, DSTAR, BAND, BOR, BXOR, BNOT, LAND, LOR, LNOT, EQUAL, LESS, GREATER, LESSEQ, GREATEREQ, RSHIFT, LSHIFT, LBRACE, RBRACE, LPAREN, RPAREN, LBRACKET, RBRACKET, DOT, COLON, SEMICOLON, COMMA, POUND]
71 ex_index_expr: expr LBRACKET expr RBRACKET . [ASSIGN, ASSIGNPLUS, ASSIGNMINUS, ASSIGNSTAR, ASSIGNSLASH, ASSIGNDSTAR, ASSIGNBAND, ASSIGNBOR, ASSIGNBXOR]
@ -8135,14 +8005,14 @@ State 165
$default reduce using rule 68 (index_expr)
State 166
State 164
62 call_expr: call_expr LPAREN expr_list RPAREN .
$default reduce using rule 62 (call_expr)
State 167
State 165
14 expr: . IDENT ASSIGN expr
15 | . IDENT ASSIGNPLUS expr
@ -8218,8 +8088,8 @@ State 167
84 paren_expr: . LPAREN expr RPAREN
85 expr_list: . %empty [FUNC, NONE, IDENT, INT, FLOAT, STRING, MINUS, BNOT, LNOT, LBRACE, LPAREN, RPAREN, LBRACKET, COMMA, POUND]
86 | . expr
87 | . expr_list expr
88 | . expr_list COMMA expr
87 | . expr_list COMMA
88 | . expr_list expr
FUNC shift, and go to state 7
NONE shift, and go to state 11
@ -8268,10 +8138,10 @@ State 167
lit_expr go to state 39
gen_expr go to state 40
paren_expr go to state 41
expr_list go to state 176
expr_list go to state 173
State 168
State 166
2 stmt_list: . stmt_list stmt
3 | . %empty
@ -8279,24 +8149,24 @@ State 168
$default reduce using rule 3 (stmt_list)
stmt_list go to state 177
stmt_list go to state 174
State 169
State 167
5 stmt: IF expr THEN stmt_list END .
$default reduce using rule 5 (stmt)
State 170
State 168
7 stmt: WHILE expr DO stmt_list END .
$default reduce using rule 7 (stmt)
State 171
State 169
2 stmt_list: . stmt_list stmt
3 | . %empty
@ -8304,10 +8174,10 @@ State 171
$default reduce using rule 3 (stmt_list)
stmt_list go to state 178
stmt_list go to state 175
State 172
State 170
2 stmt_list: . stmt_list stmt
3 | . %empty
@ -8315,10 +8185,10 @@ State 172
$default reduce using rule 3 (stmt_list)
stmt_list go to state 179
stmt_list go to state 176
State 173
State 171
2 stmt_list: stmt_list . stmt
4 stmt: . expr
@ -8411,7 +8281,7 @@ State 173
RETURN shift, and go to state 8
BREAK shift, and go to state 9
CONTINUE shift, and go to state 10
END shift, and go to state 180
END shift, and go to state 177
NONE shift, and go to state 11
IDENT shift, and go to state 12
INT shift, and go to state 13
@ -8446,14 +8316,7 @@ State 173
paren_expr go to state 41
State 174
92 ident_list: ident_list COMMA IDENT .
$default reduce using rule 92 (ident_list)
State 175
State 172
14 expr: . IDENT ASSIGN expr
15 | . IDENT ASSIGNPLUS expr
@ -8542,7 +8405,7 @@ State 175
LBRACKET shift, and go to state 21
POUND shift, and go to state 22
expr go to state 181
expr go to state 178
logic_expr go to state 25
ulogic_expr go to state 26
rel_expr go to state 27
@ -8562,7 +8425,7 @@ State 175
paren_expr go to state 41
State 176
State 173
14 expr: . IDENT ASSIGN expr
15 | . IDENT ASSIGNPLUS expr
@ -8636,8 +8499,8 @@ State 176
82 | . LBRACE assoc_list RBRACE
83 | . paren_expr
84 paren_expr: . LPAREN expr RPAREN
87 expr_list: expr_list . expr
88 | expr_list . COMMA expr
87 expr_list: expr_list . COMMA
88 | expr_list . expr
FUNC shift, and go to state 7
NONE shift, and go to state 11
@ -8650,7 +8513,7 @@ State 176
LNOT shift, and go to state 18
LBRACE shift, and go to state 19
LPAREN shift, and go to state 20
RPAREN shift, and go to state 182
RPAREN shift, and go to state 179
LBRACKET shift, and go to state 21
COMMA shift, and go to state 122
POUND shift, and go to state 22
@ -8675,7 +8538,7 @@ State 176
paren_expr go to state 41
State 177
State 174
2 stmt_list: stmt_list . stmt
4 stmt: . expr
@ -8768,7 +8631,7 @@ State 177
RETURN shift, and go to state 8
BREAK shift, and go to state 9
CONTINUE shift, and go to state 10
END shift, and go to state 183
END shift, and go to state 180
NONE shift, and go to state 11
IDENT shift, and go to state 12
INT shift, and go to state 13
@ -8803,7 +8666,7 @@ State 177
paren_expr go to state 41
State 178
State 175
2 stmt_list: stmt_list . stmt
4 stmt: . expr
@ -8896,7 +8759,7 @@ State 178
RETURN shift, and go to state 8
BREAK shift, and go to state 9
CONTINUE shift, and go to state 10
END shift, and go to state 184
END shift, and go to state 181
NONE shift, and go to state 11
IDENT shift, and go to state 12
INT shift, and go to state 13
@ -8931,7 +8794,7 @@ State 178
paren_expr go to state 41
State 179
State 176
2 stmt_list: stmt_list . stmt
4 stmt: . expr
@ -9024,7 +8887,7 @@ State 179
RETURN shift, and go to state 8
BREAK shift, and go to state 9
CONTINUE shift, and go to state 10
END shift, and go to state 185
END shift, and go to state 182
NONE shift, and go to state 11
IDENT shift, and go to state 12
INT shift, and go to state 13
@ -9059,14 +8922,14 @@ State 179
paren_expr go to state 41
State 180
State 177
66 funcdecl_expr: FUNC LPAREN ident_list RPAREN stmt_list END .
$default reduce using rule 66 (funcdecl_expr)
State 181
State 178
68 index_expr: expr . LBRACKET expr RBRACKET
69 | expr . DOT IDENT
@ -9081,28 +8944,28 @@ State 181
$default reduce using rule 97 (assoc_item)
State 182
State 179
63 call_expr: call_expr COLON IDENT LPAREN expr_list RPAREN .
$default reduce using rule 63 (call_expr)
State 183
State 180
6 stmt: IF expr THEN stmt_list ELSE stmt_list END .
$default reduce using rule 6 (stmt)
State 184
State 181
8 stmt: FOR IDENT IN expr DO stmt_list END .
$default reduce using rule 8 (stmt)
State 185
State 182
65 funcdecl_expr: FUNC IDENT LPAREN ident_list RPAREN stmt_list END .

564
parser.tab.c
File diff suppressed because it is too large
View File

30
parser.y

@ -403,6 +403,7 @@ expr_list:
AS($$, exprlist_node)->expr = $1;
AS($$, exprlist_node)->next = NULL;
}
| expr_list COMMA { $$ = $1; }
| expr_list expr {
exprlist_node *cur = $1;
while(cur->next) cur = cur->next;
@ -412,15 +413,6 @@ expr_list:
cur->next = NULL;
$$ = $1;
}
| expr_list COMMA expr {
exprlist_node *cur = $1;
while(cur->next) cur = cur->next;
cur->next = NEW(exprlist_node);
cur = cur->next;
cur->expr = $3;
cur->next = NULL;
$$ = $1;
}
;
ident_list:
@ -430,6 +422,7 @@ ident_list:
AS($$, identlist_node)->ident = $1;
AS($$, identlist_node)->next = NULL;
}
| ident_list COMMA { $$ = $1; }
| ident_list IDENT {
identlist_node *cur = $1;
while(cur->next) cur = cur->next;
@ -439,15 +432,6 @@ ident_list:
cur->next = NULL;
$$ = $1;
}
| ident_list COMMA IDENT {
identlist_node *cur = $1;
while(cur->next) cur = cur->next;
cur->next = NEW(identlist_node);
cur = cur->next;
cur->ident = $3;
cur->next = NULL;
$$ = $1;
}
;
assoc_list:
@ -457,6 +441,7 @@ assoc_list:
AS($$, assoclist_node)->item = $1;
AS($$, assoclist_node)->next = NULL;
}
| assoc_list COMMA { $$ = $1; }
| assoc_list assoc_item {
assoclist_node *cur = $1;
while(cur->next) cur = cur->next;
@ -466,15 +451,6 @@ assoc_list:
cur->next = NULL;
$$ = $1;
}
| assoc_list COMMA assoc_item {
assoclist_node *cur = $1;
while(cur->next) cur = cur->next;
cur->next = NEW(assoclist_node);
cur = cur->next;
cur->item = $3;
cur->next = NULL;
$$ = $1;
}
;
assoc_item:

2
solrun.c

@ -40,7 +40,7 @@ int main(int argc, char **argv) {
return 0;
}
printf("NULL program (probably a syntax error)");
printf("NULL program (probably a syntax error)\n");
return 1;
}
Loading…
Cancel
Save