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
We ditch strings altogether. That's radical but not necessarily impossible, it mostly depends on rowan's and logos' ability to work with byte slices. That's why Paths exist in Rust in the first place : they may not be UTF-8. Clearly the best solution if it's doable.
We convert files before parsing them. That's unfortunately a bit slower and IMO a little more undesirable as we're clearly transforming user input just because we like it better. That also prevents us from pretending to be 100% compatible with lustres's spec. And this also requires asking the user which encoding their files are in, which is a new CLI parameter/function argument
rowan: unfortunately, the GreenNode::new constructor takes an &str. We can try to open an issue, but if this doesn't work, it's always possible to cheat. We could for instance encode the byte slice as base64 and prepend a discriminator char. Dirty, but still better than option 2 IMO as we're not imposing our own rules.
The text was updated successfully, but these errors were encountered:
Also this wouldn't require a full rewrite of anything once we're using nom (#8), as our parser won't deal with the source code anymore at all, it's all hidden in the rowan_nom module.
2 solutions :
rowan
's andlogos
' ability to work with byte slices. That's whyPath
s exist in Rust in the first place : they may not be UTF-8. Clearly the best solution if it's doable.Edit: byte slice support
logos
: should be good in theory, but I don't know if regexes work well with non-string inputrowan
: unfortunately, theGreenNode::new
constructor takes an&str
. We can try to open an issue, but if this doesn't work, it's always possible to cheat. We could for instance encode the byte slice as base64 and prepend a discriminator char. Dirty, but still better than option 2 IMO as we're not imposing our own rules.The text was updated successfully, but these errors were encountered: