aboutsummaryrefslogtreecommitdiff
path: root/lua/lexers/pony.lua
diff options
context:
space:
mode:
authororbitalquark <70453897+orbitalquark@users.noreply.github.com>2024-09-18 14:30:49 -0400
committerRandy Palamar <randy@rnpnr.xyz>2025-01-04 12:29:07 -0700
commitc1f4d3f68787fa2ae964c468d28a84df37319b28 (patch)
treedcd62bd74f8f9fd786cba6a0c248fb388d5244a8 /lua/lexers/pony.lua
parentcc18cea14d1f836abcebb84a96f5029431474255 (diff)
downloadvis-c1f4d3f68787fa2ae964c468d28a84df37319b28.tar.gz
vis-c1f4d3f68787fa2ae964c468d28a84df37319b28.tar.xz
lexers: switch to tabs for indentation
Diffstat (limited to 'lua/lexers/pony.lua')
-rw-r--r--lua/lexers/pony.lua44
1 files changed, 22 insertions, 22 deletions
diff --git a/lua/lexers/pony.lua b/lua/lexers/pony.lua
index 9782db1..fbe6d09 100644
--- a/lua/lexers/pony.lua
+++ b/lua/lexers/pony.lua
@@ -22,24 +22,24 @@ lex:add_rule('annotation', annotation)
-- Functions.
-- Highlight functions with syntax sugar at declaration.
lex:add_rule('function',
- token(lexer.KEYWORD, word_match('fun new be')) * ws^-1 * annotation^-1 * ws^-1 * capability^-1 *
- ws^-1 * token(lexer.FUNCTION, word_match{
- 'create', 'dispose', '_final', 'apply', 'update', 'add', 'sub', 'mul', 'div', 'mod',
- 'add_unsafe', 'sub_unsafe', 'mul_unsafe', 'div_unsafe', 'mod_unsafe', 'shl', 'shr',
- 'shl_unsafe', 'shr_unsafe', 'op_and', 'op_or', 'op_xor', 'eq', 'ne', 'lt', 'le', 'ge', 'gt',
- 'eq_unsafe', 'ne_unsafe', 'lt_unsafe', 'le_unsafe', 'ge_unsafe', 'gt_unsafe', 'neg',
- 'neg_unsafe', 'op_not', --
- 'has_next', 'next', --
- '_serialise_space', '_serialise', '_deserialise'
- }))
+ token(lexer.KEYWORD, word_match('fun new be')) * ws^-1 * annotation^-1 * ws^-1 * capability^-1 *
+ ws^-1 * token(lexer.FUNCTION, word_match{
+ 'create', 'dispose', '_final', 'apply', 'update', 'add', 'sub', 'mul', 'div', 'mod',
+ 'add_unsafe', 'sub_unsafe', 'mul_unsafe', 'div_unsafe', 'mod_unsafe', 'shl', 'shr',
+ 'shl_unsafe', 'shr_unsafe', 'op_and', 'op_or', 'op_xor', 'eq', 'ne', 'lt', 'le', 'ge', 'gt',
+ 'eq_unsafe', 'ne_unsafe', 'lt_unsafe', 'le_unsafe', 'ge_unsafe', 'gt_unsafe', 'neg',
+ 'neg_unsafe', 'op_not', --
+ 'has_next', 'next', --
+ '_serialise_space', '_serialise', '_deserialise'
+ }))
-- Keywords.
lex:add_rule('keyword', token(lexer.KEYWORD, word_match{
- 'actor', 'as', 'be', 'break', 'class', 'compile_error', 'compile_intrinsic', 'continue',
- 'consume', 'do', 'else', 'elseif', 'embed', 'end', 'error', 'for', 'fun', 'if', 'ifdef', 'iftype',
- 'in', 'interface', 'is', 'isnt', 'lambda', 'let', 'match', 'new', 'object', 'primitive',
- 'recover', 'repeat', 'return', 'struct', 'then', 'this', 'trait', 'try', 'type', 'until', 'use',
- 'var', 'where', 'while', 'with'
+ 'actor', 'as', 'be', 'break', 'class', 'compile_error', 'compile_intrinsic', 'continue',
+ 'consume', 'do', 'else', 'elseif', 'embed', 'end', 'error', 'for', 'fun', 'if', 'ifdef', 'iftype',
+ 'in', 'interface', 'is', 'isnt', 'lambda', 'let', 'match', 'new', 'object', 'primitive',
+ 'recover', 'repeat', 'return', 'struct', 'then', 'this', 'trait', 'try', 'type', 'until', 'use',
+ 'var', 'where', 'while', 'with'
}))
-- Constants.
@@ -47,14 +47,14 @@ lex:add_rule('constant', token(lexer.CONSTANT, word_match('true false')))
-- Operators.
local ops = {
- ['+'] = true, ['-'] = true, ['*'] = true, ['/'] = true, ['%'] = true, ['+~'] = true,
- ['-~'] = true, ['*~'] = true, ['/~'] = true, ['%~'] = true, ['<<'] = true, ['>>'] = true,
- ['<<~'] = true, ['>>~'] = true, ['=='] = true, ['!='] = true, ['<'] = true, ['<='] = true,
- ['>='] = true, ['>'] = true, ['==~'] = true, ['!=~'] = true, ['<~'] = true, ['<=~'] = true,
- ['>=~'] = true, ['>~'] = true
+ ['+'] = true, ['-'] = true, ['*'] = true, ['/'] = true, ['%'] = true, ['+~'] = true,
+ ['-~'] = true, ['*~'] = true, ['/~'] = true, ['%~'] = true, ['<<'] = true, ['>>'] = true,
+ ['<<~'] = true, ['>>~'] = true, ['=='] = true, ['!='] = true, ['<'] = true, ['<='] = true,
+ ['>='] = true, ['>'] = true, ['==~'] = true, ['!=~'] = true, ['<~'] = true, ['<=~'] = true,
+ ['>=~'] = true, ['>~'] = true
}
lex:add_rule('operator', token(lexer.OPERATOR, word_match('and or xor not addressof digestof') +
- lpeg.Cmt(S('+-*/%<>=!~')^1, function(input, index, op) return ops[op] and index or nil end)))
+ lpeg.Cmt(S('+-*/%<>=!~')^1, function(input, index, op) return ops[op] and index or nil end)))
-- Identifiers.
local id_suffix = (lexer.alnum + "'" + '_')^0
@@ -86,7 +86,7 @@ lex:add_rule('comment', token(lexer.COMMENT, line_comment + block_comment))
-- Punctuation.
-- There is no suitable token name for this, change this if ever one is added.
lex:add_rule('punctuation',
- token(lexer.OPERATOR, P('=>') + '.>' + '<:' + '->' + S('=.,:;()[]{}!?~^&|_@')))
+ token(lexer.OPERATOR, P('=>') + '.>' + '<:' + '->' + S('=.,:;()[]{}!?~^&|_@')))
-- Qualifiers.
lex:add_rule('qualifier', token(lexer.LABEL, '#' * word_match('read send share any alias')))