File tree Expand file tree Collapse file tree
core/src/main/kotlin/org/evomaster/core/parser Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -130,19 +130,20 @@ object RegexHandler {
130130 result.append(c); i++
131131 }
132132
133- // comment
133+ // comment (when COMMENTS flag is on)
134134 c == ' #' && currentFlags.comments -> {
135135 i++
136+ // advance index until line terminator (eg: "#...\n") without copying
136137 while (i < regex.length && ! currentFlags.isLineTerminator(regex[i])) i++
137- // consume line terminator
138+ // consume line terminator too:
138139 if (i < regex.length) {
139140 // \r\n is a 2-character line terminator
140141 if (regex[i] == ' \r ' && i+ 1 < regex.length && regex[i+ 1 ] == ' \n ' ) i + = 2
141142 else i++
142143 }
143144 }
144145
145- // whitespace, skip when comments flag is on
146+ // whitespace, skip copying when comments flag is on
146147 c.isWhitespace() && currentFlags.comments -> i++
147148
148149 // else copy
You can’t perform that action at this time.
0 commit comments