Skip to content

Commit

Permalink
Improve auto-complete for this case #186 : adjust grammar
Browse files Browse the repository at this point in the history
  • Loading branch information
xonixx committed Apr 28, 2024
1 parent 5bf3104 commit 147fec9
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/main/java/intellij_awk/Awk.bnf
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ lvalue ::= gawk_var_name | DOLLAR expr

// XXX this covers a[1][2][3] like in Gawk
// XXX awk only supports a[1]
private gawk_var_name ::= var_name (LBRACKET expr_lst RBRACKET)*
//private gawk_var_name ::= var_name (LBRACKET expr_lst RBRACKET)*

// XXX for some reason the below makes it terribly slow or hanging on profile5.awk
/*private gawk_var_name ::= var_name (subscript_start RBRACKET)*
Expand All @@ -512,6 +512,15 @@ private subscript_start ::= LBRACKET expr_lst {
}
private recover_on_rbracket ::= !RBRACKET*/

private gawk_var_name ::= var_name (subscript_start RBRACKET)*
private subscript_start ::= LBRACKET expr_lst_inner {
pin=1
}
private expr_lst_inner ::= expr_lst {
// recoverWhile=recover_on_rbracket
}
//private recover_on_rbracket ::= !RBRACKET

private var_name ::= builtin_var_name | user_var_name

builtin_var_name ::= SPECIAL_VAR_NAME | SPECIAL_VAR_NAME_GAWK
Expand Down

0 comments on commit 147fec9

Please sign in to comment.