From 24c8a559bcf442e1769f3f0cb98e6430e3db1be5 Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Fri, 1 Jan 2021 19:24:17 -0800 Subject: Clarify the regexp comment even more, and allow empty invocations so the error can be dealt with at a higher level --- src/commandline.lalrpop | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/commandline.lalrpop') diff --git a/src/commandline.lalrpop b/src/commandline.lalrpop index dd7d84e..15af3cf 100644 --- a/src/commandline.lalrpop +++ b/src/commandline.lalrpop @@ -1,7 +1,7 @@ grammar; pub Invocation: Vec<&'input str> = { - NEWLINE, + NEWLINE, }; // Several of the regexps below make use of Unicode character classes. [1] is @@ -49,11 +49,12 @@ match { // token for them makes the error messages more informative. r"[\p{C}&&[^\n\r]]" => CONTROL, - // Z is the unicode class for separators, including line, paragraph, and space - // separators. C is the class for control characters. This regexp tests for - // the intersection of the negation of these character classes, along with a - // negated class enumerating all the explicitly-recognized characters, which - // means it matches any character NOT in the regexps above. + // Z is the unicode class for separators, which is exhaustively partitioned + // into line, paragraph, and space separators. Each of those subclasses is + // handled above. C is the class for control characters. This regexp tests + // for the intersection of the negation of these character classes, along + // with a negated class enumerating all the explicitly-recognized characters, + // which means it matches any character NOT in the regexps above. // // Note that, counterintuitively, line feed and carriage return are classified // as control characters, not as line separators. Either way, this regexp would -- cgit 1.4.1