Conversation
Co-authored-by: nixel2007 <1132840+nixel2007@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the BSL preprocessor #Использовать directive handling so that unquoted library identifiers may include / (e.g., oint/api/grpc), aligning the lexer behavior with valid BSL syntax and adding regression tests.
Changes:
- Expanded the lexer
USE_LETTERfragment inBSLLexer.g4to include/inUSE_MODE. - Added lexer test coverage to ensure
Использовать oint/api/grpctokenizes asPREPROC_IDENTIFIER. - Added parser match coverage to ensure
#Использовать oint/api/grpcis accepted by theuserule.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/main/antlr/BSLLexer.g4 |
Allows / in unquoted #Использовать identifiers via USE_MODE rules. |
src/test/java/com/github/_1c_syntax/bsl/parser/BSLLexerTest.java |
Adds a lexer regression test for slash-separated identifiers in Использовать. |
src/test/java/com/github/_1c_syntax/bsl/parser/BSLParserMatchesTest.java |
Adds a parser match test for #Использовать with slash-separated identifiers. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Restructure USE_MODE to use USE_SEGMENT pattern so that slashes are only allowed as separators between segments, not consecutively. This prevents #Использовать lib//comment from tokenizing the comment as part of the identifier. Co-authored-by: nixel2007 <1132840+nixel2007@users.noreply.github.com>
Co-authored-by: nixel2007 <1132840+nixel2007@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|



#Использовать oint/api/grpcis valid BSL syntax but the lexer rejected it becauseUSE_LETTERonly allowed letters and hyphens.USE_SEGMENTfragment inBSLLexer.g4and restructuredUSE_IDENTIFIERto use a segment-based pattern (USE_SEGMENT ('/' USE_SEGMENT)*), allowing/only as a separator between non-empty segments. This prevents the lexer from greedily consuming//line comments (e.g.,#Использовать lib//commentcorrectly tokenizeslibas the identifier).//comment handling.Original prompt
📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.