Implemented switch statements
This commit is contained in:
parent
09ec8d8446
commit
52d1de042c
10 changed files with 170 additions and 27 deletions
|
@ -69,5 +69,6 @@ const (
|
|||
Import // import
|
||||
Loop // loop
|
||||
Return // return
|
||||
Switch // switch
|
||||
_keywordsEnd // </keywords>
|
||||
)
|
||||
|
|
|
@ -151,6 +151,8 @@ func Tokenize(buffer []byte) List {
|
|||
kind = Loop
|
||||
case "return":
|
||||
kind = Return
|
||||
case "switch":
|
||||
kind = Switch
|
||||
}
|
||||
|
||||
tokens = append(tokens, Token{Kind: kind, Position: position, Length: Length(len(identifier))})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue