Skip to content

Commit

Permalink
Add more to STR
Browse files Browse the repository at this point in the history
  • Loading branch information
lszeremeta committed Jan 13, 2023
1 parent 2a5caad commit f410fe9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion other-notations/YARSpg.ebnf
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ OPTIONAL ::= ( 'O' | 'o' ) ( 'P' | 'p' ) ( 'T' | 't' ) ( 'I' | 'i' ) ( 'O' | 'o'
/* END CASE-INSENSITIVE NAMES */

COMMENT ::= '#' [^#xd#xa#xc]*
STR ::= '"' ( [^#x22#x5C#xd#xa] | '\' ('"' | '\' | 'r' | 'n'))* '"' /* #x22=" #x5C=\ #xD=carriage return #xA=new line */
STR ::= '"' ( [^#x22#x5C#xd#xa] | '\' [tbnrf#x22#x27#x5C])* '"' /* #x22=" #x5C=\ #xD=carriage return #xA=new line #x27='; */
UNSIGNED_INT
::= [0-9]+
ALNUMPLUS
Expand Down
2 changes: 1 addition & 1 deletion yarspg/YARSpg.g4
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ COMMENT
;

STR
: '"' (~ ["\\\r\n] | '\\' ('"' | '\\' | 'r' | 'n'))* '"'
: '"' (~ ["\\\r\n] | '\\' [tbnrf"'\\])* '"'
;
UNSIGNED_INT
Expand Down
8 changes: 7 additions & 1 deletion yarspg/examples/test-example.yarspg
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,13 @@ S(f23)-({"label"}["bytes": Bytes(2,4)])->(f321)
S(f23)-({"label"}["bytes": Bytes(2, 4)])->(f321)
S(f23)-({"label"}["duration": Duration])->(f321)

# tbnrf"'\\
(hiddenL2 {"Text-Proper"}["articleid": "HIDDEN", "articleext": ".art", "position": "17\\5", "notation": "m.1.2"])
(hiddenL2 {"Text-Proper"}["articleid": "HIDDEN", "articleext": ".art", "position": "17\t5", "notation": "m.1.2"])
(hiddenL2 {"Text-Proper"}["articleid": "HIDDEN", "articleext": ".art", "position": "17\b5", "notation": "m.1.2"])
(hiddenL3 {"Text-Proper"}["articleid": "HIDDEN", "articleext": ".art", "position": "17\n5", "notation": "m.1.2"])
(hiddenL3 {"Text-Proper"}["articleid": "HIDDEN", "articleext": ".art", "position": "175\r", "notation": "m.1.2"])
(hiddenL3 {"Text-Proper"}["articleid": "HIDDEN", "articleext": ".art", "position": "17\n5\r", "notation": "m.1.2"])
(hiddenL2 {"Text-Proper"}["articleid": "HIDDEN", "articleext": ".art", "position": "17\"5", "notation": "m.1.2"])
(hiddenL2 {"Text-Proper"}["articleid": "HIDDEN", "articleext": ".art", "position": "17\f5", "notation": "m.1.2"])
(hiddenL2 {"Text-Proper"}["articleid": "HIDDEN", "articleext": ".art", "position": "17\"5", "notation": "m.1.2"])
(hiddenL2 {"Text-Proper"}["articleid": "HIDDEN", "articleext": ".art", "position": "17\'5", "notation": "m.1.2"])

0 comments on commit f410fe9

Please sign in to comment.