[GH-ISSUE #17] > ${var} breaks the parser. #6

Closed
opened 2026-02-28 01:20:28 +03:00 by kerem · 2 comments
Owner

Originally created by @tufanbarisyildirim on GitHub (May 1, 2023).
Original GitHub issue: https://github.com/tufanbarisyildirim/gonginx/issues/17

Originally assigned to: @tufanbarisyildirim on GitHub.

Looks like ${var} can break the parser.

         > Hi @pksml85 can I have your example config file to improve [gonginx](https://github.com/tufanbarisyildirim/gonginx)?

Hi @tufanbarisyildirim. Sorry for the delay... but here is the example. GoNginx destroys my location blocks.

Here is my original config code and here is the mangled code from GoNginx

Originally posted by @pksml85 in https://github.com/0xJacky/nginx-ui/issues/73#issuecomment-1528894406

Originally created by @tufanbarisyildirim on GitHub (May 1, 2023). Original GitHub issue: https://github.com/tufanbarisyildirim/gonginx/issues/17 Originally assigned to: @tufanbarisyildirim on GitHub. Looks like ${var} can break the parser. > Hi @pksml85 can I have your example config file to improve [gonginx](https://github.com/tufanbarisyildirim/gonginx)? Hi @tufanbarisyildirim. Sorry for the delay... but here is the example. GoNginx destroys my location blocks. Here is [my original config code](https://pastebin.com/aXW7e8tC) and here is the [mangled code from GoNginx](https://pastebin.com/tjFakDHE) _Originally posted by @pksml85 in https://github.com/0xJacky/nginx-ui/issues/73#issuecomment-1528894406_
kerem closed this issue 2026-02-28 01:20:28 +03:00
Author
Owner

@tufanbarisyildirim commented on GitHub (May 4, 2023):

I think a good plan could be something like;

  • Separate keywords & vars during the lexing instead of scanning all in 1 keyword
  • Define a Parameter (at same level with Directive) statement in parser and encapsulate all tokens that creates the parameter.
<!-- gh-comment-id:1535384286 --> @tufanbarisyildirim commented on GitHub (May 4, 2023): I think a good plan could be something like; - Separate keywords & vars during the lexing instead of scanning all in 1 keyword - Define a `Parameter` (at same level with Directive) statement in parser and encapsulate all tokens that creates the parameter.
Author
Owner

@tufanbarisyildirim commented on GitHub (May 8, 2023):

I think a good plan could be something like;

  • Separate keywords & vars during the lexing instead of scanning all in 1 keyword
  • Define a Parameter (at same level with Directive) statement in parser and encapsulate all tokens that creates the parameter.

instead, changed the way we read a keyword, now token.Variable is useless and we need another PR to clean it up.

<!-- gh-comment-id:1538219012 --> @tufanbarisyildirim commented on GitHub (May 8, 2023): > I think a good plan could be something like; > > * Separate keywords & vars during the lexing instead of scanning all in 1 keyword > * Define a `Parameter` (at same level with Directive) statement in parser and encapsulate all tokens that creates the parameter. instead, changed the way we read a keyword, now token.Variable is useless and we need another PR to clean it up.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/gonginx#6
No description provided.