Add Windows and macOS to CI build matrix and fix cross-platform issues - #445
Open
addwes7 wants to merge 2 commits into
Open
Add Windows and macOS to CI build matrix and fix cross-platform issues#445addwes7 wants to merge 2 commits into
addwes7 wants to merge 2 commits into
Conversation
DQinYuan
requested changes
Jun 21, 2026
| public static QLParser.ProgramContext buildTree(String script, ParserOperatorManager operatorManager, | ||
| boolean printTree, Consumer<String> printer, InterpolationMode interpolationMode, String selectorStart, | ||
| String selectorEnd, boolean strictNewLines) { | ||
| script = script.replace("\r\n", "\n").replace("\r", "\n"); |
Collaborator
There was a problem hiding this comment.
这个处理略粗暴,建议在Lexer或者Parser中做修改
Author
There was a problem hiding this comment.
Moved the CRLF normalization into QLexer so string literal token text is normalized during lexing
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.
What is the purpose of this PR
The CI workflow currently runs only on
ubuntu-latest. This PR extends the build matrix to includewindows-latestandmacos-latest, and fixes a platform-specific issue that was uncovered when running the test suite on Windows.Expected Result
The project builds and tests successfully on Ubuntu, Windows, and macOS with consistent behavior across platforms.
Windows-specific issue
Multi-line string literals fail on Windows
Expected:
assert("hello\nworld" == "hello\nworld")passes on all platforms.Actual:
The assertion fails on Windows.
Why:
Windows uses
\r\n(CRLF) line endings, while Unix-based systems use\n(LF). Scripts read from disk therefore contain different newline sequences depending on the platform, causing multi-line string literals to produce different values.Fix:
Normalize all line endings to
\nbefore lexing and parsing.Changes
.github/workflows/unittest.ymlwindows-latestandmacos-latestto the CI matrixSyntaxTreeFactory.javaCRLF/CR→LF) before lexingDescription of Fix
Scripts are now normalized to use Unix-style line endings (
\n) before tokenization and parsing. This removes platform-dependent differences in multi-line string literals and ensures scripts behave consistently on Windows, macOS, and Linux.