diff options
| author | adelon <22380201+adelon@users.noreply.github.com> | 2025-08-12 00:37:28 +0200 |
|---|---|---|
| committer | adelon <22380201+adelon@users.noreply.github.com> | 2025-08-12 00:37:28 +0200 |
| commit | 39ef87d3ce39152febc130aa95e25dc0722c3525 (patch) | |
| tree | 018ce21f85bc132306ac5130db405527a313c1a7 /source/Syntax/Abstract.hs | |
| parent | afce89ead823b6e9eec4a0b115bbe57a89a8e912 (diff) | |
Allow relation symbols with parameters
Parameters must follow the relation symbol and be surrounded by braces, like so: `\rel{x}{y}{z}`.
This attempt is still brittle/broken in a few ways:
- It makes using braces in creative ways in mixfix notation ambiguous.
- It does not verify that the parameters are used in a consistent manner for each symbol. It essentially allows users to define `a\MyRel b` and `a\MyRel{x} b` (and ones with even more parameters).
- It allows parameters for all relation symbols, even for those where it makes no sense in ordinary TeX markup, e.g. `a <{x} b`.
Diffstat (limited to 'source/Syntax/Abstract.hs')
| -rw-r--r-- | source/Syntax/Abstract.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/Syntax/Abstract.hs b/source/Syntax/Abstract.hs index 23da652..31a1029 100644 --- a/source/Syntax/Abstract.hs +++ b/source/Syntax/Abstract.hs @@ -92,8 +92,8 @@ makeTuple = foldr1 ExprPair data Chain - = ChainBase (NonEmpty Expr) Sign Relation (NonEmpty Expr) - | ChainCons (NonEmpty Expr) Sign Relation Chain + = ChainBase (NonEmpty Expr) Sign Relation [Expr] (NonEmpty Expr) -- left arguments, possibly empty list of parameters, right arguments + | ChainCons (NonEmpty Expr) Sign Relation [Expr] Chain deriving (Show, Eq, Ord) data Relation @@ -319,7 +319,7 @@ data DefnHead | DefnVerb (Maybe (NounPhrase Maybe)) VarSymbol (VerbOf VarSymbol) | DefnNoun VarSymbol (NounOf VarSymbol) | DefnSymbolicPredicate PrefixPredicate (NonEmpty VarSymbol) - | DefnRel VarSymbol RelationSymbol VarSymbol + | DefnRel VarSymbol RelationSymbol [VarSymbol] VarSymbol -- ^ E.g.: /@$x \subseteq y$ iff [...@/ deriving (Show, Eq, Ord) @@ -411,7 +411,7 @@ data Abbreviation = AbbreviationAdj VarSymbol (AdjOf VarSymbol) Stmt | AbbreviationVerb VarSymbol (VerbOf VarSymbol) Stmt | AbbreviationNoun VarSymbol (NounOf VarSymbol) Stmt - | AbbreviationRel VarSymbol RelationSymbol VarSymbol Stmt + | AbbreviationRel VarSymbol RelationSymbol [VarSymbol] VarSymbol Stmt | AbbreviationFun (FunOf VarSymbol) Term | AbbreviationEq SymbolPattern Expr deriving (Show, Eq, Ord) |
