Skip to content

Commit a4cf290

Browse files
committed
Improved lexer and parser for ^ in strings and pointers
1 parent a6c4ba6 commit a4cf290

File tree

3 files changed

+7371
-7223
lines changed

3 files changed

+7371
-7223
lines changed

src/main/antlr3/org/sonar/plugins/delphi/antlr/Delphi.g

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -489,8 +489,10 @@ factor : '@' factor
489489
| designator
490490
| typeId '(' expression ')'
491491
;
492-
stringFactor : (ControlString | ControlChar) (QuotedString (ControlString | ControlChar))* (QuotedString)?
493-
| QuotedString ((ControlString | ControlChar) QuotedString)* (ControlString | ControlChar)?
492+
stringFactor : (controlString) (QuotedString (controlString))* (QuotedString)?
493+
| QuotedString ((controlString) QuotedString)* (controlString)?
494+
;
495+
controlString : ControlChar (ControlChar)*
494496
;
495497
setSection : '[' (expression ((',' | '..') expression)*)? ']'
496498
;
@@ -958,8 +960,6 @@ ControlChar : '^' ( {isControlchar()}?=> Alpha
958960
;
959961
QuotedString : '\'' ('\'\'' | ~('\''))* '\'' //taken from PASCAL grammar
960962
;
961-
ControlString : ControlChar (ControlChar)*
962-
;
963963
fragment
964964
Alpha : 'a'..'z'
965965
| 'A'..'Z'

0 commit comments

Comments
 (0)