Skip to content

Fixes several bugs found by parsing configure - #330

Open
thatch wants to merge 1 commit into
tree-sitter:masterfrom
thatch:configure-if-stmts
Open

Fixes several bugs found by parsing configure#330
thatch wants to merge 1 commit into
tree-sitter:masterfrom
thatch:configure-if-stmts

Conversation

@thatch

@thatch thatch commented Mar 22, 2026

Copy link
Copy Markdown

First, the problem I'm trying to solve: parse a generated autoconf "configure" script to analyze variable dependencies among the checks.

Prior to this change, many of the checks aren't whole (for example, treating if as a command, not as going up until a corresponding fi), and despite the length of this PR I believe this is the minimal changes necessary to parse the cpython 3.15 configure script. (note: not 100% sure this is enough yet, but it's enough that I have bigger issues in my own code rather than the syntactic parsing)

See new tests in test/corpus/statements.txt that cover these cases.

P.S. This actually comes a little full circle for me, I added the pygments bash lexer testing against a configure script almost 20 years ago.

See new tests in test/corpus/statements.txt that cover these cases.

The common theme was that the `if` block would be parsed as ending
earlier than it really does.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant