Spec new encoding from #3 - #5
Merged
Merged
Conversation
rossberg
reviewed
Nov 10, 2025
rossberg
left a comment
Member
There was a problem hiding this comment.
Ah, I'm afraid the text type is for meta-level strings, which are a completely separate universe from Wasm strings or sequences. Sorry for misleading you in my earlier comment!
See my suggestion below for how you can express an empty Wasm string (as an empty sequence of codepoints).
Your second version should have worked as well, though. I'll have to investigate.
The latter two refer to the length of the binary encoding, so are not what we want here. This notation is not currently interpreted by SpecTec, so type checking may be a bit too loose.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is producing an error that I don't know how to resolve. I have tried the following conditions:
if nm_e = ""(fails with many flavors of "expression's typechar*does not match typetext")if |nm_e| = 0(fails with "expression's typenamedoes not match type (_)*")if ||nm_e|| = 0(fails with "type error: undeclared grammarnm_e")if ||Bname|| = 0(works, but clearly shouldn't because there are two occurrences ofBnamein the grammar rule!)It really seems like both of the first two options should work. Surely
char*should be able to matchtext, and surelyname(which is defined aschar*) should match(_)*.