Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Declarator Parser Failure if Whitespace after Opening Paren #566

Closed
p6rt opened this issue Jan 2, 2009 · 5 comments
Closed

Declarator Parser Failure if Whitespace after Opening Paren #566

p6rt opened this issue Jan 2, 2009 · 5 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Jan 2, 2009

Migrated from rt.perl.org#61914 (status was 'resolved')

Searchable as RT61914$

@p6rt
Copy link
Author

p6rt commented Jan 2, 2009

From publiustemp-perl6compiler2@yahoo.com

This works fine​:

  class Foo {
  has ($.this,
  $.that,
  );
  }
  my Foo $foo .= new( this => 3, that => 4 );
  say $foo.this;

However, any whitespace after the opening paren causes a parse failure​:

  class Foo {
  has ( $.this,
  $.that,
  );
  }
  my Foo $foo .= new( this => 3, that => 4 );
  say $foo.this;

Unable to parse declarator; couldn't find final ')' at line 4, near "$.this, \n "

current instr.​: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir​:83)
called from Sub 'parrot;Perl6;Grammar;declarator' pc 81845 (src/gen_grammar.pir​:23527)
called from Sub 'parrot;Perl6;Grammar;scoped' pc 82534 (src/gen_grammar.pir​:23780)
called from Sub 'parrot;Perl6;Grammar;scope_declarator' pc 83560 (src/gen_grammar.pir​:24183)
called from Sub 'parrot;Perl6;Grammar;noun' pc 70435 (src/gen_grammar.pir​:19268)
called from Sub 'parrot;Perl6;Grammar;expect_term' pc 65600 (src/gen_grammar.pir​:17435)
called from Sub 'parrot;PGE;OPTable;parse' pc 1988 (compilers/pge/PGE/OPTable.pir​:566)
called from Sub 'parrot;Perl6;Grammar;statement' pc 29622 (src/gen_grammar.pir​:3674)
called from Sub 'parrot;Perl6;Grammar;statementlist' pc 27358 (src/gen_grammar.pir​:2799)
called from Sub 'parrot;Perl6;Grammar;statement_block' pc 24895 (src/gen_grammar.pir​:1841)
called from Sub 'parrot;Perl6;Grammar;block' pc 26388 (src/gen_grammar.pir​:2419)
called from Sub 'parrot;Perl6;Grammar;package_block' pc 79263 (src/gen_grammar.pir​:22572)
called from Sub 'parrot;Perl6;Grammar;package_def' pc 77242 (src/gen_grammar.pir​:21820)
called from Sub 'parrot;Perl6;Grammar;package_declarator' pc 75576 (src/gen_grammar.pir​:21207)
called from Sub 'parrot;Perl6;Grammar;noun' pc 70330 (src/gen_grammar.pir​:19233)
called from Sub 'parrot;Perl6;Grammar;expect_term' pc 65600 (src/gen_grammar.pir​:17435)
called from Sub 'parrot;PGE;OPTable;parse' pc 1988 (compilers/pge/PGE/OPTable.pir​:566)
called from Sub 'parrot;Perl6;Grammar;statement' pc 29622 (src/gen_grammar.pir​:3674)
called from Sub 'parrot;Perl6;Grammar;statementlist' pc 27358 (src/gen_grammar.pir​:2799)
called from Sub 'parrot;Perl6;Grammar;statement_block' pc 24895 (src/gen_grammaruse v6;

This is r34828
$ uname -a
Darwin curtis-poes-computer-3.local 9.5.1 Darwin Kernel Version 9.5.1​: Fri Sep 19 16​:19​:24 PDT 2008; root​:xnu-1228.8.30~1/RELEASE_I386 i386

Cheers,
Ovid
--
Buy the book - http://www.oreilly.com/catalog/perlhks/
Tech blog - http://use.perl.org/~Ovid/journal/
Twitter - http://twitter.com/OvidPerl
Official Perl 6 Wiki - http://www.perlfoundation.org/perl6

@p6rt
Copy link
Author

p6rt commented Jan 11, 2009

From @pmichaud

On Fri Jan 02 12​:06​:57 2009, publiustemp-perl6compiler2@​yahoo.com wrote​:

However, any whitespace after the opening paren causes a parse
failure​:

class Foo {
has ( $.this,
$.that,
);
}
my Foo $foo .= new( this => 3, that => 4 );
say $foo.this;

Unable to parse declarator; couldn't find final ')' at line 4, near
"$.this, \n "

Now working as of r35397​:

  $ cat x
  class Foo {
  has ( $.this,
  $.that,
  );
  }

  my Foo $foo .= new( this => 3, that => 4);
  say $foo.this;

  $ ./parrot perl6.pbc x
  3
  $

Assigning ticket to moritz so we can make sure there's a regression
spectest for this. Thanks!

Pm

@p6rt
Copy link
Author

p6rt commented Jan 11, 2009

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jan 11, 2009

From @moritz

On Sun Jan 11 00​:57​:23 2009, pmichaud wrote​:

On Fri Jan 02 12​:06​:57 2009, publiustemp-perl6compiler2@​yahoo.com wrote​:

However, any whitespace after the opening paren causes a parse
failure​:

class Foo {
has ( $.this,
$.that,
);
}
my Foo $foo .= new( this => 3, that => 4 );
say $foo.this;

Unable to parse declarator; couldn't find final ')' at line 4, near
"$.this, \n "

Now working as of r35397​:

$ cat x
class Foo {
has ( $.this,
$.that,
);
}

my Foo $foo .= new( this => 3, that => 4);
say $foo.this;

$ ./parrot perl6.pbc x
3
$

Assigning ticket to moritz so we can make sure there's a regression
spectest for this. Thanks!

Added to t/spec/S12-attributes/instance.t.

Cheers,
Moritz

@p6rt
Copy link
Author

p6rt commented Jan 11, 2009

@moritz - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Jan 11, 2009
@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant