From 4c4392d29df777ff702dfe99b4f3c23142976e05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= Date: Fri, 11 Aug 2023 01:27:32 +0200 Subject: update lexers to orbitalquark/scintillua@b789dde Rather than cherry pick patches from after 6.2 we will just grab everything as is. --- lua/lexers/rails.lua | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'lua/lexers/rails.lua') diff --git a/lua/lexers/rails.lua b/lua/lexers/rails.lua index 9f750c6..7601127 100644 --- a/lua/lexers/rails.lua +++ b/lua/lexers/rails.lua @@ -1,17 +1,13 @@ --- Copyright 2006-2022 Mitchell. See LICENSE. +-- Copyright 2006-2024 Mitchell. See LICENSE. -- Ruby on Rails LPeg lexer. -local lexer = require('lexer') -local token, word_match = lexer.token, lexer.word_match +local lexer = lexer local P, S = lpeg.P, lpeg.S -local lex = lexer.new('rails', {inherit = lexer.load('ruby')}) +local lex = lexer.new(..., {inherit = lexer.load('ruby')}) --- Whitespace -lex:modify_rule('whitespace', token(lexer.WHITESPACE, lexer.space^1)) - --- Functions. -lex:modify_rule('function', token(lexer.FUNCTION, word_match{ +-- Word lists. +lex:set_word_list(lexer.FUNCTION_BUILTIN, { -- ActionPack. 'before_filter', 'skip_before_filter', 'skip_after_filter', 'after_filter', 'around_filter', 'filter', 'filter_parameter_logging', 'layout', 'require_dependency', 'render', 'render_action', @@ -38,6 +34,8 @@ lex:modify_rule('function', token(lexer.FUNCTION, word_match{ -- ActiveSupport. 'alias_method_chain', 'alias_attribute', 'delegate', 'cattr_accessor', 'mattr_accessor', 'returning', 'memoize' -}) + lex:get_rule('function')) +}, true) + +lexer.property['scintillua.comment'] = '#' return lex -- cgit v1.2.3