/metalualib/mlp_lexer.lua
http://github.com/davidm/lua-inspect · Lua · 32 lines · 12 code · 6 blank · 14 comment · 1 complexity · 6a83e7cd06017fee1351cc39e64ca625 MD5 · raw file
- ----------------------------------------------------------------------
- -- Metalua: $Id: mll.lua,v 1.3 2006/11/15 09:07:50 fab13n Exp $
- --
- -- Summary: Source file lexer. ~~Currently only works on strings.
- -- Some API refactoring is needed.
- --
- ----------------------------------------------------------------------
- --
- -- Copyright (c) 2006-2007, Fabien Fleutot <metalua@gmail.com>.
- --
- -- This software is released under the MIT Licence, see licence.txt
- -- for details.
- --
- ----------------------------------------------------------------------
- module ("mlp", package.seeall)
- require "lexer"
- local mlp_lexer = lexer.lexer:clone()
- local keywords = {
- "and", "break", "do", "else", "elseif",
- "end", "false", "for", "function", "if",
- "in", "local", "nil", "not", "or", "repeat",
- "return", "then", "true", "until", "while",
- "...", "..", "==", ">=", "<=", "~=",
- "+{", "-{" }
-
- for w in values(keywords) do mlp_lexer:add(w) end
- _M.lexer = mlp_lexer