Skip to content

Commit

Permalink
Add the precedence number in comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mingodad committed Sep 5, 2024
1 parent 05db3ed commit af79a80
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion json2ebnf-lua.js
Original file line number Diff line number Diff line change
Expand Up @@ -470,9 +470,10 @@ function parseJsonGrammar(fname, rule_sep, choice_sep, rule_terminator, isEbnfRR

if( json.precedences && json.precedences.length ) {
fd.printf("\nprecedences ::= {");
let high_prec = json.precedences.length;
for(var idx in json.precedences) {
let elm = json.precedences[idx];
fd.printf("\n\t{");
fd.printf("\n\t/*%0.2d*/{", high_prec--);
for(var idx2 in elm) {
let elm2 = elm[idx2];
switch(elm2.type) {
Expand Down

0 comments on commit af79a80

Please sign in to comment.