File tree Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ kind(x) = kind(head(x))
92
92
flags (x) = flags (head (x))
93
93
94
94
# Predicates based on kind() / flags()
95
- is_error (x) = kind (x) == K " error "
95
+ is_error (x) = is_error ( kind (x))
96
96
has_flags (x, test_flags) = has_flags (flags (x), test_flags)
97
97
is_trivia (x) = has_flags (x, TRIVIA_FLAG)
98
98
is_infix (x) = has_flags (x, INFIX_FLAG)
Original file line number Diff line number Diff line change @@ -7,14 +7,24 @@ const _str_to_kind = let Ts = TzTokens
7
7
Dict ([
8
8
" None" => Ts. NONE
9
9
" EndMarker" => Ts. ENDMARKER
10
- " error" => Ts. ERROR
11
10
" Comment" => Ts. COMMENT
12
11
" Whitespace" => Ts. WHITESPACE
13
12
" Identifier" => Ts. IDENTIFIER
14
13
" @" => Ts. AT_SIGN
15
14
" ," => Ts. COMMA
16
15
" ;" => Ts. SEMICOLON
17
16
17
+ " BEGIN_ERRORS" => Ts. begin_errors
18
+ # Tokenization errors
19
+ " ErrorEofMultiComment" => Ts. EOF_MULTICOMMENT
20
+ " ErrorEofChar" => Ts. EOF_CHAR
21
+ " ErrorInvalidNumericConstant" => Ts. INVALID_NUMERIC_CONSTANT
22
+ " ErrorInvalidOperator" => Ts. INVALID_OPERATOR
23
+ " ErrorInvalidInterpolationTerminator" => Ts. INVALID_INTERPOLATION_TERMINATOR
24
+ # Generic error
25
+ " error" => Ts. ERROR
26
+ " END_ERRORS" => Ts. end_errors
27
+
18
28
" BEGIN_KEYWORDS" => Ts. begin_keywords
19
29
" baremodule" => Ts. BAREMODULE
20
30
" begin" => Ts. BEGIN
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ kind(raw::TzTokens.Token) = TzTokens.exactkind(raw)
43
43
# Some renaming for naming consistency
44
44
is_literal (k) = TzTokens. isliteral (kind (k))
45
45
is_keyword (k) = TzTokens. iskeyword (kind (k))
46
- is_error (k) = TzTokens. iserror (kind (k) )
46
+ is_error (k:: Kind ) = TzTokens. iserror (k )
47
47
is_contextual_keyword (k) = TzTokens. iscontextualkeyword (kind (k))
48
48
is_operator (k) = TzTokens. isoperator (kind (k))
49
49
is_word_operator (k) = TzTokens. iswordoperator (kind (k))
You can’t perform that action at this time.
0 commit comments