regex: Add licenses
This commit is contained in:
+61
@@ -0,0 +1,61 @@
|
|||||||
|
Portions, Copyright © 1991-2005 Unicode, Inc. The following applies to Unicode.
|
||||||
|
|
||||||
|
COPYRIGHT AND PERMISSION NOTICE
|
||||||
|
|
||||||
|
Copyright © 1991-2005 Unicode, Inc. All rights reserved. Distributed under
|
||||||
|
the Terms of Use in http://www.unicode.org/copyright.html. Permission is
|
||||||
|
hereby granted, free of charge, to any person obtaining a copy of the
|
||||||
|
Unicode data files and any associated documentation (the "Data Files")
|
||||||
|
or Unicode software and any associated documentation (the "Software")
|
||||||
|
to deal in the Data Files or Software without restriction, including without
|
||||||
|
limitation the rights to use, copy, modify, merge, publish, distribute,
|
||||||
|
and/or sell copies of the Data Files or Software, and to permit persons
|
||||||
|
to whom the Data Files or Software are furnished to do so, provided that
|
||||||
|
(a) the above copyright notice(s) and this permission notice appear with
|
||||||
|
all copies of the Data Files or Software, (b) both the above copyright
|
||||||
|
notice(s) and this permission notice appear in associated documentation,
|
||||||
|
and (c) there is clear notice in each modified Data File or in the Software
|
||||||
|
as well as in the documentation associated with the Data File(s) or Software
|
||||||
|
that the data or software has been modified.
|
||||||
|
|
||||||
|
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
|
||||||
|
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||||
|
OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
|
||||||
|
INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
|
||||||
|
OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
||||||
|
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||||
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||||
|
PERFORMANCE OF THE DATA FILES OR SOFTWARE.
|
||||||
|
|
||||||
|
Except as contained in this notice, the name of a copyright holder shall
|
||||||
|
not be used in advertising or otherwise to promote the sale, use or other
|
||||||
|
dealings in these Data Files or Software without prior written
|
||||||
|
authorization of the copyright holder.
|
||||||
|
|
||||||
|
2. Additional terms from the Database:
|
||||||
|
|
||||||
|
Copyright © 1995-1999 Unicode, Inc. All Rights reserved.
|
||||||
|
|
||||||
|
Disclaimer
|
||||||
|
|
||||||
|
The Unicode Character Database is provided as is by Unicode, Inc.
|
||||||
|
No claims are made as to fitness for any particular purpose. No warranties
|
||||||
|
of any kind are expressed or implied. The recipient agrees to determine
|
||||||
|
applicability of information provided. If this file has been purchased
|
||||||
|
on magnetic or optical media from Unicode, Inc., the sole remedy for any claim
|
||||||
|
will be exchange of defective media within 90 days of receipt. This disclaimer
|
||||||
|
is applicable for all other data files accompanying the Unicode Character Database,
|
||||||
|
some of which have been compiled by the Unicode Consortium, and some of which
|
||||||
|
have been supplied by other sources.
|
||||||
|
|
||||||
|
Limitations on Rights to Redistribute This Data
|
||||||
|
|
||||||
|
Recipient is granted the right to make copies in any form for internal
|
||||||
|
distribution and to freely use the information supplied in the creation of
|
||||||
|
products supporting the UnicodeTM Standard. The files in
|
||||||
|
the Unicode Character Database can be redistributed to third parties or other
|
||||||
|
organizations (whether for profit or not) as long as this notice and the disclaimer
|
||||||
|
notice are retained. Information can be extracted from these files and used
|
||||||
|
in documentation or programs, as long as there is an accompanying notice
|
||||||
|
indicating the source.
|
||||||
@@ -620,14 +620,3 @@ KInt Kotlin_text_regex_decomposeCodePoint(KInt codePoint, ArrayHeader* outputCod
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // extern "C"
|
} // extern "C"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ package kotlin.text
|
|||||||
* [Pattern]. Might include a detailed description, the original regular
|
* [Pattern]. Might include a detailed description, the original regular
|
||||||
* expression, and the index at which the error occurred.
|
* expression, and the index at which the error occurred.
|
||||||
*
|
*
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
class PatternSyntaxException(val description: String = "", val pattern: String = "", index: Int = -1)
|
class PatternSyntaxException(val description: String = "", val pattern: String = "", index: Int = -1)
|
||||||
: IllegalArgumentException("Error in \"$pattern\" ($index). $description")
|
: IllegalArgumentException("Error in \"$pattern\" ($index). $description")
|
||||||
|
|||||||
@@ -44,26 +44,19 @@ enum class RegexOption(override val value: Int, override val mask: Int = value)
|
|||||||
*/
|
*/
|
||||||
MULTILINE(Pattern.MULTILINE),
|
MULTILINE(Pattern.MULTILINE),
|
||||||
|
|
||||||
//jvm-specific
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enables literal parsing of the pattern.
|
* Enables literal parsing of the pattern.
|
||||||
* Metacharacters or escape sequences in the input sequence will be given no special meaning.
|
* Metacharacters or escape sequences in the input sequence will be given no special meaning.
|
||||||
*/
|
*/
|
||||||
LITERAL(Pattern.LITERAL),
|
LITERAL(Pattern.LITERAL),
|
||||||
|
|
||||||
/**
|
/** Enables Unix lines mode. In this mode, only the `'\n'` is recognized as a line terminator. */
|
||||||
* Enables Unix lines mode.
|
|
||||||
* In this mode, only the `'\n'` is recognized as a line terminator.
|
|
||||||
*/
|
|
||||||
UNIX_LINES(Pattern.UNIX_LINES),
|
UNIX_LINES(Pattern.UNIX_LINES),
|
||||||
|
|
||||||
/** Permits whitespace and comments in pattern. */
|
/** Permits whitespace and comments in pattern. */
|
||||||
COMMENTS(Pattern.COMMENTS),
|
COMMENTS(Pattern.COMMENTS),
|
||||||
|
|
||||||
/** Enables the mode, when the expression `.` matches any character,
|
/** Enables the mode, when the expression `.` matches any character, including a line terminator. */
|
||||||
* including a line terminator.
|
|
||||||
*/
|
|
||||||
DOT_MATCHES_ALL(Pattern.DOTALL),
|
DOT_MATCHES_ALL(Pattern.DOTALL),
|
||||||
|
|
||||||
/** Enables equivalence by canonical decomposition. */
|
/** Enables equivalence by canonical decomposition. */
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@@ -19,7 +35,6 @@ package kotlin.text.regex
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Unicode category (i.e. Ll, Lu).
|
* Unicode category (i.e. Ll, Lu).
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
internal open class UnicodeCategory(protected val category: Int) : AbstractCharClass() {
|
internal open class UnicodeCategory(protected val category: Int) : AbstractCharClass() {
|
||||||
override fun contains(ch: Int): Boolean = alt xor (ch.toChar().category.value == category)
|
override fun contains(ch: Int): Boolean = alt xor (ch.toChar().category.value == category)
|
||||||
@@ -27,7 +42,6 @@ internal open class UnicodeCategory(protected val category: Int) : AbstractCharC
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Unicode category scope (i.e IsL, IsM, ...)
|
* Unicode category scope (i.e IsL, IsM, ...)
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
internal class UnicodeCategoryScope(category: Int) : UnicodeCategory(category) {
|
internal class UnicodeCategoryScope(category: Int) : UnicodeCategory(category) {
|
||||||
override fun contains(ch: Int): Boolean = alt xor (category shr ch.toChar().category.value and 1 != 0)
|
override fun contains(ch: Int): Boolean = alt xor (category shr ch.toChar().category.value and 1 != 0)
|
||||||
@@ -36,8 +50,6 @@ internal class UnicodeCategoryScope(category: Int) : UnicodeCategory(category) {
|
|||||||
/**
|
/**
|
||||||
* This class represents character classes, i.e. sets of character either predefined or user defined.
|
* This class represents character classes, i.e. sets of character either predefined or user defined.
|
||||||
* Note: this class represent a token, not node, so being constructed by lexer.
|
* Note: this class represent a token, not node, so being constructed by lexer.
|
||||||
*
|
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
internal abstract class AbstractCharClass : SpecialToken() {
|
internal abstract class AbstractCharClass : SpecialToken() {
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,40 @@
|
|||||||
// TODO: License.
|
/*
|
||||||
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
|
* this work for additional information regarding copyright ownership.
|
||||||
|
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||||
|
* (the "License"); you may not use this file except in compliance with
|
||||||
|
* the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
package kotlin.text.regex
|
package kotlin.text.regex
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Line terminator factory
|
* Line terminator factory
|
||||||
*
|
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
internal abstract class AbstractLineTerminator {
|
internal abstract class AbstractLineTerminator {
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@@ -19,8 +35,6 @@ package kotlin.text.regex
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* User defined character classes (e.g. [abef]).
|
* User defined character classes (e.g. [abef]).
|
||||||
*
|
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
// TODO: replace the implementation with one using BitSet for first 256 symbols and a hash table / tree for the rest of UTF.
|
// TODO: replace the implementation with one using BitSet for first 256 symbols and a hash table / tree for the rest of UTF.
|
||||||
internal class CharClass(val ignoreCase: Boolean = false, negative: Boolean = false) : AbstractCharClass() {
|
internal class CharClass(val ignoreCase: Boolean = false, negative: Boolean = false) : AbstractCharClass() {
|
||||||
@@ -473,8 +487,7 @@ internal class CharClass(val ignoreCase: Boolean = false, negative: Boolean = fa
|
|||||||
* @param ch
|
* @param ch
|
||||||
* *
|
* *
|
||||||
* @return `true` if character class contains symbol specified;
|
* @return `true` if character class contains symbol specified;
|
||||||
* *
|
* */
|
||||||
*/
|
|
||||||
override operator fun contains(ch: Int): Boolean {
|
override operator fun contains(ch: Int): Boolean {
|
||||||
if (nonBitSet == null) {
|
if (nonBitSet == null) {
|
||||||
return alt xor bits_.get(ch)
|
return alt xor bits_.get(ch)
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@@ -41,8 +57,6 @@ external private fun decomposeString(inputCodePoints: IntArray, inputLength: Int
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This is base class for special tokens like character classes and quantifiers.
|
* This is base class for special tokens like character classes and quantifiers.
|
||||||
*
|
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
internal abstract class SpecialToken {
|
internal abstract class SpecialToken {
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@@ -19,7 +35,6 @@ package kotlin.text.regex
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Match result implementation
|
* Match result implementation
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
internal class MatchResultImpl
|
internal class MatchResultImpl
|
||||||
|
|||||||
@@ -1,10 +1,38 @@
|
|||||||
package kotlin.text.regex
|
/*
|
||||||
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
/**
|
*
|
||||||
* Apache Harmony Pattern class implementation.
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* Analogue for Kotlin Regex class. Need to be merged with it.
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
|
* this work for additional information regarding copyright ownership.
|
||||||
|
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||||
|
* (the "License"); you may not use this file except in compliance with
|
||||||
|
* the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package kotlin.text.regex
|
||||||
|
|
||||||
/** Represents a compiled pattern used by [Regex] for matching, searching, or replacing strings. */
|
/** Represents a compiled pattern used by [Regex] for matching, searching, or replacing strings. */
|
||||||
internal class Pattern(val pattern: String, flags: Int = 0) {
|
internal class Pattern(val pattern: String, flags: Int = 0) {
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,35 @@
|
|||||||
// TODO: License.
|
/*
|
||||||
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
|
* this work for additional information regarding copyright ownership.
|
||||||
|
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||||
|
* (the "License"); you may not use this file except in compliance with
|
||||||
|
* the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
package kotlin.text.regex
|
package kotlin.text.regex
|
||||||
|
|
||||||
@@ -7,8 +38,6 @@ import kotlin.IllegalArgumentException
|
|||||||
/**
|
/**
|
||||||
* Represents RE quantifier; contains two fields responsible for min and max number of repetitions.
|
* Represents RE quantifier; contains two fields responsible for min and max number of repetitions.
|
||||||
* Negative value for maximum number of repetition represents infinity(i.e. +,*)
|
* Negative value for maximum number of repetition represents infinity(i.e. +,*)
|
||||||
|
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
internal class Quantifier(val min: Int, val max: Int = min) : SpecialToken() {
|
internal class Quantifier(val min: Int, val max: Int = min) : SpecialToken() {
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@@ -29,8 +45,6 @@ internal abstract class SimpleSet : AbstractSet {
|
|||||||
/**
|
/**
|
||||||
* Basic class for nodes, representing given regular expression.
|
* Basic class for nodes, representing given regular expression.
|
||||||
* Note: (Almost) All the classes representing nodes has 'set' suffix.
|
* Note: (Almost) All the classes representing nodes has 'set' suffix.
|
||||||
*
|
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
internal abstract class AbstractSet(val type: Int = 0) {
|
internal abstract class AbstractSet(val type: Int = 0) {
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@@ -19,8 +35,6 @@ package kotlin.text.regex
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This class represent atomic group (?>X), once X matches, this match become unchangeable till the end of the match.
|
* This class represent atomic group (?>X), once X matches, this match become unchangeable till the end of the match.
|
||||||
*
|
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
open internal class AtomicJointSet(children: List<AbstractSet>, fSet: FSet) : NonCapturingJointSet(children, fSet) {
|
open internal class AtomicJointSet(children: List<AbstractSet>, fSet: FSet) : NonCapturingJointSet(children, fSet) {
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@@ -19,8 +35,6 @@ package kotlin.text.regex
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Back reference node;
|
* Back reference node;
|
||||||
*
|
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
open internal class BackReferenceSet(val referencedGroup: Int, val consCounter: Int, val ignoreCase: Boolean = false)
|
open internal class BackReferenceSet(val referencedGroup: Int, val consCounter: Int, val ignoreCase: Boolean = false)
|
||||||
: SimpleSet() {
|
: SimpleSet() {
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@@ -19,8 +35,6 @@ package kotlin.text.regex
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents node accepting single character.
|
* Represents node accepting single character.
|
||||||
*
|
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
open internal class CharSet(char: Char, val ignoreCase: Boolean = false) : LeafSet() {
|
open internal class CharSet(char: Char, val ignoreCase: Boolean = false) : LeafSet() {
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@@ -20,7 +36,6 @@ package kotlin.text.regex
|
|||||||
/**
|
/**
|
||||||
* Special node for ".*" construction.
|
* Special node for ".*" construction.
|
||||||
* The main idea here is to find line terminator and try to find the rest of the construction from this point.
|
* The main idea here is to find line terminator and try to find the rest of the construction from this point.
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
// TODO: Add optimized implementation for '.+' case
|
// TODO: Add optimized implementation for '.+' case
|
||||||
internal class DotQuantifierSet(
|
internal class DotQuantifierSet(
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@@ -19,8 +35,6 @@ package kotlin.text.regex
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Node accepting any character except line terminators.
|
* Node accepting any character except line terminators.
|
||||||
*
|
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
internal class DotSet(val lt: AbstractLineTerminator, val matchLineTerminator: Boolean)
|
internal class DotSet(val lt: AbstractLineTerminator, val matchLineTerminator: Boolean)
|
||||||
: SimpleSet(AbstractSet.TYPE_DOTSET) {
|
: SimpleSet(AbstractSet.TYPE_DOTSET) {
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@@ -19,8 +35,6 @@ package kotlin.text.regex
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents end of input '\z', i.e. matches only character after the last one;
|
* Represents end of input '\z', i.e. matches only character after the last one;
|
||||||
*
|
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
internal class EOISet : SimpleSet() {
|
internal class EOISet : SimpleSet() {
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@@ -21,8 +37,6 @@ package kotlin.text.regex
|
|||||||
* Represents a node for a '$' sign.
|
* Represents a node for a '$' sign.
|
||||||
* Note: In Kotlin we use only the "anchoring bounds" mode when "$" matches the end of a match region.
|
* Note: In Kotlin we use only the "anchoring bounds" mode when "$" matches the end of a match region.
|
||||||
* See: http://docs.oracle.com/javase/8/docs/api/java/util/regex/Matcher.html#useAnchoringBounds-boolean-
|
* See: http://docs.oracle.com/javase/8/docs/api/java/util/regex/Matcher.html#useAnchoringBounds-boolean-
|
||||||
*
|
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
internal class EOLSet(val consCounter: Int, val lt: AbstractLineTerminator, val multiline: Boolean = false) : SimpleSet() {
|
internal class EOLSet(val consCounter: Int, val lt: AbstractLineTerminator, val multiline: Boolean = false) : SimpleSet() {
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@@ -19,8 +35,6 @@ package kotlin.text.regex
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Valid constant zero character match.
|
* Valid constant zero character match.
|
||||||
*
|
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
internal class EmptySet(override var next: AbstractSet) : LeafSet() {
|
internal class EmptySet(override var next: AbstractSet) : LeafSet() {
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@@ -19,7 +35,6 @@ package kotlin.text.regex
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The node which marks end of the particular group.
|
* The node which marks end of the particular group.
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
open internal class FSet(val groupIndex: Int) : SimpleSet() {
|
open internal class FSet(val groupIndex: Int) : SimpleSet() {
|
||||||
|
|
||||||
@@ -69,8 +84,6 @@ open internal class FSet(val groupIndex: Int) : SimpleSet() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Special construction which marks end of pattern.
|
* Special construction which marks end of pattern.
|
||||||
*
|
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
internal class FinalSet : FSet(0) {
|
internal class FinalSet : FSet(0) {
|
||||||
|
|
||||||
@@ -89,8 +102,6 @@ internal class FinalSet : FSet(0) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Non-capturing group closing node.
|
* Non-capturing group closing node.
|
||||||
*
|
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
internal class NonCapFSet(groupIndex: Int) : FSet(groupIndex) {
|
internal class NonCapFSet(groupIndex: Int) : FSet(groupIndex) {
|
||||||
|
|
||||||
@@ -109,7 +120,6 @@ internal class NonCapFSet(groupIndex: Int) : FSet(groupIndex) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* LookAhead FSet, always returns true
|
* LookAhead FSet, always returns true
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
internal class AheadFSet : FSet(-1) {
|
internal class AheadFSet : FSet(-1) {
|
||||||
|
|
||||||
@@ -126,7 +136,6 @@ internal class AheadFSet : FSet(-1) {
|
|||||||
* jointSet in "consumers" equals to current index and return current string
|
* jointSet in "consumers" equals to current index and return current string
|
||||||
* index, return -1 otherwise.
|
* index, return -1 otherwise.
|
||||||
|
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
internal class BehindFSet(groupIndex: Int) : FSet(groupIndex) {
|
internal class BehindFSet(groupIndex: Int) : FSet(groupIndex) {
|
||||||
|
|
||||||
@@ -141,8 +150,6 @@ internal class BehindFSet(groupIndex: Int) : FSet(groupIndex) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents an end of an atomic group.
|
* Represents an end of an atomic group.
|
||||||
*
|
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
internal class AtomicFSet(groupIndex: Int) : FSet(groupIndex) {
|
internal class AtomicFSet(groupIndex: Int) : FSet(groupIndex) {
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@@ -22,7 +38,6 @@ package kotlin.text.regex
|
|||||||
* generally used for constructions we cant identify number of characters they
|
* generally used for constructions we cant identify number of characters they
|
||||||
* consume.
|
* consume.
|
||||||
|
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
open internal class GroupQuantifierSet(
|
open internal class GroupQuantifierSet(
|
||||||
val quantifier: Quantifier,
|
val quantifier: Quantifier,
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@@ -20,8 +36,6 @@ package kotlin.text.regex
|
|||||||
/**
|
/**
|
||||||
* Represents group, which is alternation of other subexpression.
|
* Represents group, which is alternation of other subexpression.
|
||||||
* One should think about "group" in this model as JointSet opening group and corresponding FSet closing group.
|
* One should think about "group" in this model as JointSet opening group and corresponding FSet closing group.
|
||||||
*
|
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
open internal class JointSet(children: List<AbstractSet>, fSet: FSet) : AbstractSet() {
|
open internal class JointSet(children: List<AbstractSet>, fSet: FSet) : AbstractSet() {
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@@ -25,8 +41,6 @@ import kotlin.RuntimeException
|
|||||||
* - a* == a{0, <inf>};
|
* - a* == a{0, <inf>};
|
||||||
* - a? == a{0, 1};
|
* - a? == a{0, 1};
|
||||||
* - a+ == a{1, <inf>};
|
* - a+ == a{1, <inf>};
|
||||||
*
|
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
open internal class LeafQuantifierSet(var quantifier: Quantifier,
|
open internal class LeafQuantifierSet(var quantifier: Quantifier,
|
||||||
innerSet: LeafSet,
|
innerSet: LeafSet,
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@@ -19,8 +35,6 @@ package kotlin.text.regex
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Base class for nodes representing leaf tokens of the RE, those who consumes fixed number of characters.
|
* Base class for nodes representing leaf tokens of the RE, those who consumes fixed number of characters.
|
||||||
*
|
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
internal abstract class LeafSet : SimpleSet(AbstractSet.TYPE_LEAF) {
|
internal abstract class LeafSet : SimpleSet(AbstractSet.TYPE_LEAF) {
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@@ -19,8 +35,6 @@ package kotlin.text.regex
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Positive lookahead node.
|
* Positive lookahead node.
|
||||||
*
|
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
internal class PositiveLookAheadSet(children: List<AbstractSet>, fSet: FSet) : AtomicJointSet(children, fSet) {
|
internal class PositiveLookAheadSet(children: List<AbstractSet>, fSet: FSet) : AtomicJointSet(children, fSet) {
|
||||||
|
|
||||||
@@ -43,8 +57,6 @@ internal class PositiveLookAheadSet(children: List<AbstractSet>, fSet: FSet) : A
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Negative look ahead node.
|
* Negative look ahead node.
|
||||||
*
|
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
internal class NegativeLookAheadSet(children: List<AbstractSet>, fSet: FSet) : AtomicJointSet(children, fSet) {
|
internal class NegativeLookAheadSet(children: List<AbstractSet>, fSet: FSet) : AtomicJointSet(children, fSet) {
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@@ -19,8 +35,6 @@ package kotlin.text.regex
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Positive lookbehind node.
|
* Positive lookbehind node.
|
||||||
*
|
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
internal class PositiveLookBehindSet(children: List<AbstractSet>, fSet: FSet) : AtomicJointSet(children, fSet) {
|
internal class PositiveLookBehindSet(children: List<AbstractSet>, fSet: FSet) : AtomicJointSet(children, fSet) {
|
||||||
|
|
||||||
@@ -45,8 +59,6 @@ internal class PositiveLookBehindSet(children: List<AbstractSet>, fSet: FSet) :
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Negative look behind node.
|
* Negative look behind node.
|
||||||
*
|
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
internal class NegativeLookBehindSet(children: List<AbstractSet>, fSet: FSet) : AtomicJointSet(children, fSet) {
|
internal class NegativeLookBehindSet(children: List<AbstractSet>, fSet: FSet) : AtomicJointSet(children, fSet) {
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@@ -19,7 +35,6 @@ package kotlin.text.regex
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Node representing non-capturing group
|
* Node representing non-capturing group
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
open internal class NonCapturingJointSet(children: List<AbstractSet>, fSet: FSet) : JointSet(children, fSet) {
|
open internal class NonCapturingJointSet(children: List<AbstractSet>, fSet: FSet) : JointSet(children, fSet) {
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@@ -19,8 +35,6 @@ package kotlin.text.regex
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Possessive quantifier set over groups.
|
* Possessive quantifier set over groups.
|
||||||
*
|
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
internal class PossessiveGroupQuantifierSet(
|
internal class PossessiveGroupQuantifierSet(
|
||||||
quantifier: Quantifier,
|
quantifier: Quantifier,
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@@ -23,8 +39,6 @@ package kotlin.text.regex
|
|||||||
* - a*+ == a{0, <inf>}+;
|
* - a*+ == a{0, <inf>}+;
|
||||||
* - a?+ == a{0, 1}+;
|
* - a?+ == a{0, 1}+;
|
||||||
* - a++ == a{1, <inf>}+;
|
* - a++ == a{1, <inf>}+;
|
||||||
*
|
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
internal class PossessiveLeafQuantifierSet(
|
internal class PossessiveLeafQuantifierSet(
|
||||||
quant: Quantifier,
|
quant: Quantifier,
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@@ -19,8 +35,6 @@ package kotlin.text.regex
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Node representing previous match (\G).
|
* Node representing previous match (\G).
|
||||||
*
|
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
internal class PreviousMatchSet : SimpleSet() {
|
internal class PreviousMatchSet : SimpleSet() {
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@@ -19,8 +35,6 @@ package kotlin.text.regex
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Base class for quantifiers.
|
* Base class for quantifiers.
|
||||||
*
|
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
internal abstract class QuantifierSet(open var innerSet: AbstractSet, override var next: AbstractSet, type: Int)
|
internal abstract class QuantifierSet(open var innerSet: AbstractSet, override var next: AbstractSet, type: Int)
|
||||||
: SimpleSet(type) {
|
: SimpleSet(type) {
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@@ -19,8 +35,6 @@ package kotlin.text.regex
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents node accepting single character from the given char class.
|
* Represents node accepting single character from the given char class.
|
||||||
*
|
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
open internal class RangeSet(charClass: AbstractCharClass, val ignoreCase: Boolean = false) : LeafSet() {
|
open internal class RangeSet(charClass: AbstractCharClass, val ignoreCase: Boolean = false) : LeafSet() {
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@@ -19,8 +35,6 @@ package kotlin.text.regex
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Reluctant version of the group quantifier set.
|
* Reluctant version of the group quantifier set.
|
||||||
*
|
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
internal class ReluctantGroupQuantifierSet(
|
internal class ReluctantGroupQuantifierSet(
|
||||||
quantifier: Quantifier,
|
quantifier: Quantifier,
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@@ -23,8 +39,6 @@ package kotlin.text.regex
|
|||||||
* - a*? == a{0, <inf>}?;
|
* - a*? == a{0, <inf>}?;
|
||||||
* - a?? == a{0, 1}?;
|
* - a?? == a{0, 1}?;
|
||||||
* - a+? == a{1, <inf>}?;
|
* - a+? == a{1, <inf>}?;
|
||||||
*
|
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
internal class ReluctantLeafQuantifierSet(
|
internal class ReluctantLeafQuantifierSet(
|
||||||
quant: Quantifier,
|
quant: Quantifier,
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@@ -21,8 +37,6 @@ package kotlin.text.regex
|
|||||||
* A node representing a '^' sign.
|
* A node representing a '^' sign.
|
||||||
* Note: In Kotlin we use only the "anchoring bounds" mode when "^" matches beginning of a match region.
|
* Note: In Kotlin we use only the "anchoring bounds" mode when "^" matches beginning of a match region.
|
||||||
* See: http://docs.oracle.com/javase/8/docs/api/java/util/regex/Matcher.html#useAnchoringBounds-boolean-
|
* See: http://docs.oracle.com/javase/8/docs/api/java/util/regex/Matcher.html#useAnchoringBounds-boolean-
|
||||||
*
|
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
internal class SOLSet(val lt: AbstractLineTerminator, val multiline: Boolean = false) : SimpleSet() {
|
internal class SOLSet(val lt: AbstractLineTerminator, val multiline: Boolean = false) : SimpleSet() {
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@@ -22,8 +38,6 @@ package kotlin.text.regex
|
|||||||
* example, lets consider regular expression: ".*word.*". During regular
|
* example, lets consider regular expression: ".*word.*". During regular
|
||||||
* expression compilation phase character sequence w-o-r-d, will be represented
|
* expression compilation phase character sequence w-o-r-d, will be represented
|
||||||
* with single node for the entire word.
|
* with single node for the entire word.
|
||||||
*
|
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
open internal class SequenceSet(substring: CharSequence, val ignoreCase: Boolean = false) : LeafSet() {
|
open internal class SequenceSet(substring: CharSequence, val ignoreCase: Boolean = false) : LeafSet() {
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@@ -19,7 +35,6 @@ package kotlin.text.regex
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Group node over subexpression without alternations.
|
* Group node over subexpression without alternations.
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
open internal class SingleSet(var kid: AbstractSet, fSet: FSet) : JointSet(listOf(), fSet) {
|
open internal class SingleSet(var kid: AbstractSet, fSet: FSet) : JointSet(listOf(), fSet) {
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@@ -84,8 +100,6 @@ package kotlin.text.regex
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents node accepting single supplementary codepoint.
|
* Represents node accepting single supplementary codepoint.
|
||||||
*
|
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
internal class SupplementaryCharSet(val codePoint: Int, ignoreCase: Boolean)
|
internal class SupplementaryCharSet(val codePoint: Int, ignoreCase: Boolean)
|
||||||
: SequenceSet(fromCharArray(Char.toChars(codePoint), 0, 2), ignoreCase) {
|
: SequenceSet(fromCharArray(Char.toChars(codePoint), 0, 2), ignoreCase) {
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@@ -86,8 +102,6 @@ package kotlin.text.regex
|
|||||||
* Represents node accepting single character from the given char class.
|
* Represents node accepting single character from the given char class.
|
||||||
* This character can be supplementary (2 chars needed to represent) or from
|
* This character can be supplementary (2 chars needed to represent) or from
|
||||||
* basic multilingual pane (1 needed char to represent it).
|
* basic multilingual pane (1 needed char to represent it).
|
||||||
*
|
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
open internal class SupplementaryRangeSet(charClass: AbstractCharClass, val ignoreCase: Boolean = false): SimpleSet() {
|
open internal class SupplementaryRangeSet(charClass: AbstractCharClass, val ignoreCase: Boolean = false): SimpleSet() {
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@@ -88,8 +104,6 @@ package kotlin.text.regex
|
|||||||
* Note that we can use high and low surrogate characters
|
* Note that we can use high and low surrogate characters
|
||||||
* that don't combine into supplementary code point.
|
* that don't combine into supplementary code point.
|
||||||
* See http://www.unicode.org/reports/tr18/#Supplementary_Characters
|
* See http://www.unicode.org/reports/tr18/#Supplementary_Characters
|
||||||
*
|
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
internal class LowSurrogateCharSet(low: Char) : CharSet(low) {
|
internal class LowSurrogateCharSet(low: Char) : CharSet(low) {
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@@ -84,8 +100,6 @@ package kotlin.text.regex
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* This class is a range that contains only surrogate characters.
|
* This class is a range that contains only surrogate characters.
|
||||||
*
|
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
internal class SurrogateRangeSet(surrChars: AbstractCharClass) : RangeSet(surrChars) {
|
internal class SurrogateRangeSet(surrChars: AbstractCharClass) : RangeSet(surrChars) {
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@@ -20,8 +36,6 @@ package kotlin.text.regex
|
|||||||
/**
|
/**
|
||||||
* Optimized greedy quantifier node ('*') for the case where there is no intersection with
|
* Optimized greedy quantifier node ('*') for the case where there is no intersection with
|
||||||
* next node and normal quantifiers could be treated as greedy and possessive.
|
* next node and normal quantifiers could be treated as greedy and possessive.
|
||||||
*
|
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
internal class UnifiedQuantifierSet(quant: LeafQuantifierSet) : LeafQuantifierSet(Quantifier.starQuantifier, quant.leaf, quant.next, quant.type) {
|
internal class UnifiedQuantifierSet(quant: LeafQuantifierSet) : LeafQuantifierSet(Quantifier.starQuantifier, quant.leaf, quant.next, quant.type) {
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2017 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@@ -19,8 +35,6 @@ package kotlin.text.regex
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents word boundary, checks current character and previous one. If they have different types returns true;
|
* Represents word boundary, checks current character and previous one. If they have different types returns true;
|
||||||
*
|
|
||||||
* @author Nikolay A. Kuznetsov
|
|
||||||
*/
|
*/
|
||||||
internal class WordBoundarySet(var positive: Boolean) : SimpleSet() {
|
internal class WordBoundarySet(var positive: Boolean) : SimpleSet() {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user