match a Lua string, comment, or expression by loose parsing in pure Lua
davidm/lua-balanced
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
master
Could not load branches
Nothing to show
Could not load tags
Nothing to show
{{ refName }}
default
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code
-
Clone
Use Git or checkout with SVN using the web URL.
Work fast with our official CLI. Learn more.
- Open with GitHub Desktop
- Download ZIP
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
== Description == This module can, for example, match a Lua string, Lua comment, or Lua expression. It is useful in particular for source filters or parsing Lua snippets embedded in another language. It is inspired by Damian Conway's Text::Balanced [2] in Perl. The unique feature of this implementation is that that it does not rigorously lex and parse the Lua grammar. It doesn't need to. It assumes during the parse that the Lua code is syntactically correct (which can be verified later using loadstring). By assuming this, extraction of delimited sequences is significantly simplified yet can still be robust, and it also supports supersets of the Lua grammar. The code, which is written entirely in Lua, is just under 200 lines of Lua code (compare to Yueliang used in MetaLua, where the lexer alone is a few hundred lines). == Project Page == Home page: http://lua-users.org/wiki/LuaBalanced == Author == (c) 2008-2011, David Manura, Licensed under the same terms as Lua (MIT license). == References == [1] http://lua-users.org/wiki/LuaBalanced [2] http://search.cpan.org/dist/Text-Balanced/lib/Text/Balanced.pm
About
match a Lua string, comment, or expression by loose parsing in pure Lua
Resources
Stars
Watchers
Forks
Packages 0
No packages published