File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -352,7 +352,25 @@ class QAST::Compiler is HLL::Compiler {
352
352
$ ops . result($ reg );
353
353
}
354
354
else {
355
- pir::die(" Lexical lookup/bind NYI" );
355
+ # Does the node have a native type marked on it?
356
+ my $ type := type_to_register_type($ node . returns );
357
+ if $ type eq ' P' {
358
+ # Consider the blocks for a declared native type.
359
+ # XXX TODO
360
+ }
361
+
362
+ # Emit the lookup or bind.
363
+ if $ * BINDVAL {
364
+ my $ valpost := self . coerce(self . as_post($ * BINDVAL ), nqp :: lc ($ type ));
365
+ $ ops . push ($ valpost );
366
+ $ ops . push_pirop(' store_lex' , self . escape($ node . name ), $ valpost . result);
367
+ $ ops . result($ valpost . result);
368
+ }
369
+ else {
370
+ my $ res_reg := $ * REGALLOC . " fresh_{ nqp :: lc ($ type )} " ();
371
+ $ ops . push_pirop(' find_lex' , $ res_reg , self . escape($ node . name ));
372
+ $ ops . result($ res_reg );
373
+ }
356
374
}
357
375
}
358
376
else {
You can’t perform that action at this time.
0 commit comments