Implement strings and partial implementation of arrays (missing index expr eval)
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
This commit is contained in:
parent
a76f47a7a3
commit
59acf6b1a1
13 changed files with 388 additions and 20 deletions
|
|
@ -13,6 +13,7 @@ const (
|
|||
PRODUCT // *
|
||||
PREFIX // -X or !X
|
||||
CALL // myFunction(X)
|
||||
INDEX // array[index]
|
||||
)
|
||||
|
||||
var precedences = map[token.TokenType]int{
|
||||
|
|
@ -25,6 +26,7 @@ var precedences = map[token.TokenType]int{
|
|||
token.ASTERISK: PRODUCT,
|
||||
token.SLASH: PRODUCT,
|
||||
token.LPAREN: CALL,
|
||||
token.LBRACKET: INDEX,
|
||||
}
|
||||
|
||||
func (p *Parser) peekPrecedence() int {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue