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

Inherits:
ReaderError show all
Defined in:
vendor/bundler/ruby/3.3.0/bundler/gems/rdf-turtle-6506e92ccd8e/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


811
812
813
814
815
816
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/rdf-turtle-6506e92ccd8e/lib/rdf/turtle/reader.rb', line 811

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:



801
802
803
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/rdf-turtle-6506e92ccd8e/lib/rdf/turtle/reader.rb', line 801

def lineno
  @lineno
end

#productionSymbol (readonly)

The current production.

Returns:



789
790
791
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/rdf-turtle-6506e92ccd8e/lib/rdf/turtle/reader.rb', line 789

def production
  @production
end

#tokenString (readonly)

The invalid token which triggered the error.

Returns:



795
796
797
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/rdf-turtle-6506e92ccd8e/lib/rdf/turtle/reader.rb', line 795

def token
  @token
end