odiszapc / nginx-java-parser

Nginx configuration parser based on ANTLR4 grammar
258 stars 85 forks source link

[BUGFIX,ISSUE-26] Dump with If blocks now are written correctly | Slight Dumping rework #27

Closed ThorbenKuck closed 3 years ago

ThorbenKuck commented 3 years ago

This bugfix fixes https://github.com/odiszapc/nginx-java-parser/issues/26, https://github.com/odiszapc/nginx-java-parser/issues/16

The issue came because of a missing break in the case condition. Also, after the if there was an "opening" bracket introduced, instead of a closing one. From the style of the code, there also might be another redesign in the pocket, that does not require a switch-case in the first place, thous eradicating any syntactic issue in the future.

Also, i bumped up the java version to 7, because 6 is no longer supported. One could think about bumping it up to 8, because there are some major things that come with it.

ThorbenKuck commented 3 years ago

@odiszapc @CodingFabian Is it possible to merge and deploy this change? It should be small and only be additive, thus not be hindering anything.

ThorbenKuck commented 3 years ago

I now also took the liberty to make the dumping process a little bit more error prone.

I switched to a more object oriented system, so that every NgxEntry can say how it self should be dumped. This way there is no more confusion and the case smell is eradicated. This also means that one could print the ast from any point on. Thoughts?

odiszapc commented 3 years ago

Hi, @ThorbenKuck Thanks for contribution! Merged to master

ThorbenKuck commented 3 years ago

Cool! Thanks!

Will the pipeline deploy the change automatically?

momoUpUp commented 1 year ago

I can't find version 0.9.7 in maven. Can you check it?