Skip to content

Commit

Permalink
add new possible migration
Browse files Browse the repository at this point in the history
  • Loading branch information
fdodino committed Nov 28, 2023
1 parent 071c4c6 commit 9085549
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/commands/repl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ function defineCommands(autoImportPath: string | undefined, options: Options, re

export function interprete(interpreter: Interpreter, line: string): string {
try {
// TODO: migrate to wollok-ts???
// Decouple 1. interpreter should link sentence, or add a new import, and repl should process the result and catch errors
const sentenceOrImport = parse.Import.or(parse.Variable).or(parse.Assignment).or(parse.Expression).tryParse(line)
const error = [sentenceOrImport, ...sentenceOrImport.descendants].flatMap(_ => _.problems ?? []).find(_ => _.level === 'error')
if (error) throw error
Expand Down

0 comments on commit 9085549

Please sign in to comment.