wyreframe 0.1.1 → 0.2.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 +9 -4
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +34 -4
- package/src/parser/Detector/BoxTracer.mjs +122 -36
- package/src/parser/Detector/BoxTracer.res +172 -27
- package/src/parser/Detector/ShapeDetector.mjs +27 -9
- package/src/parser/Detector/ShapeDetector.res +15 -8
- package/src/parser/Errors/ErrorMessages.mjs +25 -0
- package/src/parser/Errors/ErrorMessages.res +17 -0
- package/src/parser/Errors/ErrorTypes.mjs +3 -0
- package/src/parser/Errors/ErrorTypes.res +8 -1
- package/src/parser/Parser.gen.tsx +3 -2
- package/src/parser/Parser.mjs +22 -10
- package/src/parser/Parser.res +27 -18
- package/src/renderer/Renderer.gen.tsx +7 -1
- package/src/renderer/Renderer.mjs +126 -25
- package/src/renderer/Renderer.res +116 -12
- package/src/test/Expect.mjs +0 -9
package/README.md
CHANGED
|
@@ -105,19 +105,24 @@ switch Renderer.createUI(ui, None) {
|
|
|
105
105
|
```javascript
|
|
106
106
|
import { parse, render, createUI, createUIOrThrow } from 'wyreframe';
|
|
107
107
|
|
|
108
|
-
// Parse only
|
|
108
|
+
// Parse only - returns { success, ast } or { success, errors }
|
|
109
109
|
const result = parse(text);
|
|
110
110
|
|
|
111
|
-
// Render only
|
|
112
|
-
|
|
111
|
+
// Render only - IMPORTANT: pass result.ast, not result directly!
|
|
112
|
+
if (result.success) {
|
|
113
|
+
const { root, sceneManager } = render(result.ast);
|
|
114
|
+
}
|
|
113
115
|
|
|
114
|
-
// Parse + Render (recommended)
|
|
116
|
+
// Parse + Render (recommended) - handles the wrapper automatically
|
|
115
117
|
const result = createUI(text);
|
|
116
118
|
|
|
117
119
|
// Throw on error
|
|
118
120
|
const { root, sceneManager } = createUIOrThrow(text);
|
|
119
121
|
```
|
|
120
122
|
|
|
123
|
+
> **Note:** `parse()` returns a wrapper object `{ success: true, ast: AST }` or `{ success: false, errors: [] }`.
|
|
124
|
+
> When using `render()` directly, make sure to pass `result.ast`, not the result object itself.
|
|
125
|
+
|
|
121
126
|
### ReScript
|
|
122
127
|
|
|
123
128
|
```rescript
|
package/dist/index.d.ts
CHANGED
|
@@ -120,6 +120,7 @@ export interface RenderResult {
|
|
|
120
120
|
export type ParseSuccessResult = {
|
|
121
121
|
success: true;
|
|
122
122
|
ast: AST;
|
|
123
|
+
warnings: ParseError[];
|
|
123
124
|
};
|
|
124
125
|
export type ParseErrorResult = {
|
|
125
126
|
success: false;
|
|
@@ -140,6 +141,7 @@ export type CreateUISuccessResult = {
|
|
|
140
141
|
root: HTMLElement;
|
|
141
142
|
sceneManager: SceneManager;
|
|
142
143
|
ast: AST;
|
|
144
|
+
warnings: ParseError[];
|
|
143
145
|
};
|
|
144
146
|
export type CreateUIErrorResult = {
|
|
145
147
|
success: false;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAaH,wCAAwC;AACxC,MAAM,MAAM,UAAU,GAClB,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,kBAAkB,GAClB,QAAQ,GACR,kBAAkB,CAAC;AAEvB,0CAA0C;AAC1C,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,YAAY,GAAG,aAAa,GAAG,MAAM,CAAC;AAE5E,qBAAqB;AACrB,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEpD,4BAA4B;AAC5B,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,CAAC;AAE9D,oCAAoC;AACpC,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,MAA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AAC,EAAE,aAAa,GAAG,cAAc,CAgB9E;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,aAAa,GACtB,YAAY,GAAG;IAAE,GAAG,EAAE,GAAG,CAAA;CAAE,CAK7B;AAGD,eAAO,MAAM,OAAO,EAAE,MAAuB,CAAC;AAC9C,eAAO,MAAM,cAAc,EAAE,MAA8B,CAAC;;;;;;;;;;;;AAG5D,wBAUE"}
|
package/dist/index.js
CHANGED
|
@@ -33,7 +33,8 @@ import * as Renderer from '../src/renderer/Renderer.mjs';
|
|
|
33
33
|
export function parse(text) {
|
|
34
34
|
const result = Parser.parse(text);
|
|
35
35
|
if (result.TAG === 'Ok') {
|
|
36
|
-
|
|
36
|
+
const [ast, warnings] = result._0;
|
|
37
|
+
return { success: true, ast, warnings };
|
|
37
38
|
}
|
|
38
39
|
else {
|
|
39
40
|
return { success: false, errors: result._0 };
|
|
@@ -79,7 +80,8 @@ export function parseOrThrow(text) {
|
|
|
79
80
|
export function parseWireframe(wireframe) {
|
|
80
81
|
const result = Parser.parseWireframe(wireframe);
|
|
81
82
|
if (result.TAG === 'Ok') {
|
|
82
|
-
|
|
83
|
+
const [ast, warnings] = result._0;
|
|
84
|
+
return { success: true, ast, warnings };
|
|
83
85
|
}
|
|
84
86
|
else {
|
|
85
87
|
return { success: false, errors: result._0 };
|
|
@@ -117,6 +119,24 @@ export function parseInteractions(dsl) {
|
|
|
117
119
|
* ```
|
|
118
120
|
*/
|
|
119
121
|
export function render(ast, options) {
|
|
122
|
+
// Input validation: Check if user accidentally passed ParseResult instead of AST
|
|
123
|
+
if (ast && typeof ast === 'object' && 'success' in ast) {
|
|
124
|
+
const parseResult = ast;
|
|
125
|
+
if (parseResult.success === true && 'ast' in parseResult) {
|
|
126
|
+
throw new Error('render() expects an AST object, but received a ParseResult. ' +
|
|
127
|
+
'Did you forget to extract .ast? Use: render(result.ast) instead of render(result)');
|
|
128
|
+
}
|
|
129
|
+
else if (parseResult.success === false) {
|
|
130
|
+
throw new Error('render() received a failed ParseResult. ' +
|
|
131
|
+
'Check parse errors before calling render: if (result.success) { render(result.ast); }');
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
// Validate AST structure
|
|
135
|
+
if (!ast || typeof ast !== 'object' || !Array.isArray(ast.scenes)) {
|
|
136
|
+
throw new Error('render() expects an AST object with a scenes array. ' +
|
|
137
|
+
'Did you pass ParseResult instead of ParseResult.ast? ' +
|
|
138
|
+
'Correct usage: const result = parse(text); if (result.success) { render(result.ast); }');
|
|
139
|
+
}
|
|
120
140
|
// Pass undefined if no options, so ReScript uses its defaults
|
|
121
141
|
const result = Renderer.render(ast, options);
|
|
122
142
|
return {
|
|
@@ -156,6 +176,7 @@ export function createUI(text, options) {
|
|
|
156
176
|
root,
|
|
157
177
|
sceneManager,
|
|
158
178
|
ast: parseResult.ast,
|
|
179
|
+
warnings: parseResult.warnings,
|
|
159
180
|
};
|
|
160
181
|
}
|
|
161
182
|
/**
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,0EAA0E;AAC1E,yFAAyF;AACzF,yCAAyC;AACzC,OAAO,KAAK,MAAM,MAAM,0BAA0B,CAAC;AACnD,yCAAyC;AACzC,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,0EAA0E;AAC1E,yFAAyF;AACzF,yCAAyC;AACzC,OAAO,KAAK,MAAM,MAAM,0BAA0B,CAAC;AACnD,yCAAyC;AACzC,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AAwNzD,+EAA+E;AAC/E,gBAAgB;AAChB,+EAA+E;AAE/E;;;;;;;;;;;;;;;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MAAM,CAAC,OAAO,CAAC;AAC9C,MAAM,CAAC,MAAM,cAAc,GAAW,MAAM,CAAC,cAAc,CAAC;AAE5D,iCAAiC;AACjC,eAAe;IACb,KAAK;IACL,YAAY;IACZ,cAAc;IACd,iBAAiB;IACjB,MAAM;IACN,QAAQ;IACR,eAAe;IACf,OAAO;IACP,cAAc;CACf,CAAC"}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -173,6 +173,7 @@ export interface RenderResult {
|
|
|
173
173
|
export type ParseSuccessResult = {
|
|
174
174
|
success: true;
|
|
175
175
|
ast: AST;
|
|
176
|
+
warnings: ParseError[];
|
|
176
177
|
};
|
|
177
178
|
|
|
178
179
|
export type ParseErrorResult = {
|
|
@@ -199,6 +200,7 @@ export type CreateUISuccessResult = {
|
|
|
199
200
|
root: HTMLElement;
|
|
200
201
|
sceneManager: SceneManager;
|
|
201
202
|
ast: AST;
|
|
203
|
+
warnings: ParseError[];
|
|
202
204
|
};
|
|
203
205
|
|
|
204
206
|
export type CreateUIErrorResult = {
|
|
@@ -246,10 +248,11 @@ type ReScriptResult<T, E> = ReScriptOk<T> | ReScriptError<E>;
|
|
|
246
248
|
* ```
|
|
247
249
|
*/
|
|
248
250
|
export function parse(text: string): ParseResult {
|
|
249
|
-
const result = Parser.parse(text) as ReScriptResult<AST, ParseError[]>;
|
|
251
|
+
const result = Parser.parse(text) as ReScriptResult<[AST, ParseError[]], ParseError[]>;
|
|
250
252
|
|
|
251
253
|
if (result.TAG === 'Ok') {
|
|
252
|
-
|
|
254
|
+
const [ast, warnings] = result._0;
|
|
255
|
+
return { success: true, ast, warnings };
|
|
253
256
|
} else {
|
|
254
257
|
return { success: false, errors: result._0 };
|
|
255
258
|
}
|
|
@@ -294,10 +297,11 @@ export function parseOrThrow(text: string): AST {
|
|
|
294
297
|
* @returns Parse result with success flag
|
|
295
298
|
*/
|
|
296
299
|
export function parseWireframe(wireframe: string): ParseResult {
|
|
297
|
-
const result = Parser.parseWireframe(wireframe) as ReScriptResult<AST, ParseError[]>;
|
|
300
|
+
const result = Parser.parseWireframe(wireframe) as ReScriptResult<[AST, ParseError[]], ParseError[]>;
|
|
298
301
|
|
|
299
302
|
if (result.TAG === 'Ok') {
|
|
300
|
-
|
|
303
|
+
const [ast, warnings] = result._0;
|
|
304
|
+
return { success: true, ast, warnings };
|
|
301
305
|
} else {
|
|
302
306
|
return { success: false, errors: result._0 };
|
|
303
307
|
}
|
|
@@ -336,6 +340,31 @@ export function parseInteractions(dsl: string): InteractionResult {
|
|
|
336
340
|
* ```
|
|
337
341
|
*/
|
|
338
342
|
export function render(ast: AST, options?: RenderOptions): RenderResult {
|
|
343
|
+
// Input validation: Check if user accidentally passed ParseResult instead of AST
|
|
344
|
+
if (ast && typeof ast === 'object' && 'success' in ast) {
|
|
345
|
+
const parseResult = ast as unknown as ParseResult;
|
|
346
|
+
if (parseResult.success === true && 'ast' in parseResult) {
|
|
347
|
+
throw new Error(
|
|
348
|
+
'render() expects an AST object, but received a ParseResult. ' +
|
|
349
|
+
'Did you forget to extract .ast? Use: render(result.ast) instead of render(result)'
|
|
350
|
+
);
|
|
351
|
+
} else if (parseResult.success === false) {
|
|
352
|
+
throw new Error(
|
|
353
|
+
'render() received a failed ParseResult. ' +
|
|
354
|
+
'Check parse errors before calling render: if (result.success) { render(result.ast); }'
|
|
355
|
+
);
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
// Validate AST structure
|
|
360
|
+
if (!ast || typeof ast !== 'object' || !Array.isArray(ast.scenes)) {
|
|
361
|
+
throw new Error(
|
|
362
|
+
'render() expects an AST object with a scenes array. ' +
|
|
363
|
+
'Did you pass ParseResult instead of ParseResult.ast? ' +
|
|
364
|
+
'Correct usage: const result = parse(text); if (result.success) { render(result.ast); }'
|
|
365
|
+
);
|
|
366
|
+
}
|
|
367
|
+
|
|
339
368
|
// Pass undefined if no options, so ReScript uses its defaults
|
|
340
369
|
const result = Renderer.render(ast, options);
|
|
341
370
|
|
|
@@ -380,6 +409,7 @@ export function createUI(text: string, options?: RenderOptions): CreateUIResult
|
|
|
380
409
|
root,
|
|
381
410
|
sceneManager,
|
|
382
411
|
ast: parseResult.ast,
|
|
412
|
+
warnings: parseResult.warnings,
|
|
383
413
|
};
|
|
384
414
|
}
|
|
385
415
|
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import * as Grid from "../Core/Grid.mjs";
|
|
4
4
|
import * as Types from "../Core/Types.mjs";
|
|
5
5
|
import * as ErrorTypes from "../Errors/ErrorTypes.mjs";
|
|
6
|
+
import * as Core__Option from "@rescript/core/src/Core__Option.mjs";
|
|
6
7
|
|
|
7
8
|
function extractBoxName(topEdgeChars) {
|
|
8
9
|
let chars = topEdgeChars.map(Grid.cellCharToString);
|
|
@@ -49,6 +50,65 @@ function isDividerOnlyEdge(edgeChars) {
|
|
|
49
50
|
});
|
|
50
51
|
}
|
|
51
52
|
|
|
53
|
+
function findLastCornerInColumn(grid, startPos) {
|
|
54
|
+
let lastCorner;
|
|
55
|
+
for (let row = startPos.row + 1 | 0, row_finish = grid.height; row < row_finish; ++row) {
|
|
56
|
+
let pos = Types.Position.make(row, startPos.col);
|
|
57
|
+
let match = Grid.get(grid, pos);
|
|
58
|
+
if (match === "Corner" && typeof match !== "object") {
|
|
59
|
+
lastCorner = pos;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return lastCorner;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function rowHasVLineInRange(grid, row, leftCol, rightCol) {
|
|
66
|
+
let found = false;
|
|
67
|
+
let col = leftCol;
|
|
68
|
+
while (col <= rightCol && !found) {
|
|
69
|
+
let match = Grid.get(grid, Types.Position.make(row, col));
|
|
70
|
+
if (match === "VLine" && typeof match !== "object") {
|
|
71
|
+
found = true;
|
|
72
|
+
}
|
|
73
|
+
col = col + 1 | 0;
|
|
74
|
+
};
|
|
75
|
+
return found;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function findBottomRightCorner(grid, topLeft, topRight) {
|
|
79
|
+
let lastCorner;
|
|
80
|
+
let row = topRight.row + 1 | 0;
|
|
81
|
+
let $$continue = true;
|
|
82
|
+
while (row < grid.height && $$continue) {
|
|
83
|
+
let pos = Types.Position.make(row, topRight.col);
|
|
84
|
+
let match = Grid.get(grid, pos);
|
|
85
|
+
let exit = 0;
|
|
86
|
+
if (match !== undefined && typeof match !== "object") {
|
|
87
|
+
switch (match) {
|
|
88
|
+
case "Corner" :
|
|
89
|
+
lastCorner = pos;
|
|
90
|
+
row = row + 1 | 0;
|
|
91
|
+
break;
|
|
92
|
+
case "VLine" :
|
|
93
|
+
row = row + 1 | 0;
|
|
94
|
+
break;
|
|
95
|
+
default:
|
|
96
|
+
exit = 1;
|
|
97
|
+
}
|
|
98
|
+
} else {
|
|
99
|
+
exit = 1;
|
|
100
|
+
}
|
|
101
|
+
if (exit === 1) {
|
|
102
|
+
if (rowHasVLineInRange(grid, row, topLeft.col, topRight.col)) {
|
|
103
|
+
row = row + 1 | 0;
|
|
104
|
+
} else {
|
|
105
|
+
$$continue = false;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
return lastCorner;
|
|
110
|
+
}
|
|
111
|
+
|
|
52
112
|
function traceBox(grid, topLeft) {
|
|
53
113
|
let match = Grid.get(grid, topLeft);
|
|
54
114
|
if (match === "Corner" && typeof match !== "object") {
|
|
@@ -88,33 +148,22 @@ function traceBox(grid, topLeft) {
|
|
|
88
148
|
}
|
|
89
149
|
let boxName = extractBoxName(topEdgeChars);
|
|
90
150
|
let topWidth = topRightOpt.col - topLeft.col | 0;
|
|
151
|
+
let bottomRightOpt = findBottomRightCorner(grid, topLeft, topRightOpt);
|
|
91
152
|
let rightEdgeScan = Grid.scanDown(grid, topRightOpt, isValidVerticalChar);
|
|
92
|
-
let lastCorner$1 = {
|
|
93
|
-
contents: undefined
|
|
94
|
-
};
|
|
95
|
-
rightEdgeScan.forEach(param => {
|
|
96
|
-
let pos = param[0];
|
|
97
|
-
let tmp = param[1];
|
|
98
|
-
if (typeof tmp !== "object" && tmp === "Corner" && !Types.Position.equals(pos, topRightOpt)) {
|
|
99
|
-
lastCorner$1.contents = pos;
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
let bottomRightOpt = lastCorner$1.contents;
|
|
104
153
|
if (bottomRightOpt !== undefined) {
|
|
105
154
|
let bottomEdgeScan = Grid.scanLeft(grid, bottomRightOpt, isValidHorizontalChar);
|
|
106
|
-
let lastCorner$
|
|
155
|
+
let lastCorner$1 = {
|
|
107
156
|
contents: undefined
|
|
108
157
|
};
|
|
109
158
|
bottomEdgeScan.forEach(param => {
|
|
110
159
|
let pos = param[0];
|
|
111
160
|
let tmp = param[1];
|
|
112
161
|
if (typeof tmp !== "object" && tmp === "Corner" && !Types.Position.equals(pos, bottomRightOpt)) {
|
|
113
|
-
lastCorner$
|
|
162
|
+
lastCorner$1.contents = pos;
|
|
114
163
|
return;
|
|
115
164
|
}
|
|
116
165
|
});
|
|
117
|
-
let bottomLeftOpt = lastCorner$
|
|
166
|
+
let bottomLeftOpt = lastCorner$1.contents;
|
|
118
167
|
if (bottomLeftOpt === undefined) {
|
|
119
168
|
return {
|
|
120
169
|
TAG: "Error",
|
|
@@ -214,20 +263,8 @@ function traceBox(grid, topLeft) {
|
|
|
214
263
|
}
|
|
215
264
|
};
|
|
216
265
|
}
|
|
217
|
-
let
|
|
218
|
-
|
|
219
|
-
contents: undefined
|
|
220
|
-
};
|
|
221
|
-
leftEdgeScan$1.forEach(param => {
|
|
222
|
-
let pos = param[0];
|
|
223
|
-
let tmp = param[1];
|
|
224
|
-
if (typeof tmp !== "object" && tmp === "Corner" && !Types.Position.equals(pos, topLeft)) {
|
|
225
|
-
lastCorner$3.contents = pos;
|
|
226
|
-
return;
|
|
227
|
-
}
|
|
228
|
-
});
|
|
229
|
-
let bottomLeftOpt$1 = lastCorner$3.contents;
|
|
230
|
-
if (bottomLeftOpt$1 === undefined) {
|
|
266
|
+
let bottomLeftViaLeft = findLastCornerInColumn(grid, topLeft);
|
|
267
|
+
if (bottomLeftViaLeft === undefined) {
|
|
231
268
|
return {
|
|
232
269
|
TAG: "Error",
|
|
233
270
|
_0: ErrorTypes.makeSimple({
|
|
@@ -237,30 +274,30 @@ function traceBox(grid, topLeft) {
|
|
|
237
274
|
})
|
|
238
275
|
};
|
|
239
276
|
}
|
|
240
|
-
let bottomEdgeScan$1 = Grid.scanRight(grid,
|
|
241
|
-
let lastCorner$
|
|
277
|
+
let bottomEdgeScan$1 = Grid.scanRight(grid, bottomLeftViaLeft, isValidHorizontalChar);
|
|
278
|
+
let lastCorner$2 = {
|
|
242
279
|
contents: undefined
|
|
243
280
|
};
|
|
244
281
|
bottomEdgeScan$1.forEach(param => {
|
|
245
282
|
let pos = param[0];
|
|
246
283
|
let tmp = param[1];
|
|
247
|
-
if (typeof tmp !== "object" && tmp === "Corner" && !Types.Position.equals(pos,
|
|
248
|
-
lastCorner$
|
|
284
|
+
if (typeof tmp !== "object" && tmp === "Corner" && !Types.Position.equals(pos, bottomLeftViaLeft)) {
|
|
285
|
+
lastCorner$2.contents = pos;
|
|
249
286
|
return;
|
|
250
287
|
}
|
|
251
288
|
});
|
|
252
|
-
let bottomRightFromLeft = lastCorner$
|
|
289
|
+
let bottomRightFromLeft = lastCorner$2.contents;
|
|
253
290
|
if (bottomRightFromLeft === undefined) {
|
|
254
291
|
return {
|
|
255
292
|
TAG: "Error",
|
|
256
293
|
_0: ErrorTypes.makeSimple({
|
|
257
294
|
TAG: "UncloseBox",
|
|
258
|
-
corner:
|
|
295
|
+
corner: bottomLeftViaLeft,
|
|
259
296
|
direction: "bottom"
|
|
260
297
|
})
|
|
261
298
|
};
|
|
262
299
|
}
|
|
263
|
-
let bottomWidth$1 = bottomRightFromLeft.col -
|
|
300
|
+
let bottomWidth$1 = bottomRightFromLeft.col - bottomLeftViaLeft.col | 0;
|
|
264
301
|
if (topWidth !== bottomWidth$1) {
|
|
265
302
|
return {
|
|
266
303
|
TAG: "Error",
|
|
@@ -292,11 +329,60 @@ function traceBox(grid, topLeft) {
|
|
|
292
329
|
};
|
|
293
330
|
}
|
|
294
331
|
|
|
332
|
+
function validateInteriorAlignment(grid, bounds) {
|
|
333
|
+
let warnings = [];
|
|
334
|
+
for (let row = bounds.top + 1 | 0, row_finish = bounds.bottom; row < row_finish; ++row) {
|
|
335
|
+
let expectedRightCol = bounds.right;
|
|
336
|
+
let rightCell = Grid.get(grid, Types.Position.make(row, expectedRightCol));
|
|
337
|
+
let exit = 0;
|
|
338
|
+
if (rightCell !== "VLine" || typeof rightCell === "object") {
|
|
339
|
+
exit = 1;
|
|
340
|
+
}
|
|
341
|
+
if (exit === 1) {
|
|
342
|
+
let actualCol;
|
|
343
|
+
let maxSearchRight = expectedRightCol + 50 | 0;
|
|
344
|
+
let colRight = expectedRightCol + 1 | 0;
|
|
345
|
+
while (colRight <= maxSearchRight && Core__Option.isNone(actualCol)) {
|
|
346
|
+
let match = Grid.get(grid, Types.Position.make(row, colRight));
|
|
347
|
+
if (match === "VLine" && typeof match !== "object") {
|
|
348
|
+
actualCol = colRight;
|
|
349
|
+
}
|
|
350
|
+
colRight = colRight + 1 | 0;
|
|
351
|
+
};
|
|
352
|
+
if (Core__Option.isNone(actualCol)) {
|
|
353
|
+
let col = expectedRightCol - 1 | 0;
|
|
354
|
+
while (col > bounds.left && Core__Option.isNone(actualCol)) {
|
|
355
|
+
let match$1 = Grid.get(grid, Types.Position.make(row, col));
|
|
356
|
+
if (match$1 === "VLine" && typeof match$1 !== "object") {
|
|
357
|
+
actualCol = col;
|
|
358
|
+
}
|
|
359
|
+
col = col - 1 | 0;
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
let foundCol = actualCol;
|
|
363
|
+
if (foundCol !== undefined && foundCol !== expectedRightCol) {
|
|
364
|
+
let warning = ErrorTypes.makeSimple({
|
|
365
|
+
TAG: "MisalignedClosingBorder",
|
|
366
|
+
position: Types.Position.make(row, foundCol),
|
|
367
|
+
expectedCol: expectedRightCol,
|
|
368
|
+
actualCol: foundCol
|
|
369
|
+
});
|
|
370
|
+
warnings.push(warning);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
return warnings;
|
|
375
|
+
}
|
|
376
|
+
|
|
295
377
|
export {
|
|
296
378
|
extractBoxName,
|
|
297
379
|
isValidHorizontalChar,
|
|
298
380
|
isValidVerticalChar,
|
|
299
381
|
isDividerOnlyEdge,
|
|
382
|
+
findLastCornerInColumn,
|
|
383
|
+
rowHasVLineInRange,
|
|
384
|
+
findBottomRightCorner,
|
|
300
385
|
traceBox,
|
|
386
|
+
validateInteriorAlignment,
|
|
301
387
|
}
|
|
302
388
|
/* Grid Not a pure module */
|