Uploaded image for project: 'Scala Programming Language'
  1. Scala Programming Language
  2. SI-4138

stringLiteral parser of JavaTokenParsers does not accept escaped double quotes.

    Details

    • Type: Bug
    • Status: CLOSED
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Compiler (Misc)
    • Labels:
      None
    • Environment:

      stringLiteral double quotes

      Description

      Should not stringLiteral parser be like this:

      ("\""+"""([^"\p{Cntrl}\\]|\\[\\/bfnrt"]|\\u[a-fA-F0-9]{4})*"""+"\"").r

        Attachments

          Activity

          Hide
          malayeri Donna Mithra Malayeri added a comment -

          Lukas, can you verify the proposed change is correct?

          Show
          malayeri Donna Mithra Malayeri added a comment - Lukas, can you verify the proposed change is correct?
          Hide
          malayeri Donna Mithra Malayeri added a comment -

          What is the difference here? What parses and doesn't parse? We need to a way to verify the proposed fix.

          Show
          malayeri Donna Mithra Malayeri added a comment - What is the difference here? What parses and doesn't parse? We need to a way to verify the proposed fix.
          Hide
          ebowman Eric Bowman added a comment -

          I ran into this trying to parse a string like:

          "for all good \"men\" to come to the aid of their country"

          I ended up overriding stringLiteral and doing exactly what the original report suggested; I concur, this is a bug, and the fix is quite safe.

          Show
          ebowman Eric Bowman added a comment - I ran into this trying to parse a string like: "for all good \"men\" to come to the aid of their country" I ended up overriding stringLiteral and doing exactly what the original report suggested; I concur, this is a bug, and the fix is quite safe.
          Show
          rytz Lukas Rytz added a comment - fixed in https://github.com/scala/scala/commit/800bdf81228cf10e6c93ae39030f9edfae96c679

            People

            • Assignee:
              rytz Lukas Rytz
              Reporter:
              martins Martins
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: