mirror of
https://github.com/hazemKrimi/jack-compiler.git
synced 2026-05-01 17:48:57 +00:00
feat: compile first test program
This commit is contained in:
@@ -75,20 +75,7 @@ type Token struct {
|
||||
func NewToken(value string, tokenType TokenType) Token {
|
||||
switch tokenType {
|
||||
case SYMBOL:
|
||||
var symbol string
|
||||
|
||||
switch value {
|
||||
case "<":
|
||||
symbol = "<"
|
||||
case ">":
|
||||
symbol = ">"
|
||||
case "&":
|
||||
symbol = "&"
|
||||
default:
|
||||
symbol = value
|
||||
}
|
||||
|
||||
return Token{Value: symbol, Type: tokenType, XML: "symbol"}
|
||||
return Token{Value: value, Type: tokenType, XML: "symbol"}
|
||||
case KEYWORD:
|
||||
return Token{Value: value, Type: tokenType, XML: "keyword"}
|
||||
case IDENTIFIER:
|
||||
|
||||
Reference in New Issue
Block a user