Class: Jade::Frontend::SemanticAnalysis::Error::VariableNotFound

Inherits:
Error
  • Object
show all
Defined in:
lib/jade/frontend/semantic_analysis/error/variable_not_found.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, name:, causes: [], candidates: []) ⇒ VariableNotFound

Returns a new instance of VariableNotFound.



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

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

Instance Attribute Details

#candidatesObject (readonly)

Returns the value of attribute candidates.



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

def candidates
  @candidates
end

#causesObject (readonly)

Returns the value of attribute causes.



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

def causes
  @causes
end

Instance Method Details

#labelObject



19
20
21
# File 'lib/jade/frontend/semantic_analysis/error/variable_not_found.rb', line 19

def label
  "not found"
end

#messageObject



15
16
17
# File 'lib/jade/frontend/semantic_analysis/error/variable_not_found.rb', line 15

def message
  "I cannot find a `#{@name}` variable"
end

#queried_nameObject

Qualified, like candidates: bare fold_left against fold is too short to clear the spell checker's threshold.



25
26
27
# File 'lib/jade/frontend/semantic_analysis/error/variable_not_found.rb', line 25

def queried_name
  @name
end