-
Notifications
You must be signed in to change notification settings - Fork 0
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
Validator, parser, visitor #1
Conversation
@@ -6,3 +6,19 @@ edition = "2021" | |||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | |||
|
|||
[dependencies] | |||
debug-cell = { git = "https://github.com/helixbass/debug-cell", rev = "d94711a" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was forked to add Ref::map()
/RefMut::map()
wtf8 = "0.1.0" | ||
|
||
[dev-dependencies] | ||
serde_json = { git = "https://github.com/helixbass/json", rev = "eb2cf6b" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was forked because of serde-rs/json#1089
Given that this is only used in tests (for parsing "known" JSON fixture files) I'm not too worried about whether the "fix" is that "sound" or not
@@ -0,0 +1,1617 @@ | |||
#[cfg(test)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be nice to clean all of this up (maybe generate some stuff via macros?) but seemed desirable to define the *Unresolved
AST types next to the corresponding AST types
}) | ||
} | ||
|
||
pub fn as_backreference(&self) -> &Backreference { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be interesting to have a macro that generates all of these (for a given enum)?
StringOrU32::String(value) => { | ||
// TODO: should handle this better? | ||
assert!(value == "$$Infinity"); | ||
u32::MAX |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if I actually "tested" this anywhere, basically I just tried to use u32::MAX
in places where the JS version was using Infinity
|
||
pub extern crate id_arena; | ||
|
||
pub type Result<T> = std::result::Result<T, RegExpSyntaxError>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should go back through and use this "everywhere"
Wtf16, | ||
}; | ||
|
||
pub type CodePoint = u32; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A little arbitrary that this is defined/exported from here (probably in general the shape of the "public API" of the crate is kind of random/likely incomplete)
}; | ||
|
||
#[derive(Clone, Debug, Default, Eq, PartialEq, Hash)] | ||
pub struct Wtf16(Vec<u16>); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems likely that this will/should get extracted into its own crate (even if not very robust) since it will probably eg "bleed into" tree-sitter-lint-plugin-eslint-builtin
?
In this PR: