Sha256: 44c3e85e87d8314f606be2417130d13178b3022313a3c892ce8560ab34136211
Contents?: true
Size: 740 Bytes
Versions: 16
Compression:
Stored size: 740 Bytes
Contents
module Finitio module Syntax module Heading include Node capture :allow_extra def allow_extra? !allow_extra.nil? end def multi? captures[:attribute].any?{|a| a.optional? } or allow_extra? end def attributes(factory) captures[:attribute].map{|a| a.compile(factory) } end def compile(factory) options = allow_extra ? allow_extra.compile(factory) : {} Finitio::Heading.new(attributes(factory), options) end def to_ast ast = captures[:attribute].map(&:to_ast).unshift(:heading) ast << allow_extra.to_ast if allow_extra ast end end # module Heading end # module Syntax end # module Finitio
Version data entries
16 entries across 16 versions & 1 rubygems