uglify/llex.lua

branch
lua5.2
changeset 99
2b6416334a25
parent 85
347ac1733354
equal deleted inserted replaced
98:61085789b12b 99:2b6416334a25
25 -- * Please read technotes.txt for more technical details. 25 -- * Please read technotes.txt for more technical details.
26 ----------------------------------------------------------------------]] 26 ----------------------------------------------------------------------]]
27 27
28 local base = _G 28 local base = _G
29 local string = require "string" 29 local string = require "string"
30 module "llex" 30 --module "llex"
31 31
32 local find = string.find 32 local find = string.find
33 local match = string.match 33 local match = string.match
34 local sub = string.sub 34 local sub = string.sub
35 35
45 end 45 end
46 46
47 -- NOTE: see init() for module variables (externally visible): 47 -- NOTE: see init() for module variables (externally visible):
48 -- tok, seminfo, tokln 48 -- tok, seminfo, tokln
49 49
50 local z, -- source stream 50 local z = '', -- source
51 sourceid, -- name of source 51 sourceid = '', -- name of source
52 I, -- position of lexer 52 I = 1, -- lexer's position in source
53 buff, -- buffer for strings 53 buff = '',
54 ln -- line number 54 ln = 1, -- line number
55 tok = {}, -- lexed token list*
56 seminfo = {}, -- lexed semantic information list*
57 tokln = {}, -- line numbers for messages*
55 58
56 ---------------------------------------------------------------------- 59 ----------------------------------------------------------------------
57 -- add information to token listing 60 -- add information to token listing
58 ---------------------------------------------------------------------- 61 ----------------------------------------------------------------------
59 62
350 ---------------------------------------------------------------- 353 ----------------------------------------------------------------
351 end--while inner 354 end--while inner
352 end--while outer 355 end--while outer
353 end 356 end
354 357
355 return _M 358 return {
359 init = init,
360 llex = llex
361 }

mercurial