|
|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
import { tokenize } from './lexer'
|
|
|
|
|
import { Parser } from './parser'
|
|
|
|
|
import { recompile } from './compiler'
|
|
|
|
|
import { recompile, definitions } from './compiler'
|
|
|
|
|
import { prettyPrint } from './ast'
|
|
|
|
|
|
|
|
|
|
export const store: Record<string, any> = {};
|
|
|
|
|
|
|
|
|
|
@ -44,6 +45,11 @@ export const _rt = {
|
|
|
|
|
}
|
|
|
|
|
return results;
|
|
|
|
|
},
|
|
|
|
|
getSource: (name: string) => {
|
|
|
|
|
const ast = definitions.get(name);
|
|
|
|
|
if (!ast) return "";
|
|
|
|
|
return prettyPrint(ast);
|
|
|
|
|
},
|
|
|
|
|
rebind: (name: string, pathOrValue: any, maybeValue?: any) => {
|
|
|
|
|
if (maybeValue === undefined) {
|
|
|
|
|
if (pathOrValue && pathOrValue.ast) {
|
|
|
|
|
|