[
https://jira.jboss.org/jira/browse/JBRULES-2376?page=com.atlassian.jira.p...
]
Edson Tirelli commented on JBRULES-2376:
----------------------------------------
Documentation is here:
http://downloads.jboss.com/drools/docs/5.0.1.26597.FINAL/drools-expert/ht...
"end" is a soft keyword, but it is the delimiter for a rules consequence, so it
can't be used "as-is" inside a rule consequence. To do that you need to
escape it, as demonstrated in the docs, using back quotes:
then
foo = new Foo()
e = foo.`end`
end
Parser fails when accessing property/method called 'end'
--------------------------------------------------------
Key: JBRULES-2376
URL:
https://jira.jboss.org/jira/browse/JBRULES-2376
Project: Drools
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: drools-compiler-DSL
Affects Versions: 5.1.0.M1
Reporter: Barry Kaplan
Assignee: Mark Proctor
Consider the following:
declare Foo
end : String
end
rule "foo" dialect "java"
when
then
foo = new Foo()
e = foo.end()
end
The compiler fails with the following error: [xx,yy]: [ERR 102] Line xx:yy mismatched
input '('
If the rule is changed to (ie, remove the parens on the 'end')
rule "foo" dialect "java"
when
then
foo = new Foo()
e = foo.end
end
The compiler error is: [0,-1]: [ERR 101] Line 0:-1 no viable alternative at input
'<eof>'
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira