diff options
author | max99x <max99x@gmail.com> | 2011-07-31 04:48:43 +0300 |
---|---|---|
committer | max99x <max99x@gmail.com> | 2011-07-31 04:48:43 +0300 |
commit | 7f735afe5ee57f693602b661e8e6286dcc914c72 (patch) | |
tree | b2600adf0702544c40453febbf8fd5e09e048102 /src/compiler.js | |
parent | 4477fc67dea3cf0e6d54f4ae59946a70b069e7ae (diff) | |
parent | 3928f293b817a48797faf10b10a69240236de767 (diff) |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src/compiler.js')
-rw-r--r-- | src/compiler.js | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/compiler.js b/src/compiler.js index 8cb023d9..8980da93 100644 --- a/src/compiler.js +++ b/src/compiler.js @@ -12,6 +12,9 @@ if (!this['load']) { if (!this['read']) { read = function(f) { snarf(f) }; } +if (!this['arguments']) { + arguments = scriptArgs; +} // Basic utilities @@ -21,7 +24,10 @@ load('utility.js'); load('settings.js'); -var settings = JSON.parse(readline()); +var settings_file = arguments[0]; +var ll_file = arguments[1]; + +var settings = JSON.parse(read(settings_file)); for (setting in settings) { this[setting] = settings[setting]; } @@ -64,13 +70,9 @@ eval(processMacros(preprocess(read('runtime.js')))); // Read llvm -var lines = []; -var line; -do { - line = readline(); - if (line == null) break; - lines.push(line); -} while(true); +var raw = read(ll_file); +var lines = raw.split('\n'); +raw = null; // Do it |