@appthreat/atom-parsetools 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/astgen.js +69 -14
- package/package.json +1 -1
- package/plugins/composer/installed.php +6 -6
- package/plugins/rubyastgen/bundle/ruby/4.0.0/extensions/x86_64-linux/4.0.0/prism-1.7.0/gem_make.out +5 -5
- package/plugins/rubyastgen/bundle/ruby/4.0.0/extensions/x86_64-linux/4.0.0/racc-1.8.1/gem_make.out +5 -5
package/astgen.js
CHANGED
|
@@ -262,7 +262,6 @@ const toEjsAst = (file) => {
|
|
|
262
262
|
let arr = originalCode.split("");
|
|
263
263
|
const scriptRegex = /(<script>)([\s\S]*?)(<\/script>)/gi;
|
|
264
264
|
let match;
|
|
265
|
-
|
|
266
265
|
while ((match = scriptRegex.exec(originalCode)) !== null) {
|
|
267
266
|
const openStart = match.index;
|
|
268
267
|
const openLen = match[1].length;
|
|
@@ -293,6 +292,7 @@ const toEjsAst = (file) => {
|
|
|
293
292
|
}
|
|
294
293
|
}
|
|
295
294
|
}
|
|
295
|
+
|
|
296
296
|
const codeWithoutScriptTag = arr.join("");
|
|
297
297
|
const out = new Array(codeWithoutScriptTag.length).fill(" ");
|
|
298
298
|
for (let i = 0; i < codeWithoutScriptTag.length; i++) {
|
|
@@ -305,20 +305,75 @@ const toEjsAst = (file) => {
|
|
|
305
305
|
while ((tagMatch = tagRegex.exec(codeWithoutScriptTag)) !== null) {
|
|
306
306
|
const [fullMatch, openTag, content, closeTag] = tagMatch;
|
|
307
307
|
if (openTag === "<%#" || content.trim().startsWith("include ")) continue;
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
308
|
+
|
|
309
|
+
let processedContent = content.trim();
|
|
310
|
+
let isTransformed = false;
|
|
311
|
+
if (processedContent === "end") {
|
|
312
|
+
processedContent = "}";
|
|
313
|
+
isTransformed = true;
|
|
314
|
+
} else if (processedContent === "else") {
|
|
315
|
+
processedContent = "} else {";
|
|
316
|
+
isTransformed = true;
|
|
317
|
+
} else if (processedContent.startsWith("else if")) {
|
|
318
|
+
let sub = processedContent.substring(4).trim();
|
|
319
|
+
const controlMatch = sub.match(/^(if)\s+(?!\()(.+)$/);
|
|
320
|
+
if (controlMatch) {
|
|
321
|
+
sub = `if (${controlMatch[2]})`;
|
|
322
|
+
}
|
|
323
|
+
processedContent = `} else ${sub} {`;
|
|
324
|
+
isTransformed = true;
|
|
325
|
+
} else {
|
|
326
|
+
const controlMatch = processedContent.match(
|
|
327
|
+
/^(if|while|for)\s+(?!\()(.+)$/
|
|
328
|
+
);
|
|
329
|
+
if (controlMatch) {
|
|
330
|
+
const keyword = controlMatch[1];
|
|
331
|
+
const condition = controlMatch[2];
|
|
332
|
+
processedContent = `${keyword} (${condition})`;
|
|
333
|
+
isTransformed = true;
|
|
334
|
+
}
|
|
335
|
+
if (
|
|
336
|
+
/^(if|while|for|try|switch|catch)/.test(processedContent) &&
|
|
337
|
+
!processedContent.endsWith("{") &&
|
|
338
|
+
!processedContent.endsWith("}") &&
|
|
339
|
+
!processedContent.endsWith(";")
|
|
340
|
+
) {
|
|
341
|
+
processedContent += " {";
|
|
342
|
+
isTransformed = true;
|
|
343
|
+
}
|
|
312
344
|
}
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
345
|
+
if (isTransformed) {
|
|
346
|
+
const startIndex = tagMatch.index;
|
|
347
|
+
const maxLen = fullMatch.length;
|
|
348
|
+
const needsSemi =
|
|
349
|
+
processedContent.length > 0 &&
|
|
350
|
+
!processedContent.endsWith("{") &&
|
|
351
|
+
!processedContent.endsWith("}") &&
|
|
352
|
+
!processedContent.endsWith(";");
|
|
353
|
+
if (needsSemi) processedContent += ";";
|
|
354
|
+
|
|
355
|
+
for (let k = 0; k < processedContent.length; k++) {
|
|
356
|
+
if (k < maxLen) {
|
|
357
|
+
out[startIndex + k] = processedContent[k];
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
} else {
|
|
361
|
+
const startIndex = tagMatch.index + openTag.length;
|
|
362
|
+
const endIndex = tagMatch.index + fullMatch.length - closeTag.length;
|
|
363
|
+
|
|
364
|
+
for (let k = startIndex; k < endIndex; k++) {
|
|
365
|
+
out[k] = codeWithoutScriptTag[k];
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
const needsSemi =
|
|
369
|
+
processedContent.length > 0 &&
|
|
370
|
+
!processedContent.endsWith("{") &&
|
|
371
|
+
!processedContent.endsWith("}") &&
|
|
372
|
+
!processedContent.endsWith(";");
|
|
373
|
+
|
|
374
|
+
if (needsSemi) {
|
|
375
|
+
out[endIndex] = ";";
|
|
376
|
+
}
|
|
322
377
|
}
|
|
323
378
|
}
|
|
324
379
|
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<?php return array(
|
|
2
2
|
'root' => array(
|
|
3
3
|
'name' => '__root__',
|
|
4
|
-
'pretty_version' => 'v1.1.
|
|
5
|
-
'version' => '1.1.
|
|
6
|
-
'reference' => '
|
|
4
|
+
'pretty_version' => 'v1.1.2',
|
|
5
|
+
'version' => '1.1.2.0',
|
|
6
|
+
'reference' => 'ea69d1c066e3a4d62a23e93dcb74e93379a38151',
|
|
7
7
|
'type' => 'library',
|
|
8
8
|
'install_path' => __DIR__ . '/../../',
|
|
9
9
|
'aliases' => array(),
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
),
|
|
12
12
|
'versions' => array(
|
|
13
13
|
'__root__' => array(
|
|
14
|
-
'pretty_version' => 'v1.1.
|
|
15
|
-
'version' => '1.1.
|
|
16
|
-
'reference' => '
|
|
14
|
+
'pretty_version' => 'v1.1.2',
|
|
15
|
+
'version' => '1.1.2.0',
|
|
16
|
+
'reference' => 'ea69d1c066e3a4d62a23e93dcb74e93379a38151',
|
|
17
17
|
'type' => 'library',
|
|
18
18
|
'install_path' => __DIR__ . '/../../',
|
|
19
19
|
'aliases' => array(),
|
package/plugins/rubyastgen/bundle/ruby/4.0.0/extensions/x86_64-linux/4.0.0/prism-1.7.0/gem_make.out
CHANGED
|
@@ -6,10 +6,10 @@ checking for whether -fvisibility=hidden is accepted as CFLAGS... yes
|
|
|
6
6
|
creating Makefile
|
|
7
7
|
|
|
8
8
|
current directory: /home/runner/work/atom-parsetools/atom-parsetools/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.7.0/ext/prism
|
|
9
|
-
make -j5 DESTDIR\= sitearchdir\=./.gem.
|
|
9
|
+
make -j5 DESTDIR\= sitearchdir\=./.gem.20260106-2204-t77tu9 sitelibdir\=./.gem.20260106-2204-t77tu9 clean
|
|
10
10
|
|
|
11
11
|
current directory: /home/runner/work/atom-parsetools/atom-parsetools/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.7.0/ext/prism
|
|
12
|
-
make -j5 DESTDIR\= sitearchdir\=./.gem.
|
|
12
|
+
make -j5 DESTDIR\= sitearchdir\=./.gem.20260106-2204-t77tu9 sitelibdir\=./.gem.20260106-2204-t77tu9
|
|
13
13
|
compiling api_node.c
|
|
14
14
|
compiling api_pack.c
|
|
15
15
|
compiling extension.c
|
|
@@ -37,8 +37,8 @@ compiling ./../../src/util/pm_strpbrk.c
|
|
|
37
37
|
linking shared-object prism/prism.so
|
|
38
38
|
|
|
39
39
|
current directory: /home/runner/work/atom-parsetools/atom-parsetools/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.7.0/ext/prism
|
|
40
|
-
make -j5 DESTDIR\= sitearchdir\=./.gem.
|
|
41
|
-
/usr/bin/install -c -m 0755 prism.so ./.gem.
|
|
40
|
+
make -j5 DESTDIR\= sitearchdir\=./.gem.20260106-2204-t77tu9 sitelibdir\=./.gem.20260106-2204-t77tu9 install
|
|
41
|
+
/usr/bin/install -c -m 0755 prism.so ./.gem.20260106-2204-t77tu9/prism
|
|
42
42
|
|
|
43
43
|
current directory: /home/runner/work/atom-parsetools/atom-parsetools/plugins/rubyastgen/bundle/ruby/4.0.0/gems/prism-1.7.0/ext/prism
|
|
44
|
-
make DESTDIR\= sitearchdir\=./.gem.
|
|
44
|
+
make DESTDIR\= sitearchdir\=./.gem.20260106-2204-t77tu9 sitelibdir\=./.gem.20260106-2204-t77tu9 clean
|
package/plugins/rubyastgen/bundle/ruby/4.0.0/extensions/x86_64-linux/4.0.0/racc-1.8.1/gem_make.out
CHANGED
|
@@ -3,16 +3,16 @@ current directory: /home/runner/work/atom-parsetools/atom-parsetools/plugins/rub
|
|
|
3
3
|
creating Makefile
|
|
4
4
|
|
|
5
5
|
current directory: /home/runner/work/atom-parsetools/atom-parsetools/plugins/rubyastgen/bundle/ruby/4.0.0/gems/racc-1.8.1/ext/racc/cparse
|
|
6
|
-
make -j5 DESTDIR\= sitearchdir\=./.gem.
|
|
6
|
+
make -j5 DESTDIR\= sitearchdir\=./.gem.20260106-2204-4787mi sitelibdir\=./.gem.20260106-2204-4787mi clean
|
|
7
7
|
|
|
8
8
|
current directory: /home/runner/work/atom-parsetools/atom-parsetools/plugins/rubyastgen/bundle/ruby/4.0.0/gems/racc-1.8.1/ext/racc/cparse
|
|
9
|
-
make -j5 DESTDIR\= sitearchdir\=./.gem.
|
|
9
|
+
make -j5 DESTDIR\= sitearchdir\=./.gem.20260106-2204-4787mi sitelibdir\=./.gem.20260106-2204-4787mi
|
|
10
10
|
compiling cparse.c
|
|
11
11
|
linking shared-object racc/cparse.so
|
|
12
12
|
|
|
13
13
|
current directory: /home/runner/work/atom-parsetools/atom-parsetools/plugins/rubyastgen/bundle/ruby/4.0.0/gems/racc-1.8.1/ext/racc/cparse
|
|
14
|
-
make -j5 DESTDIR\= sitearchdir\=./.gem.
|
|
15
|
-
/usr/bin/install -c -m 0755 cparse.so ./.gem.
|
|
14
|
+
make -j5 DESTDIR\= sitearchdir\=./.gem.20260106-2204-4787mi sitelibdir\=./.gem.20260106-2204-4787mi install
|
|
15
|
+
/usr/bin/install -c -m 0755 cparse.so ./.gem.20260106-2204-4787mi/racc
|
|
16
16
|
|
|
17
17
|
current directory: /home/runner/work/atom-parsetools/atom-parsetools/plugins/rubyastgen/bundle/ruby/4.0.0/gems/racc-1.8.1/ext/racc/cparse
|
|
18
|
-
make DESTDIR\= sitearchdir\=./.gem.
|
|
18
|
+
make DESTDIR\= sitearchdir\=./.gem.20260106-2204-4787mi sitelibdir\=./.gem.20260106-2204-4787mi clean
|