Fix Emitte.emitHeader() and add testcase for fragile file names#399
Merged
regisd merged 13 commits intojflex-de:masterfrom Oct 7, 2018
Merged
Fix Emitte.emitHeader() and add testcase for fragile file names#399regisd merged 13 commits intojflex-de:masterfrom
regisd merged 13 commits intojflex-de:masterfrom
Conversation
Nothing is taken after description ?
There is no way to remove the default test.java file otherwise. (btw, compiling a file which doesn't exist... passes in the jflex-maven-plugin, but not on a real javac)
This is the behaviour of javac.
This is the behaviour of javac.
… wrong file. By default, the test tries to compile <Testname>.java, but - either the lexer is name Yylex.java - or the camel case rule is incorrect, e.g. No-unused.java - or the lexer has a completely different name defined by `%xlass` in the flex
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.
slashifymethod.The initial case to protect against was on Windows for a file called
src\main\resources\u0022.txt(or similar).Then the generated code comment would be
\by/. Hence both Windows and Unix would produce:\in their name – even though that's a bit asking for trouble.\src/test/cases/filename/filename\u000AFILE_NAMES_MUST_BE_ESCAPED\u000A.flexthat causes (because\u000Ais\n):execJavac()fail if the input file is missing, to mimic the real behaviour ofjavactoCompile = className + ".java"but the generated lexer doesn't have the name of the test (for instance, it hasYylex.java). This is fixed withexecJavac()failing and tests listing their generated files. See commit fb9eb77javac-extra-filesbyjavac-files(with the corresponding semantic change) otherwise there is no way to remove the<testname>.javafrom the input files (even when the flex spec gives a different name)