Changeset 849:18ead2310e93 in livinglogic.java.ul4

Show
Ignore:
Timestamp:
06/13/13 18:35:20 (6 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

Switch to triple quoted string parsing method from Jython.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/main/antlr3/com/livinglogic/ul4/UL4.g

    r844 r849  
    149149 
    150150STRING3 
    151     : '"""' (options {greedy=false;}:.)* '"""' 
    152     | '\'\'\'' (options {greedy=false;}:.)* '\'\'\'' 
     151    : '"""' (options {greedy=false;}:TRIQUOTE)* '"""' 
     152    |  '\'\'\'' (options {greedy=false;}:TRIAPOS)* '\'\'\'' 
     153    ; 
     154 
     155/** the two '"'? cause a warning -- is there a way to avoid that? */ 
     156fragment 
     157TRIQUOTE 
     158    : '"'? '"'? (ESC_SEQ|~('\\'|'"'))+ 
     159    ; 
     160 
     161/** the two '\''? cause a warning -- is there a way to avoid that? */ 
     162fragment 
     163TRIAPOS 
     164    : '\''? '\''? (ESC_SEQ|~('\\'|'\''))+ 
    153165    ; 
    154166