Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Fix empty fragment being created when an access modifier occurs by itself #306

Merged

Conversation

bamarsha
Copy link
Contributor

@bamarsha bamarsha commented Feb 4, 2020

Access modifiers were registered as a fragment header, but no parser existed that could parse them by themselves (they could only be parsed if they were followed by function, operation, or newtype). This means that if they aren't followed by one of those headers, none of the fragment parsers would succeed, so the default parser would try to create an invalid fragment by skipping over input until it finds the next fragment header. However, the next fragment header was the access modifier itself, so it wouldn't skip any input at all, creating an empty invalid fragment instead and causing this exception:

QsCompilerException: fragment has been built but no input was consumed

To fix this I added parsers for the access modifiers that can consume just an access modifier by itself before creating an invalid fragment, which makes sure that input is always consumed when a fragment is built.

See #259.

@bamarsha bamarsha merged commit 5d42a27 into features/access-modifiers Feb 5, 2020
@bamarsha bamarsha deleted the marshallsa/modifier-empty-fragment-fix branch February 5, 2020 02:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants