MCPcopy Index your code
hub / github.com/aiscript-dev/aiscript / getAst

Function getAst

scripts/repl.mjs:39–59  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

37});
38
39async function getAst() {
40 let script = '';
41 let a = await i.question('>>> ');
42 while (true) {
43 try {
44 if (a === '.exit') return null;
45 script += a;
46 let ast = Parser.parse(script);
47 script = '';
48 return ast;
49 } catch(e) {
50 if (e instanceof errors.AiScriptUnexpectedEOFError) {
51 script += '\n';
52 a = await i.question('... ');
53 } else {
54 script = '';
55 throw e;
56 }
57 }
58 }
59}
60
61async function main(){
62 try {

Callers 1

mainFunction · 0.85

Calls 1

parseMethod · 0.45

Tested by

no test coverage detected