gracelang / minigrace

Self-hosting compiler for the Grace programming language
39 stars 22 forks source link

importing files with .grace in name #248

Closed apblack closed 4 years ago

apblack commented 7 years ago

If one writes (incorrectly)

import "filename.grace" as nick

the compiler will find and compile filename.grace, as if one had written

import "filename" as nick

but there will then be an internal error when the runtime fails to load the compiled version, which it seeks under the name filename.grace.js

apblack commented 5 years ago

I think that the right behaviour here should be to reject the import statement with the extension. Why? There should be just one way of doing the import, and that should be by using the basename without an extension.

KimBruce commented 5 years ago

Sounds reasonable to me, though I would hope for a specialized error message that would let the user know that the ".grace" suffix was the problem (or maybe even that any suffix is a problem).

apblack commented 5 years ago

Of course. Helpful Messages are Us

apblack commented 4 years ago

This is fixed in commit 23d441a