@yyds-lang/textmate 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,2 @@
1
+ import { a as YYDS_KEYWORDS, c as yydsLanguageConfiguration, i as yydsGrammar, n as toShikiLanguageDefinition, o as YydsKeyword, r as YYDS_SCOPE_NAME, s as YydsLanguageConfiguration, t as ShikiLanguageDefinition } from "./shiki-C3EJuFhC.mjs";
2
+ export { type ShikiLanguageDefinition, YYDS_KEYWORDS, YYDS_SCOPE_NAME, type YydsKeyword, type YydsLanguageConfiguration, toShikiLanguageDefinition, yydsGrammar, yydsLanguageConfiguration };
package/dist/index.mjs ADDED
@@ -0,0 +1,2 @@
1
+ import { a as yydsLanguageConfiguration, i as YYDS_KEYWORDS, n as YYDS_SCOPE_NAME, r as yydsGrammar, t as toShikiLanguageDefinition } from "./shiki-XKvsC8B5.mjs";
2
+ export { YYDS_KEYWORDS, YYDS_SCOPE_NAME, toShikiLanguageDefinition, yydsGrammar, yydsLanguageConfiguration };
@@ -0,0 +1,98 @@
1
+ //#region src/language/config.d.ts
2
+ interface YydsLanguageConfiguration {
3
+ comments: {
4
+ lineComment: string;
5
+ blockComment: [string, string];
6
+ };
7
+ brackets: [string, string][];
8
+ autoClosingPairs: {
9
+ open: string;
10
+ close: string;
11
+ }[];
12
+ surroundingPairs: [string, string][];
13
+ }
14
+ declare const yydsLanguageConfiguration: YydsLanguageConfiguration;
15
+ //#endregion
16
+ //#region src/textmate/keywords.d.ts
17
+ declare const YYDS_KEYWORDS: readonly ["yyds", "song", "tempo", "velocity", "meter", "key", "unit", "octave", "strict", "section", "track", "play", "repeat", "after", "refer", "instrument", "volume", "pan", "mute", "solo", "transpose", "allow_unbalanced"];
18
+ type YydsKeyword = (typeof YYDS_KEYWORDS)[number];
19
+ //#endregion
20
+ //#region src/textmate/grammar.d.ts
21
+ declare const YYDS_SCOPE_NAME = "source.yyds";
22
+ declare const yydsGrammar: {
23
+ readonly scopeName: "source.yyds";
24
+ readonly name: "YYDS";
25
+ readonly patterns: readonly [{
26
+ readonly include: "#comments";
27
+ }, {
28
+ readonly include: "#keywords";
29
+ }, {
30
+ readonly include: "#strings";
31
+ }, {
32
+ readonly include: "#numbers";
33
+ }, {
34
+ readonly include: "#notes";
35
+ }, {
36
+ readonly include: "#duration";
37
+ }, {
38
+ readonly include: "#operators";
39
+ }];
40
+ readonly repository: {
41
+ readonly comments: {
42
+ readonly patterns: readonly [{
43
+ readonly name: "comment.line.double-slash.yyds";
44
+ readonly match: "//.*$";
45
+ }];
46
+ };
47
+ readonly keywords: {
48
+ readonly patterns: readonly [{
49
+ readonly name: "keyword.control.yyds";
50
+ readonly match: string;
51
+ }];
52
+ };
53
+ readonly strings: {
54
+ readonly patterns: readonly [{
55
+ readonly name: "string.quoted.double.yyds";
56
+ readonly begin: "\"";
57
+ readonly end: "\"";
58
+ }];
59
+ };
60
+ readonly numbers: {
61
+ readonly patterns: readonly [{
62
+ readonly name: "constant.numeric.yyds";
63
+ readonly match: "\\b\\d+(?:\\.\\d+)?\\b";
64
+ }];
65
+ };
66
+ readonly notes: {
67
+ readonly patterns: readonly [{
68
+ readonly name: "entity.name.note.yyds";
69
+ readonly match: "\\b[A-G](?:#|b)?\\d\\b";
70
+ }, {
71
+ readonly name: "constant.language.rest.yyds";
72
+ readonly match: "\\b(?:R|__)\\b";
73
+ }];
74
+ };
75
+ readonly duration: {
76
+ readonly patterns: readonly [{
77
+ readonly name: "storage.type.duration.yyds";
78
+ readonly match: "\\/(w|h|q|e|s|\\d+)\\.?";
79
+ }];
80
+ };
81
+ readonly operators: {
82
+ readonly patterns: readonly [{
83
+ readonly name: "keyword.operator.yyds";
84
+ readonly match: "\\||@|%|=|->|-";
85
+ }];
86
+ };
87
+ };
88
+ };
89
+ //#endregion
90
+ //#region src/textmate/shiki.d.ts
91
+ interface ShikiLanguageDefinition {
92
+ id: string;
93
+ scopeName: string;
94
+ grammar: unknown;
95
+ }
96
+ declare function toShikiLanguageDefinition(id?: string): ShikiLanguageDefinition;
97
+ //#endregion
98
+ export { YYDS_KEYWORDS as a, yydsLanguageConfiguration as c, yydsGrammar as i, toShikiLanguageDefinition as n, YydsKeyword as o, YYDS_SCOPE_NAME as r, YydsLanguageConfiguration as s, ShikiLanguageDefinition as t };
@@ -0,0 +1,123 @@
1
+ //#region src/language/config.ts
2
+ const yydsLanguageConfiguration = {
3
+ comments: {
4
+ lineComment: "//",
5
+ blockComment: ["/*", "*/"]
6
+ },
7
+ brackets: [
8
+ ["{", "}"],
9
+ ["(", ")"],
10
+ ["[", "]"]
11
+ ],
12
+ autoClosingPairs: [
13
+ {
14
+ open: "{",
15
+ close: "}"
16
+ },
17
+ {
18
+ open: "(",
19
+ close: ")"
20
+ },
21
+ {
22
+ open: "[",
23
+ close: "]"
24
+ },
25
+ {
26
+ open: "\"",
27
+ close: "\""
28
+ }
29
+ ],
30
+ surroundingPairs: [
31
+ ["{", "}"],
32
+ ["(", ")"],
33
+ ["[", "]"],
34
+ ["\"", "\""]
35
+ ]
36
+ };
37
+ //#endregion
38
+ //#region src/textmate/keywords.ts
39
+ const YYDS_KEYWORDS = [
40
+ "yyds",
41
+ "song",
42
+ "tempo",
43
+ "velocity",
44
+ "meter",
45
+ "key",
46
+ "unit",
47
+ "octave",
48
+ "strict",
49
+ "section",
50
+ "track",
51
+ "play",
52
+ "repeat",
53
+ "after",
54
+ "refer",
55
+ "instrument",
56
+ "volume",
57
+ "pan",
58
+ "mute",
59
+ "solo",
60
+ "transpose",
61
+ "allow_unbalanced"
62
+ ];
63
+ //#endregion
64
+ //#region src/textmate/grammar.ts
65
+ const YYDS_SCOPE_NAME = "source.yyds";
66
+ const yydsGrammar = {
67
+ scopeName: YYDS_SCOPE_NAME,
68
+ name: "YYDS",
69
+ patterns: [
70
+ { include: "#comments" },
71
+ { include: "#keywords" },
72
+ { include: "#strings" },
73
+ { include: "#numbers" },
74
+ { include: "#notes" },
75
+ { include: "#duration" },
76
+ { include: "#operators" }
77
+ ],
78
+ repository: {
79
+ comments: { patterns: [{
80
+ name: "comment.line.double-slash.yyds",
81
+ match: "//.*$"
82
+ }] },
83
+ keywords: { patterns: [{
84
+ name: "keyword.control.yyds",
85
+ match: `\\b(${YYDS_KEYWORDS.join("|")})\\b`
86
+ }] },
87
+ strings: { patterns: [{
88
+ name: "string.quoted.double.yyds",
89
+ begin: "\"",
90
+ end: "\""
91
+ }] },
92
+ numbers: { patterns: [{
93
+ name: "constant.numeric.yyds",
94
+ match: "\\b\\d+(?:\\.\\d+)?\\b"
95
+ }] },
96
+ notes: { patterns: [{
97
+ name: "entity.name.note.yyds",
98
+ match: "\\b[A-G](?:#|b)?\\d\\b"
99
+ }, {
100
+ name: "constant.language.rest.yyds",
101
+ match: "\\b(?:R|__)\\b"
102
+ }] },
103
+ duration: { patterns: [{
104
+ name: "storage.type.duration.yyds",
105
+ match: "\\/(w|h|q|e|s|\\d+)\\.?"
106
+ }] },
107
+ operators: { patterns: [{
108
+ name: "keyword.operator.yyds",
109
+ match: "\\||@|%|=|->|-"
110
+ }] }
111
+ }
112
+ };
113
+ //#endregion
114
+ //#region src/textmate/shiki.ts
115
+ function toShikiLanguageDefinition(id = "yyds") {
116
+ return {
117
+ id,
118
+ scopeName: YYDS_SCOPE_NAME,
119
+ grammar: yydsGrammar
120
+ };
121
+ }
122
+ //#endregion
123
+ export { yydsLanguageConfiguration as a, YYDS_KEYWORDS as i, YYDS_SCOPE_NAME as n, yydsGrammar as r, toShikiLanguageDefinition as t };
@@ -0,0 +1,2 @@
1
+ import { a as YYDS_KEYWORDS, c as yydsLanguageConfiguration, i as yydsGrammar, n as toShikiLanguageDefinition, o as YydsKeyword, r as YYDS_SCOPE_NAME, s as YydsLanguageConfiguration, t as ShikiLanguageDefinition } from "./shiki-C3EJuFhC.mjs";
2
+ export { type ShikiLanguageDefinition, YYDS_KEYWORDS, YYDS_SCOPE_NAME, type YydsKeyword, type YydsLanguageConfiguration, toShikiLanguageDefinition, yydsGrammar, yydsLanguageConfiguration };
package/dist/types.mjs ADDED
@@ -0,0 +1,2 @@
1
+ import { a as yydsLanguageConfiguration, i as YYDS_KEYWORDS, n as YYDS_SCOPE_NAME, r as yydsGrammar, t as toShikiLanguageDefinition } from "./shiki-XKvsC8B5.mjs";
2
+ export { YYDS_KEYWORDS, YYDS_SCOPE_NAME, toShikiLanguageDefinition, yydsGrammar, yydsLanguageConfiguration };
package/package.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "@yyds-lang/textmate",
3
+ "version": "0.0.0",
4
+ "description": "YYDS TextMate grammar package.",
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
+ }