You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a quasi-standard for dialect tags agreed among several compiler maintainers. Any newly developed syntax highlighting should aim to support this.
For example, the pygments syntax rendering framework for Python, Gaius Mulley's Emacs highlighting for Modula-2 and Benjamin Kowarsch's highlighting for vim support the tags.
A dialect tag is a special comment that indicates in which dialect the code has been written.
At the very least the dialect mnemonics for PIM, ISO and R10 should be supported.
A dialect tag is placed ideally before or directly after the module header in a Modula-2 source file. The highlighting script should scan for the first occurrence of such a tag within the first 100-200 lines of source (accounting for a copyright header that may occur at the top).
If a tag is found, the highlighting script should render the source code according to the dialect indicated by the dialect tag. Otherwise it may use a default setting. A more sophisticated script could search for a keyword that is unique in only one dialect, but this is not really necessary since people who want their source files to be rendered properly will soon learn to add dialect tags to all their sources.
For more details, see the Modula-2 documentation for pygments at:
This extension does highlighting by regular expressions, as most vscode syntax highlighting does. This would need to be changed to a programmed syntax highlighter for this to work.
Is this tag normally inside a comment? Those links don't work.
There is a quasi-standard for dialect tags agreed among several compiler maintainers. Any newly developed syntax highlighting should aim to support this.
For example, the pygments syntax rendering framework for Python, Gaius Mulley's Emacs highlighting for Modula-2 and Benjamin Kowarsch's highlighting for vim support the tags.
A dialect tag is a special comment that indicates in which dialect the code has been written.
A dialect mnemonic indicates the dialect
An optional compiler mnemonic indicates language extensions of a specific compiler.
No whitespace is permitted.
At the very least the dialect mnemonics for PIM, ISO and R10 should be supported.
A dialect tag is placed ideally before or directly after the module header in a Modula-2 source file. The highlighting script should scan for the first occurrence of such a tag within the first 100-200 lines of source (accounting for a copyright header that may occur at the top).
If a tag is found, the highlighting script should render the source code according to the dialect indicated by the dialect tag. Otherwise it may use a default setting. A more sophisticated script could search for a keyword that is unique in only one dialect, but this is not really necessary since people who want their source files to be rendered properly will soon learn to add dialect tags to all their sources.
For more details, see the Modula-2 documentation for pygments at:
https://www.pydoc.io/pypi/Pygments-2.1.3/autoapi/modula2/index.html
and the Modula-2 support package for Vim at:
https://bitbucket.org/trijezdci/m2syntaxcolour/src/default/Vim/
The text was updated successfully, but these errors were encountered: