Skip to content

Conversation

lianghai
Copy link
Contributor

@lianghai lianghai commented Mar 8, 2025

They don’t really have self.glyphs. The erroneous self.glyph has been hiding in a branch of edge case (no prefix, no suffix, and no nested lookups).

It’s unclear if such an edge case should be serialized as a special case (without the ' mark), therefore I’m only proposing a minimal fix for now.

@khaledhosny
Copy link
Collaborator

Since this code is not covered by any tests, can you add some?

@lianghai
Copy link
Contributor Author

Uh, I don’t really understand the intended behavior of this part of code (this PR just fixed some apparent typos), and https://github.com/fonttools/fonttools/tree/main/Tests/feaLib seems rather complicated. I’ll leave the test case to you guys…

@khaledhosny
Copy link
Collaborator

I thought you hit this with some feature code, but it is alright if you don’t have a test. I’m also not sure about this special case.

@khaledhosny khaledhosny merged commit c3b23f7 into fonttools:main Apr 16, 2025
11 checks passed
@lianghai
Copy link
Contributor Author

Oh I hit this when I generated FEA code from the AST. I accidentally created a ChainContextSubstStatement instance with “no prefix, no suffix, and no nested lookups”. Parsing from a sub rule without the ' mark (as suggested in the .asFea() code I touched) probably won’t ever end up with a ChainContextSubstStatement…

@khaledhosny
Copy link
Collaborator

Oh I hit this when I generated FEA code from the AST. I accidentally created a ChainContextSubstStatement instance with “no prefix, no suffix, and no nested lookups”. Parsing from a sub rule without the ' mark (as suggested in the .asFea() code I touched) probably won’t ever end up with a ChainContextSubstStatement…

Yes, I guessed it would be something like this. Too niche for a test.

@lianghai lianghai deleted the feaLib branch July 3, 2025 14:46
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.

2 participants