fix: pycode environment produced an error

pull/511/head
Xein 2023-01-01 08:15:46 +07:00
parent 1ec3941b97
commit 541bd2df22
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
================================================================================