Skip to content
This repository has been archived by the owner on Feb 22, 2018. It is now read-only.

fix(parser): changes parser to throw an error when it encounters an unexpected token #905

Conversation

vsavkin
Copy link
Contributor

@vsavkin vsavkin commented Apr 15, 2014

Change the handling of unexpected tokens. Make the parser throw the "is an unexpected token" exception, so ExpressionVisitor won't throw confusing "Can not watch expression containing ';'".

Closes #830

@mhevery
Copy link
Contributor

mhevery commented Apr 15, 2014

Thanks for your contribution! In order for us to be able to accept it, we ask you to sign our CLA (contributor's license agreement). CLA is important for us to be able to avoid legal troubles down the road.

For individuals (a simple click-through form): http://code.google.com/legal/individual-cla-v1.0.html

@vsavkin vsavkin added cla: no and removed cla: yes labels Apr 15, 2014
@@ -40,6 +40,9 @@ class DynamicParserImpl {
if (isChain && expr is Filter) {
error('Cannot have a filter in a chain');
}
if(!isChain && index < tokens.length){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing ws before & after parenthesis

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@vicb
Copy link
Contributor

vicb commented Apr 15, 2014

LGTM with a few comments. Thanks for the fix.

@mhevery
Copy link
Contributor

mhevery commented Apr 15, 2014

Achievement unlocked: CLA signature found!

@vsavkin vsavkin added cla: yes and removed cla: no labels Apr 15, 2014
@vsavkin
Copy link
Contributor Author

vsavkin commented Apr 15, 2014

Just pushed the style changes. Please, let me know if anything else is required.

@vicb
Copy link
Contributor

vicb commented Apr 15, 2014

could you please squash your commits and force push and then you're fine.

…nexpected token

Change the handling of unexpected tokens. Make the parser throw the "is an unexpected token" exception, so ExpressionVisitor won't throw confusing "Can not watch expression containing ';'".

Closes dart-archive#830
@vsavkin
Copy link
Contributor Author

vsavkin commented Apr 15, 2014

@vicb I squashed the commits.

@vicb
Copy link
Contributor

vicb commented Apr 15, 2014

@mhevery I don't want to merge this while you are preparing the release. Can you handle this once you're done ? Thanks.

@mhevery mhevery self-assigned this Apr 15, 2014
mhevery pushed a commit that referenced this pull request Apr 15, 2014
…nexpected token

Change the handling of unexpected tokens. Make the parser throw the "is an unexpected token" exception, so ExpressionVisitor won't throw confusing "Can not watch expression containing ';'".

Closes #830

Closes #905
mhevery pushed a commit that referenced this pull request Apr 16, 2014
…nexpected token

Change the handling of unexpected tokens. Make the parser throw the "is an unexpected token" exception, so ExpressionVisitor won't throw confusing "Can not watch expression containing ';'".

Closes #830

Closes #905
mhevery pushed a commit that referenced this pull request Apr 17, 2014
…nexpected token

Change the handling of unexpected tokens. Make the parser throw the "is an unexpected token" exception, so ExpressionVisitor won't throw confusing "Can not watch expression containing ';'".

Closes #830

Closes #905
@mhevery mhevery closed this in 7c26ab0 Apr 17, 2014
mhevery pushed a commit that referenced this pull request Apr 24, 2014
…nexpected token

Change the handling of unexpected tokens. Make the parser throw the "is an unexpected token" exception, so ExpressionVisitor won't throw confusing "Can not watch expression containing ';'".

Closes #830

Closes #905
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging this pull request may close these issues.

ExpressionVisitor should throw with better messages
3 participants