Bring back quoted words.
I didn't think they were used. My mistake.
@@ -637,20 +637,36 @@ const wordlist = {p
;;
}
+/* word: /wordchar*/
/* word: /wordchar*/
const word = {p
var c, n
var start
skipspace(p)
+
c = peekc(p)
+ if c == '"'
n = 0
+ getc(p)
start = p.rest
while p.rest.len > 0
c = peekc(p)
- if c == '\\'
+ if c == '"'
+ getc(p)
+ goto done
+ elif c == '\\'
c = getc(p)
;;
+ getc(p)
+ n += std.charlen(c)
+ ;;
+ failparse(p, "input ended within quoted word\n")
+ else
+ n = 0
+ start = p.rest
+ while p.rest.len > 0
+ c = peekc(p)
if wordchar(c)
getc(p)
n += std.charlen(c)
@@ -658,6 +674,8 @@ const word = {p
break
;;
;;
+ ;;
+:done
if n > 0
-> `std.Some std.sldup(start[:n])
else
