1 --------------------------------------------------------------------------------
2 -- Copyright (c) 2006-2014 Fabien Fleutot and others.
4 -- All rights reserved.
6 -- This program and the accompanying materials are made available
7 -- under the terms of the Eclipse Public License v1.0 which
8 -- accompanies this distribution, and is available at
9 -- http://www.eclipse.org/legal/epl-v10.html
11 -- This program and the accompanying materials are also made available
12 -- under the terms of the MIT public license which accompanies this
13 -- distribution, and is available at http://www.lua.org/license.html
16 -- Fabien Fleutot - API and implementation
18 --------------------------------------------------------------------------------
20 ----------------------------------------------------------------------
21 -- Generate a new lua-specific lexer, derived from the generic lexer.
22 ----------------------------------------------------------------------
24 local generic_lexer = require 'metalua.grammar.lexer'
27 local lexer = generic_lexer.lexer :clone()
30 "and", "break", "do", "else", "elseif",
31 "end", "false", "for", "function",
34 "in", "local", "nil", "not", "or", "repeat",
35 "return", "then", "true", "until", "while",
36 "...", "..", "==", ">=", "<=", "~=",
38 "+{", "-{" } -- Metalua
40 for _, w in ipairs(keywords) do lexer :add (w) end