/metalualib/mlp_lexer.lua
Lua | 32 lines | 12 code | 6 blank | 14 comment | 1 complexity | 6a83e7cd06017fee1351cc39e64ca625 MD5 | raw file
Possible License(s): ISC
1---------------------------------------------------------------------- 2-- Metalua: $Id: mll.lua,v 1.3 2006/11/15 09:07:50 fab13n Exp $ 3-- 4-- Summary: Source file lexer. ~~Currently only works on strings. 5-- Some API refactoring is needed. 6-- 7---------------------------------------------------------------------- 8-- 9-- Copyright (c) 2006-2007, Fabien Fleutot <metalua@gmail.com>. 10-- 11-- This software is released under the MIT Licence, see licence.txt 12-- for details. 13-- 14---------------------------------------------------------------------- 15 16module ("mlp", package.seeall) 17 18require "lexer" 19 20local mlp_lexer = lexer.lexer:clone() 21 22local keywords = { 23 "and", "break", "do", "else", "elseif", 24 "end", "false", "for", "function", "if", 25 "in", "local", "nil", "not", "or", "repeat", 26 "return", "then", "true", "until", "while", 27 "...", "..", "==", ">=", "<=", "~=", 28 "+{", "-{" } 29 30for w in values(keywords) do mlp_lexer:add(w) end 31 32_M.lexer = mlp_lexer