acspec-parser 0.5.2 → 0.6.0
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ValidationAcceptor } from 'langium';
|
|
2
|
-
import type { WriteCommand, CheckCommand, CheckAlarmCommand, CheckActionCommand, WatchCommand, UnwatchCommand, DelayCommand, ScheduleCommand, LoopCommand, CountCommand } from './generated/ast.js';
|
|
2
|
+
import type { WriteCommand, CheckCommand, CheckAlarmCommand, CheckActionCommand, WatchCommand, UnwatchCommand, DelayCommand, ScheduleCommand, LoopCommand, CountCommand, AddressParam } from './generated/ast.js';
|
|
3
3
|
import type { AcspecServices } from './acspec-module.js';
|
|
4
4
|
/**
|
|
5
5
|
* Register custom validation checks.
|
|
@@ -10,6 +10,7 @@ export declare function registerValidationChecks(services: AcspecServices): void
|
|
|
10
10
|
*/
|
|
11
11
|
export declare class AcspecValidator {
|
|
12
12
|
private validateAddress;
|
|
13
|
+
checkAddressParam(node: AddressParam | undefined, accept: ValidationAcceptor): void;
|
|
13
14
|
checkWriteCommand(write: WriteCommand, accept: ValidationAcceptor): void;
|
|
14
15
|
checkCheckCommand(check: CheckCommand, accept: ValidationAcceptor): void;
|
|
15
16
|
checkAlarmCommand(check_alarm: CheckAlarmCommand, accept: ValidationAcceptor): void;
|
|
@@ -11,7 +11,7 @@ export declare const AcspecTerminals: {
|
|
|
11
11
|
SL_COMMENT: RegExp;
|
|
12
12
|
};
|
|
13
13
|
export type AcspecTerminalNames = keyof typeof AcspecTerminals;
|
|
14
|
-
export type AcspecKeywordNames = "," | "check" | "check!" | "check_action" | "check_action!" | "check_alarm" | "check_alarm!" | "count" | "delay" | "delay!" | "init" | "loop" | "schedule" | "unit" | "unwatch" | "unwatch!" | "use" | "watch" | "watch!" | "write" | "write!" | "{" | "|" | "}";
|
|
14
|
+
export type AcspecKeywordNames = "," | ":" | "check" | "check!" | "check_action" | "check_action!" | "check_alarm" | "check_alarm!" | "count" | "delay" | "delay!" | "init" | "loop" | "schedule" | "unit" | "unwatch" | "unwatch!" | "use" | "watch" | "watch!" | "write" | "write!" | "{" | "|" | "}";
|
|
15
15
|
export type AcspecTokenNames = AcspecTerminalNames | AcspecKeywordNames;
|
|
16
16
|
export type BlockCommand = CountCommand | LoopCommand | ScheduleCommand;
|
|
17
17
|
export declare const BlockCommand = "BlockCommand";
|
|
@@ -22,6 +22,7 @@ export declare function isLineCommand(item: unknown): item is LineCommand;
|
|
|
22
22
|
export interface AddressParam extends langium.AstNode {
|
|
23
23
|
readonly $container: CheckCommand | UnwatchCommand | WatchCommand | WriteCommand;
|
|
24
24
|
readonly $type: 'AddressParam';
|
|
25
|
+
module?: number;
|
|
25
26
|
value: string;
|
|
26
27
|
}
|
|
27
28
|
export declare const AddressParam = "AddressParam";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "acspec-parser",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"AcSpec",
|
|
6
6
|
"acspec"
|
|
@@ -29,14 +29,18 @@
|
|
|
29
29
|
"cross-env": "^10.0.0",
|
|
30
30
|
"esbuild": "^0.25.8",
|
|
31
31
|
"langium-cli": "^3.5.2",
|
|
32
|
-
"typescript": "^5.8.3"
|
|
32
|
+
"typescript": "^5.8.3",
|
|
33
|
+
"vitest": "^4.0.1"
|
|
33
34
|
},
|
|
34
35
|
"scripts": {
|
|
35
36
|
"build": "tsc && cross-env NODE_ENV=development node esbuild.js",
|
|
36
37
|
"build:prod": "tsc && cross-env NODE_ENV=production node esbuild.js",
|
|
37
38
|
"langium:generate": "langium generate",
|
|
38
39
|
"langium:generate:production": "langium generate --mode=production",
|
|
39
|
-
"type-check": "tsc --noEmit --skipLibCheck"
|
|
40
|
+
"type-check": "tsc --noEmit --skipLibCheck",
|
|
41
|
+
"test": "vitest",
|
|
42
|
+
"test:watch": "vitest watch",
|
|
43
|
+
"test:coverage": "vitest run --coverage"
|
|
40
44
|
},
|
|
41
45
|
"license": "ISC"
|
|
42
|
-
}
|
|
46
|
+
}
|