File: maithili_dsl/transpiler/linter.py:48-51
Parenthesis/quote balance is counted over the raw line, including characters inside string literals:
Input: छपाउ("(क")
Linter: पंक्ति 1: गोल ब्रैकेट असंतुलित अछि # false positive (verified)
Related gap in the same block: only " quotes are counted — a line using '...' strings is never checked, and an apostrophe inside a double-quoted string would confuse a naive fix.
Fix: strip string-literal contents from the line before counting — the transpiler already has exactly the right tool (_tokenize_preserving_strings in transpile.py); import it and count only the code tokens. That fixes both the false positive and lets you count ' properly.
Tests: parens/quotes inside strings (no error), genuinely unbalanced lines (still error), single-quoted strings.
Good first issue: the tokenizer already exists — this is wiring + tests.
File:
maithili_dsl/transpiler/linter.py:48-51Parenthesis/quote balance is counted over the raw line, including characters inside string literals:
Related gap in the same block: only
"quotes are counted — a line using'...'strings is never checked, and an apostrophe inside a double-quoted string would confuse a naive fix.Fix: strip string-literal contents from the line before counting — the transpiler already has exactly the right tool (
_tokenize_preserving_stringsintranspile.py); import it and count only the code tokens. That fixes both the false positive and lets you count'properly.Tests: parens/quotes inside strings (no error), genuinely unbalanced lines (still error), single-quoted strings.
Good first issue: the tokenizer already exists — this is wiring + tests.