-
-
Notifications
You must be signed in to change notification settings - Fork 8
Debugging the Code
joha2 edited this page Jul 7, 2016
·
4 revisions
Go into the build
directory mentioned in README.md
and create a file debug.js
.
Write the following code into it to debug the bit encoding problems: (you may omit the comments ;-))
var cosmicos = require('./lib/cosmicos').cosmicos;
var evl = new cosmicos.Evaluate();
evl.applyOldOrder(); // old symbols introduced to start with at least something
//console.log(evl.evaluateLine("intro is:int;")); // logs a message in the console
console.log(evl.codifyLine("intro is:int;"));
console.log(evl.codifyLine("is:prime 5;"));
// calls Parse.codify
Afterwards edit the appropriate hx-Files and perform make
in the build directory. Then check the output of js debug.js
called from within the build
directory. In the hx-Files you may use trace
to obtain an output at STDOUT
.
Maybe the creation process of the message lasts veeeeery long due to several intermediate trace
instructions. Then cancel it and cp -vf ./transform/CosmicEval.js ./lib/cosmicos.js
to obtain an up-to-date js file for testing.