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
Close major grammar gaps surfaced by real-world sample run
Data-driven session against ~100 .bsl/.os files pulled from
1c-syntax/bsl-language-server and 1c-syntax/vsc-language-1c-bsl test
fixtures. Before: roughly 60% clean parses, after: 85% clean / 0 hard
failures. Concrete fixes:
* UTF-8 BOM (U+FEFF) at the start of a file is now treated as whitespace.
Real 1C:Enterprise configuration files are *always* saved with a leading
BOM by the designer; without this fix every config module landed an
error token at offset 0.
* Local Перем declarations inside a procedure/function body. Added
VarStatement to the body production alongside BodyStatement and
Preprocessor — mirrors ANTLR's subVar.
* Bare label as a standalone body item (~Метка: with no following
statement). Added Label as its own BodyStatement variant, marked with
~labelOpt so Lezer's GLR engine still prefers the Label+statement form
when one follows.
* #Удаление / #КонецУдаления / #Вставка / #КонецВставки preprocessor
directives (configuration-extension markers). Added four new
preproc-only specialized terms and corresponding parser productions;
styleTags routes them as macroName.
* Optional trailing ';' after flat statements (Возврат, Прервать,
assignment, call). Was Limitation #1 in the README — now closed. The
new 'stmtSemi' precedence biases the parser to shift ';' into the
current statement rather than reduce it as a bare-; sibling.
* BSL keywords used as method/property names after (e.g.
Запрос.Выполнить()). Was a major silent gap: 'Выполнить' globally
specialized to the Execute keyword, breaking PropertyAccess/CallAccess
which expected Identifier. New dotIdentifier rule lifts every BSL
keyword as a valid identifier in dot-position; styleTags re-routes
PropertyAccess/dotKeyword and CallAccess/dotKeyword to propertyName so
the colour stays sensible.
Test fixtures updated to reflect the new shape (block statements now
consume their trailing ; greedily). Added two new fixture cases: local
Перем and #Удаление/#Вставка.
README Limitations section rewritten to enumerate only the three real
remaining gaps and pin the 85%-clean number against real-world samples.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
0 commit comments