diff options
| author | Bobby <[email protected]> | 2023-11-03 16:17:15 +0000 |
|---|---|---|
| committer | Bobby <[email protected]> | 2023-11-03 16:17:15 +0000 |
| commit | e8a6c163c9a58b69f6f96c373118ac6996637e25 (patch) | |
| tree | d16ab60698adbd9491e5904809c67a4ecc41cd0e /ast | |
| parent | 15f9a15757322221d8bf9a3ecd5d8ce8490ebda6 (diff) | |
| download | mana-e8a6c163c9a58b69f6f96c373118ac6996637e25.tar.xz mana-e8a6c163c9a58b69f6f96c373118ac6996637e25.zip | |
parser:init pratt parser. parser:add prefix, infix and `parseIntegerLiteral`
Diffstat (limited to 'ast')
| -rw-r--r-- | ast/ast.go | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -128,3 +128,17 @@ func (es *ExpressionStatement) String() string { } return "" } + +// IntegerLiteral represents an integer literal. +type IntegerLiteral struct { + Token tokens.Token // the token.INT token + Value int64 +} + +func (il *IntegerLiteral) expressionNode() {} +func (il *IntegerLiteral) TokenLiteral() string { + return il.Token.Literal +} +func (il *IntegerLiteral) String() string { + return il.Token.Literal +} |
