Skip to content

LPeg extension for the Defold game engine.

License

Notifications You must be signed in to change notification settings

astrochili/defold-lpeg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LPeg for Defold

LPeg for Defold

LPeg extension for the Defold game engine. LPeg is a pattern-matching library by Roberto Ierusalimschy for Lua.

The extension includes source code of LPeg 1.0.2 (MIT Licence).

Installation

Add the link to the latest release zip-archive as a library dependency in the Defold project configuration.

Usage

All operations are accessible through the global variable lpeg.

local P = lpeg.P 

local pattern = P'a' * P'b' ^ 0
local result = lpeg.match(pattern, 'abbc')

print(result) --> 4

Narrator

This library is used by Narrator to parse the Ink language. You can check how its parser works here.