rubyx/lib/soml/compiler/field_def.rb
Torsten Ruger 229f5896c6 update to use new ast
soml was updated to have a typed ast layer to make programatic creation
easier
this brings LOTS of syntax change with it, that does not really mean
anything at all
All tests pass again so back to the same
2016-03-07 11:55:28 +02:00

17 lines
591 B
Ruby

module Soml
Compiler.class_eval do
include AST::Sexp
def on_FieldDef statement
reset_regs # field_def is a statement, no return and all regs
#puts statement.inspect
# type , name , value = *statement
name_s = no_space( statement.name.value )
@method.ensure_local( name_s, statement.type ) unless( @method.has_arg(name_s))
# if there is a value assigned, process it as am assignemnt statement (kind of call on_assign)
process( Soml::Assignment.new(statement.name , statement.value ) ) if statement.value
return nil
end
end
end