Changeset 6376 for perl5/PIL2JS/lib/PIL.pm
- Timestamp:
- 08/20/05 15:47:35 (3 years ago)
- svk:copy_cache_prev:
- 8581
- Files:
-
- 1 modified
-
perl5/PIL2JS/lib/PIL.pm (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
perl5/PIL2JS/lib/PIL.pm
r6315 r6376 18 18 # Are we in a sublike thing? If yes, what sublevel does that thing have? 19 19 our $IN_SUBLIKE = undef; 20 our @IN_SUBLIKES; 20 21 21 22 # What's the name of the sub we're currently in? … … 23 24 24 25 # Our current pos? 25 our $CUR_POS = bless [ "<unknown>", (0) x 4 ] => "PIL::MkPos"; 26 our $CUR_POS = bless { 27 posName => "<unknown>", 28 posBeginLine => 0, 29 posBeginColumn => 0, 30 posEndLine => 0, 31 posEndColumn => 0, 32 } => "PIL::MkPos"; 26 33 27 34 # Are we in pilGlob? … … 181 188 "\n// End of initialization of global vars and exportation of subs.\n"; 182 189 183 return sprintf <<EOF, $decl_js, add_indent( 2, join "\n", @glob_js, $init_js, $main_js);190 return sprintf <<EOF, $decl_js, add_indent(3, join "\n", @glob_js, $init_js, $main_js); 184 191 %s 185 192 PIL2JS.catch_all_exceptions(function () { 186 PIL2JS.runloop(function () { 187 var PIL2JS = AlsoPIL2JS_SpeedupHack; 188 var pad = {}; PIL2JS_subpads.push(pad); 189 pad['\$?POSITION'] = _24main_3a_3a_3fPOSITION; 190 pad['\$_'] = _24main_3a_3a_; 193 PIL2JS.catch_end_exception(function() { 194 PIL2JS.runloop(function () { 195 var PIL2JS = AlsoPIL2JS_SpeedupHack; 196 var pad = {}; PIL2JS_subpads.push(pad); 197 pad['\$?POSITION'] = _24main_3a_3a_3fPOSITION; 198 pad['\$_'] = _24main_3a_3a_; 191 199 192 200 %s 201 }); 193 202 }); 194 203 }); … … 207 216 208 217 sub as_js { 209 return sprintf "new PIL2JS. Box.Constant(new PIL2JS.Context({ main: %s, type: %s }))",218 return sprintf "new PIL2JS.Context({ main: %s, type: %s })", 210 219 PIL::doublequote($_[0]->main), 211 220 defined $_[0]->type
