Can now save (apply) stuff from textEditor with annotations
This commit is contained in:
parent
479abf7996
commit
ef48a4f468
2 changed files with 5 additions and 3 deletions
|
|
@ -202,7 +202,7 @@ export const _rt = {
|
|||
const trimmed = code.trim();
|
||||
|
||||
// is it a definition
|
||||
const defMatch = /^([a-z_][a-zA-Z0-9_]*)\s*=(?![=])/.exec(trimmed);
|
||||
const defMatch = /^([a-z_][a-zA-Z0-9_]*)\s*[:=]/.exec(trimmed);
|
||||
|
||||
if (defMatch) {
|
||||
try {
|
||||
|
|
@ -214,7 +214,8 @@ export const _rt = {
|
|||
if (defs.length > 0) {
|
||||
const def = defs[0];
|
||||
recompile(def.name, def.body!);
|
||||
const source = prettyPrint({ kind: 'definition', name: def.name, body: def.body });
|
||||
definitions.set(def.name, def);
|
||||
const source = prettyPrint(def);
|
||||
appendChangeLog(def.name, source);
|
||||
saveDefinitions();
|
||||
return { _tag: 'Defined', _0: def.name };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue