miking-lang / miking

Miking - the meta viking: a meta-language system for creating embedded languages
Other
51 stars 31 forks source link

Pretty printing of programs where externals shadow instrinsics does not work #874

Open br4sco opened 3 weeks ago

br4sco commented 3 weeks ago

The pretty printer in mixer/print.mc currently cannot handle the case where an external shadows an intrinsic. For example, if we have an intrinsic foo and try to pretty print a program

type Foo
external foo : Foo
mexpr ()

it will pretty print to

type Foo
external foo1 : Foo
mexpr ()

which breaks the mapping to the external implementation of foo.

We can either forbid this kind of shadowing or update the pretty printer so that external foo : Foo actually shadows the intrinsic foo.