<commit_before>module Atomo
  module AST
    class Primitive < Node
      attr_reader :value

      def initialize(line, value)
        @value = value
        @line = line
      end

      def ==(b)
        b.kind_of?(Primitive) and \
        @value == b.value
      end

      def bytecode(g)
        pos(g)

        if @value.kind_of? Float
          g.push_unique_literal @value
        else
          g.push @value
        end
      end
    end
  end
end<commit_msg>Atomo::AST::Primitive#bytecode is a bit smarter now<commit_after>module Atomo
  module AST
    class Primitive < Node
      attr_reader :value

      def initialize(line, value)
        @value = value
        @line = line
      end

      def ==(b)
        b.kind_of?(Primitive) and \
        @value == b.value
      end

      def bytecode(g)
        pos(g)

        # TODO: `(~#true) will break here
        case @value
        when :true, :false, :self, :nil, Integer
          g.push @value
        else
          g.push_literal @value
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.08579599618684461, 'fraction_numerical': 0.0, 'mean_word_length': 1.5240384615384615, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '2853579', 'n_tokens_mistral': 333, 'n_tokens_neox': 326, 'n_words': 94}