mirror of
https://github.com/RoBaertschi/tt.git
synced 2025-04-18 23:13:29 +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 {
|
switch l.ch {
|
||||||
case ';':
|
case ';':
|
||||||
tok = l.newToken(token.Semicolon)
|
tok = l.newToken(token.Semicolon)
|
||||||
|
case ':':
|
||||||
|
tok = l.newToken(token.Colon)
|
||||||
case '=':
|
case '=':
|
||||||
if l.peekByte() == '=' {
|
if l.peekByte() == '=' {
|
||||||
pos := l.position
|
pos := l.position
|
||||||
|
13
test.tt
13
test.tt
@ -1,6 +1,11 @@
|
|||||||
fn main() = {
|
fn main() = {
|
||||||
if 3 == 2 {
|
hi: i64 = 4;
|
||||||
if 3 == 3 in 3
|
|
||||||
else 4
|
if hi == 2 {
|
||||||
} else 2
|
hi = 3
|
||||||
|
} else {
|
||||||
|
hi = 2
|
||||||
|
}
|
||||||
|
|
||||||
|
hi
|
||||||
};
|
};
|
||||||
|
@ -32,6 +32,7 @@ const (
|
|||||||
Int TokenType = "INT"
|
Int TokenType = "INT"
|
||||||
|
|
||||||
Semicolon TokenType = ";"
|
Semicolon TokenType = ";"
|
||||||
|
Colon TokenType = ":"
|
||||||
Equal TokenType = "="
|
Equal TokenType = "="
|
||||||
OpenParen TokenType = "("
|
OpenParen TokenType = "("
|
||||||
CloseParen TokenType = ")"
|
CloseParen TokenType = ")"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user