summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorIrene Knapp <ireneista@gmail.com>2021-01-01 19:24:17 -0800
committerIrene Knapp <ireneista@gmail.com>2021-01-01 19:24:17 -0800
commit24c8a559bcf442e1769f3f0cb98e6430e3db1be5 (patch)
tree1a64a3251b14e0b1c903b70cc6ca65fb5a9c5839 /src
parentc7ecc405b08e73ad0a9ac809b149f59adc6d1ac2 (diff)
Clarify the regexp comment even more, and allow empty invocations so the error can be dealt with at a higher level
Diffstat (limited to 'src')
-rw-r--r--src/commandline.lalrpop13
1 files changed, 7 insertions, 6 deletions
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> = {
-  <WORD+> NEWLINE,
+  <WORD*> 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