diff --git a/licenses/third_party/unicode_LICENSE.txt b/licenses/third_party/unicode_LICENSE.txt new file mode 100644 index 00000000000..3ffc0fa00a6 --- /dev/null +++ b/licenses/third_party/unicode_LICENSE.txt @@ -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. diff --git a/runtime/src/main/cpp/Regex.cpp b/runtime/src/main/cpp/Regex.cpp index 1d5d31a9d04..0e2122c13b4 100644 --- a/runtime/src/main/cpp/Regex.cpp +++ b/runtime/src/main/cpp/Regex.cpp @@ -620,14 +620,3 @@ KInt Kotlin_text_regex_decomposeCodePoint(KInt codePoint, ArrayHeader* outputCod } } // extern "C" - - - - - - - - - - - diff --git a/runtime/src/main/kotlin/kotlin/text/PatternSyntaxException.kt b/runtime/src/main/kotlin/kotlin/text/PatternSyntaxException.kt index f15f7a1fd15..522d72e5daf 100644 --- a/runtime/src/main/kotlin/kotlin/text/PatternSyntaxException.kt +++ b/runtime/src/main/kotlin/kotlin/text/PatternSyntaxException.kt @@ -22,7 +22,7 @@ package kotlin.text * [Pattern]. Might include a detailed description, the original regular * expression, and the index at which the error occurred. * - * @author Nikolay A. Kuznetsov + */ class PatternSyntaxException(val description: String = "", val pattern: String = "", index: Int = -1) : IllegalArgumentException("Error in \"$pattern\" ($index). $description") diff --git a/runtime/src/main/kotlin/kotlin/text/Regex.kt b/runtime/src/main/kotlin/kotlin/text/Regex.kt index b963fc656d2..dfc3ad61647 100644 --- a/runtime/src/main/kotlin/kotlin/text/Regex.kt +++ b/runtime/src/main/kotlin/kotlin/text/Regex.kt @@ -44,26 +44,19 @@ enum class RegexOption(override val value: Int, override val mask: Int = value) */ MULTILINE(Pattern.MULTILINE), - //jvm-specific - /** * Enables literal parsing of the pattern. * Metacharacters or escape sequences in the input sequence will be given no special meaning. */ 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), /** Permits whitespace and comments in pattern. */ COMMENTS(Pattern.COMMENTS), - /** Enables the mode, when the expression `.` matches any character, - * including a line terminator. - */ + /** Enables the mode, when the expression `.` matches any character, including a line terminator. */ DOT_MATCHES_ALL(Pattern.DOTALL), /** Enables equivalence by canonical decomposition. */ diff --git a/runtime/src/main/kotlin/kotlin/text/regex/AbstractCharClass.kt b/runtime/src/main/kotlin/kotlin/text/regex/AbstractCharClass.kt index 2c3797a1d01..45c1b4b82a8 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/AbstractCharClass.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/AbstractCharClass.kt @@ -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 * contributor license agreements. See the NOTICE file distributed with @@ -19,7 +35,6 @@ package kotlin.text.regex /** * Unicode category (i.e. Ll, Lu). - * @author Nikolay A. Kuznetsov */ internal open class UnicodeCategory(protected val category: Int) : AbstractCharClass() { 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, ...) - * @author Nikolay A. Kuznetsov */ internal class UnicodeCategoryScope(category: Int) : UnicodeCategory(category) { 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. * Note: this class represent a token, not node, so being constructed by lexer. - * - * @author Nikolay A. Kuznetsov */ internal abstract class AbstractCharClass : SpecialToken() { diff --git a/runtime/src/main/kotlin/kotlin/text/regex/AbstractLineTerminator.kt b/runtime/src/main/kotlin/kotlin/text/regex/AbstractLineTerminator.kt index a0b1f984f98..4cd1280a0d9 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/AbstractLineTerminator.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/AbstractLineTerminator.kt @@ -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 /** * Line terminator factory - * - * @author Nikolay A. Kuznetsov */ internal abstract class AbstractLineTerminator { diff --git a/runtime/src/main/kotlin/kotlin/text/regex/CharClass.kt b/runtime/src/main/kotlin/kotlin/text/regex/CharClass.kt index 242410330fc..fcb06cb41d5 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/CharClass.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/CharClass.kt @@ -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 * contributor license agreements. See the NOTICE file distributed with @@ -19,8 +35,6 @@ package kotlin.text.regex /** * 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. 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 * * * @return `true` if character class contains symbol specified; - * * - */ + * */ override operator fun contains(ch: Int): Boolean { if (nonBitSet == null) { return alt xor bits_.get(ch) diff --git a/runtime/src/main/kotlin/kotlin/text/regex/Lexer.kt b/runtime/src/main/kotlin/kotlin/text/regex/Lexer.kt index 6996b555271..babb968898b 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/Lexer.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/Lexer.kt @@ -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 * 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. - * - * @author Nikolay A. Kuznetsov */ internal abstract class SpecialToken { diff --git a/runtime/src/main/kotlin/kotlin/text/regex/MatchResultImpl.kt b/runtime/src/main/kotlin/kotlin/text/regex/MatchResultImpl.kt index ca6e69b2d69..511740a5937 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/MatchResultImpl.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/MatchResultImpl.kt @@ -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 * contributor license agreements. See the NOTICE file distributed with @@ -19,7 +35,6 @@ package kotlin.text.regex /** * Match result implementation - * @author Nikolay A. Kuznetsov */ internal class MatchResultImpl diff --git a/runtime/src/main/kotlin/kotlin/text/regex/Pattern.kt b/runtime/src/main/kotlin/kotlin/text/regex/Pattern.kt index 51c5a92b8a3..fe7aee0ccc3 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/Pattern.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/Pattern.kt @@ -1,10 +1,38 @@ -package kotlin.text.regex - -/** - * Apache Harmony Pattern class implementation. - * Analogue for Kotlin Regex class. Need to be merged with it. +/* + * 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 + /** Represents a compiled pattern used by [Regex] for matching, searching, or replacing strings. */ internal class Pattern(val pattern: String, flags: Int = 0) { diff --git a/runtime/src/main/kotlin/kotlin/text/regex/Quantifier.kt b/runtime/src/main/kotlin/kotlin/text/regex/Quantifier.kt index b146d80896b..359e3d5df80 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/Quantifier.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/Quantifier.kt @@ -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 @@ -7,8 +38,6 @@ import kotlin.IllegalArgumentException /** * 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. +,*) - - * @author Nikolay A. Kuznetsov */ internal class Quantifier(val min: Int, val max: Int = min) : SpecialToken() { diff --git a/runtime/src/main/kotlin/kotlin/text/regex/sets/AbstractSet.kt b/runtime/src/main/kotlin/kotlin/text/regex/sets/AbstractSet.kt index 3764bc6af4d..e6902b90f51 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/sets/AbstractSet.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/sets/AbstractSet.kt @@ -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 * 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. * Note: (Almost) All the classes representing nodes has 'set' suffix. - * - * @author Nikolay A. Kuznetsov */ internal abstract class AbstractSet(val type: Int = 0) { diff --git a/runtime/src/main/kotlin/kotlin/text/regex/sets/AtomicJointSet.kt b/runtime/src/main/kotlin/kotlin/text/regex/sets/AtomicJointSet.kt index f1864cf796d..e4cfbc4bfed 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/sets/AtomicJointSet.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/sets/AtomicJointSet.kt @@ -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 * 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. - * - * @author Nikolay A. Kuznetsov */ open internal class AtomicJointSet(children: List, fSet: FSet) : NonCapturingJointSet(children, fSet) { diff --git a/runtime/src/main/kotlin/kotlin/text/regex/sets/BackReferenceSet.kt b/runtime/src/main/kotlin/kotlin/text/regex/sets/BackReferenceSet.kt index 8796c578456..e7ae04eb775 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/sets/BackReferenceSet.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/sets/BackReferenceSet.kt @@ -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 * contributor license agreements. See the NOTICE file distributed with @@ -19,8 +35,6 @@ package kotlin.text.regex /** * Back reference node; - * - * @author Nikolay A. Kuznetsov */ open internal class BackReferenceSet(val referencedGroup: Int, val consCounter: Int, val ignoreCase: Boolean = false) : SimpleSet() { diff --git a/runtime/src/main/kotlin/kotlin/text/regex/sets/CharSet.kt b/runtime/src/main/kotlin/kotlin/text/regex/sets/CharSet.kt index 2386a0cf150..b051054a785 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/sets/CharSet.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/sets/CharSet.kt @@ -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 * contributor license agreements. See the NOTICE file distributed with @@ -19,8 +35,6 @@ package kotlin.text.regex /** * Represents node accepting single character. - * - * @author Nikolay A. Kuznetsov */ open internal class CharSet(char: Char, val ignoreCase: Boolean = false) : LeafSet() { diff --git a/runtime/src/main/kotlin/kotlin/text/regex/sets/CompositeRangeSet.kt b/runtime/src/main/kotlin/kotlin/text/regex/sets/CompositeRangeSet.kt index 25ed64e87a7..2d3116c9d6f 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/sets/CompositeRangeSet.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/sets/CompositeRangeSet.kt @@ -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 * contributor license agreements. See the NOTICE file distributed with diff --git a/runtime/src/main/kotlin/kotlin/text/regex/sets/DecomposedCharSet.kt b/runtime/src/main/kotlin/kotlin/text/regex/sets/DecomposedCharSet.kt index 15c907ba5b2..c2fa9e66684 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/sets/DecomposedCharSet.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/sets/DecomposedCharSet.kt @@ -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 * contributor license agreements. See the NOTICE file distributed with diff --git a/runtime/src/main/kotlin/kotlin/text/regex/sets/DotQuantifierSet.kt b/runtime/src/main/kotlin/kotlin/text/regex/sets/DotQuantifierSet.kt index 7354a11cbd2..7daaf142a64 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/sets/DotQuantifierSet.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/sets/DotQuantifierSet.kt @@ -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 * contributor license agreements. See the NOTICE file distributed with @@ -20,7 +36,6 @@ package kotlin.text.regex /** * 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. - * @author Nikolay A. Kuznetsov */ // TODO: Add optimized implementation for '.+' case internal class DotQuantifierSet( diff --git a/runtime/src/main/kotlin/kotlin/text/regex/sets/DotSet.kt b/runtime/src/main/kotlin/kotlin/text/regex/sets/DotSet.kt index 9846f1b8066..acf43dc4e79 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/sets/DotSet.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/sets/DotSet.kt @@ -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 * contributor license agreements. See the NOTICE file distributed with @@ -19,8 +35,6 @@ package kotlin.text.regex /** * Node accepting any character except line terminators. - * - * @author Nikolay A. Kuznetsov */ internal class DotSet(val lt: AbstractLineTerminator, val matchLineTerminator: Boolean) : SimpleSet(AbstractSet.TYPE_DOTSET) { diff --git a/runtime/src/main/kotlin/kotlin/text/regex/sets/EOISet.kt b/runtime/src/main/kotlin/kotlin/text/regex/sets/EOISet.kt index c5ac514ffff..573c6a0a745 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/sets/EOISet.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/sets/EOISet.kt @@ -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 * 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; - * - * @author Nikolay A. Kuznetsov */ internal class EOISet : SimpleSet() { diff --git a/runtime/src/main/kotlin/kotlin/text/regex/sets/EOLSet.kt b/runtime/src/main/kotlin/kotlin/text/regex/sets/EOLSet.kt index 72c86f24449..e8bdc599d39 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/sets/EOLSet.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/sets/EOLSet.kt @@ -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 * contributor license agreements. See the NOTICE file distributed with @@ -21,8 +37,6 @@ package kotlin.text.regex * Represents a node for a '$' sign. * 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- - * - * @author Nikolay A. Kuznetsov */ internal class EOLSet(val consCounter: Int, val lt: AbstractLineTerminator, val multiline: Boolean = false) : SimpleSet() { diff --git a/runtime/src/main/kotlin/kotlin/text/regex/sets/EmptySet.kt b/runtime/src/main/kotlin/kotlin/text/regex/sets/EmptySet.kt index bc5b9ca19f4..d4bfb05419c 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/sets/EmptySet.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/sets/EmptySet.kt @@ -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 * contributor license agreements. See the NOTICE file distributed with @@ -19,8 +35,6 @@ package kotlin.text.regex /** * Valid constant zero character match. - * - * @author Nikolay A. Kuznetsov */ internal class EmptySet(override var next: AbstractSet) : LeafSet() { diff --git a/runtime/src/main/kotlin/kotlin/text/regex/sets/FSets.kt b/runtime/src/main/kotlin/kotlin/text/regex/sets/FSets.kt index 9478f367ad4..227b965bcaa 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/sets/FSets.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/sets/FSets.kt @@ -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 * 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. - * @author Nikolay A. Kuznetsov */ 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. - * - * @author Nikolay A. Kuznetsov */ internal class FinalSet : FSet(0) { @@ -89,8 +102,6 @@ internal class FinalSet : FSet(0) { /** * Non-capturing group closing node. - * - * @author Nikolay A. Kuznetsov */ internal class NonCapFSet(groupIndex: Int) : FSet(groupIndex) { @@ -109,7 +120,6 @@ internal class NonCapFSet(groupIndex: Int) : FSet(groupIndex) { /** * LookAhead FSet, always returns true - * @author Nikolay A. Kuznetsov */ 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 * index, return -1 otherwise. - * @author Nikolay A. Kuznetsov */ 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. - * - * @author Nikolay A. Kuznetsov */ internal class AtomicFSet(groupIndex: Int) : FSet(groupIndex) { diff --git a/runtime/src/main/kotlin/kotlin/text/regex/sets/GroupQuantifierSet.kt b/runtime/src/main/kotlin/kotlin/text/regex/sets/GroupQuantifierSet.kt index 887f36f6f60..52fb107ef8b 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/sets/GroupQuantifierSet.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/sets/GroupQuantifierSet.kt @@ -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 * 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 * consume. - * @author Nikolay A. Kuznetsov */ open internal class GroupQuantifierSet( val quantifier: Quantifier, diff --git a/runtime/src/main/kotlin/kotlin/text/regex/sets/HangulDecomposedCharSet.kt b/runtime/src/main/kotlin/kotlin/text/regex/sets/HangulDecomposedCharSet.kt index b37a01fce44..3ab55584c6a 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/sets/HangulDecomposedCharSet.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/sets/HangulDecomposedCharSet.kt @@ -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 * contributor license agreements. See the NOTICE file distributed with diff --git a/runtime/src/main/kotlin/kotlin/text/regex/sets/JointSet.kt b/runtime/src/main/kotlin/kotlin/text/regex/sets/JointSet.kt index 4d3114c0233..5bbafc08995 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/sets/JointSet.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/sets/JointSet.kt @@ -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 * 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. * 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, fSet: FSet) : AbstractSet() { diff --git a/runtime/src/main/kotlin/kotlin/text/regex/sets/LeafQuantifierSet.kt b/runtime/src/main/kotlin/kotlin/text/regex/sets/LeafQuantifierSet.kt index e9a2872337d..0b450746a0a 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/sets/LeafQuantifierSet.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/sets/LeafQuantifierSet.kt @@ -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 * contributor license agreements. See the NOTICE file distributed with @@ -25,8 +41,6 @@ import kotlin.RuntimeException * - a* == a{0, }; * - a? == a{0, 1}; * - a+ == a{1, }; - * - * @author Nikolay A. Kuznetsov */ open internal class LeafQuantifierSet(var quantifier: Quantifier, innerSet: LeafSet, diff --git a/runtime/src/main/kotlin/kotlin/text/regex/sets/LeafSet.kt b/runtime/src/main/kotlin/kotlin/text/regex/sets/LeafSet.kt index c0445567079..f7a48343657 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/sets/LeafSet.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/sets/LeafSet.kt @@ -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 * 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. - * - * @author Nikolay A. Kuznetsov */ internal abstract class LeafSet : SimpleSet(AbstractSet.TYPE_LEAF) { diff --git a/runtime/src/main/kotlin/kotlin/text/regex/sets/LookAheadSets.kt b/runtime/src/main/kotlin/kotlin/text/regex/sets/LookAheadSets.kt index 8dbdd42d4ed..edda33edb98 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/sets/LookAheadSets.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/sets/LookAheadSets.kt @@ -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 * contributor license agreements. See the NOTICE file distributed with @@ -19,8 +35,6 @@ package kotlin.text.regex /** * Positive lookahead node. - * - * @author Nikolay A. Kuznetsov */ internal class PositiveLookAheadSet(children: List, fSet: FSet) : AtomicJointSet(children, fSet) { @@ -43,8 +57,6 @@ internal class PositiveLookAheadSet(children: List, fSet: FSet) : A /** * Negative look ahead node. - * - * @author Nikolay A. Kuznetsov */ internal class NegativeLookAheadSet(children: List, fSet: FSet) : AtomicJointSet(children, fSet) { diff --git a/runtime/src/main/kotlin/kotlin/text/regex/sets/LookBehindSets.kt b/runtime/src/main/kotlin/kotlin/text/regex/sets/LookBehindSets.kt index dd4540e46f6..9d9a2d8a40c 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/sets/LookBehindSets.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/sets/LookBehindSets.kt @@ -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 * contributor license agreements. See the NOTICE file distributed with @@ -19,8 +35,6 @@ package kotlin.text.regex /** * Positive lookbehind node. - * - * @author Nikolay A. Kuznetsov */ internal class PositiveLookBehindSet(children: List, fSet: FSet) : AtomicJointSet(children, fSet) { @@ -45,8 +59,6 @@ internal class PositiveLookBehindSet(children: List, fSet: FSet) : /** * Negative look behind node. - * - * @author Nikolay A. Kuznetsov */ internal class NegativeLookBehindSet(children: List, fSet: FSet) : AtomicJointSet(children, fSet) { diff --git a/runtime/src/main/kotlin/kotlin/text/regex/sets/NonCapturingJointSet.kt b/runtime/src/main/kotlin/kotlin/text/regex/sets/NonCapturingJointSet.kt index 94adcd48971..7bcd82e5136 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/sets/NonCapturingJointSet.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/sets/NonCapturingJointSet.kt @@ -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 * contributor license agreements. See the NOTICE file distributed with @@ -19,7 +35,6 @@ package kotlin.text.regex /** * Node representing non-capturing group - * @author Nikolay A. Kuznetsov */ open internal class NonCapturingJointSet(children: List, fSet: FSet) : JointSet(children, fSet) { diff --git a/runtime/src/main/kotlin/kotlin/text/regex/sets/PossessiveGroupQuantifierSet.kt b/runtime/src/main/kotlin/kotlin/text/regex/sets/PossessiveGroupQuantifierSet.kt index 173013b21c3..519b19c1150 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/sets/PossessiveGroupQuantifierSet.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/sets/PossessiveGroupQuantifierSet.kt @@ -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 * contributor license agreements. See the NOTICE file distributed with @@ -19,8 +35,6 @@ package kotlin.text.regex /** * Possessive quantifier set over groups. - * - * @author Nikolay A. Kuznetsov */ internal class PossessiveGroupQuantifierSet( quantifier: Quantifier, diff --git a/runtime/src/main/kotlin/kotlin/text/regex/sets/PossessiveLeafQuantifierSet.kt b/runtime/src/main/kotlin/kotlin/text/regex/sets/PossessiveLeafQuantifierSet.kt index dd80615e637..a660c978390 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/sets/PossessiveLeafQuantifierSet.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/sets/PossessiveLeafQuantifierSet.kt @@ -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 * contributor license agreements. See the NOTICE file distributed with @@ -23,8 +39,6 @@ package kotlin.text.regex * - a*+ == a{0, }+; * - a?+ == a{0, 1}+; * - a++ == a{1, }+; - * - * @author Nikolay A. Kuznetsov */ internal class PossessiveLeafQuantifierSet( quant: Quantifier, diff --git a/runtime/src/main/kotlin/kotlin/text/regex/sets/PreviousMatchSet.kt b/runtime/src/main/kotlin/kotlin/text/regex/sets/PreviousMatchSet.kt index a6b468ace56..4e8d64e082e 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/sets/PreviousMatchSet.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/sets/PreviousMatchSet.kt @@ -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 * contributor license agreements. See the NOTICE file distributed with @@ -19,8 +35,6 @@ package kotlin.text.regex /** * Node representing previous match (\G). - * - * @author Nikolay A. Kuznetsov */ internal class PreviousMatchSet : SimpleSet() { diff --git a/runtime/src/main/kotlin/kotlin/text/regex/sets/QuantifierSet.kt b/runtime/src/main/kotlin/kotlin/text/regex/sets/QuantifierSet.kt index db6d9221ead..477f196a6b3 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/sets/QuantifierSet.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/sets/QuantifierSet.kt @@ -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 * contributor license agreements. See the NOTICE file distributed with @@ -19,8 +35,6 @@ package kotlin.text.regex /** * Base class for quantifiers. - * - * @author Nikolay A. Kuznetsov */ internal abstract class QuantifierSet(open var innerSet: AbstractSet, override var next: AbstractSet, type: Int) : SimpleSet(type) { diff --git a/runtime/src/main/kotlin/kotlin/text/regex/sets/RangeSet.kt b/runtime/src/main/kotlin/kotlin/text/regex/sets/RangeSet.kt index 95433d7ec51..330fa305f76 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/sets/RangeSet.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/sets/RangeSet.kt @@ -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 * 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. - * - * @author Nikolay A. Kuznetsov */ open internal class RangeSet(charClass: AbstractCharClass, val ignoreCase: Boolean = false) : LeafSet() { diff --git a/runtime/src/main/kotlin/kotlin/text/regex/sets/ReluctantGroupQuantifierSet.kt b/runtime/src/main/kotlin/kotlin/text/regex/sets/ReluctantGroupQuantifierSet.kt index 9c4247f4828..8c1874a7b98 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/sets/ReluctantGroupQuantifierSet.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/sets/ReluctantGroupQuantifierSet.kt @@ -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 * contributor license agreements. See the NOTICE file distributed with @@ -19,8 +35,6 @@ package kotlin.text.regex /** * Reluctant version of the group quantifier set. - * - * @author Nikolay A. Kuznetsov */ internal class ReluctantGroupQuantifierSet( quantifier: Quantifier, diff --git a/runtime/src/main/kotlin/kotlin/text/regex/sets/ReluctantLeafQuantifierSet.kt b/runtime/src/main/kotlin/kotlin/text/regex/sets/ReluctantLeafQuantifierSet.kt index fa48a3c5804..113f92c7bd0 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/sets/ReluctantLeafQuantifierSet.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/sets/ReluctantLeafQuantifierSet.kt @@ -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 * contributor license agreements. See the NOTICE file distributed with @@ -23,8 +39,6 @@ package kotlin.text.regex * - a*? == a{0, }?; * - a?? == a{0, 1}?; * - a+? == a{1, }?; - * - * @author Nikolay A. Kuznetsov */ internal class ReluctantLeafQuantifierSet( quant: Quantifier, diff --git a/runtime/src/main/kotlin/kotlin/text/regex/sets/SOLSet.kt b/runtime/src/main/kotlin/kotlin/text/regex/sets/SOLSet.kt index 6e4566dd28a..5b1a0a8ea3e 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/sets/SOLSet.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/sets/SOLSet.kt @@ -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 * contributor license agreements. See the NOTICE file distributed with @@ -21,8 +37,6 @@ package kotlin.text.regex * A node representing a '^' sign. * 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- - * - * @author Nikolay A. Kuznetsov */ internal class SOLSet(val lt: AbstractLineTerminator, val multiline: Boolean = false) : SimpleSet() { diff --git a/runtime/src/main/kotlin/kotlin/text/regex/sets/SequenceSet.kt b/runtime/src/main/kotlin/kotlin/text/regex/sets/SequenceSet.kt index 889470c9ff6..26057d96657 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/sets/SequenceSet.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/sets/SequenceSet.kt @@ -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 * 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 * expression compilation phase character sequence w-o-r-d, will be represented * with single node for the entire word. - * - * @author Nikolay A. Kuznetsov */ open internal class SequenceSet(substring: CharSequence, val ignoreCase: Boolean = false) : LeafSet() { diff --git a/runtime/src/main/kotlin/kotlin/text/regex/sets/SingleSet.kt b/runtime/src/main/kotlin/kotlin/text/regex/sets/SingleSet.kt index cbd47e3fc77..fbaa57573d1 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/sets/SingleSet.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/sets/SingleSet.kt @@ -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 * contributor license agreements. See the NOTICE file distributed with @@ -19,7 +35,6 @@ package kotlin.text.regex /** * Group node over subexpression without alternations. - * @author Nikolay A. Kuznetsov */ open internal class SingleSet(var kid: AbstractSet, fSet: FSet) : JointSet(listOf(), fSet) { diff --git a/runtime/src/main/kotlin/kotlin/text/regex/sets/SupplementaryCharSet.kt b/runtime/src/main/kotlin/kotlin/text/regex/sets/SupplementaryCharSet.kt index dba91a0dc56..67ee68394d6 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/sets/SupplementaryCharSet.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/sets/SupplementaryCharSet.kt @@ -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 * contributor license agreements. See the NOTICE file distributed with @@ -84,8 +100,6 @@ package kotlin.text.regex /** * Represents node accepting single supplementary codepoint. - * - * @author Nikolay A. Kuznetsov */ internal class SupplementaryCharSet(val codePoint: Int, ignoreCase: Boolean) : SequenceSet(fromCharArray(Char.toChars(codePoint), 0, 2), ignoreCase) { diff --git a/runtime/src/main/kotlin/kotlin/text/regex/sets/SupplementaryRangeSet.kt b/runtime/src/main/kotlin/kotlin/text/regex/sets/SupplementaryRangeSet.kt index 9470e030b2c..2de87b16540 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/sets/SupplementaryRangeSet.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/sets/SupplementaryRangeSet.kt @@ -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 * 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. * This character can be supplementary (2 chars needed to represent) or from * basic multilingual pane (1 needed char to represent it). - * - * @author Nikolay A. Kuznetsov */ open internal class SupplementaryRangeSet(charClass: AbstractCharClass, val ignoreCase: Boolean = false): SimpleSet() { diff --git a/runtime/src/main/kotlin/kotlin/text/regex/sets/SurrogateCharSets.kt b/runtime/src/main/kotlin/kotlin/text/regex/sets/SurrogateCharSets.kt index dc21ae7d1ba..73a5fc253a3 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/sets/SurrogateCharSets.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/sets/SurrogateCharSets.kt @@ -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 * 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 * that don't combine into supplementary code point. * See http://www.unicode.org/reports/tr18/#Supplementary_Characters - * - * @author Nikolay A. Kuznetsov */ internal class LowSurrogateCharSet(low: Char) : CharSet(low) { diff --git a/runtime/src/main/kotlin/kotlin/text/regex/sets/SurrogateRangeSet.kt b/runtime/src/main/kotlin/kotlin/text/regex/sets/SurrogateRangeSet.kt index 476664f5fb4..0112fdee4be 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/sets/SurrogateRangeSet.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/sets/SurrogateRangeSet.kt @@ -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 * 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. - * - * @author Nikolay A. Kuznetsov */ internal class SurrogateRangeSet(surrChars: AbstractCharClass) : RangeSet(surrChars) { diff --git a/runtime/src/main/kotlin/kotlin/text/regex/sets/UnifiedQuantifierSet.kt b/runtime/src/main/kotlin/kotlin/text/regex/sets/UnifiedQuantifierSet.kt index 87b775efc7a..a5452ce8fad 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/sets/UnifiedQuantifierSet.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/sets/UnifiedQuantifierSet.kt @@ -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 * 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 * 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) { diff --git a/runtime/src/main/kotlin/kotlin/text/regex/sets/WordBoundarySet.kt b/runtime/src/main/kotlin/kotlin/text/regex/sets/WordBoundarySet.kt index 86bd38f0894..65e311d1352 100644 --- a/runtime/src/main/kotlin/kotlin/text/regex/sets/WordBoundarySet.kt +++ b/runtime/src/main/kotlin/kotlin/text/regex/sets/WordBoundarySet.kt @@ -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 * 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; - * - * @author Nikolay A. Kuznetsov */ internal class WordBoundarySet(var positive: Boolean) : SimpleSet() {