Class: LangTimeline

Inherits:
Resyma::Language show all
Defined in:
lib/resyma/nise/date.rb

Instance Attribute Summary

Attributes inherited from Resyma::Language

#engine

Instance Method Summary collapse

Methods inherited from Resyma::Language

#build_language, #built?, #initialize, #load, load, #load_ast, #load_parsetree!

Constructor Details

This class inherits a constructor from Resyma::Language

Instance Method Details

#syntaxObject



39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/resyma/nise/date.rb', line 39

def syntax
  (array; id("-"); str)... >> begin
    items = []
    until nodes.empty?
      date, _, text = (1..3).map { nodes.shift }
      raise SyntaxError if date.children.length != 3 # '[' DATE ']'

      date = LangDate.new.load_parsetree!(date.children[1], src_binding,
                                          src_filename, src_lineno)
      items.push [date, text.to_ruby]
    end
    items
  end
end