This is an automated email from the ASF dual-hosted git repository. rombert pushed a commit to annotated tag org.apache.sling.repoinit.parser-1.0.0 in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-repoinit-parser.git
commit db642cd824d3b3ba2dd61aa4b6125d8757901f6a Author: Bertrand Delacretaz <bdelacre...@apache.org> AuthorDate: Tue May 17 14:18:51 2016 +0000 SLING-5449 - use nicer 'create path' syntax git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/commons/repoinit/parser@1744278 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/javacc/RepoInitGrammar.jjt | 12 ++++++------ src/test/resources/testcases/test-20.txt | 9 ++++----- src/test/resources/testcases/test-99.txt | 4 ++-- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/main/javacc/RepoInitGrammar.jjt b/src/main/javacc/RepoInitGrammar.jjt index abc011c..66b52b0 100644 --- a/src/main/javacc/RepoInitGrammar.jjt +++ b/src/main/javacc/RepoInitGrammar.jjt @@ -61,17 +61,17 @@ TOKEN: | < CREATE: "create" > | < DELETE: "delete" > | < SERVICE: "service" > +| < PATH: "path" > | < END: "end" > | < USER: "user" > | < NODETYPES: "nodetypes" > -| < CREATE_PATH: "create_path" > | < LPAREN: "(" > | < RPAREN: ")" > | < PRINCIPAL: (["a"-"z"] | ["A"-"Z"] | ["0"-"9"] | "_" | "-")+ > | < COMMA: "," > | < STAR: "*" > | < NAMESPACED_ITEM: (["a"-"z"] | ["A"-"Z"])+ ":" (["a"-"z"] | ["A"-"Z"])+ > -| < PATH: "/" (["a"-"z"] | ["A"-"Z"] | ["0"-"9"] | ["-"] | ["_"] | ["."] | ["/"]) * > +| < PATH_STRING: "/" (["a"-"z"] | ["A"-"Z"] | ["0"-"9"] | ["-"] | ["_"] | ["."] | ["/"]) * > | < EOL: "\n" > } @@ -149,8 +149,8 @@ List<String> pathsList() : List<String> paths = new ArrayList<String>(); } { - t = <PATH> { paths.add(t.image); } - ( <COMMA> t = <PATH> { paths.add(t.image); } )* + t = <PATH_STRING> { paths.add(t.image); } + ( <COMMA> t = <PATH_STRING> { paths.add(t.image); } )* { return paths; } } @@ -162,10 +162,10 @@ void createPathStatement(List<Operation> result) : Token t2 = null; } { - <CREATE_PATH> + <CREATE> <PATH> ( <LPAREN> t1 = <NAMESPACED_ITEM> <RPAREN> { defaultPrimaryType = t1.image; } ) ? - ( t1 = <PATH> ( <LPAREN> t2 = <NAMESPACED_ITEM> <RPAREN> ) ? + ( t1 = <PATH_STRING> ( <LPAREN> t2 = <NAMESPACED_ITEM> <RPAREN> ) ? { if(cp == null) { cp = new CreatePath(defaultPrimaryType); diff --git a/src/test/resources/testcases/test-20.txt b/src/test/resources/testcases/test-20.txt index 9a67807..30f1355 100644 --- a/src/test/resources/testcases/test-20.txt +++ b/src/test/resources/testcases/test-20.txt @@ -1,6 +1,5 @@ # Various create path tests -# TODO should use "create path" instead of "create_path" -create_path (sling:Folder) /var/discovery(nt:unstructured)/somefolder -create_path /one/two/three -create_path /three/four(nt:folk)/five(nt:jazz)/six -create_path (nt:x) /seven/eight/nine +create path (sling:Folder) /var/discovery(nt:unstructured)/somefolder +create path /one/two/three +create path /three/four(nt:folk)/five(nt:jazz)/six +create path (nt:x) /seven/eight/nine diff --git a/src/test/resources/testcases/test-99.txt b/src/test/resources/testcases/test-99.txt index 6632b03..df013a8 100644 --- a/src/test/resources/testcases/test-99.txt +++ b/src/test/resources/testcases/test-99.txt @@ -17,8 +17,8 @@ set ACL on /tmp allow some:otherPrivilege for bob_the_service end -create_path /content/example.com(sling:Folder) -create_path (nt:unstructured) /var +create path /content/example.com(sling:Folder) +create path (nt:unstructured) /var set ACL for alice, bob,fred remove * on / -- To stop receiving notification emails like this one, please contact "commits@sling.apache.org" <commits@sling.apache.org>.