@junnyontop-pixel/neo-app 1.1.13 → 1.1.14
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/compiler/NeoParser.js +14 -3
- package/package.json +1 -1
package/compiler/NeoParser.js
CHANGED
|
@@ -5,7 +5,7 @@ export class NeoParser {
|
|
|
5
5
|
if (scriptMatch) scriptContent = scriptMatch[1].trim();
|
|
6
6
|
|
|
7
7
|
// 태그 블록만 추출하기 위해 스크립트 제외
|
|
8
|
-
const cleanSource = source.replace(/@Script\s*\{[\s\S]*?\}/, "").trim();
|
|
8
|
+
const cleanSource = source.replace(/@Script\s*\{[\s\S]*?\}/, "").trim();
|
|
9
9
|
|
|
10
10
|
const root = this.parseRecursive(cleanSource);
|
|
11
11
|
return { root, scriptContent };
|
|
@@ -64,8 +64,19 @@ export class NeoParser {
|
|
|
64
64
|
const childNode = this.parseRecursive(remainingText.substring(childMatch.index));
|
|
65
65
|
if (childNode) {
|
|
66
66
|
node.children.push(childNode);
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
|
|
68
|
+
// 자식 노드의 끝 지점을 찾아서 다음 검색 위치를 조정
|
|
69
|
+
let braceCount = 1;
|
|
70
|
+
let i = remainingText.indexOf('{', childMatch.index) + 1;
|
|
71
|
+
|
|
72
|
+
while (braceCount > 0 && i < remainingText.length) {
|
|
73
|
+
if (remainingText[i] === '{') braceCount++;
|
|
74
|
+
else if (remainingText[i] === '}') braceCount--;
|
|
75
|
+
i++;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// 정규식의 다음 검색 시작 위치를 자식 노드가 끝난 지점(i)으로 옮겨줘
|
|
79
|
+
childRegex.lastIndex = i;
|
|
69
80
|
}
|
|
70
81
|
}
|
|
71
82
|
|