Skip to content

Commit

Permalink
fix in sTeX linter wrt \endgroup
Browse files Browse the repository at this point in the history
  • Loading branch information
Jazzpirate committed Oct 11, 2023
1 parent 57520b8 commit f8b0e7a
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/mmt-stex/src/info/kwarc/mmt/stex/parsing/Rules.scala
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ object Begin extends MacroRule {
env.header = nstate.children.reverse
val next = try {
parser.readTop {
parser.In.startsWith("\\end")
parser.In.startsWith("\\end{")
}
} catch {
case le: LaTeXParseError if !rl.isInstanceOf[UnknownEnvironmentRule] =>
Expand Down Expand Up @@ -435,6 +435,22 @@ object TeXRules {
new MacroApplication
}
}
val begingroup = new MacroRule {
override def name = "begingroup"

override def apply(implicit parser: ParseState[PlainMacro]): MacroApplication = {
parser.latex.opengroup
new MacroApplication
}
}
val endgroup = new MacroRule {
override def name = "endgroup"

override def apply(implicit parser: ParseState[PlainMacro]): MacroApplication = {
parser.latex.closegroup
new MacroApplication
}
}
val explsyntaxon = new MacroRule {
override def name: String = "ExplSyntaxOn"

Expand All @@ -456,6 +472,7 @@ object TeXRules {
VerbatimEnvRule("verbatim"),VerbatimEnvRule("lstlisting"),VerbatimEnvRule("stexcode"),
InlineVerbRule("lstinline"),InlineVerbRule("verb"),InlineVerbRule("stexcodeinline"),
lstdefinelanguage,url,makeatletter,makeatother,explsyntaxon,explsyntaxoff,
begingroup,endgroup,
SkipCommand("newcommand","voov"),
SkipCommand("providecommand", "voov"),
SkipCommand("renewcommand", "voov"),
Expand Down

0 comments on commit f8b0e7a

Please sign in to comment.