<commit_before>require 'constructor'

#
# NLSE = NanoLite Shader Execution representation
#
# This module contains an intermediary representation of the shader code. Types have been resolved (typically by NLSL Compiler)
# so all expressions are typed. Code represented as NLSE is supposed to be transformed to the respective
# runtime environments using target transformers.
#
module NLSE

  class Comment
    constructor :value, :accessors => true

    def __children; [ ]; end
  end

  class Value
    constructor :type, :value, :ref, :accessors => true

    def __children; [ ]; end
  end

  class ComponentAccess
    constructor :type, :value, :component, :accessors => true

    def __children; [ value ]; end
  end

  class MatrixColumnAccess
    constructor :type, :value, :index, :accessors => true

    def __children; [ value ]; end
  end

  class VariableAssignment
    constructor :name, :value, :accessors => true

    def __children; [ value ]; end
  end

  #
  # Base class for all binary operations
  #
  class Op
    constructor :a, :b, :signature, :accessors => true

    def __children; [ a, b ]; end

    #
    # True if this operator requires strict typing
    #
    # strictness means that an operator only makes sense when types are in a certain order (e.g., vec div scalar)
    # associativity means that an operator can be applied to an arbitrary operand order (e.g., vec mul vec)
    # strictness is a stronger condition that associativity (e.g., scalar div scalar is not-strict and not associative, however scalar mul scalar is also non-strict but associative)
    #
    def self.strict_types?; false; end
  end

  #
  # Base class for all binary operations involving matrices or vectors
  #
  class VectorOp < Op
    def type
      signature.split(" ").sort.last.to_sym
    end
  end

  class MatMulMat < VectorOp<commit_msg>NLSE now maintains inital variable assignment flag<commit_after>require 'constructor'

#
# NLSE = NanoLite Shader Execution representation
#
# This module contains an intermediary representation of the shader code. Types have been resolved (typically by NLSL Compiler)
# so all expressions are typed. Code represented as NLSE is supposed to be transformed to the respective
# runtime environments using target transformers.
#
module NLSE

  class Comment
    constructor :value, :accessors => true

    def __children; [ ]; end
  end

  class Value
    constructor :type, :value, :ref, :accessors => true

    def __children; [ ]; end
  end

  class ComponentAccess
    constructor :type, :value, :component, :accessors => true

    def __children; [ value ]; end
  end

  class MatrixColumnAccess
    constructor :type, :value, :index, :accessors => true

    def __children; [ value ]; end
  end

  class VariableAssignment
    constructor :name, :value, :initial, :accessors => true

    def __children; [ value ]; end

    def initial_assignment?
      initial
    end
  end

  #
  # Base class for all binary operations
  #
  class Op
    constructor :a, :b, :signature, :accessors => true

    def __children; [ a, b ]; end

    #
    # True if this operator requires strict typing
    #
    # strictness means that an operator only makes sense when types are in a certain order (e.g., vec div scalar)
    # associativity means that an operator can be applied to an arbitrary operand order (e.g., vec mul vec)
    # strictness is a stronger condition that associativity (e.g., scalar div scalar is not-strict and not associative, however scalar mul scalar is also non-strict but associative)
    #
    def self.strict_types?; false; end
  end

  #
  # Base class for all binary operations involving matrices or vectors
  #
  class VectorOp < Op
    def type
      signature.split(" ").sort.last.to_sym
    end
  end

  class MatMulMat < VectorOp
{'fraction_non_alphanumeric': 0.07229232386961093, 'fraction_numerical': 0.0, 'mean_word_length': 3.280089988751406, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6152086', 'n_tokens_mistral': 1054, 'n_tokens_neox': 1015, 'n_words': 456}