bitwise operators and boolean operators
Some checks failed
Test / build (push) Waiting to run
Build / build (push) Has been cancelled

This commit is contained in:
Chuck Smith
2024-03-23 10:00:02 -04:00
parent cbb430b47d
commit ef8c8f8f04
13 changed files with 427 additions and 188 deletions

View File

@@ -33,6 +33,8 @@ func TestNextToken(t *testing.T) {
[1, 2];
{"foo": "bar"}
d.foo
&|^~
!&&||
`
tests := []struct {
@@ -74,10 +76,10 @@ func TestNextToken(t *testing.T) {
{token.RPAREN, ")"},
{token.SEMICOLON, ";"},
{token.BANG, "!"},
{token.NOT, "!"},
{token.MINUS, "-"},
{token.SLASH, "/"},
{token.ASTERISK, "*"},
{token.DIVIDE, "/"},
{token.MULTIPLY, "*"},
{token.INT, "5"},
{token.SEMICOLON, ";"},
{token.INT, "5"},
@@ -137,6 +139,13 @@ func TestNextToken(t *testing.T) {
{token.IDENT, "d"},
{token.DOT, "."},
{token.IDENT, "foo"},
{token.BitwiseAND, "&"},
{token.BitwiseOR, "|"},
{token.BitwiseXOR, "^"},
{token.BitwiseNOT, "~"},
{token.NOT, "!"},
{token.AND, "&&"},
{token.OR, "||"},
{token.EOF, ""},
}