@yyds-lang/ast 0.0.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.
@@ -0,0 +1,17 @@
1
+ //#region src/diagnostic/codes.d.ts
2
+ declare const YYDS_DIAGNOSTIC_CODES: {
3
+ readonly LEX_UNTERMINATED_STRING: "YYDS_LEX_UNTERMINATED_STRING";
4
+ readonly PARSE_UNEXPECTED_TOKEN: "YYDS_PARSE_UNEXPECTED_TOKEN";
5
+ readonly SEM_DUPLICATE_SECTION: "YYDS_SEM_DUPLICATE_SECTION";
6
+ readonly SEM_UNKNOWN_SECTION: "YYDS_SEM_UNKNOWN_SECTION";
7
+ readonly SEM_UNKNOWN_TRACK: "YYDS_SEM_UNKNOWN_TRACK";
8
+ readonly SEM_CYCLIC_REF: "YYDS_SEM_CYCLIC_REF";
9
+ };
10
+ type YydsDiagnosticCode = (typeof YYDS_DIAGNOSTIC_CODES)[keyof typeof YYDS_DIAGNOSTIC_CODES];
11
+ declare const YYDS_DIAGNOSTIC_SEVERITY: {
12
+ readonly ERROR: "error";
13
+ readonly WARNING: "warning";
14
+ readonly INFO: "info";
15
+ };
16
+ //#endregion
17
+ export { YYDS_DIAGNOSTIC_SEVERITY as n, YydsDiagnosticCode as r, YYDS_DIAGNOSTIC_CODES as t };
@@ -0,0 +1,6 @@
1
+ import { n as YYDS_DIAGNOSTIC_SEVERITY, r as YydsDiagnosticCode, t as YYDS_DIAGNOSTIC_CODES } from "./codes-BxSX9I5P.mjs";
2
+
3
+ //#region src/index.d.ts
4
+ declare const AST_PACKAGE = "@yyds-lang/ast";
5
+ //#endregion
6
+ export { AST_PACKAGE, YYDS_DIAGNOSTIC_CODES, YYDS_DIAGNOSTIC_SEVERITY, type YydsDiagnosticCode };
package/dist/index.mjs ADDED
@@ -0,0 +1,19 @@
1
+ //#region src/diagnostic/codes.ts
2
+ const YYDS_DIAGNOSTIC_CODES = {
3
+ LEX_UNTERMINATED_STRING: "YYDS_LEX_UNTERMINATED_STRING",
4
+ PARSE_UNEXPECTED_TOKEN: "YYDS_PARSE_UNEXPECTED_TOKEN",
5
+ SEM_DUPLICATE_SECTION: "YYDS_SEM_DUPLICATE_SECTION",
6
+ SEM_UNKNOWN_SECTION: "YYDS_SEM_UNKNOWN_SECTION",
7
+ SEM_UNKNOWN_TRACK: "YYDS_SEM_UNKNOWN_TRACK",
8
+ SEM_CYCLIC_REF: "YYDS_SEM_CYCLIC_REF"
9
+ };
10
+ const YYDS_DIAGNOSTIC_SEVERITY = {
11
+ ERROR: "error",
12
+ WARNING: "warning",
13
+ INFO: "info"
14
+ };
15
+ //#endregion
16
+ //#region src/index.ts
17
+ const AST_PACKAGE = "@yyds-lang/ast";
18
+ //#endregion
19
+ export { AST_PACKAGE, YYDS_DIAGNOSTIC_CODES, YYDS_DIAGNOSTIC_SEVERITY };
@@ -0,0 +1,81 @@
1
+ import { r as YydsDiagnosticCode$1 } from "./codes-BxSX9I5P.mjs";
2
+
3
+ //#region src/ast/index.d.ts
4
+ type DiagnosticSeverity$1 = "error" | "warning" | "info";
5
+ interface Position$1 {
6
+ line: number;
7
+ column: number;
8
+ offset: number;
9
+ }
10
+ interface Range$1 {
11
+ start: Position$1;
12
+ end: Position$1;
13
+ }
14
+ interface Token$1 {
15
+ type: string;
16
+ value: string;
17
+ range: Range$1;
18
+ }
19
+ interface Diagnostic$1 {
20
+ code: string;
21
+ severity: DiagnosticSeverity$1;
22
+ message: string;
23
+ range: Range$1;
24
+ }
25
+ interface AstNode$1 {
26
+ type: string;
27
+ range: Range$1;
28
+ }
29
+ interface HeaderNode$1 extends AstNode$1 {
30
+ type: "Header";
31
+ key: string;
32
+ value: string;
33
+ }
34
+ interface TrackRefNode$1 {
35
+ section: string;
36
+ track: string;
37
+ }
38
+ interface BarNode$1 extends AstNode$1 {
39
+ type: "Bar";
40
+ events: string[];
41
+ }
42
+ interface TrackNode$1 extends AstNode$1 {
43
+ type: "Track";
44
+ name: string;
45
+ instrument?: string;
46
+ ref?: TrackRefNode$1;
47
+ bars: BarNode$1[];
48
+ }
49
+ interface SectionNode$1 extends AstNode$1 {
50
+ type: "Section";
51
+ name: string;
52
+ tracks: TrackNode$1[];
53
+ }
54
+ interface PlayNode$1 extends AstNode$1 {
55
+ type: "Play";
56
+ section: string;
57
+ }
58
+ type StatementNode$1 = HeaderNode$1 | SectionNode$1 | PlayNode$1;
59
+ interface ProgramNode$1 extends AstNode$1 {
60
+ type: "Program";
61
+ body: StatementNode$1[];
62
+ }
63
+ //#endregion
64
+ //#region src/types/index.d.ts
65
+ type AstNode = AstNode$1;
66
+ type BarNode = BarNode$1;
67
+ type Diagnostic = Diagnostic$1;
68
+ type DiagnosticSeverity = DiagnosticSeverity$1;
69
+ type HeaderNode = HeaderNode$1;
70
+ type PlayNode = PlayNode$1;
71
+ type Position = Position$1;
72
+ type ProgramNode = ProgramNode$1;
73
+ type Range = Range$1;
74
+ type SectionNode = SectionNode$1;
75
+ type StatementNode = StatementNode$1;
76
+ type Token = Token$1;
77
+ type TrackNode = TrackNode$1;
78
+ type TrackRefNode = TrackRefNode$1;
79
+ type YydsDiagnosticCode = YydsDiagnosticCode$1;
80
+ //#endregion
81
+ export { AstNode, BarNode, Diagnostic, DiagnosticSeverity, HeaderNode, PlayNode, Position, ProgramNode, Range, SectionNode, StatementNode, Token, TrackNode, TrackRefNode, YydsDiagnosticCode };
package/dist/types.mjs ADDED
@@ -0,0 +1 @@
1
+ export {};
package/package.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "@yyds-lang/ast",
3
+ "version": "0.0.0",
4
+ "description": "Core YYDS AST and diagnostics types.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "files": [
8
+ "dist"
9
+ ],
10
+ "publishConfig": {
11
+ "access": "public"
12
+ },
13
+ "devDependencies": {
14
+ "@types/node": "^24",
15
+ "typescript": "^5",
16
+ "vite-plus": "latest"
17
+ },
18
+ "exports": {
19
+ ".": "./dist/index.mjs",
20
+ "./types": "./dist/types.mjs",
21
+ "./package.json": "./package.json"
22
+ },
23
+ "scripts": {
24
+ "build": "vp pack",
25
+ "dev": "vp pack --watch",
26
+ "test": "vp test",
27
+ "check": "vp check"
28
+ }
29
+ }