Skip to content

Latest commit

 

History

History
18 lines (13 loc) · 366 Bytes

README.md

File metadata and controls

18 lines (13 loc) · 366 Bytes

LuaLexer

适用于Lua5.3.x的Lua词法解析器

Lua 示例代码

local lexer = require("lualexer")

-- Lua代码
local input = "local x = 42"

-- 进行词法解析
local tokens = lexer.tokenize(input)

-- 输出类型和值
for i, token in ipairs(tokens) do
    print(string.format("Token %d: Type = %s, Value = %s", i, token.type, token.value))
end