# Using jEdit 4.2 Perl mode (gnu.regexp)
#
# a collection of syntax coloring test cases

#########################################################
# correct, positive tests
# valid syntax that is correctly recognized in 4.2

x =~ m/E/
x =~ m{E}
x =~ m#E#
x =~ m/\//
x =~ m#a\#b#
x =~ m#\#b#
x =~ m{E}
x =~ m#\##

#########################################################
# correct, negative tests
# invalid syntax that is recognized as such and colored (or not) correctly in 4.2

x =~ m/\/
x =~ m/a\/
x =~ m#a\#

# (I think the last one is invalid syntax, not certain though)

#########################################################
# negative tests that pass and should not
# invalid syntax that is wrongly recognized and colorized in 4.2
# (I think this is invalid syntax)

X =~ m//////

#########################################################
# positive tests that fail and should not
# valid cases that fail, creating syntax coloring errors in 4.2

# note the following is taken from the perl manual
# (http://www.perl.com/doc/manual/html/pod/perlre.html)
# jEdit currently fails to highlight this syntax correctly

$_ = 'a' x 8;
  m<
     (?{ $cnt = 0 })
     (
       a
       (?{
           local $cnt = $cnt + 1;
       })
     )*
     aaaa
     (?{ $res = $cnt })
   >x;

# same as above

x =~ m{ \(
          (
            [^()]+
          |
            \( [^()]* \)
          )+
       \)
     }x
