Class: Jade::Parsing::MissingThenError

Inherits:
Error
  • Object
show all
Defined in:
lib/jade/parsing/error.rb

Overview

Specific case-branch shape: ‘in <pat> <body>` on the same source line, no `then` between them. Almost always the user meant `in <pat> then <body>` for an inline branch.

Instance Attribute Summary

Attributes inherited from Error

#actual, #context, #expected

Attributes inherited from Error

#entry, #span

Instance Method Summary collapse

Methods inherited from Error

#commit, #committed?, #initialize, #with_context

Methods inherited from Error

#candidates, #initialize, #notes, #queried_name, #to_diagnostic

Constructor Details

This class inherits a constructor from Jade::Parsing::Error

Instance Method Details

#labelObject



131
132
133
# File 'lib/jade/parsing/error.rb', line 131

def label
  "missing `then`"
end

#messageObject



124
125
126
127
128
129
# File 'lib/jade/parsing/error.rb', line 124

def message
  "#{context_prefix}Case branch needs `then` before an inline body " \
    "(got #{@actual.value.inspect} on the same line as `in`). " \
    "Write `in <pat> then <expr>`, or put the body on the next " \
    "line for the multi-statement form."
end