Skip to content

dingyi222666/lua-parser

Folders and files

NameName
Last commit message
Last commit date
Sep 19, 2024
Sep 19, 2024
Dec 4, 2024
Jan 24, 2024
Jan 26, 2024
Sep 19, 2024
Dec 4, 2024
Jan 24, 2024
Feb 1, 2023
Feb 1, 2023
Jan 26, 2024

Repository files navigation

lua-parser

work in progress

A Lua 5.3 Lexer & Parser written in pure Kotlin.

Features

  • Kotlin Multiplatform support (JVM / JS / Native)
  • Parse source to AST
  • Transform AST to source code
  • Semantic analysis. Provide type information (Work in progress)

Usage

  • Add the dependency to your gradle file
implementation("io.github.dingyi222666:luaparser:1.0.3")

Ok. Use it like this:

val lexer = LuaLexer("print('hello world')")
val parser = LuaParser()

val root = parser.parse(lexer)

println(AST2Lua().asCode(root))

More usage coming soon.

Special thanks

GavinHigham/lpil53

fstirlitz/luaparse

Rosemose/sora-editor