Class: Kumi::Syntax::Root
- Inherits:
-
Struct
- Object
- Struct
- Kumi::Syntax::Root
- Includes:
- Node
- Defined in:
- lib/kumi/syntax/root.rb
Overview
Represents the root of the Abstract Syntax Tree. It holds all the top-level declarations parsed from the source.
Instance Attribute Summary collapse
-
#imports ⇒ Object
Returns the value of attribute imports.
-
#inputs ⇒ Object
Returns the value of attribute inputs.
-
#traits ⇒ Object
Returns the value of attribute traits.
-
#values ⇒ Object
Returns the value of attribute values.
Attributes included from Node
Instance Method Summary collapse
Methods included from Node
Instance Attribute Details
#imports ⇒ Object
Returns the value of attribute imports
7 8 9 |
# File 'lib/kumi/syntax/root.rb', line 7 def imports @imports end |
#inputs ⇒ Object
Returns the value of attribute inputs
7 8 9 |
# File 'lib/kumi/syntax/root.rb', line 7 def inputs @inputs end |
#traits ⇒ Object
Returns the value of attribute traits
7 8 9 |
# File 'lib/kumi/syntax/root.rb', line 7 def traits @traits end |
#values ⇒ Object
Returns the value of attribute values
7 8 9 |
# File 'lib/kumi/syntax/root.rb', line 7 def values @values end |
Instance Method Details
#children ⇒ Object
10 |
# File 'lib/kumi/syntax/root.rb', line 10 def children = [inputs, values, traits, imports] |
#digest ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/kumi/syntax/root.rb', line 12 def digest # The digest must be stable and depend on anything that could change the # compiled output. This includes the AST, the Kumi version (compiler changes), # and the Ruby version (runtime behavior changes). digest_input = "#{Kumi::VERSION}-#{RUBY_VERSION}-#{self}" # Ruby constants cannot start with a number, so we add a prefix. "KUMI_#{Digest::SHA256.hexdigest(digest_input)}" end |