Skip to content

Commit 367a21c

Browse files
committed
LT22418: take flle not found; try using \r\n
Change-Id: Ibf2f647c5306b37c77f826a47ec78e1c73065501
1 parent 432e3ac commit 367a21c

2 files changed

Lines changed: 18 additions & 15 deletions

File tree

Src/Utilities/pcpatrflex/DisambiguateInFLExDB/DisambiguateInFLExDBTests/PcPatrInvokerTests.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ public void PcPatrInvokerTest()
3232
{
3333
// Check for the existence of the PcPatr executable
3434
Assert.IsTrue(File.Exists(Path.Combine(FwDirectoryFinder.ExeOrDllDirectory, "pcpatr64.exe")));
35+
// Check for the existence of the PcPatr batch and take files
36+
Assert.IsTrue(File.Exists(Path.Combine(Path.GetTempPath(), "PcPatrFLEx.bat")));
37+
Assert.IsTrue(File.Exists(Path.Combine(Path.GetTempPath(), "PcPatrFLEx.tak")));
3538
string grammarFile = "Invoker.grm";
3639
File.Copy(Path.Combine(TestDataDir, grammarFile), Path.Combine(Path.GetTempPath(), grammarFile), true);
3740
string anaFile = Path.Combine(TestDataDir, "Invoker.ana");

Src/Utilities/pcpatrflex/DisambiguateInFLExDB/PCPatrInvoker.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ private void CreateBatchFile()
5050
{
5151
BatchFile = Path.Combine(Path.GetTempPath(), "PcPatrFLEx.bat");
5252
StringBuilder sbBatchFile = new StringBuilder();
53-
sbBatchFile.Append("@echo off\n");
53+
sbBatchFile.Append("@echo off\r\n");
5454
sbBatchFile.Append("cd \"");
5555
sbBatchFile.Append(Path.GetTempPath());
56-
sbBatchFile.Append("\"\n\"");
56+
sbBatchFile.Append("\"\r\n\"");
5757
sbBatchFile.Append(GetPcPatr64ExePath());
5858
sbBatchFile.Append("\\pcpatr64\" -t ");
5959
sbBatchFile.Append(takeFileName);
60-
sbBatchFile.Append("\n");
60+
sbBatchFile.Append("\r\n");
6161
File.WriteAllText(BatchFile, sbBatchFile.ToString());
6262
Console.WriteLine("\nbatch file =");
6363
Console.WriteLine("=================================================");
@@ -119,13 +119,13 @@ private void CreateTakeFile()
119119
//StringBuilder sbTakeFileShortPath = new StringBuilder(255);
120120
//int i = GetShortPathName(takeFile, sbTakeFileShortPath, sbTakeFileShortPath.Capacity);
121121
var sbTake = new StringBuilder();
122-
sbTake.Append("set comment |\n");
122+
sbTake.Append("set comment |\r\n");
123123
sbTake.Append("log ");
124124
sbTake.Append(logFileName);
125-
sbTake.Append("\n");
125+
sbTake.Append("\r\n");
126126
sbTake.Append("load grammar ");
127127
sbTake.Append(GrammarFile);
128-
sbTake.Append("\n");
128+
sbTake.Append("\r\n");
129129
// See if the failure we're getting in GitHub is due to not finding the grammr file:
130130
// We'll put it in the temp directory now.
131131
//StringBuilder sbGrammarFileShortPath = new StringBuilder(255);
@@ -135,24 +135,24 @@ private void CreateTakeFile()
135135
// sbGrammarFileShortPath.Capacity
136136
//);
137137
//sbTake.Append(sbGrammarFileShortPath.ToString() + "\n");
138-
sbTake.Append("set timing on\n");
139-
sbTake.Append("set gloss on\n");
140-
sbTake.Append("set features all\n");
138+
sbTake.Append("set timing on\r\n");
139+
sbTake.Append("set gloss on\r\n");
140+
sbTake.Append("set features all\r\n");
141141
HandleRootGloss(sbTake);
142-
sbTake.Append("set tree xml\n");
142+
sbTake.Append("set tree xml\r\n");
143143
sbTake.Append("set ambiguities ");
144144
sbTake.Append(MaxAmbiguities);
145-
sbTake.Append("\n");
145+
sbTake.Append("\r\n");
146146
if (!TimeLimit.Equals("0"))
147147
{
148148
sbTake.Append("set limit ");
149149
sbTake.Append(TimeLimit);
150-
sbTake.Append("\n");
150+
sbTake.Append("\r\n");
151151
}
152-
sbTake.Append("set write-ample-parses on\n");
152+
sbTake.Append("set write-ample-parses on\r\n");
153153
// since the batch fle defaults to the temp directory, we just use the invoker files as they are
154-
sbTake.Append("file disambiguate Invoker.ana Invoker.and\n");
155-
sbTake.Append("exit\n");
154+
sbTake.Append("file disambiguate Invoker.ana Invoker.and\r\n");
155+
sbTake.Append("exit\r\n");
156156
File.WriteAllText(takeFile, sbTake.ToString());
157157
AndFile = Path.Combine(Path.GetTempPath(), "Invoker.and");
158158
Console.WriteLine("\ntake file =");

0 commit comments

Comments
 (0)