Class: Coradoc::Configurable::ParserConfig

Inherits:
ConfigSection show all
Defined in:
lib/coradoc/configurable.rb

Overview

Parser configuration section

Instance Attribute Summary collapse

Attributes inherited from ConfigSection

#options

Instance Method Summary collapse

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(options = {})
  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_enabledBoolean

Returns Enable parser caching.

Returns:

  • (Boolean)

    Enable parser caching



133
134
135
# File 'lib/coradoc/configurable.rb', line 133

def cache_enabled
  @cache_enabled
end

#include_source_locBoolean

Returns Include source location in AST.

Returns:

  • (Boolean)

    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_depthInteger

Returns Maximum nesting depth.

Returns:

  • (Integer)

    Maximum nesting depth



142
143
144
# File 'lib/coradoc/configurable.rb', line 142

def max_nesting_depth
  @max_nesting_depth
end

#strict_modeBoolean

Returns Strict parsing mode.

Returns:

  • (Boolean)

    Strict parsing mode



136
137
138
# File 'lib/coradoc/configurable.rb', line 136

def strict_mode
  @strict_mode
end