Commit graph

8 commits

Author SHA1 Message Date
leaysgur
15b87adb05 chore(regular_expression): Extract diagnostics (#5287)
- Extract `Diagnostic::error()`s to separate file
- Align error message prefix
2024-08-28 03:19:29 +00:00
leaysgur
cffce11620 fix(regular_expression): Prevent panic on too large number (#5282)
Partially close #5257

Use `checked_(mul|add)` to prevent panic.
2024-08-28 01:31:54 +00:00
leaysgur
46b641b75d feat(regular_expression): Validate max quantifier value (#5218)
I've never seen but `/a{9007199254740991}/` is valid and this is the maximum value for quantifier.

\+ left comment about #5210 experiment.
2024-08-26 07:11:04 +00:00
leaysgur
c7b81f5762 chore(regular_expression): Update example to support RegExp constructor (#5106)
- Fix example to handle `new RegExp()` too
- Update NOTE comments

- - -

Until I tried interacting with the actual AST parsed by `oxc_parser`, I thought that the current `oxc_regular_expression` lacked support for the `RegExp` constructor due to escape sequences.

This was because `"\""` remained `"\""` after reading the source text from `.js` files.

However, once it was parsed by `oxc_parser`, I found that everything was [resolved](8ef85a43c0/crates/oxc_parser/src/lexer/string.rs)! (Wonderful work as usual. 👏🏻 )

Now there is nothing to worry about. 😌
2024-08-23 04:57:32 +00:00
leaysgur
96f57984eb refactor(regular_expression): Misc refactoring for body_parser (#5062)
- Add examples to list all `RegExp`s in source code
- Refactor `MayContainStrings` related part
2024-08-22 11:21:41 +00:00
Boshen
afe728a73a feat(parser): parse regular expression with regex parser (#4998)
Many false positives and incorrect errors. @leaysgur Enjoy 😁

Run `just conformance` to update the snapshot.
2024-08-22 03:09:55 +00:00
Boshen
081e2a37d9
refactor(regular_expression): s/RegExpLiteral/RegularExpression 2024-08-20 14:26:32 +08:00
Boshen
8d3f61bb54
chore(oxc_regular_expression): rename crate 2024-08-20 10:59:00 +08:00