[
https://issues.apache.org/jira/browse/SLING-10119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17313057#comment-17313057
]
Bertrand Delacretaz commented on SLING-10119:
---------------------------------------------
This is the grammar of the related parser productions, I'm not sure why "set
end" causes it to "jump" to the final <END> token.
{code}
void propertyLine(List<PropertyLine> lines) :
{
Token name = null;
Token type = null;
List<String> values;
Token t = null;
boolean isDefault = false;
}
{
(t = <SET> | t = <SETDEF> {isDefault = true;} )
( name = <STRING> | name = <NAMESPACED_ITEM>)
( <LCURLY> ( type = <STRING> ) <RCURLY> )?
<TO> ( values = propertyValuesList() )
<EOL>
{
lines.add(new PropertyLine(name.image, type == null ? null :
type.image, values, isDefault));
}
}
void setPropertiesStatement(List<Operation> result) :
{
List<PropertyLine> lines = new ArrayList<PropertyLine>();
List<String> paths;
}
{
<SET> <PROPERTIES> <ON> ( paths = pathsList() ) <EOL>
( propertyLine(lines) | blankLine() ) +
<END>
( <EOL> | <EOF> )
{
result.add(new SetProperties(paths, lines));
}
}
{code}
> Repoinit parser fails on "set property end to..."
> -------------------------------------------------
>
> Key: SLING-10119
> URL: https://issues.apache.org/jira/browse/SLING-10119
> Project: Sling
> Issue Type: Improvement
> Components: Repoinit
> Affects Versions: Repoinit Parser 1.6.2
> Reporter: Bertrand Delacretaz
> Assignee: Bertrand Delacretaz
> Priority: Minor
>
> Using "end" instead of "endS" in the below test causes parsing to fail:
>
> {code}
> set properties on /endkeyword
> # using "end" instead of "endS" below causes parsing to fail
> set endS to one
> set two to endS
> end
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)