# This is the file I used to debug my syntax colouring mode for 'nedit'. #] A difficult comment [{fl;dkg fghfgh fghf #fsdf# (Highlight) #fdgdlfkg #fdg #dfgdfg}[] # Identifier operator number separator: avnCXV += 5; # Punctuation symbols. !\$%\&\*\+\-/:\<=\>\?@\\\^_`\| # Illegal characters. °'Æ¥ØÞЮ©º¬£¨ßæð¯ # These character constants ought to (?!) confuse it: ''''\A/''"''\' # That's the character constant ''' followed by the character constant '\A\' followed by the character constant '"', followed by a syntax error. # Here are some constants, identifiers and keywords, with a few separators scattered around, and a literal string in the middle. The string contains a newline and a hash and an escape sequence: Hello, there. How ARE you today? "GREAT, #thanks\21/" I said. # A number literal: 1F.3o0 # Constant, keyword, identifier: A BB ccc # Constant, keyword, separator, constant: Anybody THERE? AAbBB6B # Something with brackets nested to a depth of six: PUBLIC STATIC VOID Main(String[] args) { for (int i=0; i<10; i++) { # Comment in the middle. if (you feel like it) { Process( ['0'-'9']['0'-'9''A'-'F']* (?:'.'['0'-'9''A'-'F']*)? (?:['b''q''o''d''h']'-'?['0'-'9']+)? ); } } } # And another copy commented out: #PUBLIC STATIC VOID Main(String[] args) { # for (int i=0; i<10; i++) { # # Comment in the middle. # if (you feel like it) { # Process( # ['0'-'9']['0'-'9''A'-'F']* # (?:'.'['0'-'9''A'-'F']*)? # (?:['b''q''o''d''h']'-'?['0'-'9']+)? # ); # } # } #} #Some numbers: 0F.55555555h0 44. 45 1b20 1d-6 # Some non-numbers. They all contain numbers, but all contain something else as well. The first starts with a constant and a separator. The second starts with a separator. The third, fourth, fifth and sixth are truncated. The sixth ends with a constant: F0.55555555h0 .44 0F 1b 1b- 1b-A # Some expressions with lots of constants, identifiers, operators and numbers and the odd bracket (which counts as a separator for syntax colouring) and keyword: Exp(I*Pi) + 1 == 0; 23 < Sum {1/n | NoZeros(n)} < 24 ALL(xs, ys) (Cartesion(xs, ys) == {(x, y) | x<-xs, y<-ys})