Class: Gherkin::Lexer::I18nLexer

Inherits:
Object
  • Object
show all
Defined in:
lib/gherkin/lexer/i18n_lexer.rb

Overview

The main entry point to lexing Gherkin source.

Constant Summary collapse

COMMENT_OR_EMPTY_LINE_PATTERN =
/^(\xEF\xBB\xBF)?\s*#|^\s*$/
LANGUAGE_PATTERN =

:nodoc:

/^(\xEF\xBB\xBF)?\s*#\s*language\s*:\s*([a-zA-Z\-]+)/

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(listener, force_ruby = false, iso_code = 'en') ⇒ I18nLexer


17
18
19
20
21
# File 'lib/gherkin/lexer/i18n_lexer.rb', line 17

def initialize(listener, force_ruby=false, iso_code='en')
  @listener = listener
  @force_ruby = force_ruby
  @iso_code = iso_code
end

Instance Attribute Details

#i18n_languageObject (readonly)

Returns the value of attribute i18n_language


15
16
17
# File 'lib/gherkin/lexer/i18n_lexer.rb', line 15

def i18n_language
  @i18n_language
end

Instance Method Details

#scan(source) ⇒ Object


23
24
25
# File 'lib/gherkin/lexer/i18n_lexer.rb', line 23

def scan(source)
  create_delegate(source).scan(source)
end