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:
Max Brunsfeld 2015-07-30 17:27:49 -07:00
parent 93259435c8
commit feb46302f3
3 changed files with 1138 additions and 1098 deletions

View file

@ -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"),

File diff suppressed because it is too large Load diff

View file

@ -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))))