Merge pull request #67 from Xein234/bug-pycode

fix: pycode environment produced an error
pull/511/head
Patrick Förster 2023-01-01 15:46:23 +07:00 committed by GitHub
commit dfb9bbb72f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 1 deletions

2
src/scanner.c vendored

@ -92,7 +92,7 @@ bool tree_sitter_latex_external_scanner_scan(void *payload, TSLexer *lexer,
const bool *valid_symbols) {
bool found = false;
TSSymbol type = 0xFFFF;
for (int i = 0; i <= TRIVIA_RAW_ENV_MINTED; i++) {
for (int i = 0; i <= TRIVIA_RAW_ENV_PYCODE; i++) {
if (valid_symbols[i]) {
if (found) {
return false;

@ -214,6 +214,28 @@ Minted environment
(text
(word))))))
================================================================================
Pycode environment
================================================================================
\begin{pycode}
print()
\end{pycode}
--------------------------------------------------------------------------------
(source_file
(pycode_environment
(begin
(curly_group_text
(text
(word))))
(source_code)
(end
(curly_group_text
(text
(word))))))
================================================================================
Math environment
================================================================================