Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions lexerState.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,6 @@ var validLexerStates = []lexerState{

COMPARATOR,
MODIFIER,
NUMERIC,
BOOLEAN,
VARIABLE,
STRING,
PATTERN,
TIME,
CLAUSE,
CLAUSE_CLOSE,
LOGICALOP,
TERNARY,
Expand Down Expand Up @@ -182,7 +175,6 @@ var validLexerStates = []lexerState{
STRING,
BOOLEAN,
CLAUSE,
CLAUSE_CLOSE,
},
},
lexerState{
Expand All @@ -201,7 +193,6 @@ var validLexerStates = []lexerState{
STRING,
TIME,
CLAUSE,
CLAUSE_CLOSE,
PATTERN,
},
},
Expand All @@ -221,7 +212,6 @@ var validLexerStates = []lexerState{
STRING,
TIME,
CLAUSE,
CLAUSE_CLOSE,
},
},
lexerState{
Expand All @@ -237,7 +227,6 @@ var validLexerStates = []lexerState{
FUNCTION,
ACCESSOR,
CLAUSE,
CLAUSE_CLOSE,
},
},

Expand Down
25 changes: 25 additions & 0 deletions parsingFailure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,31 @@ func TestParsingFailure(test *testing.T) {
Input: "0x12g1",
Expected: INVALID_TOKEN_TRANSITION,
},
ParsingFailureTest{
Name: "Invalid LOGICALOP transition",
Input: "(a > 100 &&) == false",
Expected: INVALID_TOKEN_TRANSITION,
},
ParsingFailureTest{
Name: "Invalid MODIFIER transition",
Input: "(a + )",
Expected: INVALID_TOKEN_TRANSITION,
},
ParsingFailureTest{
Name: "Invalid COMPARATOR transition",
Input: "(a > )",
Expected: INVALID_TOKEN_TRANSITION,
},
ParsingFailureTest{
Name: "Invalid PREFIX transition",
Input: "(~)",
Expected: INVALID_TOKEN_TRANSITION,
},
ParsingFailureTest{
Name: "Invalid CLAUSE_CLOSE transition",
Input: "(a == b) c",
Expected: INVALID_TOKEN_TRANSITION,
},
}

runParsingFailureTests(parsingTests, test)
Expand Down