support C-style comments (line and block)#7
Open
dancomstock wants to merge 1 commit into
Open
Conversation
Owner
|
I have a separate "Text file preprocessor" that I use in my engine that handles /* */ and // style comments, along with macros, includes, and some other things. Unfortunately that system is a bit too dependent on other parts of my game engine solely due to handling #include, so I haven't yet included it here. I could upload the files for reference however. |
Owner
|
(this is just directly uploaded from my engine. it would need a little bit of cleanup to include in this repro, but I might later) |
Author
|
Thanks, I'll take a look. I've been wondering how the csv merges/appends work so this is great. |
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.
Resolves #5
I started work on a python implementation and noticed the "//" comments in the Mewgenics files so added support for it, figured I should backport it to the c++ code as well.
Changed inComment to inLineComment and added inBlockComment in order to differentiate.
Added a check for "/" and then check to see if the next character is another "/" or "*" to determine if it is starting a line or block comment and if so it also does an extra increment to skip the next character (or if not then just resume normal behavior)
the inLineComment end check is unchanged. inBlockComment checks for the ending "*/"
Tested with a basic GON file that looked like:
Let me know if there's some other cases that might be good to test for.