Skip to content

Commit b76051c

Browse files
author
Viktor Chernev
committed
final v9.0.1
1 parent 092b6fb commit b76051c

File tree

12 files changed

+93
-250
lines changed

12 files changed

+93
-250
lines changed

@DescribeCompilerAPI/DescribeCompiler.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
</ItemGroup>
6161
<ItemGroup>
6262
<Content Include="describe.ico" />
63+
<EmbeddedResource Include="Templates\HTML_PARACORD\ProductionColored.html" />
6364
<EmbeddedResource Include="Templates\HTML_PARACORD\Item.html" />
6465
<EmbeddedResource Include="Templates\HTML_PARACORD\ItemColored.html" />
6566
<EmbeddedResource Include="Templates\HTML_PARACORD\ItemComment.html" />
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<li><div style="color: {COLOR};" class="listree-submenu-heading">{TITLE}</div><ul class="listree-submenu-items"><br />{ITEMS}<br /></ul></li>

@DescribeCompilerAPI/Translations.cs

Lines changed: 66 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ public interface IUnfoldTranslator
1313
{
1414
bool IsInitialized();
1515
string TranslateUnfold(DescribeUnfold u);
16-
17-
1816
}
1917
public class UnfoldTranslator : IUnfoldTranslator
2018
{
@@ -27,7 +25,8 @@ public class UnfoldTranslator : IUnfoldTranslator
2725
static string emptyItemTemplate;
2826
static string commentItemTemplate;
2927
static string coloredItemTemplate;
30-
static string prodTemplate;
28+
static string productionTemplate;
29+
static string coloredProductionTemplate;
3130
static string linkTemplate;
3231

3332
public UnfoldTranslator(string template = null)
@@ -58,8 +57,10 @@ public UnfoldTranslator(string template = null)
5857
pageTemplate = File.ReadAllText(finfo.FullName);
5958
else if (finfo.Name.StartsWith("Root"))
6059
rootTemplate = File.ReadAllText(finfo.FullName);
60+
else if (finfo.Name.StartsWith("ProductionColored"))
61+
coloredProductionTemplate = File.ReadAllText(finfo.FullName);
6162
else if (finfo.Name.StartsWith("Production"))
62-
prodTemplate = File.ReadAllText(finfo.FullName);
63+
productionTemplate = File.ReadAllText(finfo.FullName);
6364
else if (finfo.Name.StartsWith("ItemEmpty"))
6465
emptyItemTemplate = File.ReadAllText(finfo.FullName);
6566
else if (finfo.Name.StartsWith("ItemComment"))
@@ -84,7 +85,12 @@ public UnfoldTranslator(string template = null)
8485
LogError("No \"Root\" Template found during translation.");
8586
flag = true;
8687
}
87-
if (prodTemplate == null)
88+
if (coloredProductionTemplate == null)
89+
{
90+
LogError("No \"ProductionColored\" Template found during translation.");
91+
flag = true;
92+
}
93+
if (productionTemplate == null)
8894
{
8995
LogError("No \"Production\" Template found during translation.");
9096
flag = true;
@@ -128,7 +134,9 @@ public UnfoldTranslator(string template = null)
128134
ResourceUtil.ExtractResourceByFileName_String(selectedTemplate, @"Page");
129135
rootTemplate =
130136
ResourceUtil.ExtractResourceByFileName_String(selectedTemplate, @"Root");
131-
prodTemplate =
137+
coloredProductionTemplate =
138+
ResourceUtil.ExtractResourceByFileName_String(selectedTemplate, @"ProductionColored");
139+
productionTemplate =
132140
ResourceUtil.ExtractResourceByFileName_String(selectedTemplate, @"Production");
133141
itemTemplate =
134142
ResourceUtil.ExtractResourceByFileName_String(selectedTemplate, @"Item");
@@ -184,8 +192,10 @@ public UnfoldTranslator(
184192
pageTemplate = File.ReadAllText(finfo.FullName);
185193
else if (finfo.Name.StartsWith("Root"))
186194
rootTemplate = File.ReadAllText(finfo.FullName);
195+
else if (finfo.Name.StartsWith("ProductionColored"))
196+
coloredProductionTemplate = File.ReadAllText(finfo.FullName);
187197
else if (finfo.Name.StartsWith("Production"))
188-
prodTemplate = File.ReadAllText(finfo.FullName);
198+
productionTemplate = File.ReadAllText(finfo.FullName);
189199
else if (finfo.Name.StartsWith("ItemEmpty"))
190200
emptyItemTemplate = File.ReadAllText(finfo.FullName);
191201
else if (finfo.Name.StartsWith("ItemComment"))
@@ -210,7 +220,12 @@ public UnfoldTranslator(
210220
LogError("No \"Root\" Template found during translation.");
211221
flag = true;
212222
}
213-
if (prodTemplate == null)
223+
if (coloredProductionTemplate == null)
224+
{
225+
LogError("No \"ProductionColored\" Template found during translation.");
226+
flag = true;
227+
}
228+
if (productionTemplate == null)
214229
{
215230
LogError("No \"Production\" Template found during translation.");
216231
flag = true;
@@ -254,7 +269,9 @@ public UnfoldTranslator(
254269
ResourceUtil.ExtractResourceByFileName_String(selectedTemplate, @"Page");
255270
rootTemplate =
256271
ResourceUtil.ExtractResourceByFileName_String(selectedTemplate, @"Root");
257-
prodTemplate =
272+
coloredProductionTemplate =
273+
ResourceUtil.ExtractResourceByFileName_String(selectedTemplate, @"ProductionColored");
274+
productionTemplate =
258275
ResourceUtil.ExtractResourceByFileName_String(selectedTemplate, @"Production");
259276
itemTemplate =
260277
ResourceUtil.ExtractResourceByFileName_String(selectedTemplate, @"Item");
@@ -313,8 +330,10 @@ public UnfoldTranslator(
313330
pageTemplate = File.ReadAllText(finfo.FullName);
314331
else if (finfo.Name.StartsWith("Root"))
315332
rootTemplate = File.ReadAllText(finfo.FullName);
333+
else if (finfo.Name.StartsWith("ProductionColored"))
334+
coloredProductionTemplate = File.ReadAllText(finfo.FullName);
316335
else if (finfo.Name.StartsWith("Production"))
317-
prodTemplate = File.ReadAllText(finfo.FullName);
336+
productionTemplate = File.ReadAllText(finfo.FullName);
318337
else if (finfo.Name.StartsWith("ItemEmpty"))
319338
emptyItemTemplate = File.ReadAllText(finfo.FullName);
320339
else if (finfo.Name.StartsWith("ItemComment"))
@@ -339,7 +358,12 @@ public UnfoldTranslator(
339358
LogError("No \"Root\" Template found during translation.");
340359
flag = true;
341360
}
342-
if (prodTemplate == null)
361+
if (coloredProductionTemplate == null)
362+
{
363+
LogError("No \"ProductionColored\" Template found during translation.");
364+
flag = true;
365+
}
366+
if (productionTemplate == null)
343367
{
344368
LogError("No \"Production\" Template found during translation.");
345369
flag = true;
@@ -383,7 +407,9 @@ public UnfoldTranslator(
383407
ResourceUtil.ExtractResourceByFileName_String(selectedTemplate, @"Page");
384408
rootTemplate =
385409
ResourceUtil.ExtractResourceByFileName_String(selectedTemplate, @"Root");
386-
prodTemplate =
410+
coloredProductionTemplate =
411+
ResourceUtil.ExtractResourceByFileName_String(selectedTemplate, @"ProductionColored");
412+
productionTemplate =
387413
ResourceUtil.ExtractResourceByFileName_String(selectedTemplate, @"Production");
388414
itemTemplate =
389415
ResourceUtil.ExtractResourceByFileName_String(selectedTemplate, @"Item");
@@ -444,8 +470,10 @@ public UnfoldTranslator(
444470
pageTemplate = File.ReadAllText(finfo.FullName);
445471
else if (finfo.Name.StartsWith("Root"))
446472
rootTemplate = File.ReadAllText(finfo.FullName);
473+
else if (finfo.Name.StartsWith("ProductionColored"))
474+
coloredProductionTemplate = File.ReadAllText(finfo.FullName);
447475
else if (finfo.Name.StartsWith("Production"))
448-
prodTemplate = File.ReadAllText(finfo.FullName);
476+
productionTemplate = File.ReadAllText(finfo.FullName);
449477
else if (finfo.Name.StartsWith("ItemEmpty"))
450478
emptyItemTemplate = File.ReadAllText(finfo.FullName);
451479
else if (finfo.Name.StartsWith("ItemComment"))
@@ -470,7 +498,12 @@ public UnfoldTranslator(
470498
LogError("No \"Root\" Template found during translation.");
471499
flag = true;
472500
}
473-
if (prodTemplate == null)
501+
if(coloredProductionTemplate == null)
502+
{
503+
LogError("No \"ProductionColored\" Template found during translation.");
504+
flag = true;
505+
}
506+
if (productionTemplate == null)
474507
{
475508
LogError("No \"Production\" Template found during translation.");
476509
flag = true;
@@ -514,7 +547,9 @@ public UnfoldTranslator(
514547
ResourceUtil.ExtractResourceByFileName_String(selectedTemplate, @"Page");
515548
rootTemplate =
516549
ResourceUtil.ExtractResourceByFileName_String(selectedTemplate, @"Root");
517-
prodTemplate =
550+
coloredProductionTemplate =
551+
ResourceUtil.ExtractResourceByFileName_String(selectedTemplate, @"ProductionColored");
552+
productionTemplate =
518553
ResourceUtil.ExtractResourceByFileName_String(selectedTemplate, @"Production");
519554
itemTemplate =
520555
ResourceUtil.ExtractResourceByFileName_String(selectedTemplate, @"Item");
@@ -797,7 +832,22 @@ string TranslateProduction(DescribeUnfold u, string id)
797832
}
798833

799834
//replace in template
800-
string pt = prodTemplate.Replace("{TITLE}", u.Translations[id] + linkage);
835+
if (u.Decorators.ContainsKey(id))
836+
{
837+
List<string> decorators = u.Decorators[id];
838+
foreach (string s in decorators)
839+
{
840+
if (s.StartsWith("color|"))
841+
{
842+
string val = s.Substring(6);
843+
string res = coloredProductionTemplate.Replace("{TITLE}", u.Translations[id] + linkage);
844+
res = res.Replace("{COLOR}", val);
845+
res = res.Replace("{ITEMS}", items);
846+
return res;
847+
}
848+
}
849+
}
850+
string pt = productionTemplate.Replace("{TITLE}", u.Translations[id] + linkage);
801851
pt = pt.Replace("{ITEMS}", items);
802852
return pt;
803853
}

@DescribeCompilerCLI/Messages.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66

77
namespace DescribeCompilerCLI
88
{
9+
//https://patorjk.com/software/taag/#p=display&f=Alpha&t=DESCRIBE
10+
//cool - 3D Diagonal, Alpha, Impossible, Isometric1
11+
//Isometric2, Isometric3, Isometric4, Slant Relief, Small Isometric1
12+
//minimalist - Bulbhead, Graceful, Modular, Ogre, Slant, Small
13+
//Small Slant, Standard, Twisted, ANSI Shadow
14+
915
internal static class Messages
1016
{
1117
internal static void setConsole()

Documentation/v 9.1/TextLinkText bug.ds

Lines changed: 0 additions & 33 deletions
This file was deleted.

Documentation/v 9.1/bugDecoratorOnProductionItem.txt renamed to Documentation/v 9.1/implemented/@featureDecoratorOnProductionItem.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ shopska salad (385) {color|green} ->
44

55
150g cucumber (29),
66
450g tomatoes (158),
7-
75g sirene (198);
7+
75g sirene (198);
8+
9+
Simply the functionality was missing
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
When we have an error, a syntax one for example, why don't we get a message like press any key to exit?
2+
And worse yet, I can write text
3+
And worse yet, when there is an error, we continue with all other errors
4+
5+
No "ProductionColored" Template found during translation.
6+
Failed to initialize the translator
7+
This parser isn't innitialized, and cannot be used. Create a new instance.

Documentation/v 9.1/next/prod-prod bug 2.ds

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
Probably no bug here but misformed Describe code.
2+
However, nothing to loose from more thorough investigation.
3+
4+
5+
16
My perform CPR <BFybFUTH> ->
27

38
make sure surroundings are safe,

Documentation/v 9.1/next/prod-prod bug.ds

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
Probably no bug here but misformed Describe code.
2+
However, nothing to loose from more thorough investigation.
3+
4+
15
Citrus fruits <zP04AFRF> ->
26

37
original citrus species ->

0 commit comments

Comments
 (0)