From 3eb0e88f911386a4e6eca991c1471070596c5554 Mon Sep 17 00:00:00 2001 From: Ryo Nihei Date: Sat, 7 May 2022 20:41:33 +0900 Subject: Change syntax for top-level directives %name changes to: #name example; %left and %right change to: #prec ( #left a b #right c d ); --- spec/syntax_error.go | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'spec/syntax_error.go') 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") ) -- cgit v1.2.3