Skip to content

Commit

Permalink
[v6] Fix my @foo = 1; my $bar = @foo[0] = True misparse
Browse files Browse the repository at this point in the history
  • Loading branch information
sorear committed Jan 14, 2011
1 parent 6b2a40e commit 4e9a91d
Show file tree
Hide file tree
Showing 5 changed files with 351 additions and 6 deletions.
3 changes: 2 additions & 1 deletion lib/Cursor.cs
Expand Up @@ -624,7 +624,8 @@ public Cursor(IP6 proto, string text, IP6 actions)
public Variable O(VarHash caps) {
Cursor nw = At(pos);
foreach (KeyValuePair<string,Variable> kv in caps)
nw.captures = new CapInfo(nw.captures, new string[] { kv.Key }, kv.Value);
nw.captures = new CapInfo(nw.captures, new string[] { kv.Key },
Kernel.NewRWScalar(Kernel.AnyMO, kv.Value.Fetch()));
VarDeque ks = new VarDeque();

DynObject lst = new DynObject(Kernel.ListMO);
Expand Down
8 changes: 8 additions & 0 deletions test2.pl
Expand Up @@ -71,6 +71,14 @@
'action methods work (candidate rule)';
}

{
my @foo = 1; #OK
my $tgt; #OK
my %into;
$tgt = %into<foo> = True;
ok %into<foo>, "2011-01-13 list assignment parsefail";
}

#is $?FILE, 'test.pl', '$?FILE works';
#is $?ORIG.substr(0,5), '# vim', '$?ORIG works';

Expand Down
1 change: 1 addition & 0 deletions v6/NieczaCompiler.pm6
Expand Up @@ -16,6 +16,7 @@ method !compile($unitname, $filename, $modtime, $source, $main, $run, $end) {
my %*units;
my $*module_loader = sub ($m) { self!load_dependent($m) };
my $*verbose = $.verbose;
my $ast;
my @steps = (
Expand Down
5 changes: 2 additions & 3 deletions v6/NieczaFrontendSTD.pm6
Expand Up @@ -116,9 +116,8 @@ method parse(:$unitname, :$filename, :$modtime, :$source) {
my $*IN_SUPPOSE = 0;
my $*FATALS = 0;

$DEBUG::EXPR = False;
$STD::DEBUG::EXPR = False;
$STD::DEBUG::symtab = False;
$DEBUG::EXPR = $STD::DEBUG::EXPR = $STD::DEBUG::symtab =
$*verbose > 1;

my $*LAST_NIBBLE = 0;
my $*LAST_NIBBLE_START = 0;
Expand Down

0 comments on commit 4e9a91d

Please sign in to comment.