runningwater 3 лет назад
Родитель
Сommit
fb05623fd6
1 измененных файлов с 14 добавлено и 0 удалено
  1. 14 0
      ast/ast.go

+ 14 - 0
ast/ast.go

@@ -82,3 +82,17 @@ func (i *Identifier) expressionNode() {
 func (i *Identifier) TokenLiteral() string {
 	return i.Token.Literal
 }
+
+// return <expression>;
+type ReturnStatement struct {
+	Token       token.Token // the token.RETURN
+	returnValue Expression
+}
+
+func (rs *ReturnStatement) TokenLiteral() string {
+	return rs.Token.Literal
+}
+
+func (rs *ReturnStatement) statementNode() {
+	panic("implement me")
+}