@lango-project/lango-js 0.1.4 → 0.1.5

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/compiler.mjs +4 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lango-project/lango-js",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "license": "Apache-2.0",
5
5
  "publishConfig": {
6
6
  "access": "public"
package/src/compiler.mjs CHANGED
@@ -1055,7 +1055,10 @@ class Parser {
1055
1055
  const next = this.peek();
1056
1056
  if (next === undefined || spaces(next) < indent)
1057
1057
  this.fail(line, "LNG1262", "unterminated multi-line expression");
1058
- source += ` ${this.line().text.trim()}`;
1058
+ const continuation = this.line().text.trim();
1059
+ const startsField = /^(?:\$?[A-Za-z_][\w-]*|['"][^'"]+['"]): /.test(continuation);
1060
+ if (startsField && !/[{,]\s*$/.test(source)) source += ",";
1061
+ source += ` ${continuation}`;
1059
1062
  depth = curlyDelimiterDepth(source);
1060
1063
  }
1061
1064
  return source;