Skip to content

Commit f31adc0

Browse files
committed
docs(readme): simplify — drop machine-specific paths, finished task-orchestration notes, and stale verification disclaimers
1 parent 8b30711 commit f31adc0

1 file changed

Lines changed: 42 additions & 101 deletions

File tree

‎README.md‎

Lines changed: 42 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -4,69 +4,32 @@
44

55
A Lua 5.3 lexer, parser, AST, and semantic-analysis toolkit written in pure Kotlin.
66

7-
The current project scope is Lua 5.3 support plus ongoing Android-Lua/LuaJava analysis, JVM reflection interop, and a JVM language-server path. These areas are active work; README examples describe the intended integration surface without claiming final serialized verification has completed.
8-
9-
Semantic analysis uses the `SemanticPipeline` API; the former legacy analyzer entry points have been retired.
7+
The project scope covers Lua 5.3 plus Android-Lua/LuaJava analysis, JVM reflection interop, and a JVM language-server path. Semantic analysis uses the `SemanticPipeline` API.
108

119
## Features
1210

13-
- [X] Kotlin Multiplatform support (JVM / JS / Native)
11+
- [x] Kotlin Multiplatform support (JVM / JS / Native)
1412
- [x] Parse source to AST
1513
- [x] Transform AST to source code
16-
- [ ] Semantic analysis. Provide type information (Work in progress)
14+
- [ ] Semantic analysis: provide type information (work in progress)
1715

1816
## Setup
1917

20-
Use JDK 17 for local JVM work. On macOS, a typical session sets `JAVA_HOME` (Corretto 17) before invoking Gradle or IDE import:
21-
22-
```bash
23-
export JAVA_HOME=/Users/dingyi/Library/Java/JavaVirtualMachines/corretto-17.0.19/Contents/Home
24-
export PATH="$JAVA_HOME/bin:$PATH"
25-
```
26-
27-
For Android-Lua and LuaJava analysis, keep the Android-Lua source checkout outside this repository and record its path in your worker notes or IDE run configuration. The historical analysis docs use that checkout as read-only reference material for import, LuaJava, JNI, asset, and helper-library behavior.
28-
29-
For Android framework reflection, point the JVM workspace configuration at the platform jar for the API level you want to model. On this macOS host (2026-07-11 re-check) the Android SDK platform jar is **present** at:
30-
31-
```text
32-
/Users/dingyi/Library/Android/sdk/platforms/android-35/android.jar
33-
```
34-
35-
Optional alternate host path when the SDK tree is not used: `/Users/dingyi/Downloads/android.jar` (currently absent on this machine). Prefer the SDK path above; never hard-code Windows `G:/` paths. See `docs/android-platform-setup.md` for discovery, skip policy, and metadata keys.
36-
37-
Use the `jvm.androidJar` metadata key or `JvmWorkspaceConfiguration.androidJar` for that path. Keep application/library jars in `jvm.classpath`, and reserve `jvm.androidJar` for the Android platform jar.
38-
18+
Use JDK 17 for local JVM work.
3919

40-
### Documentation map
41-
42-
- [Production readiness guide](docs/production-readiness.md): setup, usage, Android-Lua inputs, verification boundaries, known limitations, and extension points.
43-
- [Android-Lua architecture notes](docs/android-lua-architecture.md): read-only source layout and fixture candidates from `/Users/dingyi/projects/java_projects/Android-Lua/app/src/main`.
44-
- [Android-Lua import and LuaJava behavior](docs/android-lua-import-luajava.md): runtime patterns modeled by parser, semantic, interop, and LSP work.
45-
- [Android-Lua compatibility matrix](docs/android-lua-compatibility-matrix.md): supported, partial, deferred, and out-of-scope behavior.
46-
- [Android-Lua library model notes](docs/android-lua-library-models.md): helper modules, overlays, stubs, and type-model priorities.
47-
- [Android-Lua corpus verification](docs/android-lua-verification.md): external corpus manifest usage and TASK-043 verification command.
48-
- [Android platform setup](docs/android-platform-setup.md): `android.jar` acquisition, metadata keys, and classloader expectations.
49-
- [Java interop model guide](docs/java-interop-model.md): Java type shapes, LuaJava helper mapping, and extension points.
50-
- [JVM reflection and classloader design](docs/jvm-reflection-classloader-design.md): provider loading, package scanning, Android jar behavior, and limitations.
51-
- [JVM language-server usage](docs/language-server-usage.md): launch shape, LSP capabilities, settings, and request examples.
52-
- [Semantic compatibility policy](docs/semantic-compat.md): retired legacy API surface and migration notes.
53-
- [Serialized verification workflow](docs/serialized-verification.md): one-at-a-time Gradle/test execution and lock rules.
54-
- [Test strategy and inventory](docs/test-strategy.md): parser, semantic, workspace, interop, LSP, and TDD inventory accounting.
20+
For Android framework reflection, point the JVM workspace configuration at the platform jar for the API level you want to model, via the `jvm.androidJar` metadata key or `JvmWorkspaceConfiguration.androidJar`. Keep application/library jars in `jvm.classpath`, and reserve `jvm.androidJar` for the Android platform jar. See `docs/android-platform-setup.md` for details.
5521

5622
## Usage
5723

58-
- Add the dependency to your gradle file
24+
Add the dependency to your Gradle file:
5925

6026
```kotlin
6127
implementation("io.github.dingyi222666:luaparser:1.0.4")
6228
```
6329

64-
### Dependencies
65-
66-
- **Kotlin consumer floor: Kotlin >= 2.1.** This library is compiled with the Kotlin 2.2.0 compiler, so consumers must build with a Kotlin Gradle plugin of 2.1 or newer to read its metadata; Kotlin 1.9 (and older) consumers fail with "compiled with an incompatible version of Kotlin".
67-
- Runtime dependencies: the Kotlin stdlib. On JVM, `org.eclipse.lsp4j` is an `api` dependency because its types appear in the public `LuaLanguageService` surface.
30+
**Requires Kotlin 2.1 or newer** — the library is compiled with Kotlin 2.2.0, and older Kotlin toolchains reject its metadata.
6831

69-
Minimal parser round-trip example:
32+
### Parser round-trip
7033

7134
```kotlin
7235
import io.github.dingyi222666.luaparser.lexer.LuaLexer
@@ -85,9 +48,7 @@ fun main() {
8548

8649
### Parser version policy
8750

88-
The public no-argument `LuaParser()` constructor intentionally defaults to `LuaVersion.ANDROLUA_5_3`. That keeps Android-Lua/AndroLua 5.3 syntax available by default for current parser, semantic, interop, and language-server work.
89-
90-
For strict Lua 5.3 grammar, construct the parser explicitly:
51+
The no-argument `LuaParser()` constructor defaults to `LuaVersion.ANDROLUA_5_3`, keeping Android-Lua/AndroLua 5.3 syntax available by default. For strict Lua 5.3 grammar:
9152

9253
```kotlin
9354
val parser = LuaParser(luaVersion = LuaVersion.LUA_5_3)
@@ -121,23 +82,21 @@ fun main() {
12182
}
12283
```
12384

124-
The returned `SemanticAnalysisResult` exposes the `SemanticModel` plus a lightweight summary.
125-
126-
The former `SemanticAnalyzer` / `AnalysisResult` / legacy symbol-table API has been retired; `SemanticPipeline` and its `SemanticAnalysisResult` / `SemanticModel` are the single public semantic entry point. See `docs/semantic-compat.md` for the retirement note.
85+
The returned `SemanticAnalysisResult` exposes the `SemanticModel` plus a lightweight summary. The former `SemanticAnalyzer` / `AnalysisResult` / legacy symbol-table API has been retired; see `docs/semantic-compat.md`.
12786

12887
### JVM workspace interop
12988

13089
`JvmWorkspaceEngine` can reflect JVM classes into synthetic Lua modules so `require("String")`, `require("Arrays")`, and similar patterns resolve through the workspace graph.
13190

132-
For metadata-driven integration, use these keys:
91+
Metadata-driven integration keys:
13392

13493
- `jvm.classes`: fully-qualified class names to mount directly
135-
- `androlua.imports`: AndroLua-style simple import names that should be resolved through JVM import prefixes
94+
- `androlua.imports`: AndroLua-style simple import names resolved through JVM import prefixes
13695
- `jvm.classpath`: newline-separated jar or directory entries used to build a reflective class loader
137-
- `jvm.androidJar`: optional path to an Android platform `android.jar`; appended to the effective reflective classpath
96+
- `jvm.androidJar`: optional path to an Android platform `android.jar`, appended to the effective reflective classpath
13897
- `jvm.importPrefixes`: newline-separated prefix list used for simple-name import resolution
13998

140-
You can also configure the JVM engine directly with `JvmWorkspaceConfiguration`:
99+
Or configure the JVM engine directly:
141100

142101
```kotlin
143102
val engine = JvmWorkspaceEngine(
@@ -166,7 +125,7 @@ import io.github.dingyi222666.luaparser.semantic.workspace.VirtualPath
166125
fun main() {
167126
val path = VirtualPath.of("main.lua")
168127
val configuration = JvmWorkspaceConfiguration(
169-
androidJar = "/Users/dingyi/Library/Android/sdk/platforms/android-35/android.jar",
128+
androidJar = "/opt/android/platforms/android-35/android.jar",
170129
androluaImports = listOf("TextView"),
171130
importPrefixes = listOf("java.lang", "android.widget")
172131
)
@@ -190,39 +149,22 @@ fun main() {
190149
}
191150
```
192151

193-
Source-level Android-Lua patterns are also recognized by the JVM workspace layer:
152+
Source-level Android-Lua patterns recognized by the JVM workspace layer:
194153

195154
- `import "java.lang.String"` exposes `String` as a visible reflected module symbol.
196-
- `import "java.util.*"` resolves all top-level classes discoverable from that package on the active JVM classpath/runtime image, making them available as reflected module symbols.
155+
- `import "java.util.*"` resolves top-level classes discoverable from that package on the active JVM classpath/runtime image.
197156
- `local import = require("import")` followed by `import("java.util.Locale")` resolves the reflected class type for the assigned local.
198157
- `luajava.bindClass("java.util.Locale")` resolves the reflected class type for the assigned local.
199158

200-
### Android and AndroLua setup notes
201-
202-
To reproduce Android class resolution on the JVM side, point `jvm.androidJar` at the platform jar for the SDK level you want to model. If you already have a combined classpath, place your dependency jars in `jvm.classpath` and the platform jar in `jvm.androidJar` so the reflective provider can resolve Android framework classes alongside your own libraries.
203-
204-
Example metadata payload:
205-
206-
```kotlin
207-
val metadata = mapOf(
208-
"androlua.imports" to "String\nLinearLayout",
209-
"jvm.classpath" to "build/test-libs/app.jar",
210-
"jvm.androidJar" to "/opt/android/platforms/android-34/android.jar",
211-
"jvm.importPrefixes" to "java.lang\nandroid.widget"
212-
)
213-
```
214-
215159
### Language server
216160

217-
A JVM `lsp4j` server is now available under `io.github.dingyi222666.luaparser.lsp` and can be launched over stdio with:
161+
A JVM `lsp4j` server is available under `io.github.dingyi222666.luaparser.lsp` and can be launched over stdio:
218162

219163
```bash
220164
./gradlew runLuaLanguageServer
221165
```
222166

223-
The current server implementation maps workspace-backed diagnostics, hover, completion, and goto-definition queries through `LuaWorkspaceQueryFacade`.
224-
225-
Workspace symbol search (`workspace/symbol`) matches case-insensitively on symbol names and ranks name-prefix matches ahead of mid-name substring matches before capping results at 500 entries; each bucket keeps the deterministic (name, path, line, column) order of the workspace index, so short queries return stable, prefix-first results instead of an arbitrary alphabetical slice.
167+
The server maps workspace-backed diagnostics, hover, completion, and goto-definition queries through `LuaWorkspaceQueryFacade`. Workspace symbol search (`workspace/symbol`) matches case-insensitively and ranks name-prefix matches ahead of mid-name substring matches.
226168

227169
Example client settings payload:
228170

@@ -235,40 +177,39 @@ Example client settings payload:
235177
}
236178
```
237179

238-
This configuration is consumed by the workspace service and serialized into the same metadata keys used by the reflective JVM workspace engine.
239-
240-
### Representative verification path
180+
See `docs/language-server-usage.md` for capabilities and request examples.
241181

242-
A minimal end-to-end local verification flow, to be run only in the serialized verification phase during coordinated waves, is:
182+
## Documentation
243183

244-
1. Start the language server with `./gradlew runLuaLanguageServer`.
245-
2. Open a Lua document containing `local String = require("String")` and set client configuration with `androlua.imports = ["String"]`.
246-
3. Request hover on `String.__class.length` and verify the server reports `java.lang.String`.
247-
4. Request goto definition on `String.__class` and verify the target URI resolves to `file:///__jvm__/classes/java/lang/String.lua`.
248-
5. Request completion on `Arrays.` after configuring `jvm.classes = ["java.util.Arrays"]` and verify `asList` is offered.
249-
250-
For a fuller setup and acceptance checklist, see `docs/production-readiness.md`.
184+
- [Production readiness guide](docs/production-readiness.md): setup, usage, verification boundaries, known limitations, and extension points.
185+
- [Android-Lua architecture notes](docs/android-lua-architecture.md)
186+
- [Android-Lua import and LuaJava behavior](docs/android-lua-import-luajava.md)
187+
- [Android-Lua compatibility matrix](docs/android-lua-compatibility-matrix.md)
188+
- [Android-Lua library model notes](docs/android-lua-library-models.md)
189+
- [Android-Lua corpus verification](docs/android-lua-verification.md)
190+
- [Android platform setup](docs/android-platform-setup.md)
191+
- [Java interop model guide](docs/java-interop-model.md)
192+
- [JVM reflection and classloader design](docs/jvm-reflection-classloader-design.md)
193+
- [JVM language-server usage](docs/language-server-usage.md)
194+
- [Semantic compatibility policy](docs/semantic-compat.md)
195+
- [Test strategy and inventory](docs/test-strategy.md)
251196

252197
## Validation
253198

254-
- During parallel code and documentation waves, do not run Gradle, tests, or compile tasks. Required checks are deferred to the dedicated serialized verification phase, currently tracked by `TASK-043`.
255-
- Outside coordinated worker waves, `./gradlew check` remains the supported default local validation path.
256-
- Semantic validation now lives in shared `commonTest` coverage, including workspace query flows.
199+
- `./gradlew check` is the default local validation path.
257200
- Native host test execution is opt-in with `-PrunNativeHostTests=true`.
258-
- Run Windows Kotlin/Native host tests explicitly with `./gradlew -PrunNativeHostTests=true mingwX64Test`.
259-
- JVM interop coverage currently lives in `src/jvmTest/kotlin/interop/jvm/JvmWorkspaceEngineTest.kt`.
260-
- LSP coverage currently lives in `src/jvmTest/kotlin/lsp/LuaLanguageServiceTest.kt`.
261-
- Runnable JVM language server entry point: `./gradlew runLuaLanguageServer`.
262-
- Final production acceptance is not claimed until `TASK-043` serialized verification and the `TASK-037` acceptance audit complete.
201+
- JVM interop coverage lives in `src/jvmTest/kotlin/interop/jvm/JvmWorkspaceEngineTest.kt`; LSP coverage lives in `src/jvmTest/kotlin/lsp/LuaLanguageServiceTest.kt`.
263202

264203
## Publishing
265204

266-
Releases go to Maven Central through the manual `publish` workflow (`.github/workflows/publish.yml`, "Run workflow" only — it never triggers on push or tag). Before every run, bump `publishVersion` in `build.gradle.kts` (the single source of truth for the published coordinates): Maven Central forbids re-uploading an existing version, so retrying an already-burned version always fails. Consumers need Kotlin 2.1 or newer: the library is compiled with the Kotlin 2.2.0 compiler, and older Kotlin compilers reject its metadata ("compiled with an incompatible version of Kotlin").
205+
Releases go to Maven Central through the manual `publish` workflow (`.github/workflows/publish.yml`, "Run workflow" only). Bump `publishVersion` in `build.gradle.kts` before every run — Maven Central forbids re-uploading an existing version.
267206

268-
## Special thanks
207+
## License
269208

270-
[GavinHigham/lpil53](https://github.com/GavinHigham/lpil53)
209+
[Apache License 2.0](LICENSE)
271210

272-
[fstirlitz/luaparse](https://github.com/fstirlitz/luaparse)
211+
## Special thanks
273212

274-
[Rosemose/sora-editor](https://github.com/Rosemoe/sora-editor/blob/main/language-java/src/main/java/io/github/rosemoe/sora/langs/java/JavaTextTokenizer.java)
213+
- [GavinHigham/lpil53](https://github.com/GavinHigham/lpil53)
214+
- [fstirlitz/luaparse](https://github.com/fstirlitz/luaparse)
215+
- [Rosemoe/sora-editor](https://github.com/Rosemoe/sora-editor/blob/main/language-java/src/main/java/io/github/rosemoe/sora/langs/java/JavaTextTokenizer.java)

0 commit comments

Comments
 (0)