luozongle01 commented on code in PR #2206: URL: https://github.com/apache/zookeeper/pull/2206#discussion_r1862093585
########## zookeeper-jute/src/main/java/org/apache/jute/compiler/generated/rcc.jj: ########## @@ -274,22 +257,38 @@ JRecord Record() : ArrayList<JField> flist = new ArrayList<JField>(); Token t; JField f; + // Get the comments on the class token + Token recordTkn; + Token rbraceTkn; + Token typeTkn; } { - <RECORD_TKN> + recordTkn = <RECORD_TKN> t = <IDENT_TKN> { rname = t.image; } <LBRACE_TKN> ( + {typeTkn = getToken(1);} f = Field() - { flist.add(f); } + { + flist.add(f); + } <SEMICOLON_TKN> + { + f.setTypeToken(typeTkn); + prevFieldSetNextTkn(typeTkn); + prevField = f; Review Comment: > How about replace `nextToken` with `semicolonToken` ? I think it is suitable: > > 1. Semicolon is the end of field declaration. > 2. `semicolonToken.next` is the next token. We can extract possible end of line comments from there. > > This way we don't need `prevField` anymore. Ah, I see. Sorry I didn't think of writing this before.🤣🤣 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@zookeeper.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org