Skip to content

Commit

Permalink
use labels in the Diagnosis chapter
Browse files Browse the repository at this point in the history
  • Loading branch information
stefjoosten committed Oct 12, 2023
1 parent 3c1d8ed commit b125d6a
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/Ampersand/Output/ToPandoc/ChapterDiagnosis.hs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ chpDiagnosis env fSpec
map (plain . str . text1ToText . tName . fst) (fRoles fSpec)
)
-- Content rows:
[ (plain . str . text1ToText . tName) rul :
[ (plain . str . label) rul :
[f rol rul | (rol, _) <- fRoles fSpec]
| rul <- sigs
]
Expand All @@ -138,7 +138,7 @@ chpDiagnosis env fSpec
( NL "Het oogmerk (purpose) van concept ",
EN "The concept "
)
<> (singleQuoted . str . text1ToText . tName) c
<> (singleQuoted . str . label) c
<> (str . l)
( NL " is niet gedocumenteerd.",
EN " remains without a purpose."
Expand All @@ -150,7 +150,7 @@ chpDiagnosis env fSpec
( NL "Het oogmerk (purpose) van de concepten: ",
EN "Concepts "
)
<> commaPandocAnd outputLang' (map (str . text1ToText . tName) xs)
<> commaPandocAnd outputLang' (map (str . label) xs)
<> (str . l)
( NL " is niet gedocumenteerd.",
EN " remain without a purpose."
Expand Down Expand Up @@ -362,7 +362,7 @@ chpDiagnosis env fSpec
( NL " geeft een conceptueel diagram met alle relaties die gedeclareerd zijn in ",
EN " shows a conceptual diagram with all relations declared in "
)
<> (singleQuoted . str . text1ToText . tName) pat
<> (singleQuoted . str . label) pat
<> "."
)
<> xDefBlck env fSpec pict
Expand Down Expand Up @@ -444,7 +444,7 @@ chpDiagnosis env fSpec
where
formalizations rls =
bulletList
[ para ((emph . str . text1ToText . tName) r <> " (" <> (str . tshow . origin) r <> ")")
[ para ((emph . str . label) r <> " (" <> (str . tshow . origin) r <> ")")
<> (para . showMath . formalExpression) r
<> (para . showPredLogic outputLang' . formalExpression) r
| r <- rls
Expand Down Expand Up @@ -488,7 +488,7 @@ chpDiagnosis env fSpec
Relations -> --The user-defined relations of the pattern / fSpec
Rules -> -- The user-defined rules of the pattern / fSpec
[Blocks]
mkTableRowPat p = mkTableRow (text1ToText . tName $ p) (relsDefdIn p) (udefrules p)
mkTableRowPat p = mkTableRow (label p) (relsDefdIn p) (udefrules p)
mkTableRow nm rels ruls =
map
(plain . str)
Expand Down Expand Up @@ -530,7 +530,7 @@ chpDiagnosis env fSpec
-- Rows:
[ [(plain . str . text1ToText . tName) rol]
<> [(plain . str . maybe "--" (text1ToText . tName) . rrpat) rul | multProcs]
<> [ (plain . str . text1ToText . tName) rul,
<> [ (plain . str . label) rul,
(plain . str . maybe "--" (text1ToText . tName) . rrpat) rul
]
| (rol, rul) <- fRoleRuls fSpec
Expand Down Expand Up @@ -577,7 +577,7 @@ chpDiagnosis env fSpec
-- Rows:
[ map
(plain . str)
[ (text1ToText . tName) r,
[ (label) r,
(tshow . origin) r,
(tshow . length) ps
]
Expand Down Expand Up @@ -625,19 +625,19 @@ chpDiagnosis env fSpec
-- else expls
-- where expls = [Plain (block<>[Space]) | Means l econt<-rrxpl r, l==Just outputLang' || l==Nothing, Para block<-econt]
quoterule :: Rule -> Inlines
quoterule = singleQuoted . str . text1ToText . tName
quoterule = singleQuoted . str . label
oneviol :: Rule -> AAtomPair -> Inlines
oneviol r p =
if isEndo (formalExpression r) && apLeft p == apRight p
then
singleQuoted
( (str . text1ToText . tName . source . formalExpression) r
( (str . label . source . formalExpression) r
<> (str . showValADL . apLeft) p
)
else
"(" <> (str . text1ToText . tName . source . formalExpression) r <> (str . showValADL . apLeft) p
"(" <> (str . label . source . formalExpression) r <> (str . showValADL . apLeft) p
<> ", "
<> (str . text1ToText . tName . target . formalExpression) r
<> (str . label . target . formalExpression) r
<> (str . showValADL . apRight) p
<> ")"
popwork :: [(Rule, AAtomPairs)]
Expand Down Expand Up @@ -676,7 +676,7 @@ chpDiagnosis env fSpec
showViolatedRule (r, ps) =
(para . emph)
( (str . l) (NL "Regel ", EN "Rule ")
<> (str . text1ToText . tName) r
<> (str . label) r
)
<> para
( ( if isSignal fSpec r
Expand All @@ -692,7 +692,7 @@ chpDiagnosis env fSpec
<> (commaPandocOr outputLang' . map (str . text1ToText . tName) . rolesOf $ r)
else
(str . l) (NL "Overtredingen van invariant ", EN "Violations of invariant ")
<> (str . text1ToText . tName) r
<> (str . label) r
)
-- Alignment:
(replicate 1 (AlignLeft, 1))
Expand Down Expand Up @@ -731,7 +731,7 @@ chpDiagnosis env fSpec
-- Alignment:
[(AlignLeft, 1.0)]
-- Header:
[(plain . str . text1ToText . tName . source . formalExpression) r]
[(plain . str . label . source . formalExpression) r]
-- Data rows:
[ [(plain . str . showValADL . apLeft) p]
| p <- take 10 . toList $ ps --max 10 rows
Expand All @@ -742,7 +742,7 @@ chpDiagnosis env fSpec
-- Alignment:
(replicate 2 (AlignLeft, 1 / 2))
-- Header:
[(plain . str . text1ToText . tName . source . formalExpression) r, (plain . str . text1ToText . tName . target . formalExpression) r]
[(plain . str . label . source . formalExpression) r, (plain . str . label . target . formalExpression) r]
-- Data rows:
[ [(plain . str . showValADL . apLeft) p, (plain . str . showValADL . apRight) p]
| p <- take 10 . toList $ ps --max 10 rows
Expand Down

0 comments on commit b125d6a

Please sign in to comment.