fix type-to-string conv. + fix binary type check + add modulo + rework import (now include)
Some checks failed
/ test (push) Failing after 41s
Some checks failed
/ test (push) Failing after 41s
This commit is contained in:
parent
91baf28fdf
commit
575fd8e37a
7 changed files with 131 additions and 91 deletions
|
|
@ -29,6 +29,7 @@ const (
|
|||
TokenMinus
|
||||
TokenStar
|
||||
TokenSlash
|
||||
TokenPercent
|
||||
TokenBang
|
||||
TokenSemicolon
|
||||
|
||||
|
|
@ -55,7 +56,7 @@ const (
|
|||
TokenVar
|
||||
TokenIf
|
||||
TokenElse
|
||||
TokenImport
|
||||
TokenInclude
|
||||
TokenType
|
||||
TokenFor
|
||||
TokenIn
|
||||
|
|
@ -166,8 +167,8 @@ func (t TokenKind) String() string {
|
|||
return "open bracket"
|
||||
case TokenCloseBracket:
|
||||
return "close bracket"
|
||||
case TokenImport:
|
||||
return "import"
|
||||
case TokenInclude:
|
||||
return "include"
|
||||
case TokenColon:
|
||||
return "colon"
|
||||
case TokenPipe:
|
||||
|
|
@ -195,7 +196,7 @@ var Keywords = map[string]TokenKind{
|
|||
"nil": TokenNil,
|
||||
"if": TokenIf,
|
||||
"else": TokenElse,
|
||||
"import": TokenImport,
|
||||
"include": TokenInclude,
|
||||
"var": TokenVar,
|
||||
"fn": TokenFunc,
|
||||
"return": TokenReturn,
|
||||
|
|
@ -268,6 +269,8 @@ func (l *Lexer) NextToken() (Token, error) {
|
|||
}
|
||||
|
||||
return l.makeToken(TokenSlash), nil
|
||||
case '%':
|
||||
return l.makeToken(TokenPercent), nil
|
||||
case '(':
|
||||
return l.makeToken(TokenOpenParenthesis), nil
|
||||
case ')':
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue