Uploaded image for project: 'XWiki Rendering'
  1. XWiki Rendering
  2. XRENDERING-215

Ambiguous lexical analyzis due to escape character

    Details

    • Tests:
      Unit, Integration
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      There's yet another regression of XRENDERING-88 (http://ci.xwiki.org/job/xwiki-enterprise-test-wysiwyg/org.xwiki.enterprise$xwiki-enterprise-test-wysiwyg/1399/testReport/org.xwiki.test.wysiwyg/MacroTest/testEditMacroWithSpecialCharactersInParameterValues/). This is, however, a more general problem of ambiguity in how the escape charater, '~', is implemented:

      This is a typical example:

            <#PARAMS:   "(%" ( "~" ~[] | ~["%"] | ["%"] ~[")"] )* "%)" >
      

      But there is a problem with ambiguity here. Take this example:

      (% %~~%) %)
      

      The PARAMS token here will be suprisingly be the whole string, because the substring "%~" matches the subpatter ["%"] ~[")"], and taking that path leads to a longer token.

        Attachments

          Activity

            People

            • Assignee:
              aj Andreas Jonsson
              Reporter:
              aj Andreas Jonsson
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: