summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/context/data/scite/lexers/scite-context-lexer-lua-longstring.lua
blob: 26bdb8dbccb0fccf9c24424fb5ab42677ee478a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
local lexer = lexer
local token = lexer.token
local P = lpeg.P

local stringlexer = { _NAME = "lua-longstring", _FILENAME = "scite-context-lexer-lua-longstring" }
local whitespace  = lexer.WHITESPACE
local context     = lexer.context

local space       = lexer.space
local nospace     = 1 - space

local p_spaces    = token(whitespace, space  ^1)
local p_string    = token("string",   nospace^1)

stringlexer._rules = {
    { "whitespace", p_spaces },
    { "string",     p_string },
}

stringlexer._tokenstyles = lexer.context.styleset

return stringlexer