app/controllers/preprocessor/python/augmentation.rb
# Does the actual work of augmenting the code.
Does the actual work of augmenting the code.
Does the actual work of augmenting the code .
def augment_code()
    @augmented_code = ""
    @augmented_code += generate_tracing_configuration()
    @code.each_line do |line|
      @state[:line_number] += 1
      line.rstrip!
      if !line.empty?
        parse_line(line)
        line = possibly_add_line_number_comment(line)
        line = possibly_add_trace_info_calls(line)
      end
      @augmented_code += line + "\n"
    end
  end
def augment_code ( ) @augmented_code = "" @augmented_code += generate_tracing_configuration ( ) @code . each_line do | line | @state [ :line_number ] += 1 line . rstrip! if ! line . empty? parse_line ( line ) line = possibly_add_line_number_comment ( line ) line = possibly_add_trace_info_calls ( line ) end @augmented_code += line + "\n" end end
Does the actual work of augmenting the code.
Does the actual work of augmenting the code .
# Configure variable tracing (the variables to be traced are declared at the # beginning of the program) # Iterate over the original code's lines # Remove trailing whitespace. If the line is not empty, parse and process it. # Update our state based on the current line # Add stuff if necessary