aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-09-01 10:24:50 -0700
committerAlon Zakai <alonzakai@gmail.com>2011-09-01 10:24:50 -0700
commitfcc9d08d9e4a7513f021952263d05f97ef997f2f (patch)
tree9ac51c2bebaccc1c87c3edb2f6ae83c847b8529f
parent29b2f2450a76096d2f9c3a96d07e832b29b1de86 (diff)
misc minor bugs
-rw-r--r--src/analyzer.js3
-rw-r--r--src/intertyper.js6
2 files changed, 7 insertions, 2 deletions
diff --git a/src/analyzer.js b/src/analyzer.js
index 4e49c7a4..8f2ea146 100644
--- a/src/analyzer.js
+++ b/src/analyzer.js
@@ -49,6 +49,7 @@ function analyzer(data) {
item.items.sort(function(a, b) { return a.lineNum - b.lineNum });
for (var i = 0; i < item.items.length; i++) {
var subItem = item.items[i];
+ assert(subItem.lineNum);
if (subItem.intertype == 'function') {
item.functions.push(subItem);
subItem.endLineNum = null;
@@ -78,7 +79,7 @@ function analyzer(data) {
currLabelFinished = true;
}
} else {
- print('// WARNING: content after a branch in a label, line: ' + subItem.lineNum);
+ print('// WARNING: content after a branch in a label, line: ' + subItem.lineNum + '::' + dump(subItem));
}
} else {
throw "ERROR: what is this? " + JSON.stringify(subItem);
diff --git a/src/intertyper.js b/src/intertyper.js
index 71b19223..5cdbff81 100644
--- a/src/intertyper.js
+++ b/src/intertyper.js
@@ -149,6 +149,7 @@ function intertyper(data, parseFunctions, baseLineNum) {
tokens.splice(openBrace, tokens.length-openBrace+1);
tokens.push(token);
token.type = '{';
+ token.text = '{ ' + token.text + ' }';
lastToken = token;
} else {
tokens.push(token);
@@ -791,7 +792,10 @@ function intertyper(data, parseFunctions, baseLineNum) {
// 'resume' - partial implementation
substrate.addActor('Resume', {
processItem: function(item) {
- return [{ intertype: 'resume' }];
+ return [{
+ intertype: 'resume',
+ lineNum: item.lineNum
+ }];
}
});
// 'switch'