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

Can't parse functions having a keyword as a prefix and whose body is followed by a newline but not a semicolon in Rakudo #1919

Closed
p6rt opened this issue Jul 8, 2010 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Jul 8, 2010

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

Searchable as RT76432$

@p6rt
Copy link
Author

p6rt commented Jul 8, 2010

From @masak

<ingy> I just found a crazy error in rakudo
<moritz_> RT has ~600 of those :-)
<moritz_> but do tell
<ingy> you can't name a subroutine "${keyword}_text"
<ingy> like get_foo
<ingy> or lt_foo
<ingy> knowing TimToady, this is probably a feature
<moritz_> rakudo​: sub get_foo() { say 3 }; get_foo()
<p6eval> rakudo e59795​: OUTPUT«3␤»
<ingy> hmm
* moritz_ doesn't see the problem
<ingy> you need newlines in there
<ingy> not a one liner
<ash_> rakudo​: sub get_fun() { ␤ say 3␤ } ␤get_fun
<p6eval> rakudo e59795​: OUTPUT«===SORRY!===␤Confused at line 11, near
"sub get_fu"␤»
<ingy> :)
<moritz_> now *that's* weird
<moritz_> please submit!
<ash_> rakudo​: sub get_fun() { ␤ say 3␤ }; ␤get_fun
<p6eval> rakudo e59795​: OUTPUT«3␤»
<ash_> its the mixing ; ? sub's don't always need those though, right?
<moritz_> after }\n the ; should be optional
<ingy> rakudo​: sub gxt_fun() { ␤ say 3␤ }; ␤gxt_fun
<p6eval> rakudo e59795​: OUTPUT«3␤»
<ingy> see?!
<masak> ingy​: crazy bug. pmichaud discovered something similar (but
not identical) about a month ago.
<ingy> masak​: can you file that for me? :)
<masak> jnthn, diakopter​: exercising the right to lay down arms?
* masak submits rakudobug

@p6rt
Copy link
Author

p6rt commented Jul 29, 2010

@coke - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jul 25, 2012

From @masak

$ cat foo
class A {
  has %!x;

  method m {
  sub foo {
  }

  %!x<bar> = 42;
  }
}

$ nom foo
===SORRY!===
CHECK FAILED​:
Undefined routine '&x' called (line 8)

$ nom -v
This is perl6 version 2012.07-3-g81328c3 built on parrot 4.5.0
revision RELEASE_4_5_0

Been a while since any of us found a closing-brace-newlines-related
parsing bug. Let's hope this is the last one. :/

@p6rt
Copy link
Author

p6rt commented Jan 17, 2014

From @coke

On Wed Jul 25 08​:49​:12 2012, masak wrote​:

$ cat foo
class A {
has %!x;

method m \{
    sub foo \{
    \}

    %\!x\<bar> = 42;
\}

}

$ nom foo
===SORRY!===
CHECK FAILED​:
Undefined routine '&x' called (line 8)

$ nom -v
This is perl6 version 2012.07-3-g81328c3 built on parrot 4.5.0
revision RELEASE_4_5_0

Been a while since any of us found a closing-brace-newlines-related
parsing bug. Let's hope this is the last one. :/

Both variants here are tested​:

S02-lexical-conventions/sub-block-parsing.t
integration/weird-errors.t
--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Jan 17, 2014

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant