aboutsummaryrefslogtreecommitdiff
path: root/ast/ast.go
diff options
context:
space:
mode:
authorBobby <[email protected]>2023-11-02 22:28:15 -0400
committerBobby <[email protected]>2023-11-02 22:28:15 -0400
commit895fd381cc3867bb362f1abf19ffc26c41cbdbe7 (patch)
tree832f369d6558dbb9fd3fbd178955234fe5272053 /ast/ast.go
parent3c98969220c0f3c6372aef3207a98e4cbcc9a135 (diff)
downloadmana-895fd381cc3867bb362f1abf19ffc26c41cbdbe7.tar.xz
mana-895fd381cc3867bb362f1abf19ffc26c41cbdbe7.zip
parser:return
Diffstat (limited to 'ast/ast.go')
-rw-r--r--ast/ast.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/ast/ast.go b/ast/ast.go
index 7b75d35..d4493f3 100644
--- a/ast/ast.go
+++ b/ast/ast.go
@@ -52,3 +52,14 @@ func (i *Identifier) expressionNode() {}
func (i *Identifier) TokenLiteral() string {
return i.Token.Literal
}
+
+// ReturnStatement represents a return statement.
+type ReturnStatement struct {
+ Token tokens.Token // the token.RETURN token
+ ReturnValue Expression
+}
+
+func (rs *ReturnStatement) statementNode() {}
+func (rs *ReturnStatement) TokenLiteral() string {
+ return rs.Token.Literal
+}