leaysgur
41582ea00c
fix(regular_expression): Improve RegExp to_string() results ( #5635 )
...
Hopefully fixes #5487
- `/^([a-zA-Z]+:)?[\p{L}0-9@/.\-_\\]+$/u`
- e3bc0ddcba/packages/cli-tools/src/launchEditor.ts (L53-L57)
2024-09-09 08:17:55 +00:00
leaysgur
28aad281b6
fix(regular_expression): Handle - in /[\-]/u as escaped character ( #5631 )
...
Fixes #5487
2024-09-09 04:14:17 +00:00
Don Isaac
0ac420d6f9
refactor(linter): use meaningful names for diagnostic parameters ( #5564 )
...
Also add `pending` fix labels to many rules.
2024-09-06 18:14:56 -04:00
leaysgur
dec139529d
refactor(regular_expression): Align diagnostics ( #5543 )
...
Manage all diagnostics for LiteralParser, FlagsParser, PatternParser in one place, same message format.
2024-09-06 16:28:06 +00:00
Boshen
1bed5ce2a5
chore: run cargo +nightly fmt to sort imports ( #5503 )
...
They are never going to be stable are they ... cedf7a4daa/.rustfmt.toml (L8-L16)
2024-09-06 04:04:26 +00:00
leaysgur
88b7ddb7e0
fix(regular_expression): Handle unterminated character class ( #5523 )
...
`/[/` is reported by `debug_assert!`, but should not.
2024-09-06 03:28:33 +00:00
rzvxa
9b984b31bd
fix(regex): panic on displaying surrogated UnicodeEscape characters. ( #5469 )
...
fixes https://github.com/oxc-project/oxc/pull/5387#issuecomment-2330534180
2024-09-05 06:18:11 +00:00
rzvxa
ccc8a27e4f
refactor(ast, ast_tools): use full method path for generated derives trait calls. ( #5462 )
...
As of now if we remove the implementation of a trait for a type and implement the method on that type directly it wouldn't break while it isn't the original trait anymore so that method might do something entirely different.
This change is more explicit on trait calls so we hit compile errors on these kinds of changes.
2024-09-05 05:36:50 +00:00
rzvxa
90facd3657
feat(ast): add ContentHash trait; remove noop Hash implementation from Span ( #5451 )
...
closes #5283
Also removes the noop Hash implementation on `Span` in favor of a real implementation.
2024-09-05 07:20:04 +03:30
rzvxa
23285f431d
feat(ast): add ContentEq trait. ( #5427 )
...
Part of #5283
2024-09-04 11:53:50 +00:00
overlookmotel
e7bd49dae4
refactor(regular_expression): correct typo ( #5429 )
...
Just correct a misspelling.
2024-09-04 00:54:22 +00:00
rzvxa
59abf27d95
feat(ast, parser): add oxc_regular_expression types to the parser and AST. ( #5256 )
...
closes #5060
2024-09-03 02:36:37 +00:00
rzvxa
c0b6269cef
feat(regular_expression): implement Display for RegularExpression type. ( #5304 )
...
Part of #5060
2024-09-03 02:20:45 +00:00
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