Class: ImportGrammar Private
- Defined in:
- lib/ruby_grammar_builder/grammar.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Represents a Textmate Grammar that has been imported This exists entirely to override Grammar#[] and should not be normally created
Instance Attribute Summary
Attributes inherited from Grammar
#ending, #name, #repository, #scope_name
Instance Method Summary collapse
-
#[](key) ⇒ PatternBase, ...
private
Access a pattern in the grammar.
-
#initialize(keys) ⇒ ImportGrammar
constructor
private
Create a new Grammar.
Methods inherited from Grammar
#[]=, #auto_version, fromTmLanguage, #generate, import, #import, new_exportable_grammar, #parseTokenSyntax, plugins, register_linter, register_transform, remove_plugin, #run_post_transform_stage, #run_pre_transform_stage, #save_to, #tokenMatching
Constructor Details
#initialize(keys) ⇒ ImportGrammar
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Create a new Grammar
659 660 661 |
# File 'lib/ruby_grammar_builder/grammar.rb', line 659 def initialize(keys) super(keys) end |
Instance Method Details
#[](key) ⇒ PatternBase, ...
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
patterns that have been imported from a file cannot be be accessed
Access a pattern in the grammar
665 666 667 668 669 |
# File 'lib/ruby_grammar_builder/grammar.rb', line 665 def [](key) raise "#{key} is a not a pattern and cannot be referenced" if @repository[key].is_a? Hash @repository[key] end |