summaryrefslogtreecommitdiff
path: root/source/Syntax
diff options
context:
space:
mode:
Diffstat (limited to 'source/Syntax')
-rw-r--r--source/Syntax/Concrete/Keywords.hs4
-rw-r--r--source/Syntax/Token.hs6
2 files changed, 5 insertions, 5 deletions
diff --git a/source/Syntax/Concrete/Keywords.hs b/source/Syntax/Concrete/Keywords.hs
index e0f577e..135cdac 100644
--- a/source/Syntax/Concrete/Keywords.hs
+++ b/source/Syntax/Concrete/Keywords.hs
@@ -203,7 +203,7 @@ _haveIntro = _thus <|> _particularly <|> _have
_colon :: Prod r Text (Located Token) SourcePos
_colon = symbol ":" ? ":"
_pipe :: Prod r Text (Located Token) SourcePos
-_pipe = symbol "|" <|> command "mid" ? "\\mid"
+_pipe = (optional (command "middle") *> symbol "|") <|> command "mid" ? "\\mid"
_comma :: Prod r Text (Located Token) SourcePos
_comma = symbol "," ? ","
_commaAnd :: Prod r Text (Located Token) SourcePos
@@ -219,4 +219,4 @@ _eq = symbol "=" ? "="
_in :: Prod r Text (Located Token) SourcePos
_in = symbol "∈" <|> command "in" ? "\\in"
_subseteq :: Prod r Text (Located Token) SourcePos
-_subseteq = command "subseteq" ? ":"
+_subseteq = command "subseteq" ? "\\subseteq"
diff --git a/source/Syntax/Token.hs b/source/Syntax/Token.hs
index eb0950f..65c02ca 100644
--- a/source/Syntax/Token.hs
+++ b/source/Syntax/Token.hs
@@ -228,7 +228,7 @@ mathToken =
beginText :: Lexer (Located Token)
beginText = lexeme do
- Char.string "\\text{"
+ Char.string "\\text{" <|> Char.string "\\textbox{"
setTextMode
pure (BeginEnv "text")
@@ -249,14 +249,14 @@ textToken = word <|> symbol <|> begin <|> end <|> textEnd <|> mathBegin <|> alig
setMathMode
pure (EndEnv "text")
- opening' = lexeme (brace <|> group <|> paren <|> bracket)
+ opening' = lexeme (group <|> optional (Char.string "\\left") *> (brace <|> paren <|> bracket))
where
brace = VisibleBraceL <$ lexeme (Char.string "\\{")
group = InvisibleBraceL <$ lexeme (Char.char '{') <* modify' incrNesting
paren = ParenL <$ lexeme (Char.char '(')
bracket = BracketL <$ lexeme (Char.char '[')
- closing' = lexeme (brace <|> group <|> paren <|> bracket)
+ closing' = lexeme (group <|> optional (Char.string "\\right") *> (brace <|> paren <|> bracket))
where
brace = VisibleBraceR <$ lexeme (Char.string "\\}")
group = InvisibleBraceR <$ lexeme (Char.char '}') <* modify' decrNesting