Commit 4e740bca authored by Camil Staps's avatar Camil Staps 🚀

Merge branch 'generate-instruction_type' into 'master'

Generate instruction_type function

See merge request !156
parents 1b9a24c5 8dccc50a
Pipeline #49534 passed with stages
in 10 minutes and 5 seconds
......@@ -9,7 +9,7 @@ WebPublic: $(WASM) abc-interpreter.js ../src/abc_instructions.h
cp $(WASM) WebPublic/js
cp abc-interpreter.js WebPublic/js
echo 'ABCInterpreter.instructions=[' >> WebPublic/js/abc-interpreter.js
sed -n 's/^\tINSTRUCTION(\(.*\))/\t"\1",/p' ../src/abc_instructions.h >> WebPublic/js/abc-interpreter.js
sed -n 's/^\tINSTRUCTION (\(.*\),.*)/\t"\1",/p' ../src/abc_instructions.h >> WebPublic/js/abc-interpreter.js
echo '];' >> WebPublic/js/abc-interpreter.js
%.wasm: %.wat
......
This diff is collapsed.
This diff is collapsed.
......@@ -42,11 +42,11 @@ where
# (e,f) = fend f
| e = (reverse is,f)
# (l,f) = freadline f
| l%(0,12) <> "\tINSTRUCTION(" = fetch_instructions is f
# i = l%(13,find_closing_paren 13 l-1)
| l%(0,13) <> "\tINSTRUCTION (" = fetch_instructions is f
# i = l%(14,find_comma 14 l-1)
= fetch_instructions [i:is] f
where
find_closing_paren i s = if (s.[i]==')') i (find_closing_paren (i+1) s)
find_comma i s = if (s.[i]==',') i (find_comma (i+1) s)
instance real TReal where real t = t
instance real TDReal where real t = t
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment