Class: Brandish::Scanner

Inherits:
Object
  • Object
show all
Includes:
Yoga::Scanner
Defined in:
lib/brandish/scanner.rb

Overview

Scans the file for tokens. This is by default done incrementally, as it's requested by the parser or whatever consumer wants to use it. This is done to make sure that work that doesn't need to be done isn't.

Constant Summary collapse

DEFAULT_OPTIONS =

The default options for the scanner.

Returns:

  • ({::Symbol => ::Object})
{ tags: %i(< >).freeze }.freeze

Instance Method Summary collapse

Constructor Details

#initialize(*args, **options) ⇒ Scanner

Initialize the scanner with the given source and file. If no file is given, it defaults to <anon>.



21
22
23
24
# File 'lib/brandish/scanner.rb', line 21

def initialize(*args, **options)
  super(*args)
  @options = DEFAULT_OPTIONS.merge(options)
end