Skip to content
Snippets Groups Projects
Commit 8f853269 authored by charguer's avatar charguer
Browse files

todo_update

parent fcf1c45c
No related branches found
No related tags found
No related merge requests found
//https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Parser_API
function esprimaToAST(prog) {
var toList = function (array) {
var r = {tag: "[]"};
......
......@@ -40,14 +40,14 @@ ASSEMBLY_JS := \
JsNumber.log.js \
JsSyntax.log.js \
JsSyntaxAux.log.js \
Translate_syntax.js \
Translate_syntax.js \
List0.log.js \
JsSyntaxInfos.log.js \
JsCommon.log.js \
JsCommonAux.log.js \
JsPreliminary.log.js \
JsInit.log.js \
Prheap.js \
Prheap.js \
LibTactics.log.js \
LibProd.log.js \
LibFunc.log.js \
......
=========================================================
FIRST
[Thomas]
- remove intermediate folder "miniml" in "../jsjsref/miniml/.."
- include a local copy of esprima so that one can work offline
- include a local copy of esprima so that we can work offline
- remove stdlib_js/* => probably drop it
=========================================================
ARTHUR
- remove "open JsNumber" to more easily trace occurences
- generate "type: " in smart contsructors
- generate the escaped source code
- control which file should feature logging
=========================================================
NEXT
- introduce testing functions called:
- test_exec("code") -> parse, convert, build trace, log trace
- lineof_temp["5"] => 5 should be int
[arthur will do a first pass]
- clean up stdlib.ml
- implement stdlib.js
- remove unused functions
- sort out remaining ones
- implement stdlib.js
- need to have one function for each one of stdlib.ml
- number related functions are implemented with JS counterpart directly
JsNumber.ml should be replaced by JsNumber.mli (we might want to keep
JsNumber.ml for future use, though), and we implement by hand JsNumber.js,
which would then be included directly in assembly.js.
- Int32 and Int64 implem [alan] directly in JS
- display JS values/env/heap/ctx in html
- contexts: essentially as before
- environments: need to follow the list of environment records
- heap: same as before, and do not attempt at first to show
additional information in the heap appart from key/value bindings.
=========================================================
NEXT
[thomas, biggest piece, ask if anything problematic]
- fill in the "esprima-to-ast.js" file, following the template
(throw an exception, caught and displayed as an alert message,
in case the source program uses for-in).
- update the code that translates esprima syntax to recognize
"use strict" directives, which come as first statement of
a body, in hte form of a raw expression of raw type "use script".
(look on the web for code that already does this for esprima).
[alan or thomas]
- figure out what to do for Parser_syntax Parser_main
- test langage features one by one, using minimal input programs;
these programs should be stored in an "examples/" folder;
for each example, check the AST, check step-by-step the execution.
- test a compound example, e.g.:
[our goal is to build trace for]
- Introduce testing functions called:
- test_exec("code") -> parse, convert, build trace, log trace
- Test first "var x = 3".
- Test a compound example, e.g.:
var x = 3;
x = 4;
if (x === 4) {
while (true) {}
while (false) {}
}
- Test langage features one by one, using minimal input programs;
these programs should be stored in an "examples/" folder;
for each example, check the AST, check step-by-step the execution.
=> to see if the right things get highlighted
[second biggest, only once we manage to build the trace]
- display JS values/env/heap/ctx in html
- contexts: essentially as before
- environments: need to follow the list of environment records
- heap: same as before, and do not attempt at first to show
additional information in the heap appart from key/value bindings.
=========================================================
LATER
- update the code that translates esprima syntax to recognize
"use strict" directives, which come as first statement of
a body, in hte form of a raw expression of raw type "use script".
(look on the web for code that already does this for esprima).
[thomas]
- bigger test262 testing.
[thomas and alan]
- set up the call to the appropriate function for propagating the
"strictness" info in the AST.
......@@ -75,6 +97,7 @@ LATER
- explain that currently JS files are generated
from ML files and thus should not be edited,
although this might change in the future.
- assembly.js should have a header
- full display of heap information
add a "+details" button
......@@ -93,6 +116,11 @@ LATER
- INTERP_VAL("x") = JSOF(INTERP_RAW("x"))
- PROG_VAL("x") = JSOF(PROG_RAW("x"))
=========================================================
LATER LATER
- Reactivate the generation of the lines of the form:
default: throw "No matching case for switch";
by having js_of_pattern return an additional boolean
......@@ -100,10 +128,6 @@ LATER
This is needed to detect bugs in the spec where the
switch are missing useful cases.
=========================================================
LATER LATER
- There is one place where we compute a "substring" in the code;
need to check whether the argument is always nonnegative.
......
......@@ -54,11 +54,14 @@ val ( > ) : 'a -> 'a -> bool
val ( <= ) : 'a -> 'a -> bool
val ( >= ) : 'a -> 'a -> bool
*)
(* no need to implement those in stdlib.js because JS has them already *)
val ( = ) : float -> float -> bool
val ( < ) : float -> float -> bool
val ( > ) : float -> float -> bool
val ( <= ) : float -> float -> bool
val ( >= ) : float -> float -> bool
(*val compare : 'a -> 'a -> int*)
val bool_eq : bool -> bool -> bool
......@@ -103,11 +106,13 @@ val ref : 'a -> 'a ref
val (:=) : 'a ref -> 'a -> unit
val (!) : 'a ref -> 'a
(* Coq extraction builtins refer directly to Pervasives at times *)
(* no longer needed it seems *)
module Pervasives : sig
val succ : int -> int
end
(* should not be needed if we do'nt use JsNumber.ml *)
module Int32 : sig
val logand : int32 -> int32 -> int32
val lognot : int32 -> int32
......@@ -120,17 +125,18 @@ module Int32 : sig
val to_float : int32 -> float
end
module Int64 : sig
(* should not be needed if we do'nt use JsNumber.ml *)
module Int64 : sig
val one : int64
val float_of_bits : int64 -> float
end
module List : sig
module List : sig (* should rely on List0 instead *)
val map : ('a -> 'b) -> 'a list -> 'b list
val rev : 'a list -> 'a list
end
module String : sig
module String : sig (* should rely on String0 instead *)
val length : string -> int
val append : string -> string -> string
val sub : string -> int -> int -> string
......@@ -149,7 +155,7 @@ val prerr_newline : unit -> unit
val prerr_endline : string -> unit
module Parser_syntax : sig (* ARTHUR: to implement *)
module Parser_syntax : sig (* needed by translate_syntax.mli and by parser_main (below) *)
type unary_op
type arith_op
type bin_op
......@@ -168,10 +174,12 @@ end
*)
module Obj : sig
module Obj : sig (* should not be needed *)
type t
end
val print_endline : string -> unit
(* only used for debug*)
val print_endline : string -> unit
val __LOC__ : string
......@@ -484,6 +484,7 @@ var parsedTree;
}
function run() {
// TODO:parse
JsInterpreter.run_javascript(JsInterpreter.runs, program);
assignSourceLocInTrace(datalog);
tracer_items = datalog;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment