@@ -39,8 +39,8 @@ class SpaceTests extends ParsleyTest {
39
39
" /**/ a" -> None ,
40
40
)
41
41
42
- val basicLine = basicNoComments.copy(commentLine = " --" )
43
- val unicodeLine = unicodeNoComments.copy(commentLine = " --" )
42
+ val basicLine = basicNoComments.copy(lineCommentStart = " --" )
43
+ val unicodeLine = unicodeNoComments.copy(lineCommentStart = " --" )
44
44
45
45
it should " parse spaces and line comments when defined" in {
46
46
cases(makeSpace(basicLine).whiteSpace *> string(" a" )) (
@@ -59,8 +59,8 @@ class SpaceTests extends ParsleyTest {
59
59
)
60
60
}
61
61
62
- val basicMulti = basicNoComments.copy(commentStart = " /*" , commentEnd = " */" )
63
- val unicodeMulti = unicodeNoComments.copy(commentStart = " /*" , commentEnd = " */" )
62
+ val basicMulti = basicNoComments.copy(multiLineCommentStart = " /*" , multiLineCommentEnd = " */" )
63
+ val unicodeMulti = unicodeNoComments.copy(multiLineCommentStart = " /*" , multiLineCommentEnd = " */" )
64
64
65
65
it should " parse spaces and multi-line comment when defined" in {
66
66
cases(makeSpace(basicMulti).whiteSpace *> string(" a" )) (
@@ -79,8 +79,8 @@ class SpaceTests extends ParsleyTest {
79
79
)
80
80
}
81
81
82
- val basicMixed = basicNoComments.copy(commentLine = " #" , commentStart = " ##" , commentEnd = " ##" )
83
- val unicodeMixed = unicodeNoComments.copy(commentLine = " #" , commentStart = " ##" , commentEnd = " ##" )
82
+ val basicMixed = basicNoComments.copy(lineCommentStart = " #" , multiLineCommentStart = " ##" , multiLineCommentEnd = " ##" )
83
+ val unicodeMixed = unicodeNoComments.copy(lineCommentStart = " #" , multiLineCommentStart = " ##" , multiLineCommentEnd = " ##" )
84
84
85
85
it should " parse spaces and mixed comments when defined" in {
86
86
cases(makeSpace(basicMixed).whiteSpace *> string(" a" )) (
@@ -111,10 +111,10 @@ class SpaceTests extends ParsleyTest {
111
111
unicode.whiteSpace shouldBe unicode.skipComments
112
112
}
113
113
114
- val basicLineEOF = basicLine.copy(commentLineAllowsEOF = true )
115
- val basicLineNoEOF = basicLine.copy(commentLineAllowsEOF = false )
116
- val basicMixedEOF = basicMixed.copy(commentLineAllowsEOF = true )
117
- val basicMixedNoEOF = basicMixed.copy(commentLineAllowsEOF = false )
114
+ val basicLineEOF = basicLine.copy(lineCommentAllowsEOF = true )
115
+ val basicLineNoEOF = basicLine.copy(lineCommentAllowsEOF = false )
116
+ val basicMixedEOF = basicMixed.copy(lineCommentAllowsEOF = true )
117
+ val basicMixedNoEOF = basicMixed.copy(lineCommentAllowsEOF = false )
118
118
119
119
it should " allow for line comments to end in EOF" in {
120
120
cases(makeSpace(basicLineEOF).whiteSpace)(" --hello world" -> Some (()))
@@ -126,9 +126,9 @@ class SpaceTests extends ParsleyTest {
126
126
cases(makeSpace(basicMixedNoEOF).whiteSpace)(" --hello world" -> None )
127
127
}
128
128
129
- val basicMultiNested = basicMulti.copy(nestedComments = true )
129
+ val basicMultiNested = basicMulti.copy(multiLineNestedComments = true )
130
130
// having the same start and end makes this... weird
131
- val basicMixedNested = basicMixed.copy(nestedComments = true , commentStart = " #-" , commentEnd = " -#" )
131
+ val basicMixedNested = basicMixed.copy(multiLineNestedComments = true , multiLineCommentStart = " #-" , multiLineCommentEnd = " -#" )
132
132
133
133
it should " parse nested comments when applicable" in {
134
134
cases(makeSpace(basicMultiNested).whiteSpace) (
@@ -143,8 +143,8 @@ class SpaceTests extends ParsleyTest {
143
143
)
144
144
}
145
145
146
- val basicMultiNonNested = basicMulti.copy(nestedComments = false )
147
- val basicMixedNonNested = basicMulti.copy(nestedComments = false )
146
+ val basicMultiNonNested = basicMulti.copy(multiLineNestedComments = false )
147
+ val basicMixedNonNested = basicMulti.copy(multiLineNestedComments = false )
148
148
149
149
it should " not parse nested comments when applicable" in {
150
150
cases(makeSpace(basicMultiNonNested).whiteSpace) (
@@ -220,8 +220,8 @@ class SpaceTests extends ParsleyTest {
220
220
}
221
221
222
222
it should " not aggressively eat everything" in {
223
- val lexer1 = makeSpace(basicCommentsOnly.copy(commentStart = " " , commentEnd = " " ))
224
- val lexer2 = makeSpace(basicCommentsOnly.copy(commentLine = " " ))
223
+ val lexer1 = makeSpace(basicCommentsOnly.copy(multiLineCommentStart = " " , multiLineCommentEnd = " " ))
224
+ val lexer2 = makeSpace(basicCommentsOnly.copy(lineCommentStart = " " ))
225
225
val lexer3 = makeSpace(unicodeCommentsOnly)
226
226
(lexer1.skipComments *> char('a' )).parse(" a" ) shouldBe a [Success [_]]
227
227
(lexer2.skipComments *> char('a' )).parse(" a" ) shouldBe a [Success [_]]
0 commit comments