-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[incubator-kie-drools#5742] [new-parser] Broken inline cast #5806
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -230,6 +230,7 @@ drlIdentifier returns [Token token] | |
| PERMITS | ||
| RECORD | ||
| VAR | ||
| THIS | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now, I add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The problem with this is that the parser will now allow But on second thought, I think it's OK because:
So +0.9. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, especially the reason "2" is the point. We'd like to minimize deviation from the old parser behaviour at this stage. (Hoping cleaner refactoring in the future) |
||
; | ||
|
||
// -------------------------------------------------------- | ||
|
@@ -671,7 +672,6 @@ primary returns [BaseDescr result] | |
: expr=parExpression { if( buildDescr ) { $result = $expr.result; } } | ||
| nonWildcardTypeArguments (explicitGenericInvocationSuffix | this_key arguments) | ||
| literal { if( buildDescr ) { $result = new AtomicExprDescr( $literal.text, true ); } } | ||
| this_key (DOT drlIdentifier)* identifierSuffix? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line was added by #5791 , but now |
||
| super_key superSuffix | ||
| new_key creator | ||
| primitiveType (LBRACK RBRACK)* DOT class_key | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -197,6 +197,7 @@ drlIdentifier | |
| PERMITS | ||
| RECORD | ||
| VAR | ||
| THIS | ||
; | ||
|
||
drlKeywords | ||
|
@@ -258,6 +259,7 @@ drlExpression | |
| NEW nonWildcardTypeArguments? innerCreator | ||
| SUPER superSuffix | ||
| explicitGenericInvocation | ||
| inlineCast | ||
) | ||
| drlExpression NULL_SAFE_DOT ( drlIdentifier | drlMethodCall ) | ||
| drlExpression LBRACK drlExpression RBRACK | ||
|
@@ -321,8 +323,11 @@ drlPrimary | |
| nonWildcardTypeArguments (explicitGenericInvocationSuffix | THIS arguments) | ||
| inlineListExpression | ||
| inlineMapExpression | ||
| inlineCast | ||
; | ||
|
||
inlineCast : drlIdentifier HASH drlIdentifier ; | ||
Comment on lines
+326
to
+329
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In This time, I prioritized simplicity for the changes in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I also filed #5808 for further refactoring for the parsers. |
||
|
||
/* extending JavaParser literal */ | ||
drlLiteral | ||
: integerLiteral | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is identical to the
inlineCastMultiple()
test below. Looks like a copy-paste error. Please fix.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for spotting this!