Class: Jade::Frontend::SemanticAnalysis::Error::UndefinedVariable

Inherits:
Error
  • Object
show all
Defined in:
lib/jade/frontend/semantic_analysis/error/undefined_variable.rb

Instance Attribute Summary collapse

Attributes inherited from Error

#entry, #span

Instance Method Summary collapse

Methods inherited from Error

#notes, #to_diagnostic

Constructor Details

#initialize(entry, span, var_ref:, candidates: []) ⇒ UndefinedVariable

Returns a new instance of UndefinedVariable.



8
9
10
11
12
# File 'lib/jade/frontend/semantic_analysis/error/undefined_variable.rb', line 8

def initialize(entry, span, var_ref:, candidates: [])
  super(entry:, span:)
  @var_ref = var_ref
  @candidates = candidates
end

Instance Attribute Details

#candidatesObject (readonly)

Returns the value of attribute candidates.



6
7
8
# File 'lib/jade/frontend/semantic_analysis/error/undefined_variable.rb', line 6

def candidates
  @candidates
end

Instance Method Details

#labelObject



18
19
20
# File 'lib/jade/frontend/semantic_analysis/error/undefined_variable.rb', line 18

def label
  "undefined"
end

#messageObject



14
15
16
# File 'lib/jade/frontend/semantic_analysis/error/undefined_variable.rb', line 14

def message
  "Undefined variable #{@var_ref}"
end

#queried_nameObject



22
23
24
# File 'lib/jade/frontend/semantic_analysis/error/undefined_variable.rb', line 22

def queried_name
  @var_ref
end