Class: Peruby::Op::Base
- Inherits:
-
Object
show all
- Defined in:
- lib/peruby/op.rb
Overview
Base evaluation protocol. Context is one of :scalar, :list, or :void.
Direct Known Subclasses
AnonSub, ArrayLiteral, Assign, BareBlock, Binary, Bind, Bless, Builtin, CFor, Call, CodeCall, Compiled, Conditional, ConstantDef, Declare, DeclareList, Delete, Dereference, DereferenceExpression, Element, Eval, Exists, FileTest, ForEach, GlobalDeclare, Goto, Group, HashLiteral, List, Literal, Local, LoopJump, Map, Match, MethodCall, ModifierFor, PackageBlock, PackageSwitch, Postfix, Prefix, Print, Printf, Push, Readline, ReadlineCondition, RefKind, RegexpLiteral, Require, Return, Say, Sequence, Sort, Split, State, SubDef, Substitute, Ternary, Transliterate, Unary, Undef, Use, Variable, While
Instance Method Summary
collapse
Instance Method Details
#argument_cells(env) ⇒ Object
20
21
22
|
# File 'lib/peruby/op.rb', line 20
def argument_cells(env)
run(env, :list)
end
|
#local_slot(_env) ⇒ Object
16
17
18
|
# File 'lib/peruby/op.rb', line 16
def local_slot(_env)
raise PerlError, "Can't localize #{self.class}"
end
|
#lvalue(_env, _context) ⇒ Object
12
13
14
|
# File 'lib/peruby/op.rb', line 12
def lvalue(_env, _context)
raise PerlError, "Can't modify #{self.class} in assignment"
end
|
#run(_env, _context) ⇒ Object
8
9
10
|
# File 'lib/peruby/op.rb', line 8
def run(_env, _context)
raise NotImplementedError
end
|
#run_subroutine(env, context) ⇒ Object
28
29
30
|
# File 'lib/peruby/op.rb', line 28
def run_subroutine(env, context)
catch(:peruby_return) { run(env, context) }
end
|
#to_callable ⇒ Object
24
25
26
|
# File 'lib/peruby/op.rb', line 24
def to_callable
->(env, context) { run(env, context) }
end
|
#warning_directive? ⇒ Boolean
32
|
# File 'lib/peruby/op.rb', line 32
def warning_directive? = false
|