Class: AdLint::Cc1::EvalFunction
- Inherits:
-
BuiltinFunction
- Object
- Object
- TypedObject
- Function
- NamedFunction
- BuiltinFunction
- AdLint::Cc1::EvalFunction
- Defined in:
- lib/adlint/cc1/builtin.rb
Instance Attribute Summary
Attributes included from Nameable
Attributes inherited from TypedObject
Attributes inherited from Object
Attributes included from Bindable
Instance Method Summary collapse
- #call(interp, args) ⇒ Object
-
#initialize(type_tbl) ⇒ EvalFunction
constructor
A new instance of EvalFunction.
Methods inherited from BuiltinFunction
Methods inherited from NamedFunction
#designated_by_lvalue?, #signature
Methods included from Nameable
Methods inherited from Function
#builtin?, #explicit?, #function?, #implicit?, #name, #named?, #signature, #temporary?, #variable?
Methods inherited from TypedObject
#to_pointer, #to_pointer_value, #to_value, #to_variable
Methods inherited from Object
#declared_as_auto?, #declared_as_extern?, #declared_as_register?, #declared_as_static?, #designated_by_lvalue?, #function?, #named?, #storage_class_specifiers, #temporary?, #variable?
Methods included from Bindable
Constructor Details
#initialize(type_tbl) ⇒ EvalFunction
Returns a new instance of EvalFunction.
70 71 72 |
# File 'lib/adlint/cc1/builtin.rb', line 70 def initialize(type_tbl) super(type_tbl, "__adlint__eval") end |
Instance Method Details
#call(interp, args) ⇒ Object
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/adlint/cc1/builtin.rb', line 74 def call(interp, *, args) puts "__adlint__eval" char_ary = args.first.first if char_ary.type.array? without_nil = char_ary.value.to_single_value.values[0..-2] prog_text = without_nil.map { |char| char.unique_sample.chr }.join if prog_text.empty? puts "no program text" else eval prog_text end puts "EOM" end super end |