chore: Grammar tidy
This commit is contained in:
parent
6879cbf0e5
commit
694acfc1d3
3 changed files with 7 additions and 7 deletions
|
@ -180,11 +180,11 @@
|
|||
Root ::= CONTAINER_DOC_COMMENT? ContainerMembers?
|
||||
|
||||
// *** Top level ***
|
||||
ContainerMembers ::= ContainerDeclarations? (ContainerField COMMA)* (ContainerField | ContainerDeclarations)?
|
||||
ContainerMembers ::= ContainerDeclaration* (ContainerField COMMA)* (ContainerField | ContainerDeclaration*)
|
||||
|
||||
ContainerDeclarations ::= (TestDecl | ComptimeDecl | DOC_COMMENT? KEYWORD_PUB? Decl)+
|
||||
ContainerDeclaration ::= TestDecl | ComptimeDecl | DOC_COMMENT? KEYWORD_PUB? Decl
|
||||
|
||||
TestDecl ::= DOC_COMMENT? KEYWORD_TEST (STRING_LITERAL_SINGLE | IDENTIFIER)? Block {pin=2}
|
||||
TestDecl ::= KEYWORD_TEST (STRING_LITERAL_SINGLE | IDENTIFIER)? Block {pin=1}
|
||||
|
||||
ComptimeDecl ::= KEYWORD_COMPTIME Block
|
||||
|
||||
|
@ -205,6 +205,7 @@ ContainerField ::= DOC_COMMENT? KEYWORD_COMPTIME? !KEYWORD_FN (IDENTIFIER COLON)
|
|||
Statement
|
||||
::= KEYWORD_COMPTIME ComptimeStatement
|
||||
| KEYWORD_NOSUSPEND BlockExprStatement
|
||||
| KEYWORD_SUSPEND BlockExprStatement
|
||||
| KEYWORD_DEFER BlockExprStatement
|
||||
| KEYWORD_ERRDEFER Payload? BlockExprStatement
|
||||
| IfStatement
|
||||
|
|
|
@ -36,7 +36,7 @@ abstract class ZigTopLevelLineMarker: RunLineMarkerContributor() {
|
|||
|
||||
var nestingLevel = 0;
|
||||
while (parent != null && parent !is PsiFile) {
|
||||
if (parent.elementType == ZigTypes.CONTAINER_DECLARATIONS) {
|
||||
if (parent.elementType == ZigTypes.CONTAINER_DECLARATION) {
|
||||
if (nestingLevel != 0)
|
||||
return null
|
||||
nestingLevel++
|
||||
|
|
|
@ -59,10 +59,9 @@ class ZigStringElementManipulator: AbstractElementManipulator<ZigStringLiteral>(
|
|||
val stringLiteral = dummy
|
||||
.firstChild
|
||||
.let {it as ZigContainerMembers}
|
||||
.containerDeclarationsList
|
||||
.first()
|
||||
.declList
|
||||
.containerDeclarationList
|
||||
.first()
|
||||
.decl!!
|
||||
.globalVarDecl!!
|
||||
.expr
|
||||
.let { it as ZigPrimaryTypeExpr }
|
||||
|
|
Loading…
Add table
Reference in a new issue