[
https://issues.apache.org/jira/browse/SLING-7942?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16623906#comment-16623906
]
Jörg Hoh commented on SLING-7942:
---------------------------------
It wasn't hard to come up with a patch :) (see
[^SLING-7942-support-semicolons]). The test suite did not require any
extension, but I tried to come up with some testcase with a weird combination
of semicolons and new lines.
I am not entirely sure if this patch is the right thing. Instead of having the
<EOL> and the <SEMICOLON> token, we should use a "<END_OF_STATEMENT> token,
which is either a newline or a semicolon. But I leave this up to the language
designers.
Anyway, I would would appreicate if this extension could make it.
> RepoInit: language should not require newlines
> ----------------------------------------------
>
> Key: SLING-7942
> URL: https://issues.apache.org/jira/browse/SLING-7942
> Project: Sling
> Issue Type: New Feature
> Components: Repoinit
> Affects Versions: Repoinit Parser 1.2.2
> Reporter: Jörg Hoh
> Priority: Major
> Attachments: SLING-7942-support-semicolons
>
>
> At the moment the repoinit used to define the scriptlets requires newlines.
> While this doesn't matter when dealing with full-blown models, it gets
> cumbersome when you just want to create an instance of the
> RepositoryInitializerFactory configuration to perform a single action (e.g.
> setting an ACL on a path for a certain user).
> When I add such a configuration and set the scripts property to ```set ACL on
> /var allow jcr:read for anonymous end``` the parser throws this exception:
> {noformat}
> ...
> Caused by: org.apache.sling.repoinit.parser.impl.ParseException: Encountered
> " "allow" "allow "" at line 1, column 29.
> Was expecting:
> "\n" ...
> {noformat}
> I can possibly find out how I can get this newline character in there, but
> it's getting cumbersome to work with.
> It would be much better if the EOL tokens are optional. Don't know if that's
> possible though.
>
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)