vis

a vi-like editor based on Plan 9's structural regular expressions

git clone https://9o.is/git/vis.git

rails.lua

(2091B)


      1 -- Copyright 2006-2025 Mitchell. See LICENSE.
      2 -- Ruby on Rails LPeg lexer.
      3 
      4 local lexer = lexer
      5 local P, S = lpeg.P, lpeg.S
      6 
      7 local lex = lexer.new(..., {inherit = lexer.load('ruby')})
      8 
      9 -- Word lists.
     10 lex:set_word_list(lexer.FUNCTION_BUILTIN, {
     11 	-- ActionPack.
     12 	'before_filter', 'skip_before_filter', 'skip_after_filter', 'after_filter', 'around_filter',
     13 	'filter', 'filter_parameter_logging', 'layout', 'require_dependency', 'render', 'render_action',
     14 	'render_text', 'render_file', 'render_template', 'render_nothing', 'render_component',
     15 	'render_without_layout', 'rescue_from', 'url_for', 'redirect_to', 'redirect_to_path',
     16 	'redirect_to_url', 'respond_to', 'helper', 'helper_method', 'model', 'service', 'observer',
     17 	'serialize', 'scaffold', 'verify', 'hide_action',
     18 	-- View helpers.
     19 	'check_box', 'content_for', 'error_messages_for', 'form_for', 'fields_for', 'file_field',
     20 	'hidden_field', 'image_submit_tag', 'label', 'link_to', 'password_field', 'radio_button',
     21 	'submit', 'text_field', 'text_area',
     22 	-- ActiveRecord.
     23 	'after_create', 'after_destroy', 'after_save', 'after_update', 'after_validation',
     24 	'after_validation_on_create', 'after_validation_on_update', 'before_create', 'before_destroy',
     25 	'before_save', 'before_update', 'before_validation', 'before_validation_on_create',
     26 	'before_validation_on_update', 'composed_of', 'belongs_to', 'has_one', 'has_many',
     27 	'has_and_belongs_to_many', 'validate', 'validates', 'validate_on_create',
     28 	'validates_numericality_of', 'validate_on_update', 'validates_acceptance_of',
     29 	'validates_associated', 'validates_confirmation_of', 'validates_each', 'validates_format_of',
     30 	'validates_inclusion_of', 'validates_exclusion_of', 'validates_length_of',
     31 	'validates_presence_of', 'validates_size_of', 'validates_uniqueness_of', --
     32 	'attr_protected', 'attr_accessible', 'attr_readonly', 'accepts_nested_attributes_for',
     33 	'default_scope', 'scope',
     34 	-- ActiveSupport.
     35 	'alias_method_chain', 'alias_attribute', 'delegate', 'cattr_accessor', 'mattr_accessor',
     36 	'returning', 'memoize'
     37 }, true)
     38 
     39 lexer.property['scintillua.comment'] = '#'
     40 
     41 return lex