readd format assembly text

pull/1/head
yann300 9 years ago
parent e7f0512635
commit ed4c94cd1a
  1. 2
      package.json
  2. 5
      src/app.js
  3. 16
      src/app/compiler.js
  4. 40
      src/app/debugger.js
  5. 8
      src/app/editor.js
  6. 2
      src/app/execution-context.js
  7. 19
      src/app/renderer.js

@ -20,7 +20,7 @@
"browserify": "^13.0.0",
"csslint": "^1.0.2",
"es6-shim": "^0.35.1",
"ethereum-remix": "0.0.2-alpha.0.0.7",
"ethereum-remix": "0.0.2-alpha.0.0.8",
"ethereumjs-abi": "^0.6.4",
"ethereumjs-block": "^1.2.2",
"ethereumjs-tx": "^1.1.1",

@ -109,9 +109,6 @@ var run = function () {
el.parent().find('li').removeClass('active');
$('#optionViews').attr('class', '').addClass(cls);
el.addClass('active');
} else {
el.removeClass('active');
$('#optionViews').removeClass(cls);
}
self.event.trigger('tabChanged', [cls]);
};
@ -424,7 +421,7 @@ var run = function () {
var transactionDebugger = new Debugger('#debugger', editor, compiler, executionContext.event, swicthToFile);
transactionDebugger.addProvider('vm', executionContext.vm());
transactionDebugger.switchProvider('VM');
transactionDebugger.switchProvider('vm');
transactionDebugger.addProvider('injected', executionContext.web3());
transactionDebugger.addProvider('web3', executionContext.web3());

@ -16,7 +16,7 @@ function Compiler (editor, queryParams, handleGithubCall, updateFiles) {
var compileJSON;
var compilerAcceptsMultipleFiles;
var previousInput = '';
var cachedRemoteFiles = {};
@ -60,7 +60,7 @@ function Compiler (editor, queryParams, handleGithubCall, updateFiles) {
});
};
this.compile = compile;
function setCompileJSON (_compileJSON) {
compileJSON = _compileJSON;
}
@ -101,18 +101,16 @@ function Compiler (editor, queryParams, handleGithubCall, updateFiles) {
this.lastCompilationResult = {
data: null,
source: null
}
};
function compilationFinished (data, missingInputs, source) {
var noFatalErrors = true; // ie warnings are ok
if (data['error'] !== undefined) {
self.event.trigger('compilationFinished', [false, [data['error']], source]);
if (utils.errortype(data['error']) !== 'warning') {
noFatalErrors = false;
}
}
if (data['errors'] !== undefined) {
self.event.trigger('compilationFinished', [false, data['errors'], source]);
data['errors'].forEach(function (err) {
if (utils.errortype(err) !== 'warning') {
noFatalErrors = false;
@ -120,13 +118,15 @@ function Compiler (editor, queryParams, handleGithubCall, updateFiles) {
});
}
if (missingInputs !== undefined && missingInputs.length > 0) {
if (!noFatalErrors) {
self.event.trigger('compilationFinished', [false, data, source]);
} else if (missingInputs !== undefined && missingInputs.length > 0) {
compile(missingInputs);
} else if (noFatalErrors) {
} else {
self.lastCompilationResult = {
data: data,
source: source
}
};
self.event.trigger('compilationFinished', [true, data, source]);
}
}

@ -9,12 +9,12 @@ var Range = ace.acequire('ace/range').Range;
function Debugger (id, editor, compiler, executionContextEvent, switchToFile) {
this.el = document.querySelector(id);
this.debugger = new remix.ui.Debugger();
this.sourceMappingDecoder = new remix.util.SourceMappingDecoder()
this.sourceMappingDecoder = new remix.util.SourceMappingDecoder();
this.el.appendChild(this.debugger.render());
this.editor = editor;
this.switchToFile = switchToFile;
this.compiler = compiler;
this.cache = new Cache()
this.cache = new Cache();
var self = this;
executionContextEvent.register('contextChanged', this, function (context) {
@ -23,33 +23,36 @@ function Debugger (id, editor, compiler, executionContextEvent, switchToFile) {
this.lastCompilationResult = null;
this.debugger.register('newTraceLoaded', this, function () {
self.cache.clear()
self.cache.clear();
self.lastCompilationResult = self.compiler.lastCompilationResult;
});
this.debugger.register('traceUnloaded', this, function () {
self.lastCompilationResult = null;
self.removeCurrentMarker()
self.cache.clear()
self.removeCurrentMarker();
self.cache.clear();
});
this.editor.onChangeSetup(function () {
if (arguments.length > 0) { // if arguments.length === 0 this is a session change, we don't want to stop debugging in that case
self.debugger.unLoad()
self.debugger.unLoad();
}
});
// register selected code item, highlight the corresponding source location
this.debugger.codeManager.register('changed', this, function (code, address, index) {
this.debugger.sourceLocationTracker.getSourceLocation(address, index, self.lastCompilationResult.data.contracts, function (error, rawLocation) {
if (!error) {
if (!self.cache.lineBreakPositionsByContent[address]) {
self.cache.lineBreakPositionsByContent[address] = self.sourceMappingDecoder.getLinebreakPositions(self.editor.getFile(self.lastCompilationResult.data.sourceList[rawLocation.file]))
if (self.lastCompilationResult) {
this.debugger.sourceLocationTracker.getSourceLocation(address, index, self.lastCompilationResult.data.contracts, function (error, rawLocation) {
if (!error) {
if (!self.cache.lineBreakPositionsByContent[address]) {
self.cache.lineBreakPositionsByContent[address] = self.sourceMappingDecoder.getLinebreakPositions(self.editor.getFile(self.lastCompilationResult.data.sourceList[rawLocation.file]));
}
var lineColumnPos = self.sourceMappingDecoder.convertOffsetToLineColumn(rawLocation, self.cache.lineBreakPositionsByContent[address]);
self.highlight(lineColumnPos, rawLocation);
} else {
self.removeCurrentMarker();
}
var lineColumnPos = self.sourceMappingDecoder.convertOffsetToLineColumn(rawLocation, self.cache.lineBreakPositionsByContent[address])
self.highlight(lineColumnPos, rawLocation);
}
});
});
}
});
}
@ -120,13 +123,12 @@ Debugger.prototype.removeCurrentMarker = function () {
}
};
function Cache () {
this.contentLineBreakPosition = {}
this.contentLineBreakPosition = {};
}
Cache.prototype.clear = function () {
this.lineBreakPositionsByContent = {}
}
this.lineBreakPositionsByContent = {};
};
module.exports = Debugger;

@ -16,12 +16,12 @@ function Editor (loadingFromGist, storage) {
setupStuff(getFiles());
this.addMarker = function (range, cssClass) {
return editor.session.addMarker(range, cssClass)
}
return editor.session.addMarker(range, cssClass);
};
this.removeMarker = function (markerId) {
editor.session.removeMarker(markerId)
}
editor.session.removeMarker(markerId);
};
this.newFile = function () {
var untitledCount = '';

@ -45,7 +45,7 @@ function ExecutionContext () {
this.setContext = function (context) {
executionContext = context;
executionContextChange(context);
setExecutionContextRadio()
setExecutionContextRadio();
};
var $injectedToggle = $('#injected-mode');

@ -20,9 +20,14 @@ function Renderer (editor, web3, updateFiles, udapp, executionContext, formalVer
if (success) {
self.contracts(data, source);
} else {
data.forEach(function (err) {
self.error(err);
});
if (data['error']) {
self.error(data['error']);
}
if (data['errors']) {
data['errors'].forEach(function (err) {
self.error(err);
});
}
}
});
}
@ -93,11 +98,17 @@ Renderer.prototype.contracts = function (data, source) {
$contractOutput.append(uiHelper.textRow('Web3 deploy', uiHelper.gethDeploy(contractName.toLowerCase(), contract['interface'], contract.bytecode), 'deploy'));
$contractOutput.append(uiHelper.textRow('uDApp', combined(contractName, contract['interface'], contract.bytecode), 'deploy'));
}
return $contractOutput.append(uiHelper.getDetails(contract, source, contractName));
var ctrSource = getSource(contractName, source, data);
return $contractOutput.append(uiHelper.getDetails(contract, ctrSource, contractName));
};
// //
var self = this;
var getSource = function (contractName, source, data) {
var currentFile = utils.fileNameFromKey(self.editor.getCacheFile());
return source.sources[currentFile];
};
var getAddress = function () { return $('#txorigin').val(); };
var getValue = function () {

Loading…
Cancel
Save