@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.cjs
CHANGED
|
@@ -3373,7 +3373,7 @@ function parseInputDecl(line, lineNumber, column, lineOffset, diagnostics) {
|
|
|
3373
3373
|
pushDiag(
|
|
3374
3374
|
diagnostics,
|
|
3375
3375
|
"COLLIE104",
|
|
3376
|
-
'Types are not supported in #inputs yet. Use "name".',
|
|
3376
|
+
'Types are not supported in #inputs yet. Use "name" or "name()".',
|
|
3377
3377
|
lineNumber,
|
|
3378
3378
|
column,
|
|
3379
3379
|
lineOffset,
|
|
@@ -3392,10 +3392,21 @@ function parseInputDecl(line, lineNumber, column, lineOffset, diagnostics) {
|
|
|
3392
3392
|
span: createSpan(lineNumber, nameColumn, name.length, lineOffset)
|
|
3393
3393
|
};
|
|
3394
3394
|
}
|
|
3395
|
+
const fnMatch = trimmed.match(/^([A-Za-z_$][A-Za-z0-9_$]*)\(\)$/);
|
|
3396
|
+
if (fnMatch) {
|
|
3397
|
+
const name = fnMatch[1];
|
|
3398
|
+
const nameStart = line.indexOf(name);
|
|
3399
|
+
const nameColumn = column + nameStart;
|
|
3400
|
+
return {
|
|
3401
|
+
name,
|
|
3402
|
+
kind: "fn",
|
|
3403
|
+
span: createSpan(lineNumber, nameColumn, name.length, lineOffset)
|
|
3404
|
+
};
|
|
3405
|
+
}
|
|
3395
3406
|
pushDiag(
|
|
3396
3407
|
diagnostics,
|
|
3397
3408
|
"COLLIE105",
|
|
3398
|
-
'Invalid #inputs declaration. Use "name".',
|
|
3409
|
+
'Invalid #inputs declaration. Use "name" or "name()".',
|
|
3399
3410
|
lineNumber,
|
|
3400
3411
|
column,
|
|
3401
3412
|
lineOffset,
|