aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--lexlua/antlr.lua2
-rw-r--r--lexlua/asm.lua4
-rw-r--r--lexlua/asp.lua2
-rw-r--r--lexlua/autoit.lua2
-rw-r--r--lexlua/awk.lua12
-rw-r--r--lexlua/bibtex.lua4
-rw-r--r--lexlua/chuck.lua6
-rw-r--r--lexlua/crystal.lua2
-rw-r--r--lexlua/css.lua14
-rw-r--r--lexlua/dart.lua2
-rw-r--r--lexlua/desktop.lua10
-rw-r--r--lexlua/django.lua2
-rw-r--r--lexlua/erlang.lua2
-rw-r--r--lexlua/fish.lua2
-rw-r--r--lexlua/gherkin.lua6
-rw-r--r--lexlua/gtkrc.lua2
-rw-r--r--lexlua/html.lua14
-rw-r--r--lexlua/icon.lua2
-rw-r--r--lexlua/inform.lua2
-rw-r--r--lexlua/java.lua2
-rw-r--r--lexlua/jsp.lua2
-rw-r--r--lexlua/latex.lua8
-rw-r--r--lexlua/lisp.lua2
-rw-r--r--lexlua/lua.lua9
-rw-r--r--lexlua/makefile.lua2
-rw-r--r--lexlua/markdown.lua6
-rw-r--r--lexlua/mediawiki.lua14
-rw-r--r--lexlua/moonscript.lua14
-rw-r--r--lexlua/php.lua2
-rw-r--r--lexlua/pico8.lua2
-rw-r--r--lexlua/props.lua2
-rw-r--r--lexlua/python.lua4
-rw-r--r--lexlua/rhtml.lua2
-rw-r--r--lexlua/ruby.lua2
-rw-r--r--lexlua/sass.lua2
-rw-r--r--lexlua/scheme.lua2
-rw-r--r--lexlua/tex.lua2
-rw-r--r--lexlua/texinfo.lua8
-rw-r--r--lexlua/toml.lua2
-rw-r--r--lexlua/txt2tags.lua10
-rw-r--r--lexlua/wsf.lua6
-rw-r--r--lexlua/xml.lua14
-rw-r--r--lexlua/xtend.lua4
43 files changed, 108 insertions, 107 deletions
diff --git a/lexlua/antlr.lua b/lexlua/antlr.lua
index 53cd2d57f..278122863 100644
--- a/lexlua/antlr.lua
+++ b/lexlua/antlr.lua
@@ -38,7 +38,7 @@ lex:add_rule('comment', token(lexer.COMMENT, line_comment + block_comment))
-- Actions.
lex:add_rule('action', token(lexer.OPERATOR, P('{')) *
token('action', (1 - P('}'))^0) * token(lexer.OPERATOR, P('}'))^-1)
-lex:add_style('action', lexer.STYLE_NOTHING)
+lex:add_style('action', lexer.styles.nothing)
-- Strings.
lex:add_rule('string', token(lexer.STRING, lexer.range("'", true)))
diff --git a/lexlua/asm.lua b/lexlua/asm.lua
index 12ebdf3cf..f2e80a3d0 100644
--- a/lexlua/asm.lua
+++ b/lexlua/asm.lua
@@ -280,7 +280,7 @@ lex:add_rule('instruction', token('instruction', word_match[[
hint_nop56 hint_nop57 hint_nop58 hint_nop59 hint_nop60 hint_nop61 hint_nop62
hint_nop63
]]))
-lex:add_style('instruction', lexer.STYLE_FUNCTION)
+lex:add_style('instruction', lexer.styles['function'])
-- Registers.
lex:add_rule('register', token('register', word_match[[
@@ -294,7 +294,7 @@ lex:add_rule('register', token('register', word_match[[
xmm9 xmm10 xmm11 xmm12 xmm13 xmm14 xmm15 ymm8 ymm9 ymm10 ymm11 ymm12 ymm13
ymm14 ymm15
]]))
-lex:add_style('register', lexer.STYLE_CONSTANT)
+lex:add_style('register', lexer.styles.constant)
-- Types.
local sizes = word_match[[
diff --git a/lexlua/asp.lua b/lexlua/asp.lua
index 0f5fb21ea..90ef15657 100644
--- a/lexlua/asp.lua
+++ b/lexlua/asp.lua
@@ -13,7 +13,7 @@ local vb = lexer.load('vb')
local vb_start_rule = token('asp_tag', '<%' * P('=')^-1)
local vb_end_rule = token('asp_tag', '%>')
lex:embed(vb, vb_start_rule, vb_end_rule)
-lex:add_style('asp_tag', lexer.STYLE_EMBEDDED)
+lex:add_style('asp_tag', lexer.styles.embedded)
-- Embedded VBScript.
local vbs = lexer.load('vbscript')
diff --git a/lexlua/autoit.lua b/lexlua/autoit.lua
index 3b6d3ae6a..856657904 100644
--- a/lexlua/autoit.lua
+++ b/lexlua/autoit.lua
@@ -116,7 +116,7 @@ lex:add_rule('string', token(lexer.STRING, dq_str + sq_str + inc))
-- Macros.
lex:add_rule('macro', token('macro', '@' * (lexer.alnum + '_')^1))
-lex:add_style('macro', lexer.STYLE_PREPROCESSOR)
+lex:add_style('macro', lexer.styles.preprocessor)
-- Variables.
lex:add_rule('variable', token(lexer.VARIABLE, '$' * (lexer.alnum + '_')^1))
diff --git a/lexlua/awk.lua b/lexlua/awk.lua
index a34730e1a..cfff1beaf 100644
--- a/lexlua/awk.lua
+++ b/lexlua/awk.lua
@@ -240,7 +240,7 @@ lex:add_rule('field', token('field', P('$') * S('$+-')^0 * (
lexer.word^1 * ('[' * P(scanFieldDelimiters))^-1 +
'"' * P(scanString) +
'/' * P(eatRegex) * '/')))
-lex:add_style('field', lexer.STYLE_LABEL)
+lex:add_style('field', lexer.styles.label)
-- Regular expressions.
-- Slash delimited regular expressions are preceded by most operators or
@@ -249,18 +249,18 @@ lex:add_style('field', lexer.STYLE_LABEL)
-- sequences like '\S', '\s' have special meanings with Gawk. Tokens that
-- contain them are displayed differently.
lex:add_rule('gawkRegex', token('gawkRegex', SLASH * P(scanGawkRegex)))
-lex:add_style('gawkRegex', lexer.STYLE_PREPROCESSOR .. {underlined = true})
+lex:add_style('gawkRegex', lexer.styles.preprocessor .. {underlined = true})
lex:add_rule('regex', token(lexer.REGEX, SLASH * P(scanRegex)))
-- Operators.
lex:add_rule('gawkOperator', token('gawkOperator', P("|&") + "@" + "**=" +
"**"))
-lex:add_style('gawkOperator', lexer.STYLE_OPERATOR .. {underlined = true})
+lex:add_style('gawkOperator', lexer.styles.operator .. {underlined = true})
lex:add_rule('operator', token(lexer.OPERATOR, S('!%&()*+,-/:;<=>?[\\]^{|}~')))
-- Numbers.
lex:add_rule('gawkNumber', token('gawkNumber', lexer.hex_num + lexer.oct_num))
-lex:add_style('gawkNumber', lexer.STYLE_NUMBER .. {underlined = true})
+lex:add_style('gawkNumber', lexer.styles.number .. {underlined = true})
lex:add_rule('number', token(lexer.NUMBER, float))
-- Keywords.
@@ -275,14 +275,14 @@ lex:add_rule('builtInVariable', token('builtInVariable', word_match[[
ARGC ARGV CONVFMT ENVIRON FILENAME FNR FS NF NR OFMT OFS ORS RLENGTH RS RSTART
SUBSEP
]]))
-lex:add_style('builtInVariable', lexer.STYLE_CONSTANT)
+lex:add_style('builtInVariable', lexer.styles.constant)
lex:add_rule('gawkBuiltInVariable', token('gawkBuiltInVariable', word_match[[
ARGIND BINMODE ERRNO FIELDWIDTHS FPAT FUNCTAB IGNORECASE LINT PREC PROCINFO
ROUNDMODE RT SYMTAB TEXTDOMAIN
]]))
lex:add_style(
- 'gawkBuiltInVariable', lexer.STYLE_CONSTANT .. {underlined = true})
+ 'gawkBuiltInVariable', lexer.styles.constant .. {underlined = true})
-- Functions.
lex:add_rule('function', token(lexer.FUNCTION, lexer.word * #P('(')))
diff --git a/lexlua/bibtex.lua b/lexlua/bibtex.lua
index 0eee5801d..edd1b659f 100644
--- a/lexlua/bibtex.lua
+++ b/lexlua/bibtex.lua
@@ -16,7 +16,7 @@ lex:add_rule('field', token('field', word_match[[
series address edition howpublished booktitle organization chapter school
institution type isbn issn affiliation issue keyword url
]]))
-lex:add_style('field', lexer.STYLE_CONSTANT)
+lex:add_style('field', lexer.styles.constant)
-- Identifiers.
lex:add_rule('identifier', token(lexer.IDENTIFIER, lexer.word))
@@ -37,7 +37,7 @@ local entry = token('entry', P('@') * word_match([[
book article booklet conference inbook incollection inproceedings manual
mastersthesis lambda misc phdthesis proceedings techreport unpublished
]], true))
-lex:add_style('entry', lexer.STYLE_PREPROCESSOR)
+lex:add_style('entry', lexer.styles.preprocessor)
local bibtex_start_rule = entry * ws^0 * token(lexer.OPERATOR, P('{'))
local bibtex_end_rule = token(lexer.OPERATOR, P('}'))
latex:embed(lex, bibtex_start_rule, bibtex_end_rule)
diff --git a/lexlua/chuck.lua b/lexlua/chuck.lua
index d3dfd2417..3726a1440 100644
--- a/lexlua/chuck.lua
+++ b/lexlua/chuck.lua
@@ -38,17 +38,17 @@ lex:add_rule('class', token(lexer.CLASS, word_match[[
-- Global ugens.
lex:add_rule('ugen', token('ugen', word_match[[dac adc blackhole]]))
-lex:add_style('ugen', lexer.STYLE_CONSTANT)
+lex:add_style('ugen', lexer.styles.constant)
-- Times.
lex:add_rule('time', token('time', word_match[[
samp ms second minute hour day week
]]))
-lex:add_style('time', lexer.STYLE_NUMBER)
+lex:add_style('time', lexer.styles.number)
-- Special special value.
lex:add_rule('now', token('now', P('now')))
-lex:add_style('now', lexer.STYLE_CONSTANT .. {bold = true})
+lex:add_style('now', lexer.styles.constant .. {bold = true})
-- Strings.
local sq_str = P('L')^-1 * lexer.range("'", true)
diff --git a/lexlua/crystal.lua b/lexlua/crystal.lua
index 85e111e90..797469b49 100644
--- a/lexlua/crystal.lua
+++ b/lexlua/crystal.lua
@@ -96,7 +96,7 @@ lex:add_rule('variable', token(lexer.VARIABLE, global_var + class_var +
lex:add_rule('symbol', token('symbol', ':' * P(function(input, index)
if input:sub(index - 2, index - 2) ~= ':' then return index end
end) * (word_char^1 + sq_str + dq_str)))
-lex:add_style('symbol', lexer.STYLE_CONSTANT)
+lex:add_style('symbol', lexer.styles.constant)
-- Operators.
lex:add_rule('operator', token(lexer.OPERATOR, S('!%^&*()[]{}-=+/|:;.,?<>~')))
diff --git a/lexlua/css.lua b/lexlua/css.lua
index c11833750..07061e223 100644
--- a/lexlua/css.lua
+++ b/lexlua/css.lua
@@ -44,7 +44,7 @@ lex:add_rule('property', token('property', word_match[[
transition transform box-shadow filter opacity resize word-break word-wrap
box-sizing animation text-overflow
]]))
-lex:add_style('property', lexer.STYLE_KEYWORD)
+lex:add_style('property', lexer.styles.keyword)
-- Values.
lex:add_rule('value', token('value', word_match[[
@@ -82,7 +82,7 @@ lex:add_rule('value', token('value', word_match[[
-- CSS 3.
flex row column ellipsis inline-block
]]))
-lex:add_style('value', lexer.STYLE_CONSTANT)
+lex:add_style('value', lexer.styles.constant)
-- Functions.
lex:add_rule('function', token(lexer.FUNCTION, word_match[[
@@ -121,7 +121,7 @@ lex:add_rule('color', token('color', word_match[[
steelblue tan teal thistle tomato transparent turquoise violet wheat white
whitesmoke yellow yellowgreen
]] + '#' * xdigit * xdigit * xdigit * (xdigit * xdigit * xdigit)^-1))
-lex:add_style('color', lexer.STYLE_NUMBER)
+lex:add_style('color', lexer.styles.number)
-- Identifiers.
local word = lexer.alpha * (lexer.alnum + S('_-'))^0
@@ -134,11 +134,11 @@ lex:add_rule('pseudoclass', ':' * token('pseudoclass', word_match[[
nth-last-child nth-last-of-type nth-of-type only-of-type only-child optional
out-of-range read-only read-write required root target valid visited
]]))
-lex:add_style('pseudoclass', lexer.STYLE_CONSTANT)
+lex:add_style('pseudoclass', lexer.styles.constant)
lex:add_rule('pseudoelement', '::' * token('pseudoelement', word_match[[
after before first-letter first-line selection
]]))
-lex:add_style('pseudoelement', lexer.STYLE_CONSTANT)
+lex:add_style('pseudoelement', lexer.styles.constant)
-- Strings.
local sq_str = lexer.range("'")
@@ -153,7 +153,7 @@ local unit = token('unit', word_match[[
ch cm deg dpcm dpi dppx em ex grad Hz in kHz mm ms pc pt px q rad rem s turn
vh vmax vmin vw
]])
-lex:add_style('unit', lexer.STYLE_NUMBER)
+lex:add_style('unit', lexer.styles.number)
lex:add_rule('number', token(lexer.NUMBER, lexer.digit^1) * unit^-1)
-- Operators.
@@ -163,7 +163,7 @@ lex:add_rule('operator', token(lexer.OPERATOR, S('~!#*>+=|.,:;()[]{}')))
lex:add_rule('at_rule', token('at_rule', P('@') * word_match[[
charset font-face media page import namespace keyframes
]]))
-lex:add_style('at_rule', lexer.STYLE_PREPROCESSOR)
+lex:add_style('at_rule', lexer.styles.preprocessor)
-- Fold points.
lex:add_fold_point(lexer.OPERATOR, '{', '}')
diff --git a/lexlua/dart.lua b/lexlua/dart.lua
index fca648485..74690feca 100644
--- a/lexlua/dart.lua
+++ b/lexlua/dart.lua
@@ -46,7 +46,7 @@ lex:add_rule('operator', token(lexer.OPERATOR, S('#?=!<>+-*$/%&|^~.,;()[]{}')))
-- Annotations.
lex:add_rule('annotation', token('annotation', '@' * lexer.word^1))
-lex:add_style('annotation', lexer.STYLE_PREPROCESSOR)
+lex:add_style('annotation', lexer.styles.preprocessor)
-- Fold points.
lex:add_fold_point(lexer.OPERATOR, '{', '}')
diff --git a/lexlua/desktop.lua b/lexlua/desktop.lua
index 8229d2c75..32716bd61 100644
--- a/lexlua/desktop.lua
+++ b/lexlua/desktop.lua
@@ -16,11 +16,11 @@ lex:add_rule('key', token('key', word_match[[
NotShowIn TryExec Exec Exec Path Terminal MimeType Categories StartupNotify
StartupWMClass URL
]]))
-lex:add_style('key', lexer.STYLE_KEYWORD)
+lex:add_style('key', lexer.styles.keyword)
-- Values.
lex:add_rule('value', token('value', word_match[[true false]]))
-lex:add_style('value', lexer.STYLE_CONSTANT)
+lex:add_style('value', lexer.styles.constant)
-- Identifiers.
local word = lexer.alpha * (lexer.alnum + S('_-'))^0
@@ -30,11 +30,11 @@ local bracketed = lexer.range('[', ']')
-- Group headers.
lex:add_rule('header', lexer.starts_line(token('header', bracketed)))
-lex:add_style('header', lexer.STYLE_LABEL)
+lex:add_style('header', lexer.styles.label)
-- Locales.
lex:add_rule('locale', token('locale', bracketed))
-lex:add_style('locale', lexer.STYLE_CLASS)
+lex:add_style('locale', lexer.styles.class)
-- Strings.
lex:add_rule('string', token(lexer.STRING, lexer.range('"')))
@@ -47,7 +47,7 @@ lex:add_rule('number', token(lexer.NUMBER, lexer.number))
-- Field codes.
lex:add_rule('code', lexer.token('code', P('%') * S('fFuUdDnNickvm')))
-lex:add_style('code', lexer.STYLE_VARIABLE)
+lex:add_style('code', lexer.styles.variable)
-- Operators.
lex:add_rule('operator', token(lexer.OPERATOR, S('=')))
diff --git a/lexlua/django.lua b/lexlua/django.lua
index 96a9b454b..e311825ef 100644
--- a/lexlua/django.lua
+++ b/lexlua/django.lua
@@ -45,7 +45,7 @@ html:modify_rule('comment', token(lexer.COMMENT, html_comment + django_comment))
local django_start_rule = token('django_tag', '{' * S('{%'))
local django_end_rule = token('django_tag', S('%}') * '}')
html:embed(lex, django_start_rule, django_end_rule)
-lex:add_style('django_tag', lexer.STYLE_EMBEDDED)
+lex:add_style('django_tag', lexer.styles.embedded)
-- Fold points.
lex:add_fold_point('django_tag', '{{', '}}')
diff --git a/lexlua/erlang.lua b/lexlua/erlang.lua
index 0d2a3b19b..f0b8d9f6e 100644
--- a/lexlua/erlang.lua
+++ b/lexlua/erlang.lua
@@ -53,7 +53,7 @@ lex:add_rule('directive', token('directive', '-' * word_match[[
author behaviour behavior compile copyright define doc else endif export file
ifdef ifndef import include include_lib module record spec type undef
]]))
-lex:add_style('directive', lexer.STYLE_PREPROCESSOR)
+lex:add_style('directive', lexer.styles.preprocessor)
-- Strings.
local sq_str = lexer.range("'", true)
diff --git a/lexlua/fish.lua b/lexlua/fish.lua
index 5ec829391..3cbd41c21 100644
--- a/lexlua/fish.lua
+++ b/lexlua/fish.lua
@@ -35,7 +35,7 @@ lex:add_rule('string', token(lexer.STRING, sq_str + dq_str))
-- Shebang.
lex:add_rule('shebang', token('shebang', lexer.to_eol('#!/')))
-lex:add_style('shebang', lexer.STYLE_LABEL)
+lex:add_style('shebang', lexer.styles.label)
-- Comments.
lex:add_rule('comment', token(lexer.COMMENT, lexer.to_eol('#')))
diff --git a/lexlua/gherkin.lua b/lexlua/gherkin.lua
index eedfe3436..66882bdaa 100644
--- a/lexlua/gherkin.lua
+++ b/lexlua/gherkin.lua
@@ -28,15 +28,15 @@ local number = token(lexer.NUMBER, lexer.number)
-- Tags.
lex:add_rule('tag', token('tag', '@' * lexer.word^0))
-lex:add_style('tag', lexer.STYLE_LABEL)
+lex:add_style('tag', lexer.styles.label)
-- Placeholders.
lex:add_rule('placeholder', token('placeholder',
lexer.range('<', '>', false, false, true)))
-lex:add_style('placeholder', lexer.STYLE_VARIABLE)
+lex:add_style('placeholder', lexer.styles.variable)
-- Examples.
lex:add_rule('example', token('example', lexer.to_eol('|')))
-lex:add_style('example', lexer.STYLE_NUMBER)
+lex:add_style('example', lexer.styles.number)
return lex
diff --git a/lexlua/gtkrc.lua b/lexlua/gtkrc.lua
index fbeaa86ba..477fa9d65 100644
--- a/lexlua/gtkrc.lua
+++ b/lexlua/gtkrc.lua
@@ -26,7 +26,7 @@ lex:add_rule('variable', token(lexer.VARIABLE, word_match[[
lex:add_rule('state', token('state', word_match[[
ACTIVE SELECTED NORMAL PRELIGHT INSENSITIVE TRUE FALSE
]]))
-lex:add_style('state', lexer.STYLE_CONSTANT)
+lex:add_style('state', lexer.styles.constant)
-- Functions.
lex:add_rule('function', token(lexer.FUNCTION, word_match[[
diff --git a/lexlua/html.lua b/lexlua/html.lua
index 5ce566750..787566949 100644
--- a/lexlua/html.lua
+++ b/lexlua/html.lua
@@ -17,7 +17,7 @@ lex:add_rule('comment', token(lexer.COMMENT, lexer.range('<!--', '-->')))
-- Doctype.
lex:add_rule('doctype', token('doctype',
lexer.range('<!' * word_match([[doctype]], true), '>')))
-lex:add_style('doctype', lexer.STYLE_COMMENT)
+lex:add_style('doctype', lexer.styles.comment)
-- Elements.
local single_element = token('single_element', '<' * P('/')^-1 * word_match([[
@@ -39,9 +39,9 @@ local unknown_element = token('unknown_element', '<' * P('/')^-1 *
(lexer.alnum + '-')^1)
local element = known_element + unknown_element
lex:add_rule('element', element)
-lex:add_style('single_element', lexer.STYLE_KEYWORD)
-lex:add_style('element', lexer.STYLE_KEYWORD)
-lex:add_style('unknown_element', lexer.STYLE_KEYWORD .. {italics = true})
+lex:add_style('single_element', lexer.styles.keyword)
+lex:add_style('element', lexer.styles.keyword)
+lex:add_style('unknown_element', lexer.styles.keyword .. {italics = true})
-- Closing tags.
local tag_close = token('element', P('/')^-1 * '>')
@@ -64,8 +64,8 @@ local known_attribute = token('attribute', word_match([[
local unknown_attribute = token('unknown_attribute', (lexer.alnum + '-')^1)
local attribute = (known_attribute + unknown_attribute) * #(lexer.space^0 * '=')
lex:add_rule('attribute', attribute)
-lex:add_style('attribute', lexer.STYLE_TYPE)
-lex:add_style('unknown_attribute', lexer.STYLE_TYPE .. {italics = true})
+lex:add_style('attribute', lexer.styles.type)
+lex:add_style('unknown_attribute', lexer.styles.type .. {italics = true})
-- TODO: performance is terrible on large files.
local in_tag = P(function(input, index)
@@ -92,7 +92,7 @@ lex:add_rule('number', #lexer.digit * lexer.last_char_includes('=') *
-- Entities.
lex:add_rule('entity', token('entity', '&' * (lexer.any - lexer.space - ';')^1 *
';'))
-lex:add_style('entity', lexer.STYLE_COMMENT)
+lex:add_style('entity', lexer.styles.comment)
-- Fold points.
local function disambiguate_lt(text, pos, line, s)
diff --git a/lexlua/icon.lua b/lexlua/icon.lua
index a850f03a1..3a8a75316 100644
--- a/lexlua/icon.lua
+++ b/lexlua/icon.lua
@@ -26,7 +26,7 @@ lex:add_rule('special_keyword', token('special_keyword', P('&') * word_match[[
lcase letters level line main null output phi pi pos progname random regions
source storage subject time trace ucase version
]]))
-lex:add_style('special_keyword', lexer.STYLE_TYPE)
+lex:add_style('special_keyword', lexer.styles.type)
-- Identifiers.
lex:add_rule('identifier', token(lexer.IDENTIFIER, lexer.word))
diff --git a/lexlua/inform.lua b/lexlua/inform.lua
index 2b6193a15..dc702cbc6 100644
--- a/lexlua/inform.lua
+++ b/lexlua/inform.lua
@@ -48,7 +48,7 @@ lex:add_rule('action', token('action', word_match[[
ThrowAt ThrownAt Tie Touch Transfer Turn Unlock VagueGo Verify Version Wait
Wake WakeOther Wave WaveHands Wear Yes
]]))
-lex:add_style('action', lexer.STYLE_VARIABLE)
+lex:add_style('action', lexer.styles.variable)
-- Identifiers.
lex:add_rule('identifier', token(lexer.IDENTIFIER, lexer.word))
diff --git a/lexlua/java.lua b/lexlua/java.lua
index ad83c5745..547cb5d0a 100644
--- a/lexlua/java.lua
+++ b/lexlua/java.lua
@@ -53,7 +53,7 @@ lex:add_rule('number', token(lexer.NUMBER, lexer.number * S('LlFfDd')^-1))
-- Annotations.
lex:add_rule('annotation', token('annotation', '@' * lexer.word))
-lex:add_style('annotation', lexer.STYLE_PREPROCESSOR)
+lex:add_style('annotation', lexer.styles.preprocessor)
-- Operators.
lex:add_rule('operator', token(lexer.OPERATOR, S('+-/*%<>!=^&|?~:;.()[]{}')))
diff --git a/lexlua/jsp.lua b/lexlua/jsp.lua
index 972065522..d3f2eaaa2 100644
--- a/lexlua/jsp.lua
+++ b/lexlua/jsp.lua
@@ -12,7 +12,7 @@ local java = lexer.load('java')
local java_start_rule = token('jsp_tag', '<%' * P('=')^-1)
local java_end_rule = token('jsp_tag', '%>')
lex:embed(java, java_start_rule, java_end_rule, true)
-lex:add_style('jsp_tag', lexer.STYLE_EMBEDDED)
+lex:add_style('jsp_tag', lexer.styles.embedded)
-- Fold points.
lex:add_fold_point('jsp_tag', '<%', '%>')
diff --git a/lexlua/latex.lua b/lexlua/latex.lua
index bb2f70823..3f18601f6 100644
--- a/lexlua/latex.lua
+++ b/lexlua/latex.lua
@@ -25,23 +25,23 @@ local math_word = word_match[[
local math_begin_end = (P('begin') + P('end')) * P(' ')^0 *
'{' * math_word * P('*')^-1 * '}'
lex:add_rule('math', token('math', '$' + '\\' * (S('[]()') + math_begin_end)))
-lex:add_style('math', lexer.STYLE_FUNCTION)
+lex:add_style('math', lexer.styles['function'])
-- LaTeX environments.
lex:add_rule('environment', token('environment', '\\' *
(P('begin') + P('end')) * P(' ')^0 * '{' * lexer.word * P('*')^-1 * '}'))
-lex:add_style('environment', lexer.STYLE_KEYWORD)
+lex:add_style('environment', lexer.styles.keyword)
-- Sections.
lex:add_rule('section', token('section', '\\' * word_match[[
part chapter section subsection subsubsection paragraph subparagraph
]] * P('*')^-1))
-lex:add_style('section', lexer.STYLE_CLASS)
+lex:add_style('section', lexer.styles.class)
-- Commands.
lex:add_rule('command', token('command', '\\' *
(lexer.alpha^1 + S('#$&~_^%{}'))))
-lex:add_style('command', lexer.STYLE_KEYWORD)
+lex:add_style('command', lexer.styles.keyword)
-- Operators.
lex:add_rule('operator', token(lexer.OPERATOR, S('&#{}[]')))
diff --git a/lexlua/lisp.lua b/lexlua/lisp.lua
index 88d6488f0..38c432130 100644
--- a/lexlua/lisp.lua
+++ b/lexlua/lisp.lua
@@ -49,7 +49,7 @@ lex:add_rule('number', token(lexer.NUMBER, P('-')^-1 * lexer.digit^1 *
-- Entities.
lex:add_rule('entity', token('entity', '&' * word))
-lex:add_style('entity', lexer.STYLE_VARIABLE)
+lex:add_style('entity', lexer.styles.variable)
-- Operators.
lex:add_rule('operator', token(lexer.OPERATOR, S('<>=*/+-`@%()')))
diff --git a/lexlua/lua.lua b/lexlua/lua.lua
index 7c5a83de8..74d6ef653 100644
--- a/lexlua/lua.lua
+++ b/lexlua/lua.lua
@@ -32,7 +32,8 @@ local deprecated_func = token('deprecated_function', word_match[[
getfenv loadstring module setfenv unpack
]])
lex:add_rule('function', func + deprecated_func)
-lex:add_style('deprecated_function', lexer.STYLE_FUNCTION .. {italics = true})
+lex:add_style(
+ 'deprecated_function', lexer.styles['function'] .. {italics = true})
-- Constants.
lex:add_rule('constant', token(lexer.CONSTANT, word_match[[
@@ -102,8 +103,8 @@ local deprecated_library = token('deprecated_library', word_match[[
debug.getfenv debug.setfenv
]])
lex:add_rule('library', library + deprecated_library)
-lex:add_style('library', lexer.STYLE_TYPE)
-lex:add_style('deprecated_library', lexer.STYLE_TYPE .. {italics = true})
+lex:add_style('library', lexer.styles.type)
+lex:add_style('deprecated_library', lexer.styles.type .. {italics = true})
-- Identifiers.
lex:add_rule('identifier', token(lexer.IDENTIFIER, lexer.word))
@@ -119,7 +120,7 @@ local sq_str = lexer.range("'")
local dq_str = lexer.range('"')
lex:add_rule('string', token(lexer.STRING, sq_str + dq_str) +
token('longstring', longstring))
-lex:add_style('longstring', lexer.STYLE_STRING)
+lex:add_style('longstring', lexer.styles.string)
-- Comments.
local line_comment = lexer.to_eol('--')
diff --git a/lexlua/makefile.lua b/lexlua/makefile.lua
index ee8f0ac59..3c9b41af2 100644
--- a/lexlua/makefile.lua
+++ b/lexlua/makefile.lua
@@ -30,7 +30,7 @@ local special_target = token(lexer.CONSTANT, word_match[[
local normal_target = token('target', (lexer.any - lexer.space - S(':#='))^1)
lex:add_rule('target', lexer.starts_line((special_target + normal_target) *
ws^0 * #(':' * -P('='))))
-lex:add_style('target', lexer.STYLE_LABEL)
+lex:add_style('target', lexer.styles.label)
-- Variables.
local word_char = lexer.any - lexer.space - S(':#=(){}')
diff --git a/lexlua/markdown.lua b/lexlua/markdown.lua
index 733c39fec..e49826e5a 100644
--- a/lexlua/markdown.lua
+++ b/lexlua/markdown.lua
@@ -28,7 +28,7 @@ lex:add_rule('blockquote', token(lexer.STRING,
lex:add_rule('list', token('list',
lexer.starts_line(S(' \t')^0 * (S('*+-') + R('09')^1 * '.')) * S(' \t')))
-lex:add_style('list', lexer.STYLE_CONSTANT)
+lex:add_style('list', lexer.styles.constant)
local hspace = S('\t\v\f\r ')
local blank_line = '\n' * hspace^0 * ('\n' + P(-1))
@@ -43,7 +43,7 @@ local code_inline = lpeg.Cmt(lpeg.C(P('`')^1), function(input, index, bt)
return (e or #input) + 1
end)
lex:add_rule('block_code', token('code', code_line + code_block + code_inline))
-lex:add_style('code', lexer.STYLE_EMBEDDED .. {eolfilled = true})
+lex:add_style('code', lexer.styles.embedded .. {eolfilled = true})
lex:add_rule('hr', token('hr', lpeg.Cmt(
lexer.starts_line(S(' \t')^0 * lpeg.C(S('*-_'))), function(input, index, c)
@@ -66,7 +66,7 @@ local ref_link_title = token(lexer.STRING, lexer.range('"', true, false) +
lexer.range("'", true, false) + lexer.range('(', ')', true))
lex:add_rule('link_label', ref_link_label * ws * ref_link_url *
(ws * ref_link_title)^-1)
-lex:add_style('link_label', lexer.STYLE_LABEL)
+lex:add_style('link_label', lexer.styles.label)
lex:add_style('link_url', {underlined = true})
local link_label = P('!')^-1 * lexer.range('[', ']', true)
diff --git a/lexlua/mediawiki.lua b/lexlua/mediawiki.lua
index 942e06612..3b4548d2c 100644
--- a/lexlua/mediawiki.lua
+++ b/lexlua/mediawiki.lua
@@ -20,15 +20,15 @@ local tag_attr = token('tag_attr', lexer.alpha^1 * lexer.space^0 *
(lexer.any - lexer.space - '>')^0)^-1)^0 * lexer.space^0)
local tag_end = token('tag_end', P('/')^-1 * '>')
lex:add_rule('tag', tag_start * tag_attr^0 * tag_end)
-lex:add_style('tag_start', lexer.STYLE_KEYWORD)
-lex:add_style('tag_attr', lexer.STYLE_TYPE)
-lex:add_style('tag_end', lexer.STYLE_KEYWORD)
+lex:add_style('tag_start', lexer.styles.keyword)
+lex:add_style('tag_attr', lexer.styles.type)
+lex:add_style('tag_end', lexer.styles.keyword)
-- Link
lex:add_rule('link', token(lexer.STRING, S('[]')))
lex:add_rule('internal_link', B('[[') *
token('link_article', (lexer.any - '|' - ']]')^1))
-lex:add_style('link_article', lexer.STYLE_STRING .. {underlined = true})
+lex:add_style('link_article', lexer.styles.string .. {underlined = true})
-- Templates and parser functions.
lex:add_rule('template', token(lexer.OPERATOR, S('{}')))
@@ -36,8 +36,8 @@ lex:add_rule('parser_func', B('{{') *
token('parser_func', P('#') * lexer.alpha^1 + lexer.upper^1 * ':'))
lex:add_rule('template_name', B('{{') *
token('template_name', (lexer.any - S('{}|'))^1))
-lex:add_style('parser_func', lexer.STYLE_FUNCTION)
-lex:add_style('template_name', lexer.STYLE_OPERATOR .. {underlined = true})
+lex:add_style('parser_func', lexer.styles['function'])
+lex:add_style('template_name', lexer.styles.operator .. {underlined = true})
-- Operators.
lex:add_rule('operator', token(lexer.OPERATOR, S('-=|#~!')))
@@ -48,6 +48,6 @@ lex:add_rule('behavior_switch', (B(lexer.space) + start_pat) *
token('behavior_switch', '__' *
(P('TOC') + 'FORCETOC' + 'NOTOC' + 'NOEDITSECTION' + 'NOCC' + 'NOINDEX') *
'__') * #lexer.space)
-lex:add_style('behavior_switch', lexer.STYLE_KEYWORD)
+lex:add_style('behavior_switch', lexer.styles.keyword)
return lex
diff --git a/lexlua/moonscript.lua b/lexlua/moonscript.lua
index d57cd55a9..c7c19834c 100644
--- a/lexlua/moonscript.lua
+++ b/lexlua/moonscript.lua
@@ -24,7 +24,7 @@ lex:add_rule('error', token(lexer.ERROR, word_match[[function end]]))
-- Self reference.
lex:add_rule('self_ref', token('self_ref', '@' * lexer.word + 'self'))
-lex:add_style('self_ref', lexer.STYLE_LABEL)
+lex:add_style('self_ref', lexer.styles.label)
-- Functions.
lex:add_rule('function', token(lexer.FUNCTION, word_match[[
@@ -99,15 +99,15 @@ lex:add_rule('library', token('library', word_match[[
-- Debug functions.
debug.upvalue
]]))
-lex:add_style('library', lexer.STYLE_TYPE)
+lex:add_style('library', lexer.styles.type)
-- Identifiers.
local identifier = token(lexer.IDENTIFIER, lexer.word)
local proper_ident = token('proper_ident', R('AZ') * lexer.word)
local tbl_key = token('tbl_key', lexer.word * ':' + ':' * lexer.word )
lex:add_rule('identifier', tbl_key + proper_ident + identifier)
-lex:add_style('proper_ident', lexer.STYLE_CLASS)
-lex:add_style('tbl_key', lexer.STYLE_REGEX)
+lex:add_style('proper_ident', lexer.styles.class)
+lex:add_style('tbl_key', lexer.styles.regex)
local longstring = lpeg.Cmt('[' * lpeg.C(P('=')^0) * '[',
function(input, index, eq)
@@ -120,7 +120,7 @@ local sq_str = lexer.range("'", false, false)
local dq_str = lexer.range('"', false, false)
lex:add_rule('string', token(lexer.STRING, sq_str + dq_str) +
token('longstring', longstring))
-lex:add_style('longstring', lexer.STYLE_STRING)
+lex:add_style('longstring', lexer.styles.string)
-- Comments.
local line_comment = lexer.to_eol('--')
@@ -132,11 +132,11 @@ lex:add_rule('number', token(lexer.NUMBER, lexer.number))
-- Function definition.
lex:add_rule('fndef', token('fndef', P('->') + '=>'))
-lex:add_style('fndef', lexer.STYLE_PREPROCESSOR)
+lex:add_style('fndef', lexer.styles.preprocessor)
-- Operators.
lex:add_rule('operator', token(lexer.OPERATOR, S('+-*!\\/%^#=<>;:,.')))
lex:add_rule('symbol', token('symbol', S('(){}[]')))
-lex:add_style('symbol', lexer.STYLE_EMBEDDED)
+lex:add_style('symbol', lexer.styles.embedded)
return lex
diff --git a/lexlua/php.lua b/lexlua/php.lua
index 257bc955d..05589d649 100644
--- a/lexlua/php.lua
+++ b/lexlua/php.lua
@@ -62,7 +62,7 @@ local html = lexer.load('html')
local php_start_rule = token('php_tag', '<?' * ('php' * lexer.space)^-1)
local php_end_rule = token('php_tag', '?>')
html:embed(lex, php_start_rule, php_end_rule)
-lex:add_style('php_tag', lexer.STYLE_EMBEDDED)
+lex:add_style('php_tag', lexer.styles.embedded)
-- Fold points.
lex:add_fold_point('php_tag', '<?', '?>')
diff --git a/lexlua/pico8.lua b/lexlua/pico8.lua
index c0061277c..dd398f862 100644
--- a/lexlua/pico8.lua
+++ b/lexlua/pico8.lua
@@ -34,6 +34,6 @@ local lua = lexer.load('lua')
local lua_start_rule = token('pico8_tag', '__lua__')
local lua_end_rule = token('pico8_tag', '__gfx__' )
lex:embed(lua, lua_start_rule, lua_end_rule)
-lex:add_style('pico8_tag', lexer.STYLE_EMBEDDED)
+lex:add_style('pico8_tag', lexer.styles.embedded)
return lex
diff --git a/lexlua/props.lua b/lexlua/props.lua
index ab0bde27b..f249fe6c4 100644
--- a/lexlua/props.lua
+++ b/lexlua/props.lua
@@ -13,7 +13,7 @@ lex:add_rule('whitespace', token(lexer.WHITESPACE, lexer.space^1))
-- Colors.
lex:add_rule('color', token('color', '#' * lexer.xdigit * lexer.xdigit *
lexer.xdigit * lexer.xdigit * lexer.xdigit * lexer.xdigit))
-lex:add_style('color', lexer.STYLE_NUMBER)
+lex:add_style('color', lexer.styles.number)
-- Comments.
lex:add_rule('comment', token(lexer.COMMENT, lexer.to_eol('#')))
diff --git a/lexlua/python.lua b/lexlua/python.lua
index 72e70d70e..4786e7a44 100644
--- a/lexlua/python.lua
+++ b/lexlua/python.lua
@@ -67,7 +67,7 @@ lex:add_rule('constant', token(lexer.CONSTANT, word_match[[
-- Self.
lex:add_rule('self', token('self', P('self')))
-lex:add_style('self', lexer.STYLE_TYPE)
+lex:add_style('self', lexer.styles.type)
-- Identifiers.
lex:add_rule('identifier', token(lexer.IDENTIFIER, lexer.word))
@@ -94,7 +94,7 @@ lex:add_rule('number', token(lexer.NUMBER, lexer.float + integer))
-- Decorators.
lex:add_rule('decorator', token('decorator', lexer.to_eol('@')))
-lex:add_style('decorator', lexer.STYLE_PREPROCESSOR)
+lex:add_style('decorator', lexer.styles.preprocessor)
-- Operators.
lex:add_rule('operator', token(lexer.OPERATOR, S('!%^&*()[]{}-=+/|:;.,?<>~`')))
diff --git a/lexlua/rhtml.lua b/lexlua/rhtml.lua
index f9decbba4..b3bedbfcb 100644
--- a/lexlua/rhtml.lua
+++ b/lexlua/rhtml.lua
@@ -12,7 +12,7 @@ local ruby = lexer.load('rails')
local ruby_start_rule = token('rhtml_tag', '<%' * P('=')^-1)
local ruby_end_rule = token('rhtml_tag', '%>')
lex:embed(ruby, ruby_start_rule, ruby_end_rule)
-lex:add_style('rhtml_tag', lexer.STYLE_EMBEDDED)
+lex:add_style('rhtml_tag', lexer.styles.embedded)
-- Fold points.
lex:add_fold_point('rhtml_tag', '<%', '%>')
diff --git a/lexlua/ruby.lua b/lexlua/ruby.lua
index e25ca6000..c05747c75 100644
--- a/lexlua/ruby.lua
+++ b/lexlua/ruby.lua
@@ -101,7 +101,7 @@ lex:add_rule('variable', token(lexer.VARIABLE, global_var + class_var +
lex:add_rule('symbol', token('symbol', ':' * P(function(input, index)
if input:sub(index - 2, index - 2) ~= ':' then return index end
end) * (word_char^1 + sq_str + dq_str)))
-lex:add_style('symbol', lexer.STYLE_CONSTANT)
+lex:add_style('symbol', lexer.styles.constant)
-- Operators.
lex:add_rule('operator', token(lexer.OPERATOR, S('!%^&*()[]{}-=+/|:;.,?<>~')))
diff --git a/lexlua/sass.lua b/lexlua/sass.lua
index 02dcf75c3..e4faf1cc3 100644
--- a/lexlua/sass.lua
+++ b/lexlua/sass.lua
@@ -16,7 +16,7 @@ lex:add_rule('variable', token(lexer.VARIABLE, '$' * (lexer.alnum + S('_-'))^1))
-- Mixins.
lex:add_rule('mixin', token('mixin', P('@') * lexer.word))
-lex:add_style('mixin', lexer.STYLE_FUNCTION)
+lex:add_style('mixin', lexer.styles['function'])
-- Fold points.
lex:add_fold_point(lexer.COMMENT, '//', lexer.fold_line_comments('//'))
diff --git a/lexlua/scheme.lua b/lexlua/scheme.lua
index 326f52cf5..a03e82d61 100644
--- a/lexlua/scheme.lua
+++ b/lexlua/scheme.lua
@@ -70,7 +70,7 @@ lex:add_rule('operator', token(lexer.OPERATOR, S('<>=*/+-`@%:()')))
-- Entity.
lex:add_rule('entity', token('entity', '&' * word))
-lex:add_style('entity', lexer.STYLE_VARIABLE)
+lex:add_style('entity', lexer.styles.variable)
-- Fold points.
lex:add_fold_point(lexer.OPERATOR, '(', ')')
diff --git a/lexlua/tex.lua b/lexlua/tex.lua
index 8c9e76860..d54d3c931 100644
--- a/lexlua/tex.lua
+++ b/lexlua/tex.lua
@@ -17,7 +17,7 @@ lex:add_rule('comment', token(lexer.COMMENT, lexer.to_eol('%')))
-- TeX environments.
lex:add_rule('environment', token('environment', '\\' * (P('begin') + 'end') *
lexer.word))
-lex:add_style('environment', lexer.STYLE_KEYWORD)
+lex:add_style('environment', lexer.styles.keyword)
-- Commands.
lex:add_rule('command', token(lexer.KEYWORD, '\\' * (lexer.alpha^1 +
diff --git a/lexlua/texinfo.lua b/lexlua/texinfo.lua
index a5a7148cb..f7479fa5d 100644
--- a/lexlua/texinfo.lua
+++ b/lexlua/texinfo.lua
@@ -80,7 +80,7 @@ local directives_base = word_match([[
]], true)
lex:add_rule('directive', token('directives', ('@end' * lexer.space^1 + '@') *
directives_base))
-lex:add_style('directives', lexer.STYLE_FUNCTION)
+lex:add_style('directives', lexer.styles['function'])
-- Chapters.
local chapters_base = word_match([[
@@ -104,7 +104,7 @@ local chapters_base = word_match([[
]], true)
lex:add_rule('chapter', token('chapters', ('@end' * lexer.space^1 + '@') *
chapters_base))
-lex:add_style('chapters', lexer.STYLE_CLASS)
+lex:add_style('chapters', lexer.styles.class)
-- Common keywords.
local keyword_base = word_match([[
@@ -182,11 +182,11 @@ local nested_braces = lexer.range('{', '}', false, false, true)
-- Italics
lex:add_rule('emph', token('emph', '@emph' * nested_braces))
-lex:add_style('emph', lexer.STYLE_STRING .. {italics = true})
+lex:add_style('emph', lexer.styles.string .. {italics = true})
-- Bold
lex:add_rule('strong', token('strong', '@strong' * nested_braces))
-lex:add_style('strong', lexer.STYLE_STRING .. {bold = true})
+lex:add_style('strong', lexer.styles.string .. {bold = true})
-- Identifiers
lex:add_rule('identifier', token(lexer.IDENTIFIER, lexer.word))
diff --git a/lexlua/toml.lua b/lexlua/toml.lua
index e96860e44..0c659b549 100644
--- a/lexlua/toml.lua
+++ b/lexlua/toml.lua
@@ -44,7 +44,7 @@ local time = hours * ':' * minutes * ':' * seconds * fraction^-1
local T = S(' \t')^1 + S('tT')
local zone = 'Z' + S(' \t')^0 * S('-+') * hours * (':' * minutes)^-1
lex:add_rule('datetime', token('timestamp', date * (T * time * zone^-1)))
-lex:add_style('timestamp', lexer.STYLE_NUMBER)
+lex:add_style('timestamp', lexer.styles.number)
-- Numbers.
lex:add_rule('number', token(lexer.NUMBER, lexer.number))
diff --git a/lexlua/txt2tags.lua b/lexlua/txt2tags.lua
index 9a7b753e3..06b407928 100644
--- a/lexlua/txt2tags.lua
+++ b/lexlua/txt2tags.lua
@@ -126,25 +126,25 @@ local font_size =
for n = 5, 1, -1 do
lex:add_style('h' .. n, {fore = lexer.colors.red, size = font_size + (6 - n)})
end
-lex:add_style('header_label', lexer.STYLE_LABEL)
+lex:add_style('header_label', lexer.styles.label)
lex:add_style('email', {underlined = true})
lex:add_style('host', {underlined = true})
lex:add_style('url', {underlined = true})
-lex:add_style('address_label', lexer.STYLE_LABEL)
+lex:add_style('address_label', lexer.styles.label)
lex:add_style('address', {underlined = true})
lex:add_style('image', {fore = lexer.colors.green})
lex:add_style('image_link', {underlined = true})
-lex:add_style('macro', lexer.STYLE_PREPROCESSOR)
+lex:add_style('macro', lexer.styles.preprocessor)
lex:add_style('bold', {bold = true})
lex:add_style('italic', {italics = true})
lex:add_style('underline', {underlined = true})
lex:add_style('strike', {italics = true}) -- a strike style is not available
lex:add_style('mono', {font = 'mono'})
lex:add_style('raw', {back = lexer.colors.grey})
-lex:add_style('tagged', lexer.STYLE_EMBEDDED)
+lex:add_style('tagged', lexer.styles.embedded)
lex:add_style('verbatim_area', {font = 'mono'}) -- in consistency with mono
lex:add_style('raw_area', {back = lexer.colors.grey}) -- in consistency with raw
-lex:add_style('tagged_area', lexer.STYLE_EMBEDDED) -- in consistency with tagged
+lex:add_style('tagged_area', lexer.styles.embedded) -- in consistency with tagged
lex:add_style('table_sep', {fore = lexer.colors.green})
lex:add_style('header_cell_content', {fore = lexer.colors.green})
diff --git a/lexlua/wsf.lua b/lexlua/wsf.lua
index dfa14b1eb..9c903349c 100644
--- a/lexlua/wsf.lua
+++ b/lexlua/wsf.lua
@@ -22,7 +22,7 @@ local identifier = (alpha + S('_-:.?')) * word_char^0
-- Elements.
local element = token('element', '<' * P('/')^-1 * identifier)
lex:add_rule('element', element)
-lex:add_style('element', lexer.STYLE_KEYWORD)
+lex:add_style('element', lexer.styles.keyword)
-- Closing tags.
local tag_close = token('element', P('/')^-1 * '>')
@@ -31,7 +31,7 @@ lex:add_rule('tag_close', tag_close)
-- Attributes.
local attribute = token('attribute', identifier) * #(lexer.space^0 * '=')
lex:add_rule('attribute', attribute)
-lex:add_style('attribute', lexer.STYLE_TYPE)
+lex:add_style('attribute', lexer.styles.type)
local in_tag = P(function(input, index)
local before = input:sub(1, index - 1)
@@ -60,7 +60,7 @@ lex:add_rule('number', #lexer.digit * lexer.last_char_includes('=') *
lex:add_rule('entity', token('entity', '&' * word_match[[
lt gt amp apos quot
]] * ';'))
-lex:add_style('entity', lexer.STYLE_OPERATOR)
+lex:add_style('entity', lexer.styles.operator)
-- Fold points.
local function disambiguate_lt(text, pos, line, s)
diff --git a/lexlua/xml.lua b/lexlua/xml.lua
index 3acee7d22..5b1e58128 100644
--- a/lexlua/xml.lua
+++ b/lexlua/xml.lua
@@ -14,7 +14,7 @@ lex:add_rule('whitespace', ws)
-- Comments and CDATA.
lex:add_rule('comment', token(lexer.COMMENT, lexer.range('<!--', '-->')))
lex:add_rule('cdata', token('cdata', lexer.range('<![CDATA[', ']]>')))
-lex:add_style('cdata', lexer.STYLE_COMMENT)
+lex:add_style('cdata', lexer.styles.comment)
local alpha = R('az', 'AZ', '\127\255')
local word_char = lexer.alnum + S('_-:.??')
@@ -24,19 +24,19 @@ local identifier = (alpha + S('_-:.?')) * word_char^0
lex:add_rule('doctype', token('doctype', P('<!DOCTYPE')) * ws *
token('doctype', identifier) * (ws * identifier)^-1 * (1 - P('>'))^0 *
token('doctype', '>'))
-lex:add_style('doctype', lexer.STYLE_COMMENT)
+lex:add_style('doctype', lexer.styles.comment)
-- Processing instructions.
lex:add_rule('proc_insn', token('proc_insn', P('<?') * (1 - P('?>'))^0 *
P('?>')^-1))
-lex:add_style('proc_insn', lexer.STYLE_COMMENT)
+lex:add_style('proc_insn', lexer.styles.comment)
-- Elements.
local namespace = token(lexer.OPERATOR, ':') * token('namespace', identifier)
lex:add_rule('element', token('element', '<' * P('/')^-1 * identifier) *
namespace^-1)
-lex:add_style('element', lexer.STYLE_KEYWORD)
-lex:add_style('namespace', lexer.STYLE_CLASS)
+lex:add_style('element', lexer.styles.keyword)
+lex:add_style('namespace', lexer.styles.class)
-- Closing tags.
lex:add_rule('close_tag', token('element', P('/')^-1 * '>'))
@@ -44,7 +44,7 @@ lex:add_rule('close_tag', token('element', P('/')^-1 * '>'))
-- Attributes.
lex:add_rule('attribute', token('attribute', identifier) * namespace^-1 *
#(lexer.space^0 * '='))
-lex:add_style('attribute', lexer.STYLE_TYPE)
+lex:add_style('attribute', lexer.styles.type)
-- TODO: performance is terrible on large files.
local in_tag = P(function(input, index)
@@ -72,7 +72,7 @@ lex:add_rule('number', #lexer.digit * lexer.last_char_includes('=') *
lex:add_rule('entity', token('entity', '&' * word_match[[
lt gt amp apos quot
]] * ';'))
-lex:add_style('entity', lexer.STYLE_OPERATOR)
+lex:add_style('entity', lexer.styles.operator)
-- Fold Points.
local function disambiguate_lt(text, pos, line, s)
diff --git a/lexlua/xtend.lua b/lexlua/xtend.lua
index c54bc137d..f0d3a56b1 100644
--- a/lexlua/xtend.lua
+++ b/lexlua/xtend.lua
@@ -42,7 +42,7 @@ lex:add_rule('identifier', token(lexer.IDENTIFIER, lexer.word))
-- Templates.
lex:add_rule('template', token('template', lexer.range("'''")))
-lex:add_style('template', lexer.STYLE_EMBEDDED)
+lex:add_style('template', lexer.styles.embedded)
-- Strings.
local sq_str = lexer.range("'", true)
@@ -73,7 +73,7 @@ lex:add_rule('number', token(lexer.NUMBER, float + hex + dec))
-- Annotations.
lex:add_rule('annotation', token('annotation', '@' * lexer.word))
-lex:add_style('annotation', lexer.STYLE_PREPROCESSOR)
+lex:add_style('annotation', lexer.styles.preprocessor)
-- Operators.
lex:add_rule('operator', token(lexer.OPERATOR, S('+-/*%<>!=^&|?~:;.()[]{}#')))