Skip to content

Commit

Permalink
Autocomplete when if is not closed #133 : grammar_improve : add som…
Browse files Browse the repository at this point in the history
…e pins
  • Loading branch information
xonixx committed Apr 30, 2023
1 parent e9972af commit 2c602bb
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/main/java/intellij_awk/Awk.bnf
Expand Up @@ -213,7 +213,8 @@ end_block ::= END
action ::= LBRACE newlines_opt (
RBRACE
| (statement terminator*)* RBRACE
) // TODO pin 1
)
{ pin=1 }

statement ::= action
| statement_if
Expand All @@ -229,18 +230,19 @@ statement ::= action
| simple_statement
| gawk_terminated_statement_switch

private statement_if ::=
IF LPAREN expr RPAREN newlines_opt (
statement terminator* [ ELSE newlines_opt statement ]
)
private statement_if ::= IF LPAREN expr RPAREN newlines_opt
statement terminator* [ ELSE newlines_opt statement ]
{ pin=2 }

private statement_while ::= WHILE LPAREN expr RPAREN newlines_opt statement
{ pin=2 }

private statement_for ::=
FOR LPAREN (
simple_statement_opt SEMICOLON newlines_opt expr_opt SEMICOLON newlines_opt simple_statement_opt RPAREN newlines_opt
| var_name IN gawk_var_name RPAREN newlines_opt
) statement
{ pin=2 }

private terminator ::= (NEWLINE|SEMICOLON) newlines_opt

Expand Down

0 comments on commit 2c602bb

Please sign in to comment.