Skip to content

cmd/yacc: allow token names beginning with _ #4037

@rsc

Description

@rsc
Yacc accepts:

%token X

but that makes X an exported name, often inappropriate. Using a purely lower-case name
breaks a common yacc style convention: upper case for tokens, lower case for
productions. An attempt to satisfy both constraints with:

%token _X

produces a syntax error - apparently Go's yacc does not allow term names beginning with
(containing?) underscore.

Should change yacc to allow underscore in term names.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions