Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display multibyte e-expression headers #181

Open
zslayton opened this issue Nov 6, 2024 · 0 comments
Open

Display multibyte e-expression headers #181

zslayton opened this issue Nov 6, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@zslayton
Copy link
Contributor

zslayton commented Nov 6, 2024

Currently, inspect assumes all e-expressions will have a one-byte header:

fn inspect_eexp(&mut self, depth: usize, eexp: EExpression<AnyEncoding>) -> Result<()> {
let mut formatter = BytesFormatter::new(
BYTES_PER_ROW,
vec![
// TODO: Add methods to EExpression that allow nuanced access to its encoded spans
// TODO: Length-prefixed and multibyte e-expression addresses
IonBytes::new(BytesKind::MacroId, &eexp.span().bytes()[0..1]),
],
);

However, is only the case for invocations of user macros with an ID lower than 64.
Invocations of system macros are two bytes (0xEE 0x__), and invocations of macros with IDs >= 64 are at least two bytes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant