#86 Syntax highlighter fails to recognize escaped (backslashed) quotation mark

v1.0_(example)
open
nobody
1
2014-03-16
2014-01-08
Balazs Szappanos
No

The new syntax highlighter (Tinn-R version 3.0.2.7) fails to understand when a backslash is followed by a quotation mark. As a result the remaining part of the R script will be coloured as a quote. Example:

dataDF <- read.table(dataFile, sep="\t", quote="\"", header=T)

See the attached image. The previous version of the syntax highlighter (Tinn-R version 2.4.1.5) was able to handle this.

1 Attachments

Discussion

  • jcfaria
    jcfaria
    2014-01-08

    I think the problem is here: quote="\""

    It should not be quote="\"

     
  • The backslash is necessary before the '"' character. See the default value in the help of the read.table function: quote = "\"'" - the syntax highlighter misunderstands this also.

     
  • jcfaria
    jcfaria
    2014-01-08

    OK, I will try to fix it in the next version of the project.
    Thanks.

     
  • jcfaria
    jcfaria
    2014-01-11

    The bug was fixed!
    You will see it in the next Tinn-R version (3.0.2.8).

    With the version you are using an alternative is to use single quotes to this string: read.table (quote = '\"')

     
    Attachments
  • Thank you!

     
  • jcfaria
    jcfaria
    2014-01-29

    • status: open --> closed
     
    • MOPTKaHo
      MOPTKaHo
      2014-03-15

      Sadly, it appears the bug is present again in Tinn-r 3.0.3.6
      To be sure, I have uninstalled my existing Tinn'r using tinn'r s uninstaller and cleaned out the registry. I installed the most recent version from sourceforge;

      creating an empty R document with the following testcode will demonstrate the problem:

      test <- "testing without quotes"; message(test)
      test2 <- "testing with three \"\"\" quote characters"; message(test2)

       
  • jcfaria
    jcfaria
    2014-03-16

    • status: closed --> open
     
  • jcfaria
    jcfaria
    2014-03-16

    I reopen this ticket.

    This shape is different from the previous one, but it is still a bug!

    Until it can be fixed, write like below:

    test2 <- 'testing with three \"\"\" quote characters'; message(test2)
    

    HTH,
    J.C.Faria

     
    Last edit: jcfaria 2014-03-16