Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.6.5
    • Fix Version/s: JRuby 1.7.0.pre1
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      1

      Description

      In the attached file, there are double quotes around a bare \r character. On MRI, this becomes a normal string containing \r. On JRuby, we treat it as end of line and terminate the comment. The second double quote then starts another large string, which is never properly terminated.

      The full code is generated by kpeg. I have trimmed it down to just what triggers the issue.

      The exception that results is some form of SyntaxError, depending on the code that follows.

      1. grammar.kpeg.rb
        0.0 kB
        Charles Oliver Nutter

        Issue Links

          Activity

          Hide
          Hiro Asari added a comment -

          Fixed in efa4931 on master.

          commit efa493146a438dee16efeb67b52c20d184480973
          Author: Hiro Asari <asari.ruby@gmail.com>
          Date:   Fri Jan 27 22:53:41 2012 -0500
          
              Fix JRUBY-6344: Embedded \r should not be treated as end of comment line
              
              Previously, we substituted '\r[^\n]' with '\n', to account for the Classic Mac OS's
              newline character. This is year 2012. It seems highly unlikely that anyone would be running JRuby on that OS.
          

          Given that JRuby requires Java 5, which was released in 2004, and the last version of the Classic Mac OS was released in 2001, it seems safe to assume that we do not have to accommodate this situation ever arising.

          Show
          Hiro Asari added a comment - Fixed in efa4931 on master. commit efa493146a438dee16efeb67b52c20d184480973 Author: Hiro Asari <asari.ruby@gmail.com> Date: Fri Jan 27 22:53:41 2012 -0500 Fix JRUBY-6344: Embedded \r should not be treated as end of comment line Previously, we substituted '\r[^\n]' with '\n', to account for the Classic Mac OS's newline character. This is year 2012. It seems highly unlikely that anyone would be running JRuby on that OS. Given that JRuby requires Java 5, which was released in 2004, and the last version of the Classic Mac OS was released in 2001, it seems safe to assume that we do not have to accommodate this situation ever arising.

            People

            • Assignee:
              Hiro Asari
              Reporter:
              Charles Oliver Nutter
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: