DanielXMoore / Civet

A TypeScript superset that favors more types and less typing
https://civet.dev
MIT License
1.55k stars 33 forks source link

import vs multiplication #1307

Closed edemaine closed 4 months ago

edemaine commented 4 months ago

I ran into this while Civetifying source/cli.civet:

export function repl
  global.quit = global.exit = => process.exit 0
  * as nodeRepl from node:repl

Currently this parses as 0 * as(nodeRepl(from({'node':repl}))).

Assuming we want to allow * multiplication to be unindented like this, we should probably forbid in the special case that it parses like an import.

Workaround:

export function repl
  global.quit = global.exit = => process.exit 0
  import * as nodeRepl from node:repl