Menu

#3005 syntax: does not allow matching of newlines

normal bug
open
5
2017-12-04
2008-01-04
No

In jEdit mode files, the following does not work:
<SEQ_REGEXP DELEGATE="FOO">\n</SEQ_REGEXP>

Likewise, the following does not include newlines:
<SEQ_REGEXP DELEGATE="FOO">\s</SEQ_REGEXP>

This would allow to fix bug 958013, so that a PHP line comment could either on "\n" or "?>".

Discussion

  • Altonator

    Altonator - 2009-02-17

    +1 vote for fixing this.
    The PHP line comment problem is very annoying.

     
  • Roman Tsourick

    Roman Tsourick - 2017-11-24
    • status: open --> closed-wont-fix
     
  • Roman Tsourick

    Roman Tsourick - 2017-11-24

    \n support does not seem to be necessary as SEQ (SEQ_REGEXP) is only applied to a single line i.e.
    until \n. And this is why \s does not "include" newlines here.

    A fix to the bug will follow (new URL https://sourceforge.net/p/jedit/bugs/2106/).

     
  • Roman Tsourick

    Roman Tsourick - 2017-12-04
    • status: closed-wont-fix --> open
     
  • Roman Tsourick

    Roman Tsourick - 2017-12-04

    I did probably wrong closing the ticket.

    Now I am trying to implement multiline strings in C mode (https://sourceforge.net/p/jedit/bugs/2935/)

    I delegated the string SPAN to a separate rule:

    <rules set="STRING_LITERAL" default="LITERAL1" escape="\">
    <seq_regexp delegate="MAIN"><![CDATA[[^\]$]]></seq_regexp>
    </rules>

    ... so that EOL without backslash should trigger fallback to MAIN. But when I try to use negative lookbehind assertion (instead of [^\] which improperly includes the token) nothing works.

    Seems like EOL does not match by itself but with something else. Thus, [^\]$ matches but (?<!\)$ does not.

    This needs further investigation.

     
  • Roman Tsourick

    Roman Tsourick - 2017-12-04
    • assigned_to: Roman Tsourick
     

Log in to post a comment.