Sha256: ff068eec83345e5bf2f14c891cf9d0a0594cd2ff72c26874da44a5a75d59dc38
Contents?: true
Size: 654 Bytes
Versions: 19
Compression:
Stored size: 654 Bytes
Contents
module Finitio module Syntax module Attribute include Node capture :type, :multiplicity capture_str :attribute_name def optional? multiplicity == ':?' end def required? multiplicity == ':' end def compile(factory) n = attribute_name.to_sym t = type.compile(factory) r = required? m = metadata factory.attribute(n, t, r, m) end def to_ast ast = [:attribute, attribute_name, type.to_ast] ast << false unless required? ast end end # module BuiltinType end # module Syntax end # module Finitio
Version data entries
19 entries across 19 versions & 1 rubygems