Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 624 lines (430 sloc) 17.203 kB
8f67bea @fglock Perlito version 8.0
authored
1 TODO list for Perlito5
2
d6cad9b @fglock Perlito5 - TODO update
authored
3
25b8875 @fglock Perlito5 - TODO update
authored
4 * perlito5 command-line
e4641d7 @fglock Perlito - extensive TODO update
authored
5
6
8f67bea @fglock Perlito version 8.0
authored
7 * libraries
8
3004b77 @fglock Perlito5 - cleanup, update TODO
authored
9 -- these should probably go into namespace Perlito5X::*
10
ce7ce91 @fglock Perlito - TODO update
authored
11 -- Test (implemented as Perlito5::Test)
3004b77 @fglock Perlito5 - cleanup, update TODO
authored
12
1a7f1d4 @fglock Perlito5 - fix Data::Dumper; TODO update; fix perlito5-browser-perl6.pl
authored
13 -- Data::Dumper (implemented as Perlito5X::Dumper)
8f67bea @fglock Perlito version 8.0
authored
14
24c23f7 @fglock Perlito5 - TODO update
authored
15 -- create perlito5-specific libs for:
7aeb314 @fglock Perlito5 - TODO update
authored
16 feature.pm
17 Config.pm
18 overload.pm
19 bytes.pm
20 integer.pm
21 lib.pm
22 Carp.pm
23 Tie::Array
24 Tie::Hash
25 Tie::Scalar
853e867 @fglock Perlito5 - perl5 - format <glob>
authored
26 Symbol
24c23f7 @fglock Perlito5 - TODO update
authored
27
4d56b5d @fglock Perlito5 - add $ENV{PERL5LIB} to @INC
authored
28 alternately, check $^H for strictness - such that perl's own strict.pm just works
29 and ${^WARNING_BITS} for warnings
30
8f67bea @fglock Perlito version 8.0
authored
31
7b982c3 @fglock Perlito5 - update TODO
authored
32 * Parser
33
2b6da07 @fglock Perlito5 - java - qr//
authored
34 -- syntax error in autoquote: $x{s}
35 parses as: $x { s/// }
36
b1d10c3 @fglock Perlito5 - java - arrayref fixes
authored
37 -- wrong precedence in keys()
38 if (keys %hh != 2) { print "not" }
39 parses as: keys(%hh != 2)
40
efd9ffb @fglock Perlito5 - java - create box class for imported java class - add exam…
authored
41 -- syntax error in ${@} in string
42 "${@}";
43
2537119 @fglock Perlito5 - TODO update
authored
44 -- "'" meaning "::"
45 $'m # $::m
46 $m' # String found where operator expected
47
48 package X'Y # X::Y
49 package X' # Invalid version format (non-numeric data)
50
131944d @fglock Perlito5 - TODO update; add more references to documentation and tests
authored
51 -- attributes
52 http://perldoc.perl.org/attributes.html
c2716c0 @fglock Perlito5 - parser - subroutine attributes
authored
53 missing MODIFY_CODE_ATTRIBUTES handlers
02db591 @fglock Perlito5 - update TODO
authored
54
131944d @fglock Perlito5 - TODO update; add more references to documentation and tests
authored
55 -- create __DATA__
2547cec @shlomif Remove trailing space.
shlomif authored
56 %Perlito5::DATA_SECTION contains the __DATA__ for each package
5058d24 @fglock Perlito5 - grammar - save __DATA__ sections
authored
57
ae33743 @fglock Perlito5 - TODO update
authored
58 -- compile-time eval() is not bound to the "program" environment, but to the "compiler" environment instead
131944d @fglock Perlito5 - TODO update; add more references to documentation and tests
authored
59 see README-perlito5-js near "Compile-time / Run-time interleaving"
60
61 my $v;
62 BEGIN { $v = "123" }
63 use Module $v; # $v is not accessible at compile-time
7b982c3 @fglock Perlito5 - update TODO
authored
64
529225f @fglock Perlito5 - TODO update
authored
65 -- parse the regexes
131944d @fglock Perlito5 - TODO update; add more references to documentation and tests
authored
66 create an AST for regexes
7b982c3 @fglock Perlito5 - update TODO
authored
67
b32dc90 @fglock Perlito5 - update TODO
authored
68 -- prototypes (signatures)
131944d @fglock Perlito5 - TODO update; add more references to documentation and tests
authored
69 http://perldoc.perl.org/perlsub.html#Prototypes
70
71 check that undeclared barewords give the right error
72 *foo = sub () { ... } # does prototype work here?
73 check signature in sort()
74 fix the prototype for 'stat(*)' (see t/test.pl in the perl test suite)
fde5276 @fglock Perlito5 - update TODO
authored
75
880ba6e @fglock Perlito5 - TODO update
authored
76 '&@' - See Try::Tiny
77
5f528ed @fglock Perlito5 - parser - more TODO special cases
authored
78 -- "namespace" parsing
131944d @fglock Perlito5 - TODO update; add more references to documentation and tests
authored
79 tests: t5/01-perlito/26-syntax-namespace.t
5f528ed @fglock Perlito5 - parser - more TODO special cases
authored
80
e107c18 @fglock Perlito5 - parser - add "glob variable"
authored
81 $ perl -e ' { package X; sub print { CORE::print(">$_[1]<\n") } } my $x = bless {}, "X"; print $x "xxx" '
82 Not a GLOB reference at -e line 1.
83
84 $ perl -e ' { package X; sub printx { CORE::print(">$_[1]<\n") } } my $x = bless {}, "X"; printx $x "xxx" '
85 >xxx<
86
87 $ perl -MO=Deparse -e ' print X:: "xxx" '
88 print X 'xxx';
89
90 $ perl -e ' use strict; my $x = X::; print $x '
91 X
92
93 $ perl -e ' use strict; my $x = X; print $x '
2547cec @shlomif Remove trailing space.
shlomif authored
94 Bareword "X" not allowed while "strict subs" in use
e107c18 @fglock Perlito5 - parser - add "glob variable"
authored
95
daea592 @fglock Perlito5 - add more "use strict"
authored
96 $ perl perlito5.pl -MO=Deparse -e ' ::X::x::y '
97 join("", ::{'main::X::'} x main::y);
98
5f528ed @fglock Perlito5 - parser - more TODO special cases
authored
99 $ perl -MO=Deparse -e ' ::X '
100 '???';
101
102 $ perl -MO=Deparse -e ' sub X {} ::X '
103 sub X { }
104 X;
105
d216d0e @fglock Perlito5 - parser - namespace TODO - more corner cases
authored
106 $ perl -e ' $::X::::X = 3; print $main::X::::X ' # 3
d69c95a @fglock Perlito5 - parser - namespace TODO - more corner cases
authored
107 $ perl -e ' $::X::::X = 3; print $main::main::X::::X ' # 3
108 $ perl -e ' $::X::::X = 3; print $main::X::main::X ' # empty
d216d0e @fglock Perlito5 - parser - namespace TODO - more corner cases
authored
109 $ perl -e ' $::X::::X = 3; print $main::X::X ' # empty
d69c95a @fglock Perlito5 - parser - namespace TODO - more corner cases
authored
110 $ perl -e ' $::X::::X = 3; print $::::X::::X ' # empty
111
bad489f @fglock Perlito5 - parser - TODO list
authored
112 -- CORE:: namespace can be used with operators:
113
114 $ perl -MO=Deparse -e ' $x CORE::and $v '
115 $v if $x;
116
117 $ perl -MO=Deparse -e ' @v = CORE::qw/ a b c / '
118 @v = ('a', 'b', 'c');
119
120 $ perl -MO=Deparse -e ' $x CORE::+ $v '
121 CORE:: is not a keyword
122
d216d0e @fglock Perlito5 - parser - namespace TODO - more corner cases
authored
123
1395266 @fglock Perlito5 - TODO update
authored
124 -- strict and warnings: create options like 'subs', 'refs'
125
b33a702 @fglock perlito5 - parser - TODO "things that work in perlito5, but which are…
authored
126 -- things that work in perlito5, but which are errors in 'perl'
127
30e4683 @fglock Perlito5 - TODO update
authored
128 $ perl -e ' my @things= map { no warnings; 123 } @list; '
129 "no" not allowed in expression
130
b33a702 @fglock perlito5 - parser - TODO "things that work in perlito5, but which are…
authored
131 quotes vs. hash lookups:
2547cec @shlomif Remove trailing space.
shlomif authored
132
b33a702 @fglock perlito5 - parser - TODO "things that work in perlito5, but which are…
authored
133 $ perl -e ' q}} '
134 # ok
2547cec @shlomif Remove trailing space.
shlomif authored
135
b33a702 @fglock perlito5 - parser - TODO "things that work in perlito5, but which are…
authored
136 $ perl -e ' $x{ q}} } '
137 Unmatched right curly bracket at -e line 1, at end of line
2547cec @shlomif Remove trailing space.
shlomif authored
138
b33a702 @fglock perlito5 - parser - TODO "things that work in perlito5, but which are…
authored
139 $ perl -e ' $x{ q]] } '
140 # ok
2547cec @shlomif Remove trailing space.
shlomif authored
141
b33a702 @fglock perlito5 - parser - TODO "things that work in perlito5, but which are…
authored
142 string interpolation with nested quotes of the same type:
2547cec @shlomif Remove trailing space.
shlomif authored
143
b33a702 @fglock perlito5 - parser - TODO "things that work in perlito5, but which are…
authored
144 $ perl -e ' " $x{"x"} " '
145 String found where operator expected at -e line 1, near "x"} ""
146
2cc1933 @fglock Perlito5 - TODO update
authored
147
95e6b6c @fglock Perlito5 - TODO cleanup
authored
148 * Add tests for fixed bugs:
149
efea5bc @fglock Perlito5 - TODO update
authored
150 ---
b45ac1f @fglock Perlito5 - parser - allow signature override
authored
151 prototypes can change during compilation
152
153 $ perl -e ' my @x; sub z0 ($$@) { zz(99, @_) } sub zz ($$$@) { print "@_\n" } @x=(9,4,6); zz(8,5,@x); z0(8,5,@x); '
154 8 5 3 # zz prototype is '$$$@'
155 99 8 5 9 4 6 # zz prototype was '@' when z0 was compiled
156
157
158 ---
188a125 @fglock Perlito5 - js - resolve filehandle methods
authored
159 resolve "filehandle" methods
160
161 $ perl -e ' package X; open(X, ">", "x"); X->print(1234) '
162 $ cat x
163 1234
164 $ nodejs perlito5.js -Isrc5/lib -Cjs -e ' package X; open(X, ">", "x"); X->print(1234) '
165
166
167 ---
efea5bc @fglock Perlito5 - TODO update
authored
168 variable declarations in expressions
169
170 our $Verbose ||= 0;
171 our (%Cache);
172 my $args = @_ or @_ = @$exports;
173
95e6b6c @fglock Perlito5 - TODO cleanup
authored
174
175 ---
176 add additional variants of "for"
177
178 # "our" with localization
179 $ perl -e ' use strict; our $x = 123; for our $x (1,2,3) { 2 } print "$x\n" '
180 123
181
182 # variable in scope with localization
183 $ perl -e ' use strict; my $x = 123; for $x (1,2,3) { 2 } print "$x\n" '123
184 123
185
186
187 ---
188 add "print", "printf", "say" special parsing - note this is related to indirect object notation
189
190 indirect object notation
191 http://lwn.net/Articles/451486/
192 http://www.modernperlbooks.com/mt/2009/08/the-problems-with-indirect-object-notation.html
193 http://shadow.cat/blog/matt-s-trout/indirect-but-still-fatal/
194 http://perlbuzz.com/mechanix/2008/02/the-perils-of-perl-5s-indirect.html
195
196 method Module $param;
197 new Class( arg => $value );
198 new Class::($args);
199 say $config->{output} "This is a diagnostic message!"; # indirect call
200 say {$config->{output}} "This is a diagnostic message!"; # say to filehandle
201
202 use Class;
203 sub Class {
204 warn 'Called Class sub not Class package';
205 'Class'
206 }
207 my $q = Class->new; # calls the Class sub above
208 my $s = new Class; # throws a 'Bareword found where operator expected' error
209 my $t = Class::->new # this works
210 my $u = new Class::; # this also works (even with sub main in the current package)
211
212 sbertrang++ noted this is also valid:
213 print( STDERR "123" )
214
215
216 ---
94163c8 @fglock perlito5 - parser - tweak TODO list
authored
217 add tests for signatures: "empty" _ $ ;$
218
219 ---
caf3b30 @fglock perlito5 - parser - fix "sub _" should be in package "main"
authored
220 add test for "sub _" should be in package "main"
221 $ perl -MO=Deparse -e ' package X; sub _ { 123 } '
222 package X;
223 sub main::_ {
224 123;
225 }
226
227 ---
228 add test for defined-or vs. m// (2012/9/25 Конрад Боровски <notifications@github.com>)
229 Note: fixed; see test t5/01-perlito/25-syntax-defined-or.t
230
231 $ perl perlito5.pl -Isrc5/lib -Cast-perl5 -e ' shift // 2 '
232 Number or Bareword found where operator expected
233
234 $ perl perlito5.pl -Isrc5/lib -Cast-perl5 -e ' shift / 2 '
235 Can't find string terminator '/' anywhere before EOF
236
237 ---
238 add test for filetest operators special case:
2cc1933 @fglock Perlito5 - TODO update
authored
239 ' -f($file).".bak" ' should be equivalent to -f "$file.bak"
2547cec @shlomif Remove trailing space.
shlomif authored
240 parses as -(f($file)).".bak"
2cc1933 @fglock Perlito5 - TODO update
authored
241 but: ' -f ($file).".bak" '
242 parses correctly
243 This seems to be because there is a rule that \w followed by '(' is a function call;
244 this needs more testing: ' ... and(2) '
dd7a160 @fglock Perlito5 - parser: fix a bug caused by incorrect is_term state
authored
245 Test: redefine 'and', 'not' and check what works.
2cc1933 @fglock Perlito5 - TODO update
authored
246
247 ' $s111++ + $s222 '
248 parses as (+$s222)++
249
dd7a160 @fglock Perlito5 - parser: fix a bug caused by incorrect is_term state
authored
250 ' $step++ < $steps '
251 Can't find string terminator '>' anywhere before EOF
252
c701f67 @fglock Perlito5 - grammar - alfanumeric quoting delimiters
authored
253 -- from moritz, Schwern and others at
254 http://stackoverflow.com/questions/161872/hidden-features-of-perl
255
256 - you can use letters as delimiters
257
258 $ perl -Mstrict -wle 'print q bJet another perl hacker.b'
259 Jet another perl hacker.
2547cec @shlomif Remove trailing space.
shlomif authored
260
c701f67 @fglock Perlito5 - grammar - alfanumeric quoting delimiters
authored
261 Likewise you can write regular expressions:
2547cec @shlomif Remove trailing space.
shlomif authored
262
c701f67 @fglock Perlito5 - grammar - alfanumeric quoting delimiters
authored
263 m xabcx
264 # same as m/abc/
265
2cc1933 @fglock Perlito5 - TODO update
authored
266
8f67bea @fglock Perlito version 8.0
authored
267
8dbed68 @fglock Perlito5 - perl6 - TODO list
authored
268 * Perl6 backend
269
b1c054d @fglock Perlito5 - TODO update
authored
270 -- keep comments
271
52a4c4c @fglock Perlito5 - perl6 - wantarray discussion
authored
272 -- context: wantarray, return-comma
273 sub x { return 7, 8 }
274 vs. sub x { return (7, 8) }
275
276 use an "out-of-band" parameter to set the call context, like:
277 $v = x( :scalar ) # 8
278 $v = x( :list ) # 2
279
2120983 @fglock Perlito5 - perl6 - TODO list; special variables fix
authored
280 -- <> is lines()
281
c022193 @fglock Perlito5 - perl6 - TODO update
authored
282 -- 0..$#num to @num.keys
283
2120983 @fglock Perlito5 - perl6 - TODO list; special variables fix
authored
284 -- choose @*ARGS or @_ in shift() and pop()
285
286 -- typeglob assignment
287
8dbed68 @fglock Perlito5 - perl6 - TODO list
authored
288 -- "given" statement not implemented
289
290 -- refactoring sub arguments
291 my $x = $_[0];
292 my ($x, $y, @rest) = @_; # check if @_ is unused elsewhere in the sub
293
2120983 @fglock Perlito5 - perl6 - TODO list; special variables fix
authored
294 -- placeholder
295 my ($a, $, $c) = 1..3;
296 ($a, *, $c) = 1..3;
297
8dbed68 @fglock Perlito5 - perl6 - TODO list
authored
298 -- __PACKAGE__
299
300 -- specialized refactoring for packages that introduce syntax
301 Try::Tiny
302 List::MoreUtils
303 Moose
304
305 -- no strict
306
307 -- bless
308
309 -- tests
310
311
312
5bb50dd @fglock Perlito5 - update TODO
authored
313 * Perl5 backend
399a3d2 @fglock Perlito5 - use scalar() instead of .elems()
authored
314
7bc739e @fglock Perlito5 - parser - add 'Perlito5::AST::Given'
authored
315 -- "given" statement not implemented
376e088 @fglock Perlito5 - TODO update
authored
316 -- "default" statement not implemented
7bc739e @fglock Perlito5 - parser - add 'Perlito5::AST::Given'
authored
317
529225f @fglock Perlito5 - TODO update
authored
318 -- ${^NAME} needs curly-escaping
319
2547cec @shlomif Remove trailing space.
shlomif authored
320 - fix regex delimiters, or escape the regexes
85c5759 @fglock Perlito5 - TODO update
authored
321
7a5d100 @fglock Perlito5 - perl5: document emitter bug (significant parenthesis)
authored
322
0cc64c5 @fglock Perlito5 - kill perl6-ish "method"
authored
323
8f67bea @fglock Perlito version 8.0
authored
324 * Javascript backend
325
1a7f1d4 @fglock Perlito5 - fix Data::Dumper; TODO update; fix perlito5-browser-perl6.pl
authored
326 -- DESTROY
327 Try::Tiny uses DESTROY to implement finally() - and it doesn't execute in js:
328
329 $ nodejs perlito5.js -Isrc5/lib -I. -I /usr/local/lib/perl5/site_perl/5.20.0 -e ' use Try::Tiny; try { print "this\n" }; try { die "this" } catch { print "catched\n" } finally { print "done\n" } '
330 this
331 catched
332
333 $ perl -e ' use Try::Tiny; try { print "this\n" }; try { die "this" } catch { print "catched\n" } finally { print "done\n" } '
334 this
335 catched
336 done
337
629bbbe @fglock Perlito5 - TODO update
authored
338 -- constant subroutines
339 -- prototype mismatch
340 $ perl -e ' sub X () { 123 } print X, "\n"; eval " sub X { 456 } "; '
341 123
342 Prototype mismatch: sub main::X () vs none at (eval 1) line 1.
343 Constant subroutine X redefined at (eval 1) line 1.
173897c @fglock Perlito5 - js - TODO - phase order
authored
344
55096c6 @fglock Perlito5 - TODO update
authored
345 -- reference to scalar doesn't work
346 $ node perlito5.js -Isrc5/lib -I. -e ' use Data::Dumper; $v = [20, \$v ]; print Dumper ($v) '
347 $VAR1 = [
348 20,
349 \undef,
350 ];
351
173897c @fglock Perlito5 - js - TODO - phase order
authored
352 -- phase order
353 print x(); # js will try to execute this before the sub declaration
354 sub x { "ok\n"; }
355 # TypeError: Object [object Object] has no method 'x'
356
4e24602 @fglock Perlito5 - TODO update
authored
357 -- assign old-self to my / local
358 local $Some_Global = $Some_Global;
359
fa46927 @fglock Perlito5 - js - TODO update
authored
360 -- missing some types of subroutine signatures
21af3dc @fglock Perlito5 - js - TODO update
authored
361
362 -- AUTOLOAD() called from UNIVERSAL autovivifies packages
363 add tests
364
09cc8db @fglock Perlito5 - js - add TODO for delete() special case
authored
365 -- delete() in the middle of an array turns exists() off:
366
367 $ perl -e ' @a = (3..7); delete $a[2]; print "exists ", (exists $a[$_] ? 1 : 0), "\n" for 0 .. $#a '
368 exists 1
369 exists 1
370 exists 0
371 exists 1
372 exists 1
373
8dda686 @fglock Perlito5 - string parser flags \E \L \U \Q (more)
authored
374 -- delete() in src5/lib/Perlito5/Grammar/String.pm doesn't seem to work:
375 delete($quote_flags->{$flag_to_reset});
376 delete($quote_flags->{last_flag});
377
ecbc8f4 @fglock Perlito5 - TODO update; fix "when"
authored
378 -- "~~" operator not implemented; See also "when" implementation
379 -- "given" statement not implemented
376e088 @fglock Perlito5 - TODO update
authored
380 -- "when" should use a "break" exception inside "given", and a "next" exception inside "for".
ecbc8f4 @fglock Perlito5 - TODO update; fix "when"
authored
381 -- "default" statement not implemented
382
9f9d0dd @fglock Perlito5 - javascript: TODO update
authored
383 -- javascript errors don't show in the global error handler when running in node.js
7a03ff4 @fglock Perlito5 - javascript: eval-block works
authored
384
1b95122 @fglock Perlito5 - TODO update
authored
385 -- "autoload" the compiler if eval-string or require() are used (eval-string needs the compiler at run-time)
386 https://github.com/fglock/Perlito/issues/23
e584da6 @fglock Perlito5 - javascript: TODO update
authored
387
529225f @fglock Perlito5 - TODO update
authored
388 -- symbol variables like $] ${"main::\$"} $#_
389 -- check that @_, $_, $a, $b and other special variables are in the right context (lexical, global, package global)
390
014a584 @fglock Perlito5 - javascript: working @ISA; update Changelog, examples
authored
391 -- add alternate mro's
85c5759 @fglock Perlito5 - TODO update
authored
392 -- cache the mro
42a3449 @fglock Perlito5 - TODO update
authored
393
394 -- add regex compiler
d2169b7 @fglock Perlito5 - t/test.pl: use cmp_ok()
authored
395 -- /x modifier
42a3449 @fglock Perlito5 - TODO update
authored
396 -- support all perl5 regex syntax
529225f @fglock Perlito5 - TODO update
authored
397 -- @v = /x/g
42a3449 @fglock Perlito5 - TODO update
authored
398
20a798b @fglock Perlito5 - js TODO - regex variables localization in blocks
authored
399 -- regex variables localization in blocks
400 $ perl -e ' "a" =~ /(.)/; print $1; { "b" =~ /(.)/; print $1; } print $1, "\n"; '
401 aba
402 $ perl -e ' "a" =~ /(.)/; print $1; { "b" =~ //; print $1; } print $1, "\n"; '
403 abb
404 $ perl -e ' "a" =~ /(.)/; print $1; { "b" =~ /x/; print $1; } print $1, "\n"; '
405 aaa
406
78ae779 @fglock Perlito5 - regex TODO - more qr() details
authored
407 -- some qr() and quotemeta() details
c7c242d @fglock Perlito5 - regex TODO - some qr() details
authored
408
409 $ perl -e ' my $x = qr/ \A x /x; my $y = qr/$x y \Q[z]/; use Data::Dumper; print Dumper $x; print Dumper $y; '
410 $VAR1 = qr/(?x-ism: \A x )/;
411 $VAR1 = qr/(?-xism:(?x-ism: \A x ) y \[z\])/;
412
78ae779 @fglock Perlito5 - regex TODO - more qr() details
authored
413 $ perl -e ' print " a b \Q [ a \nn"; '
414 a b \ \[\ a\ \
415 n
416
4242a67 @fglock Perlito5 - string parser flags \E \L \U \Q
authored
417 $ perl -e ' print "x\Q[\Qx]\Ex\n" '
418 x\[x\\\]x\ # '\' is quoted, but 'Q' disappears
419
6cf47b4 @fglock Perlito5 - TODO update
authored
420 -- qr() returns a Regexp object
421 {
422 package Regexp;
423 sub x { 123 }
424 }
425 $a = qr//;
426 print $a->x, "\n"; # 123
427
887219b @fglock Perlito5 - javascript: work around variable redeclaration bug
authored
428 -- bug: variable redeclaration does not work
429 -- javascript "var" erases the outer value within the whole current lexical scope
42a3449 @fglock Perlito5 - TODO update
authored
430 -- bug: "my" variables - this doesn't work as expected: my $v = $v
431 possible fix: rename variables
efe33bd @fglock Perlito5 - js - TODO update
authored
432 possible fix: initialize variables to null
433 -- add tests using closures, to check that the redeclared variable is a different variable
434 $ perl -e ' my $x = 10; print "$x\n"; my $x; print "$x\n"; '
435 10
436 [space]
437 $ nodejs perlito5.js -Isrc5/lib -e ' my $x = 10; print "$x\n"; my $x; print "$x\n"; '
438 10
439 10
887219b @fglock Perlito5 - javascript: work around variable redeclaration bug
authored
440
b75827a @fglock Perlito5 - TODO update
authored
441 -- lvalue ternary: ($a_or_b ? $a : $b) = $c;
442 -- lvalue substr()
443 -- 4-arguments substr()
b1c054d @fglock Perlito5 - TODO update
authored
444 -- lvalue pos($str)
78fd976 @fglock Perlito5 - javascript: fix 3-arguments substr()
authored
445 -- pos($str)
b44f592 @fglock Perlito5 - TODO update
authored
446 -- lvalue chomp(), chop()
b1c054d @fglock Perlito5 - TODO update
authored
447 -- lvalue subroutine
78fd976 @fglock Perlito5 - javascript: fix 3-arguments substr()
authored
448
8f67bea @fglock Perlito version 8.0
authored
449 -- bug: variable aliases create copies instead
efe33bd @fglock Perlito5 - js - TODO update
authored
450 for (@x) { $_++ } # doesn't change @x
8f67bea @fglock Perlito version 8.0
authored
451
ce36bd0 @fglock Perlito5 - update TODO
authored
452 -- generate more compact code; maybe use more subroutines instead of inlining;
453 autovivification is probably the most verbose part of the code.
1b95122 @fglock Perlito5 - TODO update
authored
454 Use less "throw" - it is not (yet?) optimized by V8
ae7ad72 @fglock Perlito5 - update docs
authored
455
7b982c3 @fglock Perlito5 - update TODO
authored
456 -- in the browser: implement "use" with XMLHttpRequest (what are the security implications?)
4b15a00 @fglock Perlito5 - cleanup parenthesis
authored
457
1b4e7ee @fglock Perlito5 - TODO update: typeglobs
authored
458 -- aliasing between lexicals and globals
459 $ perl -e 'use strict; my $x = 3; *main::z = \$x; print $main::z; '
460 3
5bb50dd @fglock Perlito5 - update TODO
authored
461
0e5b55f @fglock Perlito5 - update TODO
authored
462 -- finish "overload" implementation
1c44abc @fglock Perlito5 - TODO - update
authored
463 See: p5str
0e5b55f @fglock Perlito5 - update TODO
authored
464
0718f37 @fglock Perlito5 - javascript: TODO update
authored
465 -- pack(), unpack()
466
b343129 @fglock Perlito - TODO update
authored
467 -- BEGIN{} should execute in the environment of the program under compilation
88914e1 @fglock Perlito5 - TODO update
authored
468 -- BEGIN/END that are defined inside blocks/closures need to run inside some pseudo-environment
469 even if the closure was never created or used in the first place
b343129 @fglock Perlito - TODO update
authored
470
9643c62 @fglock Perlito5 - TODO update
authored
471 -- flip-flop operator
472 if either operand to scalar '..' is a constant the value is implicitly compared to the input line number ($.)
473
e272236 @fglock Perlito5 - TODO update
authored
474 -- caller() in nodejs and Chrome:
475
476 $ nodejs perlito5.js -Isrc5/lib -I. -e ' sub x { print JS::inline("new Error().stack") }; sub yy { x() }; my $f = sub { yy() }; $f->() '
477
478 "Error
479 at tmp104 [as x] (eval at <anonymous> (/perlito5.js:31586:57), <anonymous>:10:63)
480 at tmp105 [as yy] (eval at <anonymous> (/perlito5.js:31586:57), <anonymous>:18:26)
481 at tmp106 (eval at <anonymous> (/perlito5.js:31586:57), <anonymous>:27:28)
482 at eval (eval at <anonymous> (/perlito5.js:31586:57), <anonymous>:32:7)
483 ..."
484
fa46927 @fglock Perlito5 - js - TODO update
authored
485
486 * Javascript - implemented but missing more tests
487
147d022 @fglock Perlito5 - java - TODO update
authored
488 -- /e modifier
489
549d3ac @fglock Perlito5 - js - assign to 0var
authored
490 -- lvalue $#a
491
606f085 @fglock Perlito5 - js - fix local()
authored
492 -- local
493 add tests: exiting a block with 'last' doesn't retrieve previous 'local' values:
494 $ nodejs perlito5.js -Isrc5/lib -I. -It -e ' $_ = "abc"; /(b)/; print "$1\n"; { print "$1\n"; /(c)/; print "$1\n"; last; } print "$1\n"; '
495 b
496 b
497 c
498 c
499
2754593 @fglock Perlito5 - TODO update
authored
500 -- '&' prototype
501 add tests; see Try::Tiny
502
efe33bd @fglock Perlito5 - js - TODO update
authored
503 -- add symbol tables for scalar, array and hash
504 -- references to typeglobs:
505 $ perl -e ' print ref(\*main) '
506 GLOB
507
fa46927 @fglock Perlito5 - js - TODO update
authored
508 -- prototype() can be set by aliasing:
509 *x = sub ($$) { 123 }; *y = *x; print prototype(\&y) # $$
510
511 -- "or" has SCALAR context (Abigail++):
512 See: t5/01-perlito/23-eval.t
513
514 -- 'next', 'last' in expression
515 (*{"${callpkg}::$sym"} = \&{"${pkg}::$sym"}, next)
516 ... ) and last
517
518 -- check that \(@a) and \@a have different meanings
519
520 -- 'x' in list context
521 @{$cache}{@$ok} = (1) x @$ok;
522
523 -- while () {}
524 this is implemented - it now needs some tests:
525 # http://blogs.perl.org/users/peter_martini/2014/05/spelunking-why-while-is-my-new-favorite-perl-ism.html
526 while () {} # infinite loop - while(1)
527 while (()) {} # no loop
528
529 -- pass @_ to &sub
530 $ node perlito5.js -I./src5/lib -Cjs -e ' @_ = (1,2); &foo; '
531 # call foo(@_)
532
533
3a6993e @fglock Perlito5 - parser - compile-time execution environment wip
authored
534 * Compile-time execution environment
535
536 -- work in progress
537
538 -- special backend option "_comp" dumps the compile-time execution environment:
539
540 $ perl perlito5.pl -Isrc5/lib -I. -It -C_comp -e ' (0, undef, undef, @_)[1, 2] ; { 123 } sub x { 456; { 3 } }'
541 {
542 'block' => [
543 {
544 'block' => [],
545 },
546 {
547 'block' => [
548 {
549 'block' => [],
550 },
551 ],
552 'name' => 'main::x',
553 'type' => 'sub',
554 },
555 ],
556 }
557
5a080f1 @fglock Perlito5 - misc/compile-time update
authored
558 $ perl perlito5.pl -Isrc5/lib -I. -It -C_comp -e ' local (undef, undef, @_) ; { 123 } sub x { 456; { my $x = 3 } } local $y; INIT { 123 } BEGIN { $Perlito5::SCOPE->{block}[-1]{xxx} = 3 }'
559 change the environment using a BEGIN block
560
3a6993e @fglock Perlito5 - parser - compile-time execution environment wip
authored
561
fb9190c @fglock Perlito5 - TODO update
authored
562 * Nice to Have
a7ab071 @fglock Perlito5 - add TODO
authored
563
b1c054d @fglock Perlito5 - TODO update
authored
564 -- keep comments
565
3c87580 @fglock Perlito - TODO update
authored
566 -- debugging symbols
567 -- line numbers in error messages
568
8f60cb4 @fglock Perlito5 - TODO update
authored
569 -- caller()
570 -- "when"
465ee11 @fglock Perlito5 - TODO update
authored
571
fb9190c @fglock Perlito5 - TODO update
authored
572 -- run more of the "perl" test suite
0cc64c5 @fglock Perlito5 - kill perl6-ish "method"
authored
573
71b0905 @fglock Perlito5 - docs update
authored
574 -- proper "use strict" and "use warnings"
1b2eecc @fglock Perlito5 - use @ARGV instead of @*ARGS
authored
575 -- use the same error messages and warnings as 'perl'
42a3449 @fglock Perlito5 - TODO update
authored
576 -- no warnings 'redefine';
1b2eecc @fglock Perlito5 - use @ARGV instead of @*ARGS
authored
577
ebce10f @fglock Perlito5 - parser: add __END__, __DATA__
authored
578 -- __LINE__, __FILE__
f4910a7 @fglock Perlito5 - TODO update
authored
579
b343129 @fglock Perlito - TODO update
authored
580 -- INIT{}, END{}
581 look at the implementation in perlito6-in-Go
f4910a7 @fglock Perlito5 - TODO update
authored
582
4b15a00 @fglock Perlito5 - cleanup parenthesis
authored
583 -- source code - remove Perl 6 code such as "token"
71b0905 @fglock Perlito5 - docs update
authored
584 (fixed: This is only loaded if the grammar compiler is needed)
4b15a00 @fglock Perlito5 - cleanup parenthesis
authored
585
61d64aa @fglock Perlito5 - parser: rewrite operator() in "perl5-land" for later tweaking
authored
586 -- *{ $name }{CODE}->();
587
588 -- local(*{$caller."::a"}) = \my $a;
6217752 @fglock Perlito5 - docs update
authored
589 -- *{$pkg . "::foo"} = \&bar;
61d64aa @fglock Perlito5 - parser: rewrite operator() in "perl5-land" for later tweaking
authored
590
bb0befb @fglock Perlito5 - 'local' now works with subscripted variables
authored
591 -- local $SIG{__WARN__};
592
efe33bd @fglock Perlito5 - js - TODO update
authored
593 -- bug https://github.com/fglock/Perlito/issues/10
594 "Perlito 5 JS has syntax errors"
595
596 Tried
597
598 YUI Compressor online
599 and
600 Google Closure Compiler
601 http://closure-compiler.appspot.com/home
602
603 Both failed with syntax errors.
604
61d64aa @fglock Perlito5 - parser: rewrite operator() in "perl5-land" for later tweaking
authored
605
9643c62 @fglock Perlito5 - TODO update
authored
606 * Oddities
607
608 -- from moritz, Schwern and others at
609 http://stackoverflow.com/questions/161872/hidden-features-of-perl
610
611 - you can give subs numeric names if you use symbolic references
612
613 $ perl -lwe '*4 = sub { print "yes" }; 4->()'
614 yes
615
d6cad9b @fglock Perlito5 - TODO update
authored
616
617 * Deprecate
618
619 -- Interpreter backend
620 this is not being maintained; the code is still in src5/lib/Perlito5/Eval.pm just in case
621
b1c054d @fglock Perlito5 - TODO update
authored
622 alternately, use the interpreter to compute constant foldings
623
Something went wrong with that request. Please try again.