Skip to content

Module imports broken for files named README.md #3695

@Baltoli

Description

@Baltoli

A user on Discord reports that they cannot import a module directly from a README.md in the tutorial.

The following code is a minimal reproduction:

README.md

```k
module A
endmodule
```

a.md

```k
module A
endmodule
```

test.k

require "README.md"

module TEST
  imports A
endmodule
$ kompile --version
K version:    v6.0.134
Build date:   Thu Oct 05 19:09:38 BST 2023
$ kompile test.k
[Error] Compiler: Could not find module: A
	Source(/home/bruce/code/scratch/test.k)
	Location(4,3,4,12)
	4 |	  imports A
	  .	  ^~~~~~~~~

If the require line in test.k is pointed at a.md instead, we see:

$ kompile --version
K version:    v6.0.134
Build date:   Thu Oct 05 19:09:38 BST 2023
$ kompile test.k
[Warning] Compiler: Could not find main syntax module with name TEST-SYNTAX in
definition.  Use --syntax-module to specify one. Using TEST as default.

as expected.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions