@markdy/core 0.8.7 → 0.8.8
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.js +26 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -942,6 +942,12 @@ function splitTargetLabel(token, lineNo) {
|
|
|
942
942
|
function parseCueLine(line, lineNo) {
|
|
943
943
|
const trimmed = line.trim();
|
|
944
944
|
const props = parseProps(trimmed);
|
|
945
|
+
if (/^@\+?\d/.test(trimmed) || /^\w[\w.-]*\.\w+\(/.test(trimmed) || /^camera\./.test(trimmed)) {
|
|
946
|
+
throw new ParseError(
|
|
947
|
+
"unsupported timeline command; use beat cues like show, frame, focus, glow, and flow lines",
|
|
948
|
+
lineNo
|
|
949
|
+
);
|
|
950
|
+
}
|
|
945
951
|
const parallelParts = splitOutsideQuotes(trimmed, "&");
|
|
946
952
|
if (parallelParts.length > 1) {
|
|
947
953
|
return {
|
|
@@ -1121,6 +1127,21 @@ function normalizeCueBlocks(blocks) {
|
|
|
1121
1127
|
}
|
|
1122
1128
|
return normalized;
|
|
1123
1129
|
}
|
|
1130
|
+
function unsupportedSyntaxMessage(line) {
|
|
1131
|
+
if (/^var\s+/.test(line)) {
|
|
1132
|
+
return "unsupported variable declaration; use scene properties and style declarations instead";
|
|
1133
|
+
}
|
|
1134
|
+
if (/^actor\s+/.test(line) || /\bfigure\s*\(/.test(line) || /\bbox\s*\(/.test(line) || /\bat\s*\(/.test(line)) {
|
|
1135
|
+
return "unsupported manual drawing syntax; declare architecture nodes like service API, cache Redis, and database DB";
|
|
1136
|
+
}
|
|
1137
|
+
if (/^@\+?\d/.test(line)) {
|
|
1138
|
+
return "unsupported timeline command; put flow and cue lines inside beat blocks";
|
|
1139
|
+
}
|
|
1140
|
+
if (/^camera\./.test(line)) {
|
|
1141
|
+
return "unsupported camera command; use frame NodeOrGroup zoom=... inside a beat";
|
|
1142
|
+
}
|
|
1143
|
+
return null;
|
|
1144
|
+
}
|
|
1124
1145
|
function pushWarning(diagnostics, seen, line, message) {
|
|
1125
1146
|
const key = `${line}:${message}`;
|
|
1126
1147
|
if (seen.has(key)) return;
|
|
@@ -1206,8 +1227,13 @@ function parse(source, opts = {}) {
|
|
|
1206
1227
|
const block = blocks[i];
|
|
1207
1228
|
const line = block.text;
|
|
1208
1229
|
const lineNo = block.line;
|
|
1230
|
+
const unsupportedMessage = unsupportedSyntaxMessage(line);
|
|
1231
|
+
if (unsupportedMessage) throw new ParseError(unsupportedMessage, lineNo);
|
|
1209
1232
|
if (line.startsWith("scene")) {
|
|
1210
1233
|
const rest = line.slice(5).trim();
|
|
1234
|
+
if (line.endsWith("{")) {
|
|
1235
|
+
throw new ParseError(`nested scene blocks are not supported; use one scene with multiple beat blocks`, lineNo);
|
|
1236
|
+
}
|
|
1211
1237
|
let remainder = rest;
|
|
1212
1238
|
const str = parseStringToken(rest);
|
|
1213
1239
|
if (str) {
|
package/package.json
CHANGED