-
Notifications
You must be signed in to change notification settings - Fork 590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[LaTeX] Inherit LaTeX from TeX #3546
[LaTeX] Inherit LaTeX from TeX #3546
Conversation
This looks good. I would've included the jump to v2 for both so extending syntaxes don't have to adjust twice. |
This commit extends LaTeX's `begin-end-commands` context to support Haskell's `\begin{code} ... \end{code}` blocks. Formerly used `plain-tex` does no longer exist.
v2 syntax requires multiple meta scope adjustments and we probably would want to replace all That's basically unrelated with just inheriting LaTeX from TeX and would cause trouble (avoidable conflicts) with @ngc92's other PRs. This WIP PR is more or less meant as inspiration for him to learn how inheritance works and how it hopefully could help avoiding code duplications when reworking/improving LaTeX. |
I took a quick look at this. Do we need to have |
Maybe. This PR is just a starting point. Further work may be needed or useful. |
The same context with identical content is already defined in TeX.
Apply an top-down principle to have most basic contexts at the end of a document and the organizational ones at the beginning - just like a tree. Readability may be improved by grouping contexts visually via delimiter comments. See also: Java, PHP, ...
added a brace-pop utility context
With regards to deathaxe#1 (comment) I've added overrides for braced groups for illustration purpose. Please note, how we now will see various So basically using the base syntax's final scope |
Illustrate how `braces` are implemented in both TeX & LaTeX with same content but different sub-scopes. Re-implementing a context without meta_prepend/meta_append overrides it completely.
c45df2d
to
4f2b78f
Compare
then I think going with In any case, what's the plan going forward with this PR. For further changes, it would probably be good to get the inheritance set up soon, so that other improvements can build on it. |
Re-arrange contexts to implement the top-down principle.
Group macro related contexts in a MACROS section
Added a couple more commits to give some inspiration of possible code structure for supporting inheritance the best we can - just some experiences from other syntaxes. In general I think of creating a Once a final state is achieved we could merge everything into master at once. Thoughts? |
Some final sub scopes changed from .latex to tex due to inheritance. Hence make Markdown syntax tests a bit more lazy.
sounds good to me. I mainly want to avoid the situation where the changes I'm doing now need to be re-done for the inheritance later on |
Sure. This PR should just have been an inspiration for you mainly. I'll try to git this content into a develop branch which you can base on furhter work. |
Closing this in favor of the general development branch/PR #3575. |
This PR is an attempt to avoid (future) code duplication when improving TeX/LaTeX.
It extends LaTeX using TeX as base syntax.
I am uncertain whether test coverage is high enough to dedect possible regressions. Hence someone with good LaTeX experience should have a look at it.