diff options
Diffstat (limited to 'closures/compiler/pexpr.pas')
| -rw-r--r-- | closures/compiler/pexpr.pas | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/closures/compiler/pexpr.pas b/closures/compiler/pexpr.pas index 98002d8b10..2678308a86 100644 --- a/closures/compiler/pexpr.pas +++ b/closures/compiler/pexpr.pas @@ -70,7 +70,7 @@ implementation nmat,nadd,nmem,nset,ncnv,ninl,ncon,nld,nflw,nbas,nutils, { parser } scanner, - pbase,pinline,ptype,pgenutil, + pbase,pinline,ptype,pgenutil,pnameless, { codegen } cgbase,procinfo,cpuinfo ; @@ -2248,8 +2248,15 @@ implementation p1:=csubscriptnode.create(srsym,p1); end else - { regular non-field load } - p1:=cloadnode.create(srsym,srsymtable); + begin + if srsym.typ in [localvarsym,paravarsym] then + p1:=handle_possible_capture(current_procinfo.procdef, tabstractnormalvarsym(srsym)) + else + p1:=nil; + if not assigned(p1) then + { regular non-field load } + p1:=cloadnode.create(srsym,srsymtable); + end end; syssym : @@ -2946,6 +2953,13 @@ implementation p1:=cinlinenode.create(in_objc_protocol_x,false,p1); end; + // nameless routine + _PROCEDURE, _FUNCTION: + if assigned(current_procinfo) then + p1:=parse_nameless_routine(current_procinfo.procdef) + else // TODO: support this later? Delphi doesn't + internalerror(20120121); + else begin Message(parser_e_illegal_expression); |
