Commit Graph

118 Commits

Author SHA1 Message Date
Asger F
3a6089740e JS: Separate JSDoc qualified names into individual identifiers 2025-03-27 11:51:14 +01:00
Asger F
c61454b5ca JS: Remove unused 'spec' field 2025-03-27 11:51:13 +01:00
Asger F
bf9d7484e4 JS: Use StringBuilder when building up type name
This code was a bit of a performance cringe. It copied every character
into a temporary array, copied that into a String, and slow-appended
that onto another String.

Note that the call to Characters.toChars is redundant here as advance()
doesn't return a code point; it returns -1 or a UTF-16 char. The -1 case
is checked for before reaching the call, so we can just cast it to
a char and use it directly.

We use a StringBuilder to accumulate the string. Normally it's faster
to track the start/end indices and do a substring(), but that won't
work in the JSDoc extractor because of the star-skipping logic in
advance().
2025-03-20 09:43:10 +01:00
Napalys Klicius
3191b2c6fc Update javascript/extractor/src/com/semmle/js/parser/RegExpParser.java
Co-authored-by: Erik Krogh Kristensen <erik-krogh@github.com>
2025-03-11 09:40:24 +01:00
Napalys
08c07f815f Improved documentation, removed union fram change note. 2025-03-11 08:30:17 +01:00
Napalys
9c8e0a5537 Applied changes from comments.
Co-authored-by: Asgerf <asgerf@github.com>
2025-03-10 13:29:05 +01:00
Napalys
95d05ceab8 Now store vFlagEnabled instead of each time searching for it.
Added `uFlagEnabled` for checking how should `\p{}` be treated. And small optimization.
2025-03-05 10:34:38 +01:00
Napalys
8086c25abe Removed Union as standard character class is already an union. 2025-03-05 10:07:20 +01:00
Napalys
fe6de2f672 Added support for character class union in regex processing 2025-03-03 14:37:46 +01:00
Napalys
3664d50772 Added support for -- subtraction opetor. 2025-03-03 14:37:43 +01:00
Napalys
381b5ebe8a Added intersection support 2025-03-03 14:37:40 +01:00
Napalys
2333c538d9 Added ability to parse nested character classes while using v flag. 2025-03-03 14:37:38 +01:00
Napalys
ed418be97a Add support for '\q{}' escape sequence in regular expressions. 2025-03-03 14:37:20 +01:00
Napalys
cb448db3ce Exposed flags to the regex parser 2025-03-02 17:08:52 +01:00
Asger F
2d36a5d478 JS: Use JSX syntax in first attempt when extension is .jsx 2025-02-03 13:17:15 +01:00
Cornelius Riemenschneider
42c343e820 Address review 2023-10-24 16:03:35 +02:00
Cornelius Riemenschneider
de85f2bbf8 Fix errorprone violations. 2023-10-20 16:23:35 +02:00
Asger F
5a4fe1b4da JS: Stop complaining about comments in JSON files 2023-04-27 10:55:36 +02:00
erik-krogh
c460eae2e1 implement diagnostics 2023-03-02 14:54:54 +01:00
erik-krogh
ccae0933c7 try to parse JS files without using the supported extensions 2022-09-19 12:20:20 +02:00
Asger Feldthaus
acc28df785 JS: Bugfix in tsconfig file inclusion handling 2021-04-01 16:33:05 +01:00
Erik Krogh Kristensen
bff59a1aaa fix parse error in regular expressions 2021-03-08 12:04:11 +01:00
alexet
8dd5a7e7c7 Javascript Extractor: Update <tt> tages to <code> 2021-02-09 12:10:09 +00:00
Asger Feldthaus
c08ba1416d JS: Add new SourceType for angular templates 2021-01-18 12:16:13 +00:00
Erik Krogh Kristensen
044fbc0b49 optimize the regexp parser 2020-11-11 21:13:11 +01:00
Erik Krogh Kristensen
6b7f8dd505 fix parse errors related to char escapes and char ranges 2020-11-10 21:02:29 +01:00
Asger Feldthaus
0220ab6784 JS: Move some TypeScript classes into .ts.extractor 2020-10-06 11:13:03 +01:00
Erik Krogh Kristensen
fbd62abd64 prevent crash when TemplateLiteral is used in import 2020-10-01 11:26:49 +02:00
Asger Feldthaus
d728c3948c JS: Log the amount of memory passed to TypeScript process 2020-09-15 09:17:42 +01:00
Erik Krogh Kristensen
038cca814a Merge branch 'main' into ts4 2020-08-28 10:27:49 +02:00
Erik Krogh Kristensen
73d1fac88e support named tuples where not all tuple elements are named 2020-08-17 16:20:26 +02:00
Erik Krogh Kristensen
6f28ddf1f8 proper support for this inside a JSX-name 2020-08-17 14:23:42 +02:00
Erik Krogh Kristensen
d95d427c5b better support for the &&=, ||=, and ??= operators 2020-08-13 09:22:32 +02:00
Erik Krogh Kristensen
fd9eb1d40b use Identifier instead of just a plain string when getting tuple-element-names 2020-08-12 16:55:55 +02:00
Erik Krogh Kristensen
26dcd2faae add support for getting the name from named tuple elements 2020-08-12 10:33:49 +02:00
Erik Krogh Kristensen
ea583fe862 add basic support for named tuple elements 2020-08-11 13:57:11 +02:00
Erik Krogh Kristensen
08c017eb09 change where tuples elements are loaded from to match TS 4.0 2020-08-11 13:57:10 +02:00
Asger Feldthaus
8632c2a3b2 JS: Factor out VirtualSourceRoot 2020-06-29 08:18:29 +01:00
Asger Feldthaus
675c64d9d4 JS: Prefer extracting file with tsconfig that included it 2020-06-25 15:38:19 +01:00
Asger Feldthaus
dceb211021 JS: Pass source root to Node.js process 2020-06-25 15:38:18 +01:00
Asger Feldthaus
823ed3bbdf JS: Wrap node --version call in retry loop 2020-05-22 10:40:16 +01:00
Asger Feldthaus
6f0356b229 Revert "JS: Remove timeout for node --version check"
This reverts commit ec7c9489dc.
2020-05-22 10:40:07 +01:00
Asger Feldthaus
ec7c9489dc JS: Remove timeout for node --version check 2020-05-20 17:12:24 +01:00
Asger Feldthaus
883846dfb6 JS: Fix extraction of negative number literal types 2020-04-20 16:17:15 +01:00
Asger Feldthaus
2bdf26a8f1 JS: Remove unneeded forwarding method 2020-03-12 15:48:47 +00:00
Asger Feldthaus
788c0f9037 JS: Refactor metadata class a bit 2020-03-12 15:45:22 +00:00
Asger Feldthaus
1a1b7d4ee0 JS: Switch to whitelisting allowed properties 2020-03-11 16:09:14 +00:00
Asger Feldthaus
759631ae56 JS: Raise default memory limit to 2.4G 2020-03-07 15:13:53 +00:00
Asger Feldthaus
c55dcf88d5 JS: Improve error reporting 2020-03-07 15:13:52 +00:00
Asger Feldthaus
8d58aad0f2 TS: Support type-only import/export 2020-02-24 11:40:27 +00:00