Skip to content

Commit eac4853

Browse files
authored
1. Правки чтения (#353)
2. Добавлено чтение тегов для ЕДТ
1 parent bc19060 commit eac4853

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/main/antlr/BSLDescriptionLexer.g4

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ CALL_OPTIONS_KEYWORD: 'CALL OPTIONS:' | 'ВАРИАНТЫ ВЫ
3434
DEPRECATE_KEYWORD: 'DEPRECATE' | 'DEPRECATE.' | 'УСТАРЕЛА' | 'УСТАРЕЛА.';
3535
SEE_KEYWORD: 'SEE' | 'СМ.';
3636
OF_KEYWORD: 'OF' | 'CONTAINS' | 'ИЗ';
37+
EDT_SKIP_KEYWORD: '@skip-check';
3738

3839
// COMMON
3940
EOL : '\r'? '\n';

src/main/antlr/BSLDescriptionParser.g4

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ methodDescription:
3535
| (deprecateBlock? descriptionBlock? parametersBlock? returnsValuesBlock? examplesBlock? callOptionsBlock?)
3636
| (descriptionBlock? parametersBlock? returnsValuesBlock? callOptionsBlock? examplesBlock? deprecateBlock?)
3737
| (descriptionBlock? parametersBlock? returnsValuesBlock? examplesBlock? callOptionsBlock? deprecateBlock?)
38-
) EOF;
38+
)
39+
skipBlock?
40+
EOF;
3941

4042
// deprecate
4143
deprecateBlock: startPart DEPRECATE_KEYWORD (deprecateDescription | EOL);
@@ -100,6 +102,10 @@ returnsValuesString:
100102
| (startPart typeDescription)
101103
;
102104

105+
// skipBlock
106+
skipBlock: startPart EDT_SKIP_KEYWORD (SPACE skipKey? (SPACE ~(EOL | EOF)*)?) EOL;
107+
skipKey: ~(EOL | EOF | SPACE)+;
108+
103109
returnsValue: type
104110
(
105111
(splitter typeDescription)
@@ -110,7 +116,8 @@ returnsValue: type
110116

111117
typeDescription:
112118
(
113-
(hyperlink | first=~(RETURNS_KEYWORD | EXAMPLE_KEYWORD | CALL_OPTIONS_KEYWORD | DEPRECATE_KEYWORD | EOL | EOF | SPACE))
119+
(hyperlink | first=~(RETURNS_KEYWORD | EXAMPLE_KEYWORD | CALL_OPTIONS_KEYWORD | DEPRECATE_KEYWORD
120+
| EDT_SKIP_KEYWORD | EOL | EOF | SPACE))
114121
(hyperlink | second=~(EOL | EOF))*
115122
EOL
116123
)
@@ -121,15 +128,15 @@ typesBlock: splitter type
121128
(
122129
(splitter typeDescription)
123130
| (splitter EOL)
124-
| EOL
131+
| (SPACE* EOL)
125132
)
126133
;
127134

128135
type: listTypes | collectionType | hyperlinkType | simpleType;
129136
simpleType: typeName=(WORD | DOTSWORD) colon=COLON?;
130137
collectionType: collection=(WORD | DOTSWORD) SPACE OF_KEYWORD SPACE value=type;
131138
hyperlinkType: hyperlink;
132-
listTypes: listType (COMMA SPACE? listType)+;
139+
listTypes: listType (COMMA SPACE? listType?)+;
133140
listType: simpleType | collectionType | hyperlinkType;
134141

135142
hyperlink: SEE_KEYWORD SPACE link=(WORD | DOTSWORD) (LPAREN linkParams=~EOL* RPAREN)?;

0 commit comments

Comments
 (0)