Rename 'star' -> 'pointer' in C grammar
Now that bug is fixed that prevented tokens from working properly when used anonymously and as named rules
This commit is contained in:
parent
93259435c8
commit
feb46302f3
3 changed files with 1138 additions and 1098 deletions
6
spec/fixtures/grammars/c.cc
vendored
6
spec/fixtures/grammars/c.cc
vendored
|
|
@ -98,7 +98,7 @@ extern const Grammar c = Grammar({
|
|||
str("=") }) },
|
||||
|
||||
{ "declarator", seq({
|
||||
repeat(sym("star")),
|
||||
repeat(sym("pointer")),
|
||||
sym("direct_declarator") }) },
|
||||
|
||||
{ "direct_declarator", choice({
|
||||
|
|
@ -123,7 +123,7 @@ extern const Grammar c = Grammar({
|
|||
str("restrict"),
|
||||
str("volatile") }) },
|
||||
|
||||
{ "star", str("*") },
|
||||
{ "pointer", str("*") },
|
||||
|
||||
{ "compound_statement", seq({
|
||||
str("{"),
|
||||
|
|
@ -139,7 +139,7 @@ extern const Grammar c = Grammar({
|
|||
|
||||
{ "math_expression", choice({
|
||||
prec(1, seq({ sym("expression"), str("+"), sym("expression") })),
|
||||
prec(2, seq({ sym("expression"), sym("star"), sym("expression") })) }) },
|
||||
prec(2, seq({ sym("expression"), str("*"), sym("expression") })) }) },
|
||||
|
||||
{ "call_expression", prec(3, seq({
|
||||
sym("expression"),
|
||||
|
|
|
|||
2228
spec/fixtures/parsers/c.c
vendored
2228
spec/fixtures/parsers/c.c
vendored
File diff suppressed because it is too large
Load diff
|
|
@ -37,5 +37,5 @@ int main() {
|
|||
(identifier) (direct_declarator (identifier))
|
||||
(compound_statement
|
||||
(declaration (identifier) (identifier))
|
||||
(declaration (identifier) (declarator (star) (direct_declarator (identifier))))
|
||||
(declaration (identifier) (declarator (pointer) (direct_declarator (identifier))))
|
||||
(declaration (identifier) (identifier))))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue