Class: Coradoc::Configurable::ParserConfig
- Inherits:
-
ConfigSection
- Object
- ConfigSection
- Coradoc::Configurable::ParserConfig
- Defined in:
- lib/coradoc/configurable.rb
Overview
Parser configuration section
Instance Attribute Summary collapse
-
#cache_enabled ⇒ Boolean
Enable parser caching.
-
#include_source_loc ⇒ Boolean
Include source location in AST.
-
#max_nesting_depth ⇒ Integer
Maximum nesting depth.
-
#strict_mode ⇒ Boolean
Strict parsing mode.
Attributes inherited from ConfigSection
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ ParserConfig
constructor
A new instance of ParserConfig.
Methods inherited from ConfigSection
#[], #[]=, #merge!, symbolize_keys, #to_h
Constructor Details
#initialize(options = {}) ⇒ ParserConfig
Returns a new instance of ParserConfig.
144 145 146 147 148 149 150 |
# File 'lib/coradoc/configurable.rb', line 144 def initialize( = {}) super @cache_enabled = @options.fetch(:cache_enabled, true) @strict_mode = @options.fetch(:strict_mode, false) @include_source_loc = @options.fetch(:include_source_loc, true) @max_nesting_depth = @options.fetch(:max_nesting_depth, 100) end |
Instance Attribute Details
#cache_enabled ⇒ Boolean
Returns Enable parser caching.
133 134 135 |
# File 'lib/coradoc/configurable.rb', line 133 def cache_enabled @cache_enabled end |
#include_source_loc ⇒ Boolean
Returns Include source location in AST.
139 140 141 |
# File 'lib/coradoc/configurable.rb', line 139 def include_source_loc @include_source_loc end |
#max_nesting_depth ⇒ Integer
Returns Maximum nesting depth.
142 143 144 |
# File 'lib/coradoc/configurable.rb', line 142 def max_nesting_depth @max_nesting_depth end |
#strict_mode ⇒ Boolean
Returns Strict parsing mode.
136 137 138 |
# File 'lib/coradoc/configurable.rb', line 136 def strict_mode @strict_mode end |