aboutsummaryrefslogtreecommitdiff
path: root/lua/lexers/elixir.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/lexers/elixir.lua')
-rw-r--r--lua/lexers/elixir.lua28
1 files changed, 14 insertions, 14 deletions
diff --git a/lua/lexers/elixir.lua b/lua/lexers/elixir.lua
index 0215bf0..8c83a09 100644
--- a/lua/lexers/elixir.lua
+++ b/lua/lexers/elixir.lua
@@ -33,9 +33,9 @@ local sigil28 = '~' * S('crsw') * lexer.range("'")
local sigil29 = '~' * S('crsw') * lexer.range('"""')
local sigil20 = '~' * S('crsw') * lexer.range("'''")
local sigil_token = token(lexer.REGEX,
- sigil10 + sigil19 + sigil11 + sigil12 + sigil13 + sigil14 + sigil15 + sigil16 + sigil17 + sigil18 +
- sigil20 + sigil29 + sigil21 + sigil22 + sigil23 + sigil24 + sigil25 + sigil26 + sigil27 +
- sigil28)
+ sigil10 + sigil19 + sigil11 + sigil12 + sigil13 + sigil14 + sigil15 + sigil16 + sigil17 + sigil18 +
+ sigil20 + sigil29 + sigil21 + sigil22 + sigil23 + sigil24 + sigil25 + sigil26 + sigil27 +
+ sigil28)
local sigiladdon_token = token(lexer.EMBEDDED, lexer.alpha^0)
lex:add_rule('sigil', sigil_token * sigiladdon_token)
@@ -55,31 +55,31 @@ lex:add_rule('comment', token(lexer.COMMENT, lexer.to_eol('#', true)))
-- Attributes.
lex:add_rule('attribute', token(lexer.LABEL, B(1 - (lexer.alnum + '_')) * '@' * lexer.alpha *
- (lexer.alnum + '_')^0))
+ (lexer.alnum + '_')^0))
-- Booleans.
lex:add_rule('boolean', token(lexer.NUMBER, P(':')^-1 * word_match('true false nil')))
-- Functions.
lex:add_rule('function', token(lexer.FUNCTION, word_match{
- 'defstruct', 'defrecordp', 'defrecord', 'defprotocol', 'defp', 'defoverridable', 'defmodule',
- 'defmacrop', 'defmacro', 'defimpl', 'defexception', 'defdelegate', 'defcallback', 'def'
+ 'defstruct', 'defrecordp', 'defrecord', 'defprotocol', 'defp', 'defoverridable', 'defmodule',
+ 'defmacrop', 'defmacro', 'defimpl', 'defexception', 'defdelegate', 'defcallback', 'def'
}))
-- Keywords.
lex:add_rule('keyword', token(lexer.KEYWORD, word_match{
- 'is_atom', 'is_binary', 'is_bitstring', 'is_boolean', 'is_float', 'is_function', 'is_integer',
- 'is_list', 'is_map', 'is_number', 'is_pid', 'is_port', 'is_record', 'is_reference', 'is_tuple',
- 'is_exception', 'case', 'when', 'cond', 'for', 'if', 'unless', 'try', 'receive', 'send', 'exit',
- 'raise', 'throw', 'after', 'rescue', 'catch', 'else', 'do', 'end', 'quote', 'unquote', 'super',
- 'import', 'require', 'alias', 'use', 'self', 'with', 'fn'
+ 'is_atom', 'is_binary', 'is_bitstring', 'is_boolean', 'is_float', 'is_function', 'is_integer',
+ 'is_list', 'is_map', 'is_number', 'is_pid', 'is_port', 'is_record', 'is_reference', 'is_tuple',
+ 'is_exception', 'case', 'when', 'cond', 'for', 'if', 'unless', 'try', 'receive', 'send', 'exit',
+ 'raise', 'throw', 'after', 'rescue', 'catch', 'else', 'do', 'end', 'quote', 'unquote', 'super',
+ 'import', 'require', 'alias', 'use', 'self', 'with', 'fn'
}))
-- Operators
local operator1 = word_match('and or not when xor in')
local operator2 = P('!==') + '!=' + '!' + '=~' + '===' + '==' + '=' + '<<<' + '<<' + '<=' + '<-' +
- '<' + '>>>' + '>>' + '>=' + '>' + '->' + '--' + '-' + '++' + '+' + '&&&' + '&&' + '&' + '|||' +
- '||' + '|>' + '|' + '..' + '.' + '^^^' + '^' + '\\\\' + '::' + '*' + '/' + '~~~' + '@'
+ '<' + '>>>' + '>>' + '>=' + '>' + '->' + '--' + '-' + '++' + '+' + '&&&' + '&&' + '&' + '|||' +
+ '||' + '|>' + '|' + '..' + '.' + '^^^' + '^' + '\\\\' + '::' + '*' + '/' + '~~~' + '@'
lex:add_rule('operator', token(lexer.OPERATOR, operator1 + operator2))
-- Identifiers
@@ -92,7 +92,7 @@ local oct = '0o' * lpeg.R('07')^1
local integer = bin + lexer.hex_num + oct + dec
local float = lexer.digit^1 * '.' * lexer.digit^1 * S('eE') * (S('+-')^-1 * lexer.digit^1)^-1
lex:add_rule('number',
- B(1 - (lexer.alpha + '_')) * S('+-')^-1 * token(lexer.NUMBER, float + integer))
+ B(1 - (lexer.alpha + '_')) * S('+-')^-1 * token(lexer.NUMBER, float + integer))
lexer.property['scintillua.comment'] = '#'