lib/starlark_compiler/ast.rb in starlark_compiler-0.4.0 vs lib/starlark_compiler/ast.rb in starlark_compiler-0.5.0
- old
+ new
@@ -141,9 +141,19 @@
@args = args.map(&method(:node))
@kwargs = kwargs.transform_values(&method(:node))
end
end
+ class FunctionDeclaration < Node
+ attr_reader :name, :args, :body, :kwargs
+ def initialize(name, args, body, **kwargs)
+ @name = name
+ @args = args.map(&method(:node))
+ @body = body.map(&method(:node))
+ @kwargs = kwargs.transform_values(&method(:node))
+ end
+ end
+
class MethodCall < Node
end
class Dictionary < Node
attr_reader :elements