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

Fix undeclared variable error #422

Merged
merged 1 commit into from May 9, 2015
Merged

Fix undeclared variable error #422

merged 1 commit into from May 9, 2015

Conversation

raydiak
Copy link
Contributor

@raydiak raydiak commented May 8, 2015

Previously it would show the cursor in a wrong (later) position and give inappropriate "expecting any of" suggestions based on that position. I'm a bit unclear on the details of this precursor thing, so please do review carefully before merging in case this is the wrong way to fix it, but what I saw seemed to suggest that precursor may be intended for these kinds of cases.

Previously it would show the cursor in a wrong (later) position and give inappropriate "expecting any of" suggestions based on that position. I'm a bit unclear on the details of this precursor thing, so please do review carefully before merging in case this is the wrong way to fix it, but what I saw seemed to suggest that precursor may be intended for these kinds of cases.
@AlexDaniel
Copy link
Contributor

It feels like this pull request lacks the example:

$test = 1;
===SORRY!=== Error while compiling ./test.pl
Variable '$test' is not declared
at ./test.pl:9
------> $test⏏ = 1;
    expecting any of:
        postfix

@raydiak
Copy link
Contributor Author

raydiak commented May 8, 2015

Thanks, good call...I had meant to at least include a link to the discussion at http://irclog.perlgeek.de/perl6/2015-05-08#i_10570744 but apparently forgot. The above example after this patch renders as:

===SORRY!=== Error while compiling -e
Variable '$test' is not declared
at -e:1
------> use strict; ⏏$test = 1;

@raydiak
Copy link
Contributor Author

raydiak commented May 8, 2015

Figured it couldn't hurt to add one more example of misbehavior to show the confusion a little more fully:

> perl6 -e 'use strict; $foo.bar'
===SORRY!=== Error while compiling -e
Variable '$foo' is not declared
at -e:1
------> use strict; $foo.bar⏏<EOL>
    expecting any of:
        method arguments

@raydiak
Copy link
Contributor Author

raydiak commented May 9, 2015

wrt $/.PRECURSOR, I found https://github.com/perl6/nqp/blob/5e9f7b8c563d3601961751aec03228325e33d76d/src/QRegex/Cursor.nqp#L731 which seems to fit the vague assumptions I was making

lizmat added a commit that referenced this pull request May 9, 2015
Fix undeclared variable error
@lizmat lizmat merged commit 176f778 into rakudo:nom May 9, 2015
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

Successfully merging this pull request may close these issues.

None yet

3 participants