Class: CodeTools::Melbourne
- Inherits:
-
Object
- Object
- CodeTools::Melbourne
- Defined in:
- lib/rubinius/processor/processor.rb
Overview
TODO: This will change to: class Processor
Instance Method Summary collapse
-
#method_missing(sym, *args) ⇒ Object
TODO: remove when all processors are defined.
-
#process_alias(line, to, from) ⇒ Object
Processing methods.
- #process_and(line, left, right) ⇒ Object
- #process_args(line, required, optional, splat, post, kwargs, kwrest, block) ⇒ Object
- #process_argscat(line, array, rest) ⇒ Object
- #process_argspush(line, arguments, value) ⇒ Object
- #process_array(line, array) ⇒ Object
- #process_attrasgn(line, receiver, name, arguments) ⇒ Object
- #process_back_ref(line, ref) ⇒ Object
- #process_begin(line, body) ⇒ Object
- #process_block(line, array) ⇒ Object
- #process_block_arg(line, name) ⇒ Object
- #process_block_pass(line, arguments, body) ⇒ Object
- #process_break(line, value) ⇒ Object
- #process_call(line, receiver, name, arguments) ⇒ Object
- #process_case(line, receiver, whens, else_body) ⇒ Object
- #process_cdecl(line, expr, value) ⇒ Object
- #process_class(line, name, superclass, body) ⇒ Object
- #process_colon2(line, outer, name) ⇒ Object
- #process_colon3(line, name) ⇒ Object
- #process_const(line, name) ⇒ Object
- #process_cvar(line, name) ⇒ Object
- #process_cvasgn(line, name, value) ⇒ Object
- #process_cvdecl(line, name, value) ⇒ Object
- #process_dangling_node ⇒ Object
- #process_defined(line, expr) ⇒ Object
- #process_defn(line, name, body) ⇒ Object
- #process_defs(line, receiver, name, body) ⇒ Object
- #process_dot2(line, start, finish) ⇒ Object
- #process_dot3(line, start, finish) ⇒ Object
- #process_dregx(line, str, array, flags) ⇒ Object
- #process_dregx_once(line, str, array, flags) ⇒ Object
- #process_dstr(line, str, array) ⇒ Object
- #process_dsym(line, str, array) ⇒ Object
- #process_dxstr(line, str, array) ⇒ Object
- #process_encoding(line, name) ⇒ Object
- #process_ensure(line, body, ensr) ⇒ Object
- #process_evstr(line, value) ⇒ Object
- #process_false(line) ⇒ Object
- #process_fcall(line, name, arguments) ⇒ Object
- #process_file(line) ⇒ Object
- #process_fixnum(line, value) ⇒ Object
- #process_flip2(line, start, finish) ⇒ Object
- #process_flip3(line, start, finish) ⇒ Object
- #process_float(line, str) ⇒ Object
- #process_for(line, iter, arguments, body) ⇒ Object
- #process_gasgn(line, name, expr) ⇒ Object
- #process_gvar(line, name) ⇒ Object
- #process_hash(line, array) ⇒ Object
- #process_iasgn(line, name, value) ⇒ Object
- #process_if(line, cond, body, else_body) ⇒ Object
- #process_imaginary(line, value) ⇒ Object
- #process_iter(line, method_send, scope) ⇒ Object
- #process_ivar(line, name) ⇒ Object
- #process_kw_arg(line, arguments) ⇒ Object
- #process_lambda(line, scope) ⇒ Object
- #process_lasgn(line, name, value) ⇒ Object
- #process_lit(line, sym) ⇒ Object
- #process_lvar(line, name) ⇒ Object
- #process_masgn(line, left, right, splat) ⇒ Object
- #process_match(line, pattern, flags) ⇒ Object
- #process_match2(line, pattern, value) ⇒ Object
- #process_match3(line, pattern, value) ⇒ Object
-
#process_missing_node(line, node_name, node_type) ⇒ Object
This method is analogous to #method_missing.
- #process_module(line, name, body) ⇒ Object
- #process_negate(line, value) ⇒ Object
- #process_next(line, value) ⇒ Object
- #process_nil(line) ⇒ Object
- #process_not(line, value) ⇒ Object
- #process_nth_ref(line, ref) ⇒ Object
- #process_number(line, value) ⇒ Object
- #process_op_asgn1(line, receiver, index, op, value) ⇒ Object
- #process_op_asgn2(line, receiver, name, op, value) ⇒ Object
- #process_op_asgn_and(line, var, value) ⇒ Object
- #process_op_asgn_or(line, var, value) ⇒ Object
- #process_op_cdecl(line, var, value, op) ⇒ Object
- #process_opt_arg(line, arguments) ⇒ Object
- #process_or(line, left, right) ⇒ Object
- #process_parse_error(message, column, line, source) ⇒ Object
- #process_postarg(line, into, rest) ⇒ Object
- #process_postexe(line, body) ⇒ Object
- #process_preexe(line, body) ⇒ Object
- #process_rational(line, value) ⇒ Object
- #process_redo(line) ⇒ Object
- #process_regex(line, str, flags) ⇒ Object
- #process_resbody(line, conditions, body, nxt) ⇒ Object
- #process_rescue(line, body, rescue_body, else_body) ⇒ Object
- #process_retry(line) ⇒ Object
- #process_return(line, value) ⇒ Object
- #process_sclass(line, receiver, body) ⇒ Object
- #process_scope(line, arguments, body, locals) ⇒ Object
- #process_self(line) ⇒ Object
- #process_splat(line, expr) ⇒ Object
- #process_str(line, str) ⇒ Object
- #process_super(line, arguments) ⇒ Object
- #process_svalue(line, expr) ⇒ Object
- #process_to_ary(line, expr) ⇒ Object
- #process_true(line) ⇒ Object
- #process_undef(line, sym) ⇒ Object
- #process_until(line, cond, body, check_first) ⇒ Object
- #process_valias(line, to, from) ⇒ Object
- #process_values(line, first, rest) ⇒ Object
- #process_vcall(line, name) ⇒ Object
- #process_when(line, conditions, body) ⇒ Object
- #process_while(line, cond, body, check_first) ⇒ Object
- #process_xstr(line, str) ⇒ Object
- #process_yield(line, arguments, unwrap) ⇒ Object
- #process_zarray(line) ⇒ Object
- #process_zsuper(line) ⇒ Object
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(sym, *args) ⇒ Object
TODO: remove when all processors are defined
22 23 24 |
# File 'lib/rubinius/processor/processor.rb', line 22 def method_missing(sym, *args) puts "#{self.class}#method_missing: #{sym} #{args.map { |x| x.inspect}.join(", ")}" end |
Instance Method Details
#process_alias(line, to, from) ⇒ Object
Processing methods
29 30 31 |
# File 'lib/rubinius/processor/processor.rb', line 29 def process_alias(line, to, from) AST::Alias.new line, to, from end |
#process_and(line, left, right) ⇒ Object
33 34 35 |
# File 'lib/rubinius/processor/processor.rb', line 33 def process_and(line, left, right) AST::And.new line, left, right end |
#process_args(line, required, optional, splat, post, kwargs, kwrest, block) ⇒ Object
37 38 39 |
# File 'lib/rubinius/processor/processor.rb', line 37 def process_args(line, required, optional, splat, post, kwargs, kwrest, block) AST::Parameters.new line, required, optional, splat, post, kwargs, kwrest, block end |
#process_argscat(line, array, rest) ⇒ Object
41 42 43 |
# File 'lib/rubinius/processor/processor.rb', line 41 def process_argscat(line, array, rest) AST::ConcatArgs.new line, array, rest end |
#process_argspush(line, arguments, value) ⇒ Object
45 46 47 |
# File 'lib/rubinius/processor/processor.rb', line 45 def process_argspush(line, arguments, value) AST::PushArgs.new line, arguments, value end |
#process_array(line, array) ⇒ Object
49 50 51 |
# File 'lib/rubinius/processor/processor.rb', line 49 def process_array(line, array) AST::ArrayLiteral.new line, array end |
#process_attrasgn(line, receiver, name, arguments) ⇒ Object
53 54 55 56 57 58 59 |
# File 'lib/rubinius/processor/processor.rb', line 53 def process_attrasgn(line, receiver, name, arguments) if name == :[]= AST::ElementAssignment.new line, receiver, arguments else AST::AttributeAssignment.new line, receiver, name, arguments end end |
#process_back_ref(line, ref) ⇒ Object
61 62 63 |
# File 'lib/rubinius/processor/processor.rb', line 61 def process_back_ref(line, ref) AST::BackRef.new line, ref end |
#process_begin(line, body) ⇒ Object
65 66 67 |
# File 'lib/rubinius/processor/processor.rb', line 65 def process_begin(line, body) AST::Begin.new line, body end |
#process_block(line, array) ⇒ Object
69 70 71 |
# File 'lib/rubinius/processor/processor.rb', line 69 def process_block(line, array) AST::Block.new line, array end |
#process_block_arg(line, name) ⇒ Object
73 74 75 |
# File 'lib/rubinius/processor/processor.rb', line 73 def process_block_arg(line, name) AST::BlockArgument.new line, name end |
#process_block_pass(line, arguments, body) ⇒ Object
77 78 79 |
# File 'lib/rubinius/processor/processor.rb', line 77 def process_block_pass(line, arguments, body) AST::BlockPass19.new line, arguments, body end |
#process_break(line, value) ⇒ Object
81 82 83 |
# File 'lib/rubinius/processor/processor.rb', line 81 def process_break(line, value) AST::Break.new line, value end |
#process_call(line, receiver, name, arguments) ⇒ Object
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/rubinius/processor/processor.rb', line 85 def process_call(line, receiver, name, arguments) if arguments.kind_of? AST::BlockPass block = arguments arguments = block.arguments block.arguments = nil else block = nil end if node = process_transforms(line, receiver, name, arguments) node.block = block if block return node end if arguments node = AST::SendWithArguments.new line, receiver, name, arguments else node = AST::Send.new line, receiver, name end node.block = block node end |
#process_case(line, receiver, whens, else_body) ⇒ Object
109 110 111 112 113 114 115 |
# File 'lib/rubinius/processor/processor.rb', line 109 def process_case(line, receiver, whens, else_body) if receiver AST::ReceiverCase.new line, receiver, whens, else_body else AST::Case.new line, whens, else_body end end |
#process_cdecl(line, expr, value) ⇒ Object
117 118 119 |
# File 'lib/rubinius/processor/processor.rb', line 117 def process_cdecl(line, expr, value) AST::ConstantAssignment.new line, expr, value end |
#process_class(line, name, superclass, body) ⇒ Object
121 122 123 |
# File 'lib/rubinius/processor/processor.rb', line 121 def process_class(line, name, superclass, body) AST::Class.new line, name, superclass, body end |
#process_colon2(line, outer, name) ⇒ Object
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
# File 'lib/rubinius/processor/processor.rb', line 125 def process_colon2(line, outer, name) if outer if outer.kind_of? AST::ConstantAccess and outer.name == :Rubinius case name when :Type AST::TypeConstant.new line when :Mirror AST::MirrorConstant.new line else AST::ScopedConstant.new line, outer, name end else AST::ScopedConstant.new line, outer, name end else AST::ConstantAccess.new line, name end end |
#process_colon3(line, name) ⇒ Object
145 146 147 |
# File 'lib/rubinius/processor/processor.rb', line 145 def process_colon3(line, name) AST::ToplevelConstant.new line, name end |
#process_const(line, name) ⇒ Object
149 150 151 |
# File 'lib/rubinius/processor/processor.rb', line 149 def process_const(line, name) AST::ConstantAccess.new line, name end |
#process_cvar(line, name) ⇒ Object
153 154 155 |
# File 'lib/rubinius/processor/processor.rb', line 153 def process_cvar(line, name) AST::ClassVariableAccess.new line, name end |
#process_cvasgn(line, name, value) ⇒ Object
157 158 159 |
# File 'lib/rubinius/processor/processor.rb', line 157 def process_cvasgn(line, name, value) AST::ClassVariableAssignment.new line, name, value end |
#process_cvdecl(line, name, value) ⇒ Object
161 162 163 |
# File 'lib/rubinius/processor/processor.rb', line 161 def process_cvdecl(line, name, value) AST::ClassVariableDeclaration.new line, name, value end |
#process_dangling_node ⇒ Object
10 11 12 13 |
# File 'lib/rubinius/processor/processor.rb', line 10 def process_dangling_node puts "Processing called but node was NULL" # TODO: output info about the current AST node end |
#process_defined(line, expr) ⇒ Object
165 166 167 |
# File 'lib/rubinius/processor/processor.rb', line 165 def process_defined(line, expr) AST::Defined.new line, expr end |
#process_defn(line, name, body) ⇒ Object
169 170 171 |
# File 'lib/rubinius/processor/processor.rb', line 169 def process_defn(line, name, body) AST::Define.new line, name, body end |
#process_defs(line, receiver, name, body) ⇒ Object
173 174 175 |
# File 'lib/rubinius/processor/processor.rb', line 173 def process_defs(line, receiver, name, body) AST::DefineSingleton.new line, receiver, name, body end |
#process_dot2(line, start, finish) ⇒ Object
177 178 179 |
# File 'lib/rubinius/processor/processor.rb', line 177 def process_dot2(line, start, finish) AST::Range.new line, start, finish end |
#process_dot3(line, start, finish) ⇒ Object
181 182 183 |
# File 'lib/rubinius/processor/processor.rb', line 181 def process_dot3(line, start, finish) AST::RangeExclude.new line, start, finish end |
#process_dregx(line, str, array, flags) ⇒ Object
185 186 187 |
# File 'lib/rubinius/processor/processor.rb', line 185 def process_dregx(line, str, array, flags) AST::DynamicRegex.new line, str, array, flags end |
#process_dregx_once(line, str, array, flags) ⇒ Object
189 190 191 |
# File 'lib/rubinius/processor/processor.rb', line 189 def process_dregx_once(line, str, array, flags) AST::DynamicOnceRegex.new line, str, array, flags end |
#process_dstr(line, str, array) ⇒ Object
193 194 195 |
# File 'lib/rubinius/processor/processor.rb', line 193 def process_dstr(line, str, array) AST::DynamicString.new line, str, array end |
#process_dsym(line, str, array) ⇒ Object
197 198 199 |
# File 'lib/rubinius/processor/processor.rb', line 197 def process_dsym(line, str, array) AST::DynamicSymbol.new line, str, array end |
#process_dxstr(line, str, array) ⇒ Object
201 202 203 |
# File 'lib/rubinius/processor/processor.rb', line 201 def process_dxstr(line, str, array) AST::DynamicExecuteString.new line, str, array end |
#process_encoding(line, name) ⇒ Object
205 206 207 |
# File 'lib/rubinius/processor/processor.rb', line 205 def process_encoding(line, name) AST::Encoding.new line, name end |
#process_ensure(line, body, ensr) ⇒ Object
209 210 211 |
# File 'lib/rubinius/processor/processor.rb', line 209 def process_ensure(line, body, ensr) AST::Ensure.new line, body, ensr end |
#process_evstr(line, value) ⇒ Object
213 214 215 216 217 218 219 |
# File 'lib/rubinius/processor/processor.rb', line 213 def process_evstr(line, value) if value AST::ToString.new line, value else AST::StringLiteral.new line, "" end end |
#process_false(line) ⇒ Object
221 222 223 |
# File 'lib/rubinius/processor/processor.rb', line 221 def process_false(line) AST::FalseLiteral.new line end |
#process_fcall(line, name, arguments) ⇒ Object
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 |
# File 'lib/rubinius/processor/processor.rb', line 225 def process_fcall(line, name, arguments) receiver = AST::Self.new line if arguments.kind_of? AST::BlockPass block = arguments arguments = block.arguments block.arguments = nil else block = nil end if node = process_transforms(line, receiver, name, arguments, true) node.block = block if block return node end if arguments node = AST::SendWithArguments.new line, receiver, name, arguments, true else node = AST::Send.new line, receiver, name, true end node.block = block node end |
#process_file(line) ⇒ Object
251 252 253 |
# File 'lib/rubinius/processor/processor.rb', line 251 def process_file(line) AST::File.new line end |
#process_fixnum(line, value) ⇒ Object
255 256 257 |
# File 'lib/rubinius/processor/processor.rb', line 255 def process_fixnum(line, value) AST::FixnumLiteral.new line, value end |
#process_flip2(line, start, finish) ⇒ Object
259 260 261 |
# File 'lib/rubinius/processor/processor.rb', line 259 def process_flip2(line, start, finish) AST::Flip2.new line, start, finish end |
#process_flip3(line, start, finish) ⇒ Object
263 264 265 |
# File 'lib/rubinius/processor/processor.rb', line 263 def process_flip3(line, start, finish) AST::Flip3.new line, start, finish end |
#process_float(line, str) ⇒ Object
267 268 269 |
# File 'lib/rubinius/processor/processor.rb', line 267 def process_float(line, str) AST::FloatLiteral.new line, str end |
#process_for(line, iter, arguments, body) ⇒ Object
271 272 273 274 275 |
# File 'lib/rubinius/processor/processor.rb', line 271 def process_for(line, iter, arguments, body) send = AST::Send.new line, iter, :each send.block = AST::For.new line, arguments, body send end |
#process_gasgn(line, name, expr) ⇒ Object
277 278 279 |
# File 'lib/rubinius/processor/processor.rb', line 277 def process_gasgn(line, name, expr) AST::GlobalVariableAssignment.new line, name, expr end |
#process_gvar(line, name) ⇒ Object
281 282 283 |
# File 'lib/rubinius/processor/processor.rb', line 281 def process_gvar(line, name) AST::GlobalVariableAccess.for_name line, name end |
#process_hash(line, array) ⇒ Object
285 286 287 |
# File 'lib/rubinius/processor/processor.rb', line 285 def process_hash(line, array) AST::HashLiteral.new line, array end |
#process_iasgn(line, name, value) ⇒ Object
289 290 291 |
# File 'lib/rubinius/processor/processor.rb', line 289 def process_iasgn(line, name, value) AST::InstanceVariableAssignment.new line, name, value end |
#process_if(line, cond, body, else_body) ⇒ Object
293 294 295 |
# File 'lib/rubinius/processor/processor.rb', line 293 def process_if(line, cond, body, else_body) AST::If.new line, cond, body, else_body end |
#process_imaginary(line, value) ⇒ Object
297 298 299 |
# File 'lib/rubinius/processor/processor.rb', line 297 def process_imaginary(line, value) AST::ImaginaryLiteral.new line, value end |
#process_iter(line, method_send, scope) ⇒ Object
301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 |
# File 'lib/rubinius/processor/processor.rb', line 301 def process_iter(line, method_send, scope) ary = scope && scope.array || [] arguments = nil if ary.first.kind_of? AST::Parameters arguments = scope.array.shift end unless arguments arguments = AST::Parameters.new line end case ary.size when 0 body = nil when 1 if scope.locals body = scope else body = scope.array.shift end else body = scope end method_send.block = AST::Iter.new line, arguments, body method_send end |
#process_ivar(line, name) ⇒ Object
330 331 332 |
# File 'lib/rubinius/processor/processor.rb', line 330 def process_ivar(line, name) AST::InstanceVariableAccess.new line, name end |
#process_kw_arg(line, arguments) ⇒ Object
334 335 336 |
# File 'lib/rubinius/processor/processor.rb', line 334 def process_kw_arg(line, arguments) AST::Block.new line, arguments end |
#process_lambda(line, scope) ⇒ Object
338 339 340 341 342 343 344 345 346 347 |
# File 'lib/rubinius/processor/processor.rb', line 338 def process_lambda(line, scope) arguments = scope.array.shift if scope.array.size == 1 body = scope.array.shift else body = scope end AST::Lambda.new line, arguments, body end |
#process_lasgn(line, name, value) ⇒ Object
350 351 352 |
# File 'lib/rubinius/processor/processor.rb', line 350 def process_lasgn(line, name, value) AST::LocalVariableAssignment.new line, name, value end |
#process_lit(line, sym) ⇒ Object
354 355 356 |
# File 'lib/rubinius/processor/processor.rb', line 354 def process_lit(line, sym) AST::SymbolLiteral.new line, sym end |
#process_lvar(line, name) ⇒ Object
358 359 360 |
# File 'lib/rubinius/processor/processor.rb', line 358 def process_lvar(line, name) AST::LocalVariableAccess.new line, name end |
#process_masgn(line, left, right, splat) ⇒ Object
362 363 364 |
# File 'lib/rubinius/processor/processor.rb', line 362 def process_masgn(line, left, right, splat) AST::MultipleAssignment.new line, left, right, splat end |
#process_match(line, pattern, flags) ⇒ Object
366 367 368 |
# File 'lib/rubinius/processor/processor.rb', line 366 def process_match(line, pattern, flags) AST::Match.new line, pattern, flags end |
#process_match2(line, pattern, value) ⇒ Object
370 371 372 |
# File 'lib/rubinius/processor/processor.rb', line 370 def process_match2(line, pattern, value) AST::Match2.new line, pattern, value end |
#process_match3(line, pattern, value) ⇒ Object
374 375 376 |
# File 'lib/rubinius/processor/processor.rb', line 374 def process_match3(line, pattern, value) AST::Match3.new line, pattern, value end |
#process_missing_node(line, node_name, node_type) ⇒ Object
This method is analogous to #method_missing. It is called if there is no processing method defined for a node.
17 18 19 |
# File 'lib/rubinius/processor/processor.rb', line 17 def process_missing_node(line, node_name, node_type) puts "Unhandled node #{node_name} (#{node_type})" end |
#process_module(line, name, body) ⇒ Object
378 379 380 |
# File 'lib/rubinius/processor/processor.rb', line 378 def process_module(line, name, body) AST::Module.new line, name, body end |
#process_negate(line, value) ⇒ Object
382 383 384 |
# File 'lib/rubinius/processor/processor.rb', line 382 def process_negate(line, value) AST::Negate.new line, value end |
#process_next(line, value) ⇒ Object
386 387 388 |
# File 'lib/rubinius/processor/processor.rb', line 386 def process_next(line, value) AST::Next.new line, value end |
#process_nil(line) ⇒ Object
390 391 392 |
# File 'lib/rubinius/processor/processor.rb', line 390 def process_nil(line) AST::NilLiteral.new line end |
#process_not(line, value) ⇒ Object
394 395 396 |
# File 'lib/rubinius/processor/processor.rb', line 394 def process_not(line, value) AST::Not.new line, value end |
#process_nth_ref(line, ref) ⇒ Object
398 399 400 |
# File 'lib/rubinius/processor/processor.rb', line 398 def process_nth_ref(line, ref) AST::NthRef.new line, ref end |
#process_number(line, value) ⇒ Object
402 403 404 405 406 407 408 409 |
# File 'lib/rubinius/processor/processor.rb', line 402 def process_number(line, value) case value when Fixnum AST::FixnumLiteral.new line, value when Bignum AST::NumberLiteral.new line, value end end |
#process_op_asgn1(line, receiver, index, op, value) ⇒ Object
411 412 413 |
# File 'lib/rubinius/processor/processor.rb', line 411 def process_op_asgn1(line, receiver, index, op, value) AST::OpAssignElement.new line, receiver, index, op, value end |
#process_op_asgn2(line, receiver, name, op, value) ⇒ Object
415 416 417 |
# File 'lib/rubinius/processor/processor.rb', line 415 def process_op_asgn2(line, receiver, name, op, value) AST::OpAssignAttribute.new line, receiver, name, op, value end |
#process_op_asgn_and(line, var, value) ⇒ Object
419 420 421 |
# File 'lib/rubinius/processor/processor.rb', line 419 def process_op_asgn_and(line, var, value) AST::OpAssignAnd.new line, var, value end |
#process_op_asgn_or(line, var, value) ⇒ Object
423 424 425 |
# File 'lib/rubinius/processor/processor.rb', line 423 def process_op_asgn_or(line, var, value) AST::OpAssignOr.new line, var, value end |
#process_op_cdecl(line, var, value, op) ⇒ Object
427 428 429 430 431 432 433 434 435 436 437 438 |
# File 'lib/rubinius/processor/processor.rb', line 427 def process_op_cdecl(line, var, value, op) op_value = case op when :and AST::And.new line, var, value when :or AST::Or.new line, var, value else args = AST::ArrayLiteral.new line, [value] AST::SendWithArguments.new line, var, op, args end AST::ConstantAssignment.new line, var, op_value end |
#process_opt_arg(line, arguments) ⇒ Object
440 441 442 |
# File 'lib/rubinius/processor/processor.rb', line 440 def process_opt_arg(line, arguments) AST::Block.new line, arguments end |
#process_or(line, left, right) ⇒ Object
444 445 446 |
# File 'lib/rubinius/processor/processor.rb', line 444 def process_or(line, left, right) AST::Or.new line, left, right end |
#process_parse_error(message, column, line, source) ⇒ Object
5 6 7 8 |
# File 'lib/rubinius/processor/processor.rb', line 5 def process_parse_error(, column, line, source) msg = "#{message}: #{@name}:#{line}:#{column}" @syntax_errors << SyntaxError.from(msg, column, line, source, @name) end |
#process_postarg(line, into, rest) ⇒ Object
448 449 450 |
# File 'lib/rubinius/processor/processor.rb', line 448 def process_postarg(line, into, rest) AST::PostArg.new line, into, rest end |
#process_postexe(line, body) ⇒ Object
452 453 454 455 456 |
# File 'lib/rubinius/processor/processor.rb', line 452 def process_postexe(line, body) node = AST::Send.new line, AST::Self.new(line), :at_exit, true node.block = AST::Iter.new line, nil, body node end |
#process_preexe(line, body) ⇒ Object
458 459 460 461 462 463 |
# File 'lib/rubinius/processor/processor.rb', line 458 def process_preexe(line, body) node = AST::PreExe19.new line node.block = AST::Iter.new line, nil, body add_pre_exe node node end |
#process_rational(line, value) ⇒ Object
465 466 467 |
# File 'lib/rubinius/processor/processor.rb', line 465 def process_rational(line, value) AST::RationalLiteral.new line, value end |
#process_redo(line) ⇒ Object
469 470 471 |
# File 'lib/rubinius/processor/processor.rb', line 469 def process_redo(line) AST::Redo.new line end |
#process_regex(line, str, flags) ⇒ Object
473 474 475 |
# File 'lib/rubinius/processor/processor.rb', line 473 def process_regex(line, str, flags) AST::RegexLiteral.new line, str, flags end |
#process_resbody(line, conditions, body, nxt) ⇒ Object
477 478 479 |
# File 'lib/rubinius/processor/processor.rb', line 477 def process_resbody(line, conditions, body, nxt) AST::RescueCondition.new line, conditions, body, nxt end |
#process_rescue(line, body, rescue_body, else_body) ⇒ Object
481 482 483 |
# File 'lib/rubinius/processor/processor.rb', line 481 def process_rescue(line, body, rescue_body, else_body) AST::Rescue.new line, body, rescue_body, else_body end |
#process_retry(line) ⇒ Object
485 486 487 |
# File 'lib/rubinius/processor/processor.rb', line 485 def process_retry(line) AST::Retry.new line end |
#process_return(line, value) ⇒ Object
489 490 491 |
# File 'lib/rubinius/processor/processor.rb', line 489 def process_return(line, value) AST::Return.new line, value end |
#process_sclass(line, receiver, body) ⇒ Object
493 494 495 |
# File 'lib/rubinius/processor/processor.rb', line 493 def process_sclass(line, receiver, body) AST::SClass.new line, receiver, body end |
#process_scope(line, arguments, body, locals) ⇒ Object
497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 |
# File 'lib/rubinius/processor/processor.rb', line 497 def process_scope(line, arguments, body, locals) case body when AST::Begin if body.rescue.kind_of? AST::NilLiteral return nil unless arguments end body = AST::Block.new line, [body.rescue] when AST::Block ary = body.array if ary.size > 1 and ary.first.kind_of?(AST::Begin) and ary.first.rescue.kind_of?(AST::NilLiteral) ary.shift end when nil # Nothing else body = AST::Block.new line, [body] end if arguments and body body.array.unshift arguments end body.locals = locals if locals body end |
#process_self(line) ⇒ Object
526 527 528 |
# File 'lib/rubinius/processor/processor.rb', line 526 def process_self(line) AST::Self.new line end |
#process_splat(line, expr) ⇒ Object
530 531 532 |
# File 'lib/rubinius/processor/processor.rb', line 530 def process_splat(line, expr) AST::SplatValue.new line, expr end |
#process_str(line, str) ⇒ Object
534 535 536 |
# File 'lib/rubinius/processor/processor.rb', line 534 def process_str(line, str) AST::StringLiteral.new line, str end |
#process_super(line, arguments) ⇒ Object
538 539 540 541 542 543 544 545 546 547 548 549 550 |
# File 'lib/rubinius/processor/processor.rb', line 538 def process_super(line, arguments) if arguments.kind_of? AST::BlockPass block = arguments arguments = block.arguments block.arguments = nil else block = nil end node = AST::Super.new line, arguments node.block = block node end |
#process_svalue(line, expr) ⇒ Object
552 553 554 |
# File 'lib/rubinius/processor/processor.rb', line 552 def process_svalue(line, expr) AST::SValue.new line, expr end |
#process_to_ary(line, expr) ⇒ Object
556 557 558 |
# File 'lib/rubinius/processor/processor.rb', line 556 def process_to_ary(line, expr) AST::ToArray.new line, expr end |
#process_true(line) ⇒ Object
560 561 562 |
# File 'lib/rubinius/processor/processor.rb', line 560 def process_true(line) AST::TrueLiteral.new line end |
#process_undef(line, sym) ⇒ Object
564 565 566 |
# File 'lib/rubinius/processor/processor.rb', line 564 def process_undef(line, sym) AST::Undef.new line, sym end |
#process_until(line, cond, body, check_first) ⇒ Object
568 569 570 |
# File 'lib/rubinius/processor/processor.rb', line 568 def process_until(line, cond, body, check_first) AST::Until.new line, cond, body, check_first end |
#process_valias(line, to, from) ⇒ Object
582 583 584 |
# File 'lib/rubinius/processor/processor.rb', line 582 def process_valias(line, to, from) AST::VAlias.new line, to, from end |
#process_values(line, first, rest) ⇒ Object
586 587 588 589 |
# File 'lib/rubinius/processor/processor.rb', line 586 def process_values(line, first, rest) rest.body.unshift first rest end |
#process_vcall(line, name) ⇒ Object
572 573 574 575 576 577 578 579 580 |
# File 'lib/rubinius/processor/processor.rb', line 572 def process_vcall(line, name) receiver = AST::Self.new line if node = process_transforms(line, receiver, name, nil, true) return node end AST::Send.new line, receiver, name, true, true end |
#process_when(line, conditions, body) ⇒ Object
591 592 593 |
# File 'lib/rubinius/processor/processor.rb', line 591 def process_when(line, conditions, body) AST::When.new line, conditions, body end |
#process_while(line, cond, body, check_first) ⇒ Object
595 596 597 |
# File 'lib/rubinius/processor/processor.rb', line 595 def process_while(line, cond, body, check_first) AST::While.new line, cond, body, check_first end |
#process_xstr(line, str) ⇒ Object
599 600 601 |
# File 'lib/rubinius/processor/processor.rb', line 599 def process_xstr(line, str) AST::ExecuteString.new line, str end |
#process_yield(line, arguments, unwrap) ⇒ Object
603 604 605 |
# File 'lib/rubinius/processor/processor.rb', line 603 def process_yield(line, arguments, unwrap) AST::Yield.new line, arguments, unwrap end |
#process_zarray(line) ⇒ Object
607 608 609 |
# File 'lib/rubinius/processor/processor.rb', line 607 def process_zarray(line) AST::EmptyArray.new line end |
#process_zsuper(line) ⇒ Object
611 612 613 |
# File 'lib/rubinius/processor/processor.rb', line 611 def process_zsuper(line) AST::ZSuper.new line end |