@cardenelabs/dragon 0.16.0 → 0.18.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.
- package/README.md +10 -0
- package/dist/index.cjs +593 -374
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +207 -16
- package/dist/index.d.ts +207 -16
- package/dist/index.js +594 -376
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/compile.ts +539 -719
- package/src/index.ts +1 -0
- package/src/json-parser.ts +130 -1
- package/src/keywords.ts +28 -0
- package/src/schemas/diagram.json +62 -1
- package/src/tokenize.ts +5 -5
- package/src/types.ts +67 -1
- package/src/v05/parser.ts +217 -6
package/src/v05/parser.ts
CHANGED
|
@@ -41,9 +41,11 @@
|
|
|
41
41
|
* 出力は v0.4 と同じ DslDocument。 既存 compile.ts で CdlDiagram に変換できる。
|
|
42
42
|
*/
|
|
43
43
|
|
|
44
|
-
import type { NodeKind, Tone, EdgeStyle } from "@cardenelabs/cdl";
|
|
45
|
-
import { TONES, NODE_KINDS, parseFormula } from "@cardenelabs/cdl";
|
|
46
|
-
import {
|
|
44
|
+
import type { NodeKind, Tone, EdgeStyle, EdgeHead, EdgeHeadFill, ClassRelationType, SequenceMessageKind } from "@cardenelabs/cdl";
|
|
45
|
+
import { TONES, NODE_KINDS, EDGE_HEADS, EDGE_HEAD_FILLS, EDGE_STYLES, EDGE_REVEALS, CLASS_RELATION_LOOK, SEQUENCE_MESSAGE_LOOK, parseFormula } from "@cardenelabs/cdl";
|
|
46
|
+
import type { EdgeReveal } from "@cardenelabs/cdl";
|
|
47
|
+
import { TONE_ALIAS, NODE_KIND_ALIAS, DIRECTIONS, resolveDirection } from "../keywords";
|
|
48
|
+
import type { DslDirection } from "../keywords";
|
|
47
49
|
import { parseRelativePos, orderByDependency } from "../relative-pos";
|
|
48
50
|
import {
|
|
49
51
|
checkValueExpression,
|
|
@@ -74,6 +76,7 @@ import type {
|
|
|
74
76
|
DslError,
|
|
75
77
|
PresetType,
|
|
76
78
|
DslLane,
|
|
79
|
+
DslBand,
|
|
77
80
|
DslGroup,
|
|
78
81
|
DslViewport,
|
|
79
82
|
} from "../types";
|
|
@@ -83,6 +86,26 @@ export type V05ParseResult = { ok: true; doc: DslDocument } | { ok: false; error
|
|
|
83
86
|
/** 矢印を出す辺。 Text DSL / JSON validator / 公開 schema の 3 経路で同じ 4 値を使う。 */
|
|
84
87
|
export const EDGE_SIDE_VALUES = ["top", "right", "bottom", "left"] as const;
|
|
85
88
|
|
|
89
|
+
/**
|
|
90
|
+
* 矢印の先の形として書ける語 (#1462)。
|
|
91
|
+
*
|
|
92
|
+
* **描画側から導く**。 手で並べると、描画側が形を増やした時に書けないままになる。
|
|
93
|
+
*/
|
|
94
|
+
export const EDGE_HEAD_VALUES: readonly string[] = EDGE_HEADS;
|
|
95
|
+
|
|
96
|
+
/** 端の印の塗り方 (#1466)。 描画側の一覧から導く = 描画側が増やせば書ける */
|
|
97
|
+
export const EDGE_HEAD_FILL_VALUES: readonly string[] = EDGE_HEAD_FILLS;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* クラス図の関係の種類 (#1466)。 描画側の表 (`CLASS_RELATION_LOOK`) の key から導く。
|
|
101
|
+
*
|
|
102
|
+
* 手で並べると、描画側が種類を足した時にここだけ取り残されて書けないままになる。
|
|
103
|
+
*/
|
|
104
|
+
export const CLASS_RELATION_VALUES: readonly string[] = Object.keys(CLASS_RELATION_LOOK);
|
|
105
|
+
|
|
106
|
+
/** 順序図の言づての種類 (#1466)。 描画側の表から導く */
|
|
107
|
+
export const SEQ_MESSAGE_VALUES: readonly string[] = Object.keys(SEQUENCE_MESSAGE_LOOK);
|
|
108
|
+
|
|
86
109
|
/**
|
|
87
110
|
* 記法が受ける top-level の項目 (#1190)。
|
|
88
111
|
*
|
|
@@ -115,6 +138,21 @@ export const TOP_LEVEL_KEYS = [
|
|
|
115
138
|
"events",
|
|
116
139
|
// 巻き上げに応じて進む値 (#1393)
|
|
117
140
|
"scrolls",
|
|
141
|
+
// 動いている間の帯 (#1466)。 順序図だけが読む
|
|
142
|
+
"bands",
|
|
143
|
+
// 矢印をいつ出すか (#1470)
|
|
144
|
+
"reveal",
|
|
145
|
+
/*
|
|
146
|
+
* 図の並ぶ向き (#1494)。
|
|
147
|
+
*
|
|
148
|
+
* **最上位の語は英語にする**。 日本語の見出し (`タイトル:` / `種類:` 等) は v0.4 の
|
|
149
|
+
* 書き方で、2026-12-31 に廃止する側にある。 ここで日本語の語を足すと、消す予定の形を
|
|
150
|
+
* 増やすことになる。
|
|
151
|
+
*
|
|
152
|
+
* 値は日本語と英語の両方を受ける。 箱の項目 (`色` / `種類` / `位置` / `大きさ`) は v0.5 でも
|
|
153
|
+
* 日本語で書けるので、書き手が自然に言う語 (`縦` / `横`) を残せる。
|
|
154
|
+
*/
|
|
155
|
+
"direction",
|
|
118
156
|
] as const;
|
|
119
157
|
|
|
120
158
|
/**
|
|
@@ -335,11 +373,14 @@ export const NODE_KIND_VALID: ReadonlySet<string> = new Set<string>([
|
|
|
335
373
|
const TONE_VALID: ReadonlySet<string> = new Set<string>(TONES);
|
|
336
374
|
|
|
337
375
|
/**
|
|
338
|
-
* 受理する線種。
|
|
376
|
+
* 受理する線種。 **描画側の一覧から導く** (#1466)。
|
|
377
|
+
*
|
|
378
|
+
* 以前は手で並べており、描画側が `dashed` を足した時にここだけ取り残されて「線種が
|
|
379
|
+
* 読めません」 で落ちた (実測)。 色名 (`TONE_VALID`) と同じく描画側を出どころにする。
|
|
339
380
|
*
|
|
340
|
-
* JSON 経路も同じ集合を読む (#1304)。
|
|
381
|
+
* JSON 経路も同じ集合を読む (#1304)。 別に持つと、線種が増えた時に片方だけ取り残される。
|
|
341
382
|
*/
|
|
342
|
-
export const STYLE_VALID: ReadonlySet<string> = new Set<string>(
|
|
383
|
+
export const STYLE_VALID: ReadonlySet<string> = new Set<string>(EDGE_STYLES);
|
|
343
384
|
|
|
344
385
|
/**
|
|
345
386
|
* 色の名前として書ける語の一覧 (#1304)。 知らせの `hint` に出す。
|
|
@@ -396,6 +437,9 @@ export function parseTextDslV05(src: string): V05ParseResult {
|
|
|
396
437
|
let type: PresetType | null = null;
|
|
397
438
|
let eyebrow: string | null = null;
|
|
398
439
|
let eyebrowLine = 0;
|
|
440
|
+
let reveal: EdgeReveal | null = null;
|
|
441
|
+
let direction: DslDirection | null = null;
|
|
442
|
+
let directionLine = 0;
|
|
399
443
|
let axes: DslAxes | undefined = undefined;
|
|
400
444
|
let axesLine = 0;
|
|
401
445
|
let actors: DslActor[] = [];
|
|
@@ -404,6 +448,8 @@ export function parseTextDslV05(src: string): V05ParseResult {
|
|
|
404
448
|
const values: DslValue[] = [];
|
|
405
449
|
let viewport: DslViewport | undefined = undefined;
|
|
406
450
|
let lanesMap: Record<string, DslLane> | undefined = undefined;
|
|
451
|
+
// 動いている間の帯 (#1466)。 順序図だけが読む
|
|
452
|
+
let bands: DslBand[] | undefined = undefined;
|
|
407
453
|
let readoutsList: DslReadout[] | undefined = undefined;
|
|
408
454
|
let inputsList: DslInput[] | undefined = undefined;
|
|
409
455
|
let formulasList: DslFormula[] | undefined = undefined;
|
|
@@ -437,6 +483,55 @@ export function parseTextDslV05(src: string): V05ParseResult {
|
|
|
437
483
|
i += 1;
|
|
438
484
|
continue;
|
|
439
485
|
}
|
|
486
|
+
if (head.key === "reveal") {
|
|
487
|
+
/*
|
|
488
|
+
* 矢印をいつ出すか (#1470)。
|
|
489
|
+
*
|
|
490
|
+
* 既定 (`phase`) は「段が名指しする矢印は、その段が来るまで描かない」。 段を進めるごとに
|
|
491
|
+
* 関係が増える図で、全ての矢印が 1 段目から見えていたことへの対処 (`cdl#582`)。
|
|
492
|
+
* `all` と書くと段に関わらず最初から全部描く。
|
|
493
|
+
*/
|
|
494
|
+
const v = (head.value ?? "").trim();
|
|
495
|
+
if (v.length > 0) {
|
|
496
|
+
if ((EDGE_REVEALS as readonly string[]).includes(v)) {
|
|
497
|
+
reveal = v as EdgeReveal;
|
|
498
|
+
} else {
|
|
499
|
+
errors.push({
|
|
500
|
+
line: line.no,
|
|
501
|
+
message: `reveal が読めません (書いた値: ${v})`,
|
|
502
|
+
hint: `使える語 = ${EDGE_REVEALS.join(" / ")}`,
|
|
503
|
+
});
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
i += 1;
|
|
507
|
+
continue;
|
|
508
|
+
}
|
|
509
|
+
if (head.key === "direction") {
|
|
510
|
+
/*
|
|
511
|
+
* 図の並ぶ向き (#1494)。
|
|
512
|
+
*
|
|
513
|
+
* `縦` は 1 つの縦列に積み、`横` は 1 人ずつ縦列を作る。 どちらも組み立て側に既にある
|
|
514
|
+
* 経路で、ここで足すのは名指しする言葉だけ。
|
|
515
|
+
*
|
|
516
|
+
* **書いた行を覚える**。 効かない図種に書いた時の知らせが、書いた場所を指せるようにする。
|
|
517
|
+
*/
|
|
518
|
+
const v = (head.value ?? "").trim();
|
|
519
|
+
if (v.length > 0) {
|
|
520
|
+
const 解けた = resolveDirection(v);
|
|
521
|
+
if (解けた !== null) {
|
|
522
|
+
direction = 解けた;
|
|
523
|
+
directionLine = line.no;
|
|
524
|
+
} else {
|
|
525
|
+
errors.push({
|
|
526
|
+
line: line.no,
|
|
527
|
+
message: `direction が読めません (書いた値: ${v})`,
|
|
528
|
+
hint: `使える語 = ${DIRECTIONS.join(" / ")} / vertical / horizontal`,
|
|
529
|
+
});
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
i += 1;
|
|
533
|
+
continue;
|
|
534
|
+
}
|
|
440
535
|
if (head.key === "eyebrow") {
|
|
441
536
|
// 空で書いた形 (`eyebrow:`) は「書かなかった」 と同じにする。 空文字を残すと
|
|
442
537
|
// 描画側が中身のない帯を出す
|
|
@@ -645,6 +740,31 @@ export function parseTextDslV05(src: string): V05ParseResult {
|
|
|
645
740
|
i = next;
|
|
646
741
|
continue;
|
|
647
742
|
}
|
|
743
|
+
if (head.key === "bands") {
|
|
744
|
+
/*
|
|
745
|
+
* 動いている間の帯 (#1466)。 `- DB: 1..2` の形で、段の番号の区間を書く。
|
|
746
|
+
*
|
|
747
|
+
* 面ごとに 2 行以上書ける = 途中で手が空く面はそこで切れる。 書かない図は
|
|
748
|
+
* 組み立て器が「最初に関わった段から最後まで」 の 1 本にする。
|
|
749
|
+
*/
|
|
750
|
+
const { items, next } = collectIndentedList(lines, i + 1, line.indent);
|
|
751
|
+
bands = [];
|
|
752
|
+
for (const it of items) {
|
|
753
|
+
// 一覧の読み手が先頭の `- ` を落とす形と落とさない形の両方を受ける
|
|
754
|
+
const m = it.trimmed.match(/^(?:-\s*)?(.+?)\s*:\s*(\d+)\s*\.\.\s*(\d+)\s*$/);
|
|
755
|
+
if (!m) {
|
|
756
|
+
errors.push({
|
|
757
|
+
line: it.no,
|
|
758
|
+
message: `帯の書き方が読めません: "${it.trimmed}"`,
|
|
759
|
+
hint: "use `- DB: 1..2` (面の名前と、段の番号の区間)",
|
|
760
|
+
});
|
|
761
|
+
continue;
|
|
762
|
+
}
|
|
763
|
+
bands.push({ actor: m[1]!, from: Number(m[2]), to: Number(m[3]) });
|
|
764
|
+
}
|
|
765
|
+
i = next;
|
|
766
|
+
continue;
|
|
767
|
+
}
|
|
648
768
|
if (head.key === "lanes") {
|
|
649
769
|
// lanes:\n l1: { x: 0, width: 320, label: "..." }\n l2: { ... }
|
|
650
770
|
const { items, next } = collectIndentedList(lines, i + 1, line.indent);
|
|
@@ -885,6 +1005,8 @@ export function parseTextDslV05(src: string): V05ParseResult {
|
|
|
885
1005
|
title: title!,
|
|
886
1006
|
type: type!,
|
|
887
1007
|
...(eyebrow !== null ? { eyebrow, eyebrowPos: { line: eyebrowLine } } : {}),
|
|
1008
|
+
...(reveal !== null ? { reveal } : {}),
|
|
1009
|
+
...(direction !== null ? { direction, directionPos: { line: directionLine } } : {}),
|
|
888
1010
|
...(axes !== undefined ? { axes, axesPos: { line: axesLine } } : {}),
|
|
889
1011
|
actors,
|
|
890
1012
|
flow,
|
|
@@ -892,6 +1014,7 @@ export function parseTextDslV05(src: string): V05ParseResult {
|
|
|
892
1014
|
...(values.length > 0 ? { values } : {}),
|
|
893
1015
|
viewport,
|
|
894
1016
|
lanes: lanesMap,
|
|
1017
|
+
...(bands && bands.length > 0 ? { bands } : {}),
|
|
895
1018
|
readouts: readoutsList,
|
|
896
1019
|
inputs: inputsList,
|
|
897
1020
|
formulas: formulasList,
|
|
@@ -2423,6 +2546,22 @@ function applyContinuationLines(actor: DslActor, rest: Line[], errors: DslError[
|
|
|
2423
2546
|
.map((x) => stripQuotes(x.trim()))
|
|
2424
2547
|
.filter(Boolean);
|
|
2425
2548
|
break;
|
|
2549
|
+
/*
|
|
2550
|
+
* 行頭の印 (#1466)。 `rows` と同じ並びで、空文字はその行に印を付けない。
|
|
2551
|
+
*
|
|
2552
|
+
* **語の意味は図の種類が決める**。 ER は `pk` / `fk` / `opt`、状態遷移は
|
|
2553
|
+
* `entry` / `exit` / `do` / `internal`。 印の 2 軸 (形 × 塗り) は共通だが、その軸が
|
|
2554
|
+
* 何を指すかは種類ごとに違う = 1 つの語彙に畳むと、どの図でも意味が合わない語が残る。
|
|
2555
|
+
*
|
|
2556
|
+
* 空の要素を捨てない (`filter(Boolean)` を掛けない) = 並びが `rows` とずれる。
|
|
2557
|
+
*/
|
|
2558
|
+
case "marks":
|
|
2559
|
+
case "印":
|
|
2560
|
+
out.marks = raw
|
|
2561
|
+
.replace(/^\[|\]$/g, "")
|
|
2562
|
+
.split(/,(?![^[]*\])/)
|
|
2563
|
+
.map((x) => stripQuotes(x.trim()));
|
|
2564
|
+
break;
|
|
2426
2565
|
case "位置":
|
|
2427
2566
|
case "pos": {
|
|
2428
2567
|
// `位置: 300,200` の形。 posX と posY は両方揃わないと効かないので、 1 つの項目に
|
|
@@ -2587,6 +2726,9 @@ export const ACTOR_ITEM_KEYS: ReadonlySet<string> = new Set([
|
|
|
2587
2726
|
"前の値",
|
|
2588
2727
|
"rows",
|
|
2589
2728
|
"行",
|
|
2729
|
+
// 行頭の印 (#1466)。 `rows` と同じ並びで、形 × 塗り の 2 軸を語で書く
|
|
2730
|
+
"marks",
|
|
2731
|
+
"印",
|
|
2590
2732
|
// 箱の中に描く図形 (#1374)
|
|
2591
2733
|
"shape",
|
|
2592
2734
|
"図形",
|
|
@@ -2751,6 +2893,7 @@ const ACTOR_RESERVED_FIELDS: ReadonlySet<string> = new Set([
|
|
|
2751
2893
|
"value",
|
|
2752
2894
|
"previous",
|
|
2753
2895
|
"rows",
|
|
2896
|
+
"marks",
|
|
2754
2897
|
"lane",
|
|
2755
2898
|
"stack",
|
|
2756
2899
|
"initial",
|
|
@@ -2904,6 +3047,7 @@ export const INLINE_ACTOR_ALIASES: Record<string, string> = {
|
|
|
2904
3047
|
値: "value",
|
|
2905
3048
|
前の値: "previous",
|
|
2906
3049
|
行: "rows",
|
|
3050
|
+
印: "marks",
|
|
2907
3051
|
};
|
|
2908
3052
|
|
|
2909
3053
|
/** 中括弧に書かれた日本語の項目名を、同じ意味の英語名に寄せる (#1301) */
|
|
@@ -2927,6 +3071,7 @@ export const INLINE_ACTOR_KEYS: ReadonlySet<string> = new Set([
|
|
|
2927
3071
|
"value",
|
|
2928
3072
|
"previous",
|
|
2929
3073
|
"rows",
|
|
3074
|
+
"marks",
|
|
2930
3075
|
"lane",
|
|
2931
3076
|
"stack",
|
|
2932
3077
|
"initial",
|
|
@@ -2989,6 +3134,33 @@ const FLOW_INLINE_READERS = {
|
|
|
2989
3134
|
v !== undefined && (EDGE_SIDE_VALUES as readonly string[]).includes(v)
|
|
2990
3135
|
? (v as "top" | "right" | "bottom" | "left")
|
|
2991
3136
|
: undefined,
|
|
3137
|
+
// 矢印の先の形 (#1462)。 書かなければ描画側の既定 (塗った三角) になる
|
|
3138
|
+
head: (v: string | undefined) =>
|
|
3139
|
+
v !== undefined && EDGE_HEAD_VALUES.includes(v) ? (v as EdgeHead) : undefined,
|
|
3140
|
+
// 出どころ側の端の形 (#1466)。 ER は端ごとに違う個数を示すので両端に要る
|
|
3141
|
+
tailHead: (v: string | undefined) =>
|
|
3142
|
+
v !== undefined && EDGE_HEAD_VALUES.includes(v) ? (v as EdgeHead) : undefined,
|
|
3143
|
+
// 端の印の塗り (#1466)。 白抜きの菱が「持つ」、塗った菱が「抱える」
|
|
3144
|
+
headFill: (v: string | undefined) =>
|
|
3145
|
+
v !== undefined && EDGE_HEAD_FILL_VALUES.includes(v) ? (v as EdgeHeadFill) : undefined,
|
|
3146
|
+
tailHeadFill: (v: string | undefined) =>
|
|
3147
|
+
v !== undefined && EDGE_HEAD_FILL_VALUES.includes(v) ? (v as EdgeHeadFill) : undefined,
|
|
3148
|
+
/*
|
|
3149
|
+
* クラス図の関係の種類 (#1466)。 書くと **線と端の形と塗りと付く側** がまとめて決まる
|
|
3150
|
+
* (`CLASS_RELATION_LOOK`)。
|
|
3151
|
+
*
|
|
3152
|
+
* 4 つを個別に書かせない = 組合せは 6 通りしか無く、1 つでも書き違えると読み手に別の意味で
|
|
3153
|
+
* 伝わる (菱を逆に置くと持ち主が入れ替わる)。 種類で書けばその 6 通りから外れない。
|
|
3154
|
+
*/
|
|
3155
|
+
relation: (v: string | undefined) =>
|
|
3156
|
+
v !== undefined && CLASS_RELATION_VALUES.includes(v) ? (v as ClassRelationType) : undefined,
|
|
3157
|
+
/*
|
|
3158
|
+
* 順序図の言づての種類 (#1466)。 書くと線と矢の形がまとめて決まる。
|
|
3159
|
+
*
|
|
3160
|
+
* 呼ぶ (実線 + 塗った矢) / 返す (破線 + 開いた矢) / 投げる (実線 + 開いた矢) の 3 つ。
|
|
3161
|
+
*/
|
|
3162
|
+
kind: (v: string | undefined) =>
|
|
3163
|
+
v !== undefined && SEQ_MESSAGE_VALUES.includes(v) ? (v as SequenceMessageKind) : undefined,
|
|
2992
3164
|
/*
|
|
2993
3165
|
* 矢印を値に追随させる 3 欄 (#1396)。 箱の `wBind` (#1392) と同じく文字列だけを取る。
|
|
2994
3166
|
*
|
|
@@ -3104,6 +3276,13 @@ function parseActor(line: Line, errors: DslError[]): DslActor | null {
|
|
|
3104
3276
|
.map((x) => stripQuotes(x.trim()))
|
|
3105
3277
|
.filter(Boolean)
|
|
3106
3278
|
: undefined,
|
|
3279
|
+
// 行頭の印 (#1466)。 `rows` と同じ並びなので **空の要素を捨てない**
|
|
3280
|
+
marks: opts.marks
|
|
3281
|
+
? opts.marks
|
|
3282
|
+
.replace(/^\[|\]$/g, "")
|
|
3283
|
+
.split(/,(?![^[]*\])/)
|
|
3284
|
+
.map((x) => stripQuotes(x.trim()))
|
|
3285
|
+
: undefined,
|
|
3107
3286
|
lane: opts.lane,
|
|
3108
3287
|
// 箱の中に描く図形 (#1374)。 パーツでは状態の上書きとして意味を持つため横取りしない
|
|
3109
3288
|
shape:
|
|
@@ -3236,6 +3415,26 @@ function parseFlowStep(line: Line, no: number, errors: DslError[]): DslStep | nu
|
|
|
3236
3415
|
hint: `使える値 = ${EDGE_SIDE_VALUES.join(", ")}`,
|
|
3237
3416
|
});
|
|
3238
3417
|
}
|
|
3418
|
+
// 読めない語を黙って捨てない (#1462)。 捨てると「書いたのに端の形が変わらない」 が
|
|
3419
|
+
// 手掛かりなしで起きる
|
|
3420
|
+
// 読めない語を黙って捨てない (#1462 / #1466)。 捨てると「書いたのに見た目が変わらない」 が
|
|
3421
|
+
// 手掛かりなしで起きる。 端の 3 欄と関係の種類を同じ形で見る
|
|
3422
|
+
for (const [欄, 使える] of [
|
|
3423
|
+
["head", EDGE_HEAD_VALUES],
|
|
3424
|
+
["tailHead", EDGE_HEAD_VALUES],
|
|
3425
|
+
["headFill", EDGE_HEAD_FILL_VALUES],
|
|
3426
|
+
["tailHeadFill", EDGE_HEAD_FILL_VALUES],
|
|
3427
|
+
["relation", CLASS_RELATION_VALUES],
|
|
3428
|
+
["kind", SEQ_MESSAGE_VALUES],
|
|
3429
|
+
] as const) {
|
|
3430
|
+
if (opts[欄] !== undefined && 中括弧[欄] === undefined) {
|
|
3431
|
+
errors.push({
|
|
3432
|
+
line: line.no,
|
|
3433
|
+
message: `矢印の ${欄} が読めません: "${opts[欄]}"`,
|
|
3434
|
+
hint: `使える値 = ${使える.join(", ")}`,
|
|
3435
|
+
});
|
|
3436
|
+
}
|
|
3437
|
+
}
|
|
3239
3438
|
数と真偽 = 表で読む(FLOW_INLINE_VALUE_KINDS, opts, "矢印の ", line.no, errors);
|
|
3240
3439
|
rest = 塊.前.trim();
|
|
3241
3440
|
}
|
|
@@ -3243,6 +3442,12 @@ function parseFlowStep(line: Line, no: number, errors: DslError[]): DslStep | nu
|
|
|
3243
3442
|
const guard = 中括弧.guard as string | undefined;
|
|
3244
3443
|
const cardinality = 中括弧.cardinality as string | undefined;
|
|
3245
3444
|
const side = 中括弧.side as "top" | "right" | "bottom" | "left" | undefined;
|
|
3445
|
+
const head = 中括弧.head as EdgeHead | undefined;
|
|
3446
|
+
const tailHead = 中括弧.tailHead as EdgeHead | undefined;
|
|
3447
|
+
const headFill = 中括弧.headFill as EdgeHeadFill | undefined;
|
|
3448
|
+
const tailHeadFill = 中括弧.tailHeadFill as EdgeHeadFill | undefined;
|
|
3449
|
+
const relation = 中括弧.relation as ClassRelationType | undefined;
|
|
3450
|
+
const msgKind = 中括弧.kind as SequenceMessageKind | undefined;
|
|
3246
3451
|
// 値に追随する 3 欄 (#1396)。 空は捨てずに知らせる = 描画側は空文字を既定値へ落とさず
|
|
3247
3452
|
// そのまま置換に使うため、書き忘れが「線が消えた」 形で出る
|
|
3248
3453
|
const widthBind = 追随する大きさとして読む(
|
|
@@ -3323,6 +3528,12 @@ function parseFlowStep(line: Line, no: number, errors: DslError[]): DslStep | nu
|
|
|
3323
3528
|
guard,
|
|
3324
3529
|
cardinality,
|
|
3325
3530
|
side,
|
|
3531
|
+
head,
|
|
3532
|
+
tailHead,
|
|
3533
|
+
headFill,
|
|
3534
|
+
tailHeadFill,
|
|
3535
|
+
relation,
|
|
3536
|
+
msgKind,
|
|
3326
3537
|
widthBind,
|
|
3327
3538
|
strokeBind,
|
|
3328
3539
|
dashOffsetBind,
|