mirror of
https://github.com/RoBaertschi/tt.git
synced 2025-04-16 05:53:30 +00:00
begin variables
This commit is contained in:
parent
0692729b40
commit
1d70a700c9
@ -65,6 +65,8 @@ func (l *Lexer) NextToken() token.Token {
|
||||
switch l.ch {
|
||||
case ';':
|
||||
tok = l.newToken(token.Semicolon)
|
||||
case ':':
|
||||
tok = l.newToken(token.Colon)
|
||||
case '=':
|
||||
if l.peekByte() == '=' {
|
||||
pos := l.position
|
||||
|
13
test.tt
13
test.tt
@ -1,6 +1,11 @@
|
||||
fn main() = {
|
||||
if 3 == 2 {
|
||||
if 3 == 3 in 3
|
||||
else 4
|
||||
} else 2
|
||||
hi: i64 = 4;
|
||||
|
||||
if hi == 2 {
|
||||
hi = 3
|
||||
} else {
|
||||
hi = 2
|
||||
}
|
||||
|
||||
hi
|
||||
};
|
||||
|
@ -32,6 +32,7 @@ const (
|
||||
Int TokenType = "INT"
|
||||
|
||||
Semicolon TokenType = ";"
|
||||
Colon TokenType = ":"
|
||||
Equal TokenType = "="
|
||||
OpenParen TokenType = "("
|
||||
CloseParen TokenType = ")"
|
||||
|
Loading…
x
Reference in New Issue
Block a user