Extended syntax support (flags etc.); improved handling of #if 0 (chaining)#94
Draft
dsalt wants to merge 10 commits intojoe-editor:mainfrom
Draft
Extended syntax support (flags etc.); improved handling of #if 0 (chaining)#94dsalt wants to merge 10 commits intojoe-editor:mainfrom
#if 0 (chaining)#94dsalt wants to merge 10 commits intojoe-editor:mainfrom
Conversation
This uses a few bits in the syntax state flags word.
Contributor
Author
|
This currently includes commits queued in #93. Let's see if they disappear automatically… |
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.
This adds a set of commands for setting and testing flags and an extra match type intended for use with testing flag bits to the syntax colouring language. The flags word is, by default, saved and restored across subroutine calls.
The C colouring code is modified to make some simple use of this, tracking whether
#if 0or#if 1have been seen in the current#ifchain and making decisions about colouring based on that.--
The main reason for its existence is that I couldn't see an easy way to handle the marking of definitely-
#if'd-out blocks without storing state somewhere. (I think that it's possible without this, but there'd be far too much duplication with all the maintenance headache which that brings.)I wasn't sure how much I'd need (and I have no idea of how much will end up being used), so what got implemented is what seemed reasonable to provide enough flexibility to cover likely uses.