oficina / mapa Public

Clone
git clone https://amadan.net/oficina/mapa

Plain git — no account needed to clone.

Download

Download this file

1package main
2
3// The columns and icons spec's mutations for column layouts (§9): the
4// grammar's column count, the merge's second pass, and the server's
5// block routes.
6
7const (
8 columnsGo = "internal/mapa/markup/columns.go"
9 mergeGo = "internal/mapa/markup/merge.go"
10 markersGo = "internal/mapa/markers.go"
11 grammarGo = "internal/mapa/grammar.go"
12 markupPackage = "./internal/mapa/markup/"
13 secondPassFrom = "\tif texts.anyFence() && !texts.layoutsHold(hunks) {"
14)
15
16var columnMutations = []mutation{
17 {gate: "COL2", test: "TestShapesThatAreNotLayoutsParseAsBefore",
18 pkg: markupPackage,
19 name: "a one-column layout is recognised",
20 edits: []edit{{file: columnsGo,
21 from: "count >= 2 && count <= 4",
22 to: "count >= 1 && count <= 4"}}},
23 {gate: "COL4",
24 test: "TestEveryMergeOfLayoutEditsHoldsValidLayouts",
25 pkg: markupPackage,
26 name: "Merge3 skips the second pass",
27 edits: []edit{{file: mergeGo, from: secondPassFrom,
28 to: "\tif false {"}}},
29 {gate: "COL4", test: "TestEveryMergeOfLayoutEditsHoldsValidLayouts",
30 pkg: markupPackage,
31 name: "Merge3 runs the second pass only when clean",
32 edits: []edit{{file: mergeGo, from: secondPassFrom,
33 to: "\tif clean && texts.anyFence() && " +
34 "!texts.layoutsHold(hunks) {"}}},
35 {gate: "COL13", test: "TestCOL13FencesAreNoBlockToMarkOrLink",
36 name: "MarkBlock accepts a fence",
37 edits: []edit{{file: markersGo,
38 from: "\t\t\tmarkup.IsFence(block.Kind) {",
39 to: "\t\t\tfalse {"}}},
40 {gate: "COL13", test: "TestCOL13AnotherGrammarIsRefusedAndTheDraftKept",
41 name: "any grammar is taken",
42 edits: []edit{{file: grammarGo,
43 from: "\t\tif request.PostFormValue(\"grammar\") == grammarField {",
44 to: "\t\tif true {"}}},
45}
46