You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By name of interior elements (e.g. Seq, Repeat, Tuple, or Record whose non-implicit elements are all base.ascii-char(.*)?)
By name pattern-match (e.g. /ascii/ && /string/ or /ascii-string/ || /asciiz-string/)
By structural pattern match (e.g. simply-nested or top-level record with a field named "string" satisfying certain ascii-like properties)
Possible workarounds:
- Move format-specific string types to Base and enforce similar prefixing logic to base.ascii-char and derivatives. This may require renaming base.asciiz-string to base.ascii-string.cstr or similar
EDIT:
This should extend to Unicode strings as well, as utf8.string = repeat utf8.char is currently handled in sequences rather than string-form. This may be good enough for now, but if text formats are ever unified (i.e. ascii as a subset of UTF-8), this may be more relevant than it is now.
The text was updated successfully, but these errors were encountered:
I'd like to see how far we can get by leveraging ascii-char and building up from there, the only complicated part is that some strings require a nul terminator, some have an optional nul terminator, and some are a fixed width and may include arbitrary nul characters. Perhaps ascii-char, ascii-nul, and ascii-non-nul would be sufficient?
archaephyrryx
changed the title
Handle all ASCII-String-like formats as first-class ASCII strings
Pretty-print all String-like formats as strings, rather than sequences of characters
Nov 8, 2023
Currently, the ASCII string types we want to display as ascii are:
base.ascii-char
orbase.ascii-char.*
(glob, not regex)"base.asciiz-string"
:=record([("string", repeat(not_byte(0x00))), ("null", is_byte(0x00))])
"tar.ascii-string"
:=record([("string", repeat(not_byte(0x00))), ("padding", repeat1(is_byte(0x00)))])
"tar.ascii-string.opt0"
:=record([("string", repeat(not_byte(0x00))), ("padding", repeat(is_byte(0x00)))])
"tar.ascii-string.opt0.nonempty"
:=record([("string", repeat1(not_byte(0x00))), ("padding", repeat(is_byte(0x00)))])
Possible classifications
base.ascii-char(.*)?
)/ascii/ && /string/
or/ascii-string/ || /asciiz-string/
)"string"
satisfying certain ascii-like properties)Possible workarounds:
- Move format-specific string types to
Base
and enforce similar prefixing logic tobase.ascii-char
and derivatives. This may require renamingbase.asciiz-string
tobase.ascii-string.cstr
or similarEDIT:
This should extend to Unicode strings as well, as
utf8.string = repeat utf8.char
is currently handled in sequences rather than string-form. This may be good enough for now, but if text formats are ever unified (i.e. ascii as a subset of UTF-8), this may be more relevant than it is now.The text was updated successfully, but these errors were encountered: