aboutsummaryrefslogtreecommitdiff
path: root/driver/lexer.go
diff options
context:
space:
mode:
authorRyo Nihei <nihei.dev@gmail.com>2021-05-08 17:32:12 +0900
committerRyo Nihei <nihei.dev@gmail.com>2021-05-08 17:39:18 +0900
commit3ab9be08993009f8a2d90b15c3458a97f4152bd9 (patch)
treec67371d87d3c4ea55ada23b5f83a0e3bcb4fc459 /driver/lexer.go
parentAdd CLI options (diff)
downloadtre-3ab9be08993009f8a2d90b15c3458a97f4152bd9.tar.gz
tre-3ab9be08993009f8a2d90b15c3458a97f4152bd9.tar.xz
Add --break-on-error option to lex command
As you use --break-on-error option, break lexical analysis with exit status 1 immediately when an error token appears.
Diffstat (limited to 'driver/lexer.go')
-rw-r--r--driver/lexer.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/driver/lexer.go b/driver/lexer.go
index 95540f4..76f8092 100644
--- a/driver/lexer.go
+++ b/driver/lexer.go
@@ -90,6 +90,7 @@ func newInvalidToken(mode spec.LexModeNum, modeName spec.LexModeName, match byte
ModeName: modeName,
ID: 0,
Match: match,
+ Text: string(match.ByteSlice()),
Invalid: true,
}
}