@marko/compiler 5.39.30 → 5.39.31
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/dist/babel-utils/parse.js +11 -3
- package/package.json +1 -1
|
@@ -134,9 +134,17 @@ sourceOffset)
|
|
|
134
134
|
parserOpts.startColumn = startColumn;
|
|
135
135
|
|
|
136
136
|
try {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
137
|
+
if (isExpression) {
|
|
138
|
+
return babelParser.parseExpression(code, parserOpts);
|
|
139
|
+
} else {
|
|
140
|
+
const { program } = babelParser.parse(code, parserOpts);
|
|
141
|
+
if (program.innerComments) {
|
|
142
|
+
const lastNode = _compiler.types.emptyStatement();
|
|
143
|
+
lastNode.trailingComments = program.innerComments;
|
|
144
|
+
program.body.push(lastNode);
|
|
145
|
+
}
|
|
146
|
+
return program.body;
|
|
147
|
+
}
|
|
140
148
|
} catch (err) {
|
|
141
149
|
const parseError = createParseError(
|
|
142
150
|
file,
|