File tree 2 files changed +39
-7
lines changed
2 files changed +39
-7
lines changed Original file line number Diff line number Diff line change 97
97
98
98
;; Multiline Basic String
99
99
100
- ml-basic-string = <ml-basic-string-delim> ml-basic-body <ml-basic-string-delim>
100
+ ml-basic-string = <ml-basic-string-beg- delim> ml-basic-body <ml-basic-string-end -delim>
101
101
102
- ml-basic-string-delim = 3quotation-mark
102
+ ml-basic-string-beg-delim = 3quotation-mark 0*1ml-newline
103
+ ml-basic-string-end-delim = 3quotation-mark
103
104
104
- <ml-basic-body> = *( ml-basic-char / ml-newline / ( escape ws ml-newline ) )
105
+ <ml-basic-body> = *( ml-basic-char / ml-newline / < ( escape 1*99( wschar / ml-newline ) )> ) ; `1*99` is workaround, `1*(...)` is not working.
105
106
<ml-basic-char> = ml-basic-unescaped / escaped
106
107
<ml-basic-unescaped> = %x20-5B / %x5D-7E / %x80-10FFFF
107
108
115
116
116
117
;; Multiline Literal String
117
118
118
- ml-literal-string = <ml-literal-string-delim> ml-literal-body <ml-literal-string-delim>
119
+ ml-literal-string = <ml-literal-string-beg- delim> ml-literal-body <ml-literal-string-end -delim>
119
120
120
- ml-literal-string-delim = 3apostrophe
121
+ ml-literal-string-beg-delim = 3apostrophe 0*1ml-newline
122
+ ml-literal-string-end-delim = 3apostrophe
121
123
122
124
<ml-literal-body> = *( ml-literal-char / ml-newline )
123
125
<ml-literal-char> = %x09 / %x20-10FFFF
Original file line number Diff line number Diff line change 33
33
(testing " Strings (literal)"
34
34
(is (= (parse-string " str = 'Comes$as\\ is<:>'" )
35
35
{" str" " Comes$as\\ is<:>" })))
36
- (testing " Strings (multiline)" )
37
- (testing " Strings (multiline literal)" ))
36
+ (testing " Strings (multiline)"
37
+ (is (= (parse-string (s/join " \n " [" key1 = \"\"\" "
38
+ " Roses are red"
39
+ " Violets are blue\"\"\" " ]))
40
+ {" key1" " Roses are red\n Violets are blue" }))
41
+ (is (= (parse-string (s/join " \n " [" key1 = \"\"\" "
42
+ " The quick brown \\ "
43
+ " "
44
+ " fox jumps over \\ "
45
+ " the lazy dog.\"\"\" " ]))
46
+ {" key1" " The quick brown fox jumps over the lazy dog." }))
47
+ (is (= (parse-string (s/join " \n " [" key1 = \"\"\"\\ "
48
+ " The quick brown \\ "
49
+ " fox jumps over \\ "
50
+ " the lazy dog.\\ "
51
+ " \"\"\" " ]))
52
+ {" key1" " The quick brown fox jumps over the lazy dog." })))
53
+ (testing " Strings (multiline literal)"
54
+ (is (= (parse-string " regex2 = '''I [dw]on't need \\ d{2} apples'''" )
55
+ {" regex2" " I [dw]on't need \\ d{2} apples" }))
56
+ (is (= (parse-string (s/join " \n " [" lines = '''"
57
+ " The first newline is"
58
+ " trimmed in raw strings."
59
+ " All other whitespace"
60
+ " is preserved."
61
+ " '''" ]))
62
+ {" lines" (s/join " \n " [" The first newline is"
63
+ " trimmed in raw strings."
64
+ " All other whitespace"
65
+ " is preserved."
66
+ " " ])}))
67
+ ))
38
68
39
69
(deftest integer-test
40
70
(testing " Integer numbers"
You can’t perform that action at this time.
0 commit comments