Exception: RDF::N3::Reader::SyntaxError

Inherits:
ReaderError show all
Defined in:
vendor/bundler/ruby/3.3.0/bundler/gems/rdf-n3-a6ef81a7e1ce/lib/rdf/n3/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


979
980
981
982
983
984
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/rdf-n3-a6ef81a7e1ce/lib/rdf/n3/reader.rb', line 979

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:



969
970
971
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/rdf-n3-a6ef81a7e1ce/lib/rdf/n3/reader.rb', line 969

def lineno
  @lineno
end

#productionSymbol (readonly)

The current production.

Returns:



957
958
959
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/rdf-n3-a6ef81a7e1ce/lib/rdf/n3/reader.rb', line 957

def production
  @production
end

#tokenString (readonly)

The invalid token which triggered the error.

Returns:



963
964
965
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/rdf-n3-a6ef81a7e1ce/lib/rdf/n3/reader.rb', line 963

def token
  @token
end