-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Bug:
code like:
String s = "\n";
String s= "\"";
println("X" +
"X");
Give compilation errors due to the fact the quotation character is replaced with multiple escaped characters ("\"")
LS4P/server/src/grammer/terms/preprocessingsnippets.ts
Lines 113 to 122 in 1998f6e
| export function mapperPipeline(newUnProcessedText: String): string{ | |
| let localUnProcessedText = newUnProcessedText.replace(/([0-9]+\.[0-9]+)/g,'$1f') | |
| conversionTuples.forEach(function(tuple){ | |
| localUnProcessedText = localUnProcessedText.replace(tuple[0],tuple[1]) | |
| }) | |
| localUnProcessedText = localUnProcessedText.replace(preprocessing.singleLineComment,``) | |
| // localUnProcessedText = localUnProcessedText.replace(/[\']{1}/g,"\\\'") | |
| localUnProcessedText = localUnProcessedText.replace(/[\"]{1}/g,"\\\"") | |
| return localUnProcessedText | |
| } |
Possible Solution
I think the problem lies at the method to create the java file:
Lines 39 to 44 in 1998f6e
| try{ | |
| childProcess.execSync(`echo \"${processedText}\" > ${__dirname}/compile/${pStandards.defaultClassName}.java`) | |
| log.writeLog(`Java File creation successful`) | |
| } catch(e) { | |
| log.writeLog(`[[ERR]] - Error in Java File Creation`) | |
| } |
fs.writeFileSync() is used there is no need for escaping quotation characters to write the java file. All characters should be written to the file "as is".Metadata
Metadata
Assignees
Labels
No labels