Exception: RDF::Turtle::Reader::SyntaxError

Inherits:
ReaderError show all
Defined in:
vendor/bundler/ruby/2.7.0/bundler/gems/rdf-turtle-3ac5e1bd6dcc/lib/rdf/turtle/reader.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, **options) ⇒ SyntaxError

Initializes a new syntax error instance.

Parameters:

Options Hash (**options):

  • :production (Symbol) — default: nil
  • :token (String) — default: nil
  • :lineno (Integer) — default: nil


615
616
617
618
619
620
# File 'vendor/bundler/ruby/2.7.0/bundler/gems/rdf-turtle-3ac5e1bd6dcc/lib/rdf/turtle/reader.rb', line 615

def initialize(message, **options)
  @production = options[:production]
  @token      = options[:token]
  @lineno     = options[:lineno] || (@token.lineno if @token.respond_to?(:lineno))
  super(message.to_s)
end

Instance Attribute Details

#linenoInteger (readonly)

The line number where the error occurred.

Returns:



605
606
607
# File 'vendor/bundler/ruby/2.7.0/bundler/gems/rdf-turtle-3ac5e1bd6dcc/lib/rdf/turtle/reader.rb', line 605

def lineno
  @lineno
end

#productionSymbol (readonly)

The current production.

Returns:



593
594
595
# File 'vendor/bundler/ruby/2.7.0/bundler/gems/rdf-turtle-3ac5e1bd6dcc/lib/rdf/turtle/reader.rb', line 593

def production
  @production
end

#tokenString (readonly)

The invalid token which triggered the error.

Returns:



599
600
601
# File 'vendor/bundler/ruby/2.7.0/bundler/gems/rdf-turtle-3ac5e1bd6dcc/lib/rdf/turtle/reader.rb', line 599

def token
  @token
end