From 1746609e248151d575f6e3913ad5023fd421bfff Mon Sep 17 00:00:00 2001 From: Ryo Nihei Date: Mon, 28 Mar 2022 01:30:49 +0900 Subject: Simplify the syntax of #ast directive This change allows using the simple syntax of the directive like `#ast $1 $3...` instead of `#ast #(foo $1 $3...)`. --- spec/syntax_error.go | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'spec/syntax_error.go') diff --git a/spec/syntax_error.go b/spec/syntax_error.go index a35a90c..ae65b35 100644 --- a/spec/syntax_error.go +++ b/spec/syntax_error.go @@ -25,14 +25,12 @@ var ( synErrZeroPos = newSyntaxError("a position must be greater than or equal to 1") // syntax errors - synErrInvalidToken = newSyntaxError("invalid token") - 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") - synErrNoDirectiveName = newSyntaxError("a directive needs a name") - synErrProdDirNoNewline = newSyntaxError("a production directive must be followed by a newline") - synErrSemicolonNoNewline = newSyntaxError("a semicolon must be followed by a newline") - synErrFragmentNoPattern = newSyntaxError("a fragment needs one pattern element") - synErrTreeInvalidFirstElem = newSyntaxError("the first element of a tree structure must be an ID") - synErrTreeUnclosed = newSyntaxError("unclosed tree structure") + synErrInvalidToken = newSyntaxError("invalid token") + 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") + synErrNoDirectiveName = newSyntaxError("a directive needs a name") + synErrProdDirNoNewline = newSyntaxError("a production directive must be followed by a newline") + synErrSemicolonNoNewline = newSyntaxError("a semicolon must be followed by a newline") + synErrFragmentNoPattern = newSyntaxError("a fragment needs one pattern element") ) -- cgit v1.2.3