diff options
author | Ryo Nihei <nihei.dev@gmail.com> | 2022-05-07 20:41:33 +0900 |
---|---|---|
committer | Ryo Nihei <nihei.dev@gmail.com> | 2022-05-10 23:14:41 +0900 |
commit | 3eb0e88f911386a4e6eca991c1471070596c5554 (patch) | |
tree | 4c3ea445a804d781b846739d70392ceb1353ea6d /spec/syntax_error.go | |
parent | Make #prec directive change only precedence and not associativity (diff) | |
download | urubu-3eb0e88f911386a4e6eca991c1471070596c5554.tar.gz urubu-3eb0e88f911386a4e6eca991c1471070596c5554.tar.xz |
Change syntax for top-level directives
%name changes to:
#name example;
%left and %right change to:
#prec (
#left a b
#right c d
);
Diffstat (limited to 'spec/syntax_error.go')
-rw-r--r-- | spec/syntax_error.go | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/spec/syntax_error.go b/spec/syntax_error.go index fdf9c40..3b44d2d 100644 --- a/spec/syntax_error.go +++ b/spec/syntax_error.go @@ -24,14 +24,15 @@ var ( synErrEmptyString = newSyntaxError("a string must include at least one character") // syntax errors - synErrInvalidToken = newSyntaxError("invalid token") - synErrNoMDName = newSyntaxError("a metadata name is missing") - synErrNoProductionName = newSyntaxError("a production name is missing") - synErrNoColon = newSyntaxError("the colon must precede alternatives") - synErrNoSemicolon = newSyntaxError("the semicolon is missing at the last of an alternative") - synErrLabelWithNoSymbol = newSyntaxError("a label must follow a symbol") - synErrNoLabel = newSyntaxError("an identifier that represents a label is missing after the label marker @") - synErrNoDirectiveName = newSyntaxError("a directive needs a name") - synErrSemicolonNoNewline = newSyntaxError("a semicolon must be followed by a newline") - synErrFragmentNoPattern = newSyntaxError("a fragment needs one pattern element") + synErrInvalidToken = newSyntaxError("invalid token") + synErrTopLevelDirNoSemicolon = newSyntaxError("a top-level directive must be followed by ;") + synErrNoProductionName = newSyntaxError("a production name is missing") + synErrNoColon = newSyntaxError("the colon must precede alternatives") + synErrNoSemicolon = newSyntaxError("the semicolon is missing at the last of an alternative") + synErrLabelWithNoSymbol = newSyntaxError("a label must follow a symbol") + synErrNoLabel = newSyntaxError("an identifier that represents a label is missing after the label marker @") + synErrNoDirectiveName = newSyntaxError("a directive needs a name") + synErrUnclosedDirGroup = newSyntaxError("a directive group must be closed by )") + synErrSemicolonNoNewline = newSyntaxError("a semicolon must be followed by a newline") + synErrFragmentNoPattern = newSyntaxError("a fragment needs one pattern element") ) |