Navigation Menu

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

Newline before => breaking parse #4218

Closed
p6rt opened this issue May 4, 2015 · 6 comments
Closed

Newline before => breaking parse #4218

p6rt opened this issue May 4, 2015 · 6 comments

Comments

@p6rt
Copy link

p6rt commented May 4, 2015

Migrated from rt.perl.org#125101 (status was 'rejected')

Searchable as RT125101$

@p6rt
Copy link
Author

p6rt commented May 4, 2015

From @drforr

Inserting a newline before '=>' seems to break context handling. The
sample code uses 0x20 space, not \t, but the problem appears to be with
\h in the parser, not the tabbing.

--cut here--
{
complementary
  => 1 # Newline and tab here
  ?? True
  !! False
}
--cut here--

--cut here--
===SORRY!=== Error while compiling /home/jgoff/bug.t
Preceding context expects a term, but found infix => instead
at /home/jgoff/bug.t​:3
------> =>⏏ 1
--cut here--

@p6rt
Copy link
Author

p6rt commented May 5, 2015

From @labster

On Mon May 04 13​:24​:19 2015, drforr@​pobox.com wrote​:

Inserting a newline before '=>' seems to break context handling. The
sample code uses 0x20 space, not \t, but the problem appears to be with
\h in the parser, not the tabbing.

--cut here--
{
[4​:15pm] TimToady​: the \h* is intentional for LTM purposes, and it can't be liberalized to \s* without potentially breaking heredocs
[4​:16pm] TimToady​: it also reduces the LTM lookahead greatly on identifiers without a subsequent =>
[4​:17pm] TimToady​: if you let it go past \n then it probably has to scan a whole bunch of spaces on the next line on the offchance someone wanted to put a newline before the =>
[4​:17pm] TimToady​: and you'll note that this is the first time in a decade that someone has actually attempted it :)
[4​:18pm] TimToady​: so it's gonna stay \h*

It sounds like this is intentional behavior.

complementary
=> 1 # Newline and tab here
?? True
!! False
}
--cut here--

--cut here--
===SORRY!=== Error while compiling /home/jgoff/bug.t
Preceding context expects a term, but found infix => instead
at /home/jgoff/bug.t​:3
------> =>⏏ 1
--cut here--

1 similar comment
@p6rt
Copy link
Author

p6rt commented May 5, 2015

From @labster

On Mon May 04 13​:24​:19 2015, drforr@​pobox.com wrote​:

Inserting a newline before '=>' seems to break context handling. The
sample code uses 0x20 space, not \t, but the problem appears to be with
\h in the parser, not the tabbing.

--cut here--
{
[4​:15pm] TimToady​: the \h* is intentional for LTM purposes, and it can't be liberalized to \s* without potentially breaking heredocs
[4​:16pm] TimToady​: it also reduces the LTM lookahead greatly on identifiers without a subsequent =>
[4​:17pm] TimToady​: if you let it go past \n then it probably has to scan a whole bunch of spaces on the next line on the offchance someone wanted to put a newline before the =>
[4​:17pm] TimToady​: and you'll note that this is the first time in a decade that someone has actually attempted it :)
[4​:18pm] TimToady​: so it's gonna stay \h*

It sounds like this is intentional behavior.

complementary
=> 1 # Newline and tab here
?? True
!! False
}
--cut here--

--cut here--
===SORRY!=== Error while compiling /home/jgoff/bug.t
Preceding context expects a term, but found infix => instead
at /home/jgoff/bug.t​:3
------> =>⏏ 1
--cut here--

@p6rt
Copy link
Author

p6rt commented May 6, 2015

From @masak

labster (>)​:

It sounds like this is intentional behavior.

Indeed. Rejecting ticket.

@p6rt
Copy link
Author

p6rt commented May 6, 2015

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

@p6rt p6rt closed this as completed May 6, 2015
@p6rt
Copy link
Author

p6rt commented May 6, 2015

@masak - Status changed from 'open' to 'rejected'

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

No branches or pull requests

1 participant