Class: Lisp::Format::Directives::ClauseSeparator

Inherits:
Directive show all
Defined in:
lib/carat/lisp-format.rb

Overview

Represents the ~; (Clause separator) directive. It separates clauses inside conditional and justifying directives (~[…~] and ~<…~>). It may not appear anywhere else.

Instance Attribute Summary

Attributes inherited from Directive

#pos

Instance Method Summary collapse

Methods inherited from Directive

#execute, #join

Constructor Details

#initialize(params, modifiers, top, pos) ⇒ ClauseSeparator

Check that top is either a BeginConditional or a BeginJustification. If not, a SyntaxError is raised.



1589
1590
1591
1592
1593
1594
1595
1596
# File 'lib/carat/lisp-format.rb', line 1589

def initialize(params, modifiers, top, pos)
  super params, modifiers, top, pos
  unless top.is_a? BeginConditional
    raise SyntaxError.new(@pos),
      '~; directive must be contained within a conditional (~[...~])' +
      ' or a justification (~<...~>)'
  end
end