[ 
https://issues.apache.org/jira/browse/GROOVY-8171?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Paul King updated GROOVY-8171:
------------------------------
    Description: 
The following test passes with the legacy parser but fails with Parrot

{code}
// legacy parser
def s1 = $/this $$/ is an escaped dollar forward slash/$
assert s1 == 'this $/ is an escaped dollar forward slash'
{code}

{code}
// antlr4 enabled (parrot)
assert s1 == 'this $/ is an escaped dollar forward slash'
       |  |
       |  false
       this / is an escaped dollar forward slash
{code}

Noticed this when I inadvertently changed a spec test in commit 
[0fb89906aa|https://github.com/apache/groovy/commit/0fb89906aa587920d11fae063bba1d1f8fe26254].
  When testing for an escaped dollar slash the test had to be changed ([commit 
942cf4eb3e|https://github.com/apache/groovy/commit/942cf4eb3e87f2718df490b9e3547f2042720781])
 to pass using the Antlr4 parser.

Based on the [dollar slashy 
docs|http://www.groovy-lang.org/syntax.html#_dollar_slashy_string] I am not 
sure if the old behavior is correct or not.

  was:
The following test passes with the legacy parser but fails with Parrot

{code}
def s1 = $/this $$/ is an escaped dollar forward slash/$

assert s1 == 'this $/ is an escaped dollar forward slash'
{code}

{code}
assert s1 == 'this $/ is an escaped dollar forward slash'
       |  |
       |  false
       this / is an escaped dollar forward slash
{code}

Noticed this when I inadvertently changed a spec test in commit 
[0fb89906aa|https://github.com/apache/groovy/commit/0fb89906aa587920d11fae063bba1d1f8fe26254].
  When testing for an escaped dollar slash the test had to be changed ([commit 
942cf4eb3e|https://github.com/apache/groovy/commit/942cf4eb3e87f2718df490b9e3547f2042720781])
 to pass using the Antlr4 parser.

Based on the [dollar slashy 
docs|http://www.groovy-lang.org/syntax.html#_dollar_slashy_string] I am not 
sure if the old behavior is correct or not.


> Escaped dollar slashy difference between old and parrot parsers
> ---------------------------------------------------------------
>
>                 Key: GROOVY-8171
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8171
>             Project: Groovy
>          Issue Type: Bug
>          Components: parser-antlr
>    Affects Versions: 3.x
>            Reporter: John Wagenleitner
>            Priority: Minor
>
> The following test passes with the legacy parser but fails with Parrot
> {code}
> // legacy parser
> def s1 = $/this $$/ is an escaped dollar forward slash/$
> assert s1 == 'this $/ is an escaped dollar forward slash'
> {code}
> {code}
> // antlr4 enabled (parrot)
> assert s1 == 'this $/ is an escaped dollar forward slash'
>        |  |
>        |  false
>        this / is an escaped dollar forward slash
> {code}
> Noticed this when I inadvertently changed a spec test in commit 
> [0fb89906aa|https://github.com/apache/groovy/commit/0fb89906aa587920d11fae063bba1d1f8fe26254].
>   When testing for an escaped dollar slash the test had to be changed 
> ([commit 
> 942cf4eb3e|https://github.com/apache/groovy/commit/942cf4eb3e87f2718df490b9e3547f2042720781])
>  to pass using the Antlr4 parser.
> Based on the [dollar slashy 
> docs|http://www.groovy-lang.org/syntax.html#_dollar_slashy_string] I am not 
> sure if the old behavior is correct or not.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to