Commit Graph

927 Commits

Author SHA1 Message Date
Taus
ac8b41a5da Merge pull request #19680 from github/tausbn/javascript-exclude-obviously-generated-files
JavaScript: Don't extract obviously generated files
2025-06-20 15:52:39 +02:00
Taus
e3d9d92f25 JavaScript: Fix duplicate comment 2025-06-10 12:59:03 +00:00
Taus
f08c2fa387 JavaScript: Move tsconfig files into extractor.tsconfig package
Also make the indentation in `CompilerOptions.java` more consistent.
2025-06-10 12:58:48 +00:00
Taus
281ccf7c11 JavaScript: Extract tsconfig.json also in basic mode
This is needed for the logic that skips files inside the directory
specified in the `tsconfig.json` `outDir` compiler option.
2025-06-05 15:01:05 +00:00
Taus
619256e037 JavaScript: Fix existing tests and test runner
Fixes two things:
- The basic test should no longer extract `tst.js` (as `tst.ts` is
  present)
- The `AutoBuild` mock did not populate `extractedFiles` correctly,
  which broke the logic that looks for TypeScript files with the same
  basename.
2025-06-05 14:59:40 +00:00
Taus
8829f7820a JavaScript: Don't extract files with TypeScript progenitors 2025-06-05 14:57:00 +00:00
Taus
14f50880e9 JavaScript: Don't extract files in tsconfig.json outDir 2025-06-05 14:56:59 +00:00
Asger F
11607e5f62 JS: Update TRAP after extractor change 2025-05-20 13:20:36 +02:00
Asger F
50e4ac8298 JS: Do not ignore variables from ambient declarations 2025-05-20 13:19:51 +02:00
Asger F
359525b65a JS: Extract more tsconfig.json patterns 2025-04-29 12:46:49 +02:00
Asger F
8c0b0c4800 JS: Ensure json files are extracted properly in tests 2025-04-29 12:46:20 +02:00
Asger F
152d6f3c29 JS: Tolerate trailing comma in JSON objects 2025-04-28 10:56:48 +02:00
Asger F
6dd8114f00 JS: Add test with trailing comma in JSON object 2025-04-28 10:56:34 +02:00
Asger F
cfa1a9b603 JS: Update extractor version string 2025-04-10 07:20:53 +02:00
Asger F
1434f7acd2 JS: Tolerate trailing comma in JSON array
Previously we'd fail to extract some tsconfig.json files because of this.
2025-04-10 07:20:51 +02:00
Asger F
800dd168c2 JS: Add failing TRAP test for trailing comma 2025-04-10 07:20:49 +02:00
Asger F
ee867e99c7 Merge pull request #19117 from lcartey/lcartey/support-sap-json-formats
JavaScript: Add support for indexing additional SAP related JSON files
2025-03-31 10:30:11 +02:00
Asger F
c8817d9667 JS: Parse with proper locations 2025-03-27 11:51:23 +01:00
Asger F
cc2bec0808 JS: Ensure correct value is used in parseNameExpression()
The call to expect() below here updates 'token' and 'value' to that of the NEXT token (not the name).

The code happened to work because the 'value' field is only updated if a token with a relevant value is found. E.g. if a name token could be followed by another name, then we would have seen the wrong name here.
2025-03-27 11:51:21 +01:00
Asger F
b1554443d8 JS: Update TRAP output 2025-03-27 11:51:19 +01:00
Asger F
fa53ff9f3e JS: Update extractor version string 2025-03-27 11:51:16 +01:00
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
Luke Cartey
8814077c76 Add support for additional SAP JSON formats. 2025-03-25 17:01:37 +00: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
c93be70053 Rename validation methods for type expressions and added recursive call for type validation.
Co-authored-by: Asgerf <asgerf@github.com>
2025-03-14 14:58:27 +01:00
Napalys
1468e81c55 Ensure interface extends valid expr. 2025-03-14 13:41:37 +01:00
Napalys Klicius
a4f2264f17 Merge pull request #18899 from Napalys/js/ecma-2024-regex
JS: Add ECMAScript 2024 `v` Flag Operators for Regex Parsing
2025-03-11 12:50:44 +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
erik-krogh
752fc64f42 bump to stable 5.8 release 2025-03-10 09:21:25 +01:00
erik-krogh
b641caa508 update TypeScript version to 5.8.1-RC 2025-03-10 09:20:29 +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
8099423b6d Renamed character class operators lists to elements. 2025-03-05 09:34:21 +01:00
Napalys
9ea89cd63f Added a test case from #18854 2025-03-05 09:34:20 +01:00
Napalys
fe6de2f672 Added support for character class union in regex processing 2025-03-03 14:37:46 +01:00
Napalys
1e05f327d6 Added test cases for union. 2025-03-03 14:37:44 +01:00
Napalys
3664d50772 Added support for -- subtraction opetor. 2025-03-03 14:37:43 +01:00
Napalys
ee83c42b71 Added test cases for subtraction --. 2025-03-03 14:37:42 +01:00
Napalys
381b5ebe8a Added intersection support 2025-03-03 14:37:40 +01:00
Napalys
fa5093f6ad Added test cases for intersection 2025-03-03 14:37:39 +01:00
Napalys
2333c538d9 Added ability to parse nested character classes while using v flag. 2025-03-03 14:37:38 +01:00
Napalys
de6f3b1d04 Add additional test cases. 2025-03-03 14:37:37 +01:00
Napalys
ab7e08f40f Added test cases for nested character class. 2025-03-03 14:37:35 +01:00
Napalys
ed418be97a Add support for '\q{}' escape sequence in regular expressions. 2025-03-03 14:37:20 +01:00
Napalys
d162acf02c Added quoted string \q parser test cases 2025-03-02 17:09:01 +01:00
Napalys
cb448db3ce Exposed flags to the regex parser 2025-03-02 17:08:52 +01:00
Chris Smowton
4567e02b8c Regularise extractor pack licenses to all cite the MIT license that covers the whole CodeQL repository 2025-02-20 18:55:55 +00:00