Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions design/mvp/Explainer.md
Original file line number Diff line number Diff line change
Expand Up @@ -2539,17 +2539,18 @@ plainname ::= <label>
| '[method]' <label> '.' <label>
| '[static]' <label> '.' <label>
label ::= <first-fragment> ( '-' <fragment> )*
first-fragment ::= [a-z] <word>
| [A-Z] <acronym>
first-fragment ::= <first-word>
| <first-acronym>
first-word ::= [a-z] [0-9a-z]*
first-acronym ::= [A-Z] [0-9A-Z]*
fragment ::= <word>
| <acronym>
word ::= [0-9a-z]*
acronym ::= [0-9A-Z]*
word ::= [0-9a-z]+
acronym ::= [0-9A-Z]+
interfacename ::= <namespace> <label> <projection> <interfaceversion>?
| <namespace>+ <label> <projection>+ <interfaceversion>? 🪺
namespace ::= <words> ':'
words ::= <word>
| <words> '-' <word>
words ::= <first-word> ( '-' <word> )*
projection ::= '/' <label>
interfaceversion ::= '@' <valid semver>
| '@' <canonversion> 🔗
Expand Down
41 changes: 41 additions & 0 deletions test/names/kebab.wast
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
(import "B-1" (func))
(import "B-1-C-2-D-3" (func))
(import "a11-B11-123-ABC-abc" (func))
(import "ns-1-a:b-1-c/D-2" (func))
))
(assert_invalid
(component
Expand All @@ -17,3 +18,43 @@
(component
(import "1-a" (func)))
"is not in kebab case")
(assert_invalid
(component
(import "" (func)))
"is not in kebab case")
(assert_invalid
(component
(import "a-" (func)))
"is not in kebab case")
(assert_invalid
(component
(import "a--" (func)))
"is not in kebab case")
(assert_invalid
(component
(import "1:a/b" (func)))
"is not in kebab case")
(assert_invalid
(component
(import "A:b/c" (func)))
"is not a valid extern name")
(assert_invalid
(component
(import "1:b/c" (func)))
"is not a valid extern name")
(assert_invalid
(component
(import "ns-A:b/c" (func)))
"is not a valid extern name")
(assert_invalid
(component
(import "ns:A/b" (func)))
"is not a valid extern name")
(assert_invalid
(component
(import "ns:1/a" (func)))
"is not a valid extern name")
(assert_invalid
(component
(import "ns:pkg-A/b" (func)))
"is not a valid extern name")