Newer
Older
import inputLine, { InputCanceledError } from './misc/inputLine';
console.log('intaractive parser');
while (true) {
let input: string;
try {
input = await inputLine('> ');
}
catch (err) {
if (err instanceof InputCanceledError) {
console.log('bye.');
return;
}
throw err;
}
// replace special chars
input = input
.replace(/\\n/g, '\n')
const parseTime = (parseTimeEnd - parseTimeStart).toFixed(3);
console.log(`parsing time: ${parseTime}ms`);
}
catch (err) {
console.log('parsing error:');
console.log(err);
}
console.log();
}
}