[K/N and WASM] Throw on unknown inline flag modifier
This commit is contained in:
committed by
Space
parent
9593069cb3
commit
7b46738796
@@ -588,6 +588,11 @@ internal class Lexer(val patternString: String, flags: Int) {
|
|||||||
positive = false
|
positive = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
'c' -> result = if (positive)
|
||||||
|
result or Pattern.CANON_EQ
|
||||||
|
else
|
||||||
|
result xor Pattern.CANON_EQ and result
|
||||||
|
|
||||||
'i' -> result = if (positive)
|
'i' -> result = if (positive)
|
||||||
result or Pattern.CASE_INSENSITIVE
|
result or Pattern.CASE_INSENSITIVE
|
||||||
else
|
else
|
||||||
@@ -609,11 +614,17 @@ internal class Lexer(val patternString: String, flags: Int) {
|
|||||||
result xor Pattern.DOTALL and result
|
result xor Pattern.DOTALL and result
|
||||||
|
|
||||||
// We don't support UNICODE_CASE.
|
// We don't support UNICODE_CASE.
|
||||||
/*'u' -> result = if (positive)
|
'u' -> {}/*result = if (positive)
|
||||||
result or Pattern.UNICODE_CASE
|
result or Pattern.UNICODE_CASE
|
||||||
else
|
else
|
||||||
result xor Pattern.UNICODE_CASE and result*/
|
result xor Pattern.UNICODE_CASE and result*/
|
||||||
|
|
||||||
|
// We don't support UNICODE_CHARACTER_CLASS.
|
||||||
|
'U' -> {}/*result = if (positive)
|
||||||
|
result or Pattern.UNICODE_CHARACTER_CLASS
|
||||||
|
else
|
||||||
|
result xor Pattern.UNICODE_CHARACTER_CLASS and result*/
|
||||||
|
|
||||||
'x' -> result = if (positive)
|
'x' -> result = if (positive)
|
||||||
result or Pattern.COMMENTS
|
result or Pattern.COMMENTS
|
||||||
else
|
else
|
||||||
@@ -628,6 +639,10 @@ internal class Lexer(val patternString: String, flags: Int) {
|
|||||||
nextIndex()
|
nextIndex()
|
||||||
return result or (1 shl 8)
|
return result or (1 shl 8)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else -> {
|
||||||
|
throw PatternSyntaxException("Unknown inline modifier", patternString, curTokenIndex)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
nextIndex()
|
nextIndex()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user