Open
Conversation
Fix EOF lexing for unterminated directives
Make build() accept parse payload input
Shorter name that doesn't imply nginx is bundled. Import name and CLI remain `crossplane` for backward compatibility.
- Fix fname variable scope leak in parser.py where the loop variable in include handling shadowed the outer fname, causing directives after includes to have incorrect file attributes when combine=True - Add support for map, types, geo, and charset_map blocks in strict mode by recognizing them as freeform contexts where arbitrary directive names are allowed (MIME types, mapping keys, etc.) - Add comprehensive tests for both fixes
When parsing nginx config like 'map ${var1}${var2} $result',
the lexer was incorrectly returning a single token '${var1}${var2} $result'
instead of two tokens '${var1}${var2}' and '$result'.
The issue was in the braced variable handler: after consuming the closing },
it didn't check if the next character was whitespace that should end the token.
The fix adds a check after the brace loop to yield the token and continue
if whitespace follows.
Bump version to 0.5.16.
Bug fixes: - Fix Lua block string escape handling to properly preserve backslash escapes like \" inside quoted strings - Use context manager for file access check in parser.py Typo corrections: - lua.py: "unxpected" -> "unexpected" - parser.py: "representaions" -> "representations" - parser.py: "contianing" -> "containing" - parser.py: "parsin'" -> "parsing" New tests: - test_cli.py: Tests for CLI argument parsing and all subcommands - test_errors.py: Tests for exception classes and hierarchy - test_abstract.py: Tests for extension base class - Expanded test_analyze.py with directive validation tests Test fixtures: - Added cli-test config directory for CLI testing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
Currently you have to create a temporary file just so you can call
crossplane.parseon it, which seems needlessly awkward.Gixy analyzer tool would particularly benefit from this, as it reads config files first (from stdin often), then has to create temp files because
crossplanedoes not yet support a string API.Checklist