Skip to content

KotlinMania/unicode-ident-kotlin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

unicode-ident-kotlin

Kotlin Multiplatform port of dtolnay/unicode-ident.

The upstream Rust crate exposes two predicates that determine whether a Unicode code point belongs to the XID_Start or XID_Continue property classes defined in Unicode Standard Annex #31, which is the property set Rust (and most other modern languages) use to decide which characters may begin or continue an identifier.

import io.github.kotlinmania.unicodeident.isXidStart
import io.github.kotlinmania.unicodeident.isXidContinue

This port is consumed by proc-macro2-kotlin for identifier validation in the Fallback token-parser, mirroring the unicode_ident::is_xid_start / unicode_ident::is_xid_continue calls in the upstream Rust fallback.rs.

Targets

Kotlin Multiplatform: macOS arm64, Linux x64, mingw x64, iOS arm64 / x64 / simulator-arm64, JS (browser + Node), Wasm-JS (browser + Node), Android, and JVM.

Build

./gradlew build
./gradlew test

Licenses

Upstream unicode-ident is (MIT OR Apache-2.0) AND Unicode-3.0. The same combination applies to this port. License texts are mirrored from upstream as LICENSE-APACHE, LICENSE-MIT, and LICENSE-UNICODE.

Upstream README is preserved verbatim as README-UPSTREAM.md.

Installation

// build.gradle.kts
commonMain.dependencies {
    implementation("io.github.kotlinmania:unicode-ident-kotlin:0.1.0")
}

About

Port of Rust crate unicode-ident

Resources

License

Apache-2.0 and 2 other licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Unknown
LICENSE-UNICODE

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors