summaryrefslogtreecommitdiff
path: root/lexer.c
diff options
context:
space:
mode:
Diffstat (limited to 'lexer.c')
-rw-r--r--lexer.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lexer.c b/lexer.c
index 0024320..4e9a4e4 100644
--- a/lexer.c
+++ b/lexer.c
@@ -88,11 +88,18 @@ lexline(InputStream *input, int toplevel)
}else if(!toplevel && peek == ':'){
Rune buf[MAX_LINE_LENGTH];
Rune *p = buf;
+ int errorguard = 0;
+ if(getrune(input) == ':')
+ errorguard = 1;
+ else
+ ungetrune(input);
+
while((peek = getrune(input)) != L'⋄' && peek != '\n' && !inputEOF(input))
*p++ = peek;
*p = 0;
ungetrune(input);
stmt->guard = lexlinestr(buf, toplevel);
+ stmt->errorguard = errorguard;
stmt->ntoks--;
}else if(peek == '{'){
int unclosed = 1;