Tags: source-academy/js-slang
Tags
Add Interactive Environment Visualiser (#1403) * The last node on context.runtime.nodes remains is no longer shifted to allow line highlighting on the frontend * WIP: Configuring Env Viz to work with a step limit * Added envSteps variable to context.runtime * Passed options as an additional paramater to ECEvaluate and ECEMachine to access isPrelude option * The evaluator now counts the number of steps (each command is one step) The value in context.runtime.envSteps is the step limit the evaluator is supposed to evaluate until. If it is -1, the evaluator will evaluate to the end. How the evaluator stops prematurely is by counting the number of steps and inserts a dummy debugger statement to break the program when the step limit is reached. * Updated to prevent use of dummy debugger statements which caused problems. Also added in context.runtime.envStepsTotal to keep track of total number of steps * Code quality improvements * Configured interpreter to fast forward to environment changing operations * Created util function to filter env changing operations * Added node location to artifically created nodes * Include application instructions as env changing operations * WIP: Update breakpoint step numbers in context * This changes how breakpoints work and fails breakpoint tests. * Minor changes * Prevent creation of empty environments for nullary functions. * Visualise pre-defined functions in the global environment . * Don't break when encountering breakpoints --------- Co-authored-by: Vansh <[email protected]> Co-authored-by: Martin Henz <[email protected]>
Name anonymous functions with more details (#355) * name anonymous functions more detailed * Update src/closure.ts Co-Authored-By: Open O. Close <[email protected]> * anonyomous functions identified by their parameters * single parameter prettier now * single parameter prettier now
PreviousNext