@collie-lang/compiler 1.4.0 → 1.5.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/dist/index.cjs +13 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +13 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -3322,7 +3322,7 @@ function parseInputDecl(line, lineNumber, column, lineOffset, diagnostics) {
|
|
|
3322
3322
|
pushDiag(
|
|
3323
3323
|
diagnostics,
|
|
3324
3324
|
"COLLIE104",
|
|
3325
|
-
'Types are not supported in #inputs yet. Use "name".',
|
|
3325
|
+
'Types are not supported in #inputs yet. Use "name" or "name()".',
|
|
3326
3326
|
lineNumber,
|
|
3327
3327
|
column,
|
|
3328
3328
|
lineOffset,
|
|
@@ -3341,10 +3341,21 @@ function parseInputDecl(line, lineNumber, column, lineOffset, diagnostics) {
|
|
|
3341
3341
|
span: createSpan(lineNumber, nameColumn, name.length, lineOffset)
|
|
3342
3342
|
};
|
|
3343
3343
|
}
|
|
3344
|
+
const fnMatch = trimmed.match(/^([A-Za-z_$][A-Za-z0-9_$]*)\(\)$/);
|
|
3345
|
+
if (fnMatch) {
|
|
3346
|
+
const name = fnMatch[1];
|
|
3347
|
+
const nameStart = line.indexOf(name);
|
|
3348
|
+
const nameColumn = column + nameStart;
|
|
3349
|
+
return {
|
|
3350
|
+
name,
|
|
3351
|
+
kind: "fn",
|
|
3352
|
+
span: createSpan(lineNumber, nameColumn, name.length, lineOffset)
|
|
3353
|
+
};
|
|
3354
|
+
}
|
|
3344
3355
|
pushDiag(
|
|
3345
3356
|
diagnostics,
|
|
3346
3357
|
"COLLIE105",
|
|
3347
|
-
'Invalid #inputs declaration. Use "name".',
|
|
3358
|
+
'Invalid #inputs declaration. Use "name" or "name()".',
|
|
3348
3359
|
lineNumber,
|
|
3349
3360
|
column,
|
|
3350
3361
|
lineOffset,
|