Skip to content

Commit

Permalink
Apply spotlessApply to fix Copyright
Browse files Browse the repository at this point in the history
  • Loading branch information
ForteScarlet committed Oct 15, 2024
1 parent 14bcf44 commit 81046c1
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 9 deletions.
15 changes: 15 additions & 0 deletions kotlinpoet/src/jsMain/kotlin/com/squareup/kotlinpoet/Util.js.kt
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright (C) 2024 Square, Inc.
*
* 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
*
* https://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 com.squareup.kotlinpoet

private val IDENTIFIER_REGEX = IDENTIFIER_REGEX_VALUE.toRegex()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ internal actual val String.isIdentifier: Boolean
get() = IDENTIFIER_REGEX.matches(this)

internal actual inline fun <reified E : Enum<E>> enumSetOf(vararg values: E): MutableSet<E> {
return when(values.size) {
return when (values.size) {
0 -> EnumSet.noneOf(E::class.java)
1 -> EnumSet.of(values[0])
2 -> EnumSet.of(values[0], values[1])
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright (C) 2024 Square, Inc.
*
* 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
*
* https://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 com.squareup.kotlinpoet

internal actual fun <K, V> Map<K, V>.toImmutableMap(): Map<K, V> =
Expand Down Expand Up @@ -46,7 +61,6 @@ internal actual fun Char.isJavaIdentifierStart(): Boolean {
this == '_'
}


internal actual fun Char.isJavaIdentifierPart(): Boolean {
// TODO
// A character may be part of a Java identifier if any of the following conditions are true:
Expand All @@ -71,15 +85,15 @@ internal actual fun Char.isJavaIdentifierPart(): Boolean {
}

internal fun Char.isIdentifierIgnorable(): Boolean {
// The following Unicode characters are ignorable in a Java identifier or a Unicode identifier:
// - ISO control characters that are not whitespace
// - '\u0000' through '\u0008'
// - '\u000E' through '\u001B'
// - '\u007F' through '\u009F'
// - all characters that have the FORMAT general category value
// The following Unicode characters are ignorable in a Java identifier or a Unicode identifier:
// - ISO control characters that are not whitespace
// - '\u0000' through '\u0008'
// - '\u000E' through '\u001B'
// - '\u007F' through '\u009F'
// - all characters that have the FORMAT general category value
return (
isISOControl() && (
this in '\u0000'..'\u0008' ||
this in '\u0000'..'\u0008' ||
this in '\u000E'..'\u001B' ||
this in '\u007F'..'\u009F'
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright (C) 2024 Square, Inc.
*
* 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
*
* https://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 com.squareup.kotlinpoet

internal actual val String.isIdentifier: Boolean
Expand Down

0 comments on commit 81046c1

Please sign in to comment.