Skip to content

Commit

Permalink
JSON Translator bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Viktor Chernev committed Nov 3, 2023
1 parent 1b1d28d commit 67e41d4
Show file tree
Hide file tree
Showing 19 changed files with 158 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"{NAME}":"{VALUE}"
{"{NAME}":"{VALUE}"}
4 changes: 2 additions & 2 deletions @DescribeCompilerCLI/DescribeCompilerCLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>C:\Users\Viktor Chernev\Desktop\DescribeParser\%40CompilerCLI\Release\</PublishUrl>
<PublishUrl>C:\Users\Viktor Chernev\Desktop\World-Describe\Language\DescribeLanguage\.repo\Release\0.9.2\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
Expand All @@ -25,7 +25,7 @@
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>0.9.0.%2a</ApplicationVersion>
<ApplicationVersion>0.9.2.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
Expand Down
2 changes: 1 addition & 1 deletion @DescribeCompilerCLI/DescribeCompilerCLI.csproj.user
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<StartArguments>parse-folder "C:\Users\Viktor Chernev\Desktop\docs-scratch\TestData" "C:\Users\Viktor Chernev\Desktop\docs-scratch\result.json" template="JSON_COMMONER" verbosity=low logfile="C:\Users\Viktor Chernev\Desktop\docs-scratch\last-log.txt" dsonly toponly=false onerror=ignore</StartArguments>
</PropertyGroup>
<PropertyGroup>
<PublishUrlHistory>C:\Users\Viktor Chernev\Desktop\DescribeParser\%40CompilerCLI\Release\|publish\</PublishUrlHistory>
<PublishUrlHistory>C:\Users\Viktor Chernev\Desktop\World-Describe\Language\DescribeLanguage\.repo\Release\0.9.2\|C:\Users\Viktor Chernev\Desktop\World-Describe\Language\DescribeLanguage\.repo\Release\|C:\Users\Viktor Chernev\Desktop\DescribeParser\%40CompilerCLI\Release\|publish\</PublishUrlHistory>
<InstallUrlHistory />
<SupportUrlHistory />
<UpdateUrlHistory />
Expand Down
4 changes: 3 additions & 1 deletion @DescribeCompilerCLI/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Reflection;
using System.Resources;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

Expand Down Expand Up @@ -34,3 +35,4 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.9.2.0")]
[assembly: AssemblyFileVersion("0.9.2.0")]
[assembly: NeutralResourcesLanguage("en")]
3 changes: 3 additions & 0 deletions Documentation/@BugCustomDecoratorsProduceBadJson.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
BUG: Custom decorators produce bad JSON

This is a bug in the inbuilt JSON translator in the API. The translator produces malformed JSON due to malformed template. Each decorator object needs to be placed in curly brackets, and those are missing from the inbuilt template
4 changes: 4 additions & 0 deletions Documentation/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
BUG: In the DescribeDB app, the UpdateDB command produces an artifact with 2 user names as start of the name of personal files - "DemonOfReason.DemonOfReason.file" instead of simply "DemonOfReason.file". This was necessairy the first time we uploaded the files to the new database, but should've been removed afterwords.

SOLUTION: DatabaseDownloader comment the line that adds the additional folder
//if (!string.IsNullOrEmpty(username)) curpath = Path.Combine(curpath, username);
39 changes: 39 additions & 0 deletions Documentation/v 9.2/next/Bug2ProductionsInRootDocument/article1.ds
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
directives ->
namespace <treeofall.documentation>;


DOCUMENTATION <rnode> ->

schemes <.schemes.rnode>,
tests <tests>;

tests <tests> ->

decorator test list ->

bgcolor {nlcomment},
background color {custom|bgcolor|red},
random item,
background color {custom|bgcolor|lime},

gap {empty},
italic one {custom|italic},
bold one {custom|bold},
how about bold italic? {custom|bold}{custom|italic},
underlined entry {custom|underline},
and a striked one {custom|striked},

and how about 4 combined?
{custom|striked}{custom|underline}{custom|bold}{custom|italic},

gap {empty},
decorators {comment},
colored {color|Magenta},
another one {color|Magenta}{custom|bold},

color block {nlcomment},
lorem ipsum {custom|bgcolor|red},
lorem ipsum {custom|bgcolor|red},
lorem ipsum {custom|bgcolor|red},
lorem ipsum {custom|bgcolor|lime},
lorem ipsum {custom|bgcolor|red};
37 changes: 37 additions & 0 deletions Documentation/v 9.2/next/Bug2ProductionsInRootDocument/article2.ds
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
directives ->
namespace <treeofall.documentation>;


DOCUMENTATION <rnode> ->

schemes <.schemes.rnode>,
decorator test list <tests>;

decorator test list <tests> ->

bgcolor {nlcomment},
background color {custom|bgcolor|red},
random item,
background color {custom|bgcolor|lime},

gap {empty},
italic one {custom|italic},
bold one {custom|bold},
how about bold italic? {custom|bold}{custom|italic},
underlined entry {custom|underline},
and a striked one {custom|striked},

and how about 4 combined?
{custom|striked}{custom|underline}{custom|bold}{custom|italic},

gap {empty},
decorators {comment},
colored {color|Magenta},
another one {color|Magenta}{custom|bold},

color block {nlcomment},
lorem ipsum {custom|bgcolor|red},
lorem ipsum {custom|bgcolor|red},
lorem ipsum {custom|bgcolor|red},
lorem ipsum {custom|bgcolor|lime},
lorem ipsum {custom|bgcolor|red};
35 changes: 35 additions & 0 deletions Documentation/v 9.2/next/Bug2ProductionsInRootDocument/article3.ds
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
directives ->
namespace <treeofall.documentation>;


DOCUMENTATION <rnode> ->

schemes <.schemes.rnode>,
decorator test list <tests> ->

bgcolor {nlcomment},
background color {custom|bgcolor|red},
random item,
background color {custom|bgcolor|lime},

gap {empty},
italic one {custom|italic},
bold one {custom|bold},
how about bold italic? {custom|bold}{custom|italic},
underlined entry {custom|underline},
and a striked one {custom|striked},

and how about 4 combined?
{custom|striked}{custom|underline}{custom|bold}{custom|italic},

gap {empty},
decorators {comment},
colored {color|Magenta},
another one {color|Magenta}{custom|bold},

color block {nlcomment},
lorem ipsum {custom|bgcolor|red},
lorem ipsum {custom|bgcolor|red},
lorem ipsum {custom|bgcolor|red},
lorem ipsum {custom|bgcolor|lime},
lorem ipsum {custom|bgcolor|red};
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
the missing coma in that JSON and cur is undefined in index.scripts.js


normativeClick https://development.worldinlists.net/index/index.scripts.js:63
loadJson("normative") https://development.worldinlists.net/index/index.scripts.js:520

addFooter(json);
addSmallTrees(json);

if(json.items.length != 1) { //json.items.length is 2, so we never go any further with population
console.log('FATAL: Unknown template!');
return;
}

listreeMake();
addLargeTree(json.items[0].id); https://development.worldinlists.net/index/index.scripts.js:433 //so here cur is undefined
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{"items":[

{"name":"branch","filename":"@documentation","text":"DOCUMENTATION","id":"treeofall.documentation.rnode","links":[],"decorators":[],"items":[{"name":"branch","filename":"schemes","text":"schemes","id":"treeofall.documentation.schemes.rnode","links":[],"decorators":[],"items":[{"name":"branch","filename":"schemes","text":"source credibility","id":"treeofall.documentation.schemes.J4j6KbeM","links":[],"decorators":[],"items":[{"name":"leaf","text":"questionable (Q)","id":"treeofall.documentation.schemes.CJclsgRT","links":[],"decorators":[],"type":"item"},{"name":"leaf","text":"mundane (M)","id":"treeofall.documentation.schemes.3GknaYve","links":[],"decorators":[],"type":"item"},{"name":"leaf","text":"credible (C)","id":"treeofall.documentation.schemes.Fxu0QKUP","links":[],"decorators":[],"type":"item"},{"name":"leaf","text":"canonical (A)","id":"treeofall.documentation.schemes.qOHgF0K6","links":[],"decorators":[],"type":"item"}],"type":"item"}],"type":"item"},{"name":"branch","filename":"@documentation","text":"tests","id":"treeofall.documentation.tests","links":[],"decorators":[],"items":[{"name":"branch","filename":"@documentation","text":"decorator test list","id":"treeofall.documentation.S666R01R","links":[],"decorators":[],"items":[{"name":"leaf","text":"bgcolor","id":"treeofall.documentation.3F9D7HQC","links":[],"decorators":[],"type":"nlcomment"},{"name":"leaf","text":"background color","id":"treeofall.documentation.PURG69QV","links":[],"decorators":[{"bgcolor":"red"}],"type":"item"},{"name":"leaf","text":"random item","id":"treeofall.documentation.AT3IDB3H","links":[],"decorators":[],"type":"item"},{"name":"leaf","text":"background color","id":"treeofall.documentation.B9KXOJTF","links":[],"decorators":[{"bgcolor":"lime"}],"type":"item"},{"name":"leaf","type":"empty"},{"name":"leaf","text":"italic one","id":"treeofall.documentation.TET48CUS","links":[],"decorators":[{"italic":""}],"type":"item"},{"name":"leaf","text":"bold one","id":"treeofall.documentation.PK686SO1","links":[],"decorators":[{"bold":""}],"type":"item"},{"name":"leaf","text":"how about bold italic?","id":"treeofall.documentation.M1B863XG","links":[],"decorators":[{"bold":""},{"italic":""}],"type":"item"},{"name":"leaf","text":"underlined entry","id":"treeofall.documentation.ALO3H127","links":[],"decorators":[{"underline":""}],"type":"item"},{"name":"leaf","text":"and a striked one","id":"treeofall.documentation.QSZ8R8J9","links":[],"decorators":[{"striked":""}],"type":"item"},{"name":"leaf","text":"and how about 4 combined?","id":"treeofall.documentation.O2HENUJI","links":[],"decorators":[{"striked":""},{"underline":""},{"bold":""},{"italic":""}],"type":"item"},{"name":"leaf","type":"empty"},{"name":"leaf","text":"decorators","id":"treeofall.documentation.QN3WX1LY","links":[],"decorators":[],"type":"comment"},{"name":"leaf","text":"colored","id":"treeofall.documentation.R8SO3PKN","links":[],"decorators":[],"color":"Magenta","type":"item"},{"name":"leaf","text":"another one","id":"treeofall.documentation.RCTDVT2P","links":[],"decorators":[{"bold":""}],"color":"Magenta","type":"item"},{"name":"leaf","text":"color block","id":"treeofall.documentation.CGEGP16L","links":[],"decorators":[],"type":"nlcomment"},{"name":"leaf","text":"lorem ipsum","id":"treeofall.documentation.D8RDEXLX","links":[],"decorators":[{"bgcolor":"red"}],"type":"item"},{"name":"leaf","text":"lorem ipsum","id":"treeofall.documentation.RTWOC4OJ","links":[],"decorators":[{"bgcolor":"red"}],"type":"item"},{"name":"leaf","text":"lorem ipsum","id":"treeofall.documentation.09T9VLF7","links":[],"decorators":[{"bgcolor":"red"}],"type":"item"},{"name":"leaf","text":"lorem ipsum","id":"treeofall.documentation.UOTRXEJ0","links":[],"decorators":[{"bgcolor":"lime"}],"type":"item"},{"name":"leaf","text":"lorem ipsum","id":"treeofall.documentation.CHL47GI4","links":[],"decorators":[{"bgcolor":"red"}],"type":"item"}],"type":"item"}],"type":"item"}],"type":"item"}

{"name":"branch","filename":"@documentation","text":"tests","id":"treeofall.documentation.tests","links":[],"decorators":[],"items":[{"name":"branch","filename":"@documentation","text":"decorator test list","id":"treeofall.documentation.S666R01R","links":[],"decorators":[],"items":[{"name":"leaf","text":"bgcolor","id":"treeofall.documentation.3F9D7HQC","links":[],"decorators":[],"type":"nlcomment"},{"name":"leaf","text":"background color","id":"treeofall.documentation.PURG69QV","links":[],"decorators":[{"bgcolor":"red"}],"type":"item"},{"name":"leaf","text":"random item","id":"treeofall.documentation.AT3IDB3H","links":[],"decorators":[],"type":"item"},{"name":"leaf","text":"background color","id":"treeofall.documentation.B9KXOJTF","links":[],"decorators":[{"bgcolor":"lime"}],"type":"item"},{"name":"leaf","type":"empty"},{"name":"leaf","text":"italic one","id":"treeofall.documentation.TET48CUS","links":[],"decorators":[{"italic":""}],"type":"item"},{"name":"leaf","text":"bold one","id":"treeofall.documentation.PK686SO1","links":[],"decorators":[{"bold":""}],"type":"item"},{"name":"leaf","text":"how about bold italic?","id":"treeofall.documentation.M1B863XG","links":[],"decorators":[{"bold":""},{"italic":""}],"type":"item"},{"name":"leaf","text":"underlined entry","id":"treeofall.documentation.ALO3H127","links":[],"decorators":[{"underline":""}],"type":"item"},{"name":"leaf","text":"and a striked one","id":"treeofall.documentation.QSZ8R8J9","links":[],"decorators":[{"striked":""}],"type":"item"},{"name":"leaf","text":"and how about 4 combined?","id":"treeofall.documentation.O2HENUJI","links":[],"decorators":[{"striked":""},{"underline":""},{"bold":""},{"italic":""}],"type":"item"},{"name":"leaf","type":"empty"},{"name":"leaf","text":"decorators","id":"treeofall.documentation.QN3WX1LY","links":[],"decorators":[],"type":"comment"},{"name":"leaf","text":"colored","id":"treeofall.documentation.R8SO3PKN","links":[],"decorators":[],"color":"Magenta","type":"item"},{"name":"leaf","text":"another one","id":"treeofall.documentation.RCTDVT2P","links":[],"decorators":[{"bold":""}],"color":"Magenta","type":"item"},{"name":"leaf","text":"color block","id":"treeofall.documentation.CGEGP16L","links":[],"decorators":[],"type":"nlcomment"},{"name":"leaf","text":"lorem ipsum","id":"treeofall.documentation.D8RDEXLX","links":[],"decorators":[{"bgcolor":"red"}],"type":"item"},{"name":"leaf","text":"lorem ipsum","id":"treeofall.documentation.RTWOC4OJ","links":[],"decorators":[{"bgcolor":"red"}],"type":"item"},{"name":"leaf","text":"lorem ipsum","id":"treeofall.documentation.09T9VLF7","links":[],"decorators":[{"bgcolor":"red"}],"type":"item"},{"name":"leaf","text":"lorem ipsum","id":"treeofall.documentation.UOTRXEJ0","links":[],"decorators":[{"bgcolor":"lime"}],"type":"item"},{"name":"leaf","text":"lorem ipsum","id":"treeofall.documentation.CHL47GI4","links":[],"decorators":[{"bgcolor":"red"}],"type":"item"}],"type":"item"}],"type":"item"}],"timestamp":"Built on 03 November 2023, 19:25:49.651 (UTC)","version":"Built with Describe Compiler version 0.9.2","short_timestamp":"03 Nov 2023, 19:25:49","short_version":"Describe Compiler v 0.9.2"}
Loading

0 comments on commit 67e41d4

Please sign in to comment.