Added test case for new tokens

This commit is contained in:
Sasha Koshka 2022-08-25 23:17:42 -04:00
parent c3b6330b22
commit 453a596587
4 changed files with 18 additions and 2 deletions

View File

@ -152,19 +152,27 @@ func TestTokenizeAll (test *testing.T) {
quickToken(1, TokenKindAt, nil),
quickToken(1, TokenKindExclamation, nil),
quickToken(1, TokenKindPercent, nil),
quickToken(2, TokenKindPercentAssignment, nil),
quickToken(1, TokenKindTilde, nil),
quickToken(2, TokenKindTildeAssignment, nil),
quickToken(1, TokenKindEqualTo, nil),
quickToken(2, TokenKindNotEqualTo, nil),
quickToken(1, TokenKindLessThan, nil),
quickToken(2, TokenKindLessThanEqualTo, nil),
quickToken(2, TokenKindLShift, nil),
quickToken(3, TokenKindLShiftAssignment, nil),
quickToken(1, TokenKindGreaterThan, nil),
quickToken(2, TokenKindGreaterThanEqualTo, nil),
quickToken(2, TokenKindRShift, nil),
quickToken(3, TokenKindRShiftAssignment, nil),
quickToken(1, TokenKindBinaryOr, nil),
quickToken(2, TokenKindBinaryOrAssignment, nil),
quickToken(2, TokenKindLogicalOr, nil),
quickToken(1, TokenKindBinaryAnd, nil),
quickToken(2, TokenKindBinaryAndAssignment, nil),
quickToken(2, TokenKindLogicalAnd, nil),
quickToken(1, TokenKindBinaryXor, nil),
quickToken(2, TokenKindBinaryXorAssignment, nil),
quickToken(1, TokenKindNewline, nil),
)
}

View File

@ -43,20 +43,28 @@ const (
TokenKindAt
TokenKindExclamation
TokenKindPercent
TokenKindPercentAssignment
TokenKindTilde
TokenKindTildeAssignment
TokenKindEqualTo
TokenKindNotEqualTo
TokenKindLessThanEqualTo
TokenKindLessThan
TokenKindLShift
TokenKindLShiftAssignment
TokenKindGreaterThan
TokenKindGreaterThanEqualTo
TokenKindRShift
TokenKindRShiftAssignment
TokenKindBinaryOr
TokenKindBinaryOrAssignment
TokenKindLogicalOr
TokenKindBinaryAnd
TokenKindBinaryAndAssignment
TokenKindLogicalAnd
TokenKindBinaryXor
TokenKindBinaryXorAssignment
)
// Token represents a single token. It holds its location in the file, as well

View File

@ -1,3 +1,3 @@
:arf
--- rw -> -349820394 932748397 239485.37520 "hello world!\n" 'E' helloWorld:.,..[]{}
+ - ++ -- * / @ ! % ~ = != < <= << > >= >> | || & &&
+ - ++ -- * / @ ! % %= ~ ~= = != < <= << <<= > >= >> >>= | |= || & &= && ^ ^=

View File

@ -39,7 +39,7 @@ func ro eMath
-- y
set z [+ [* 0392 00] 98 x [/ 9832 y] 930]
# TODO: need tokens |= &= ~= <<= >>=
# TODO: need tokens ~=
! true
~ 0b01