slatex / sTeX

A semantic Extension of TeX/LaTeX
49 stars 9 forks source link

weird error with loading BNF.en.tex #375

Open kohlhase opened 1 year ago

kohlhase commented 1 year ago

When I format MiKoMH/AI/source/course/notes/notes-part1.tex, then I get the errors:

(/Users/kohlhase/localmh/MathHub/smglom/grammar/source/mod/BNF.en.tex

Debug sref: New label http://mathhub.info/smglom/grammar/mod/BNF?REF433at
Definition

)) (/Users/kohlhase/localmh/MathHub/MiKoMH/AI/source/prereq/slides/aibnf.en.tex/Users/kohlhase/localmh/MathHub/MiKoMH/AI/source/prereq/slides/aibnf.en.tex:33:
 Undefined control sequence.
l.33 ...ymname[post=s]{term}}      & t  & \BNFrule
                                                  ! & X  & \text{\symname{va...

/Users/kohlhase/localmh/MathHub/MiKoMH/AI/source/prereq/slides/aibnf.en.tex:34: Undefined control sequence.
l.34                        && \BNFalt
                                      ! & f^0 & \text{\symname{constant}}\\
/Users/kohlhase/localmh/MathHub/MiKoMH/AI/source/prereq/slides/aibnf.en.tex:35: Undefined control sequence.
l.35                        && \BNFalt
                                      ! & \apply{f^k}\tseq & \text{\symname{...

/Users/kohlhase/localmh/MathHub/MiKoMH/AI/source/prereq/slides/aibnf.en.tex:36: Undefined control sequence.
l.36 ...mname[post=e]{formula}} & \Avar & \BNFrule
                                                  ! & \apply{p^k}\tseq & \te...

/Users/kohlhase/localmh/MathHub/MiKoMH/AI/source/prereq/slides/aibnf.en.tex:37: Undefined control sequence.
l.37                        &&\BNFalt
                                     !& \lneg{\Avar} & \text{\symname{negati...

/Users/kohlhase/localmh/MathHub/MiKoMH/AI/source/prereq/slides/aibnf.en.tex:38: Undefined control sequence.
l.38                        && \BNFalt
                                      ! & \ldisj{\Aseq1,\Aseq2} & \text{\sym...

/Users/kohlhase/localmh/MathHub/MiKoMH/AI/source/prereq/slides/aibnf.en.tex:39: Undefined control sequence.
l.39                        && \BNFalt
                                      ! & \allcdot{X}\Avar & \text{\symname{...

[47])

they are in MiKoMH/AI/source/prereq/slides/aibnf.en.tex which works fine when formatted separately. And I have no idea why this is not loaded. The only thing that I can see is that BNF.en.tex is loaded three times: the usual two times for the dependencies and one more time directly before the errors are thrown.

Interestingly no other module give me these problems, ...

Jazzpirate commented 1 year ago

This error is being cause by an \inputref[smglom/grammar]{mod/BNF.en} at a position where ?BNF is already in context. As a result, in the \inputref the module BNF is instantiated anew, but none of the symbol declarations do anything since the symbols already exist, resulting in (at \end{smodule}) a new, but empty ?BNF overwriting the old one.

This should be fixed by making sure that declarations that already exist properly overwrite the existing ones.