app/controllers/preprocessor/python/python_preprocessor.rb
# Handles the case where the initial syntax check was successful. Move to the next phase, augment
# the code and trigger a syntax check of the augmented code.
Handles the case where the initial syntax check was successful. Move to the next phase, augment
the code and trigger a syntax check of the augmented code.
Handles the case where the initial syntax check was successful . Move to the next phase augment the code and trigger a syntax check of the augmented code .
def syntax_check_success(send, line)
    @phase = :augment
    @augmented_code = PythonCodeAugmenter.new(@code, @tracing_vars).to_a()
    send.call([
      {:write_file => {:filename => @filename, :content => @augmented_code}},
      {:execute => {:command => "#{VM_PYTHON} -c \"compile(open('#{@filename}').read(), '', 'exec')\" && echo success",
                    :stdout => 'augmentsuccess',
                    :stderr => 'augmentfail'}}])
    return {:type => :no}
  end
def syntax_check_success ( send , line ) @phase = :augment @augmented_code = PythonCodeAugmenter . new ( @code , @tracing_vars ) . to_a ( ) send . call ( [ { :write_file => { :filename => @filename , :content => @augmented_code } } , { :execute => { :command => "#{VM_PYTHON} -c \"compile(open('#{@filename}').read(), '', 'exec')\" && echo success" , :stdout => 'augmentsuccess' , :stderr => 'augmentfail' } } ] ) return { :type => :no } end
Handles the case where the initial syntax check was successful.
Handles the case where the initial syntax check was successful .
# Trigger the new syntax check # Don't output anything
send
line