Use special lexer rules for escapes; fixes catastrophic backtracking, and highlights them too. Fixes #2356
35 lines
733 B
Properties
35 lines
733 B
Properties
#https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Properties.htm
|
|
# mixing spaces
|
|
Truth = Beauty
|
|
Truth:Beauty
|
|
Truth Beauty
|
|
Truth :Beauty
|
|
|
|
! line continuations and escapes
|
|
fruits apple, banana, pear, \
|
|
cantaloupe, watermelon, \
|
|
kiwi, mango
|
|
key = \
|
|
value1 \\\
|
|
and value2\\
|
|
key\ 2 = value
|
|
key\\ 3 = value3
|
|
key \
|
|
= value
|
|
|
|
! empty keys and edge cases
|
|
key1 =
|
|
key2
|
|
key3 the value3
|
|
key4 the:value4
|
|
key5 the=value5
|
|
key6=the value6
|
|
|
|
! escapes in keys
|
|
key\ with\ spaces = value
|
|
key\nwith\nnewlines = value\nwith\nnewlines
|
|
|
|
! indented comment
|
|
|
|
! line continuations do \
|
|
not = work for comments
|