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))
9292flags (x) = flags (head (x))
9393
9494# Predicates based on kind() / flags()
95- is_error (x) = kind (x) == K " error "
95+ is_error (x) = is_error ( kind (x))
9696has_flags (x, test_flags) = has_flags (flags (x), test_flags)
9797is_trivia (x) = has_flags (x, TRIVIA_FLAG)
9898is_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
77Dict ([
88" None" => Ts. NONE
99" EndMarker" => Ts. ENDMARKER
10- " error" => Ts. ERROR
1110" Comment" => Ts. COMMENT
1211" Whitespace" => Ts. WHITESPACE
1312" Identifier" => Ts. IDENTIFIER
1413" @" => Ts. AT_SIGN
1514" ," => Ts. COMMA
1615" ;" => Ts. SEMICOLON
1716
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+
1828" BEGIN_KEYWORDS" => Ts. begin_keywords
1929" baremodule" => Ts. BAREMODULE
2030" begin" => Ts. BEGIN
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ kind(raw::TzTokens.Token) = TzTokens.exactkind(raw)
4343# Some renaming for naming consistency
4444is_literal (k) = TzTokens. isliteral (kind (k))
4545is_keyword (k) = TzTokens. iskeyword (kind (k))
46- is_error (k) = TzTokens. iserror (kind (k) )
46+ is_error (k:: Kind ) = TzTokens. iserror (k )
4747is_contextual_keyword (k) = TzTokens. iscontextualkeyword (kind (k))
4848is_operator (k) = TzTokens. isoperator (kind (k))
4949is_word_operator (k) = TzTokens. iswordoperator (kind (k))
You can’t perform that action at this time.
0 commit comments