-
Notifications
You must be signed in to change notification settings - Fork 17.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/yacc: fix handling of tokens that don't start with letters
CL 149110043 changed yacc to no longer keep a leading space for quoted tokens. That is OK by itself but unfortunately yacc was relying on that leading space to notice which tokens it should not output as const declarations. Add a few such tokens to expr.y, although it won't make any immediate difference as we seem to have no tests for yacc. LGTM=rsc R=golang-codereviews, rsc CC=golang-codereviews https://golang.org/cl/152720043
- Loading branch information
1 parent
1cfa595
commit fe2bc11
Showing
2 changed files
with
11 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,8 @@ import ( | |
|
||
%type <num> expr expr1 expr2 expr3 | ||
|
||
%token '+' '-' '*' '/' '(' ')' | ||
|
||
%token <num> NUM | ||
|
||
%% | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters