Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix printing of expressions including non-zero list levels #5453

Merged
merged 1 commit into from
May 31, 2023

Conversation

zickgraf
Copy link
Contributor

For example, ([ x ]{[ 1 ]})[1] was previously printed as [ x ]{[ 1 ]}[1], that is, the parentheses were missing.

This is a follow-up to #5116 which fixed this for nested sublist extractions only. This PR should now cover all possible cases.

See the description of the new helper function ExprHasNonZeroListLevel for details.

Text for release notes

see title

For example, `([ x ]{[ 1 ]})[1]` was previously printed as
`([ x ]{[ 1 ]})[1]`, that is, the parentheses were missing.
@zickgraf
Copy link
Contributor Author

The CI failure in teststandard - ABI=32 CONFIGFLAGS="" - ubuntu-latest is due to some problem with Ubuntu packages :/

@@ -314,4 +314,30 @@ function ( x ) return ([ [ x ] ]{[ 1 ]}){[ 1 ]}{[ 1 ]}; end
# four extractions
gap> funcloop(x -> ([ [ x ] ]{[ 1 ]}{[ 1 ]}){[ 1 ]}{[ 1 ]});
function ( x ) return ([ [ x ] ]{[ 1 ]}{[ 1 ]}){[ 1 ]}{[ 1 ]}; end

# list access at level 0 after EXPR_ELMS_LIST
gap> funcloop(x -> ([ x ]{[ 1 ]})[1]); # EXPR_ELM_LIST
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably also want to test the unbracketed case -- unless that is already somewhere else and I missed it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unbracketed case [ x ]{[ 1 ]}[1] is an expression of type EXPR_ELM_LIST_LEV and thus uses a code path which I have not touched at all. The "other" case is the default case L[i] which I expect to be sufficiently covered. That's why I have not added further tests. But of course I could add further tests if you prefer.

@fingolfin fingolfin closed this May 31, 2023
@fingolfin fingolfin reopened this May 31, 2023
@fingolfin fingolfin added kind: bug Issues describing general bugs, and PRs fixing them release notes: use title For PRs: the title of this PR is suitable for direct use in the release notes labels May 31, 2023
@fingolfin fingolfin enabled auto-merge (squash) May 31, 2023 20:16
@fingolfin fingolfin merged commit f049274 into gap-system:master May 31, 2023
@zickgraf zickgraf deleted the print_list_level_fix branch June 1, 2023 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Issues describing general bugs, and PRs fixing them release notes: use title For PRs: the title of this PR is suitable for direct use in the release notes topic: kernel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants