From 1c3eb394033a42c3d9f263db71dc403a0e5292fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Wed, 25 Nov 2020 14:53:12 +0100 Subject: [PATCH] All them tests --- README.md | 0 package-lock.json | 0 package.json | 0 scripts/run-tests | 0 src/Lexer.mjs | 0 src/Parser.mjs | 0 src/ast-to-data.mjs | 0 src/ast-to-string.mjs | 17 ++- src/data-to-ast.mjs | 0 src/data-to-string.mjs | 0 src/mod.mjs | 0 src/spec/ast-to-data.mjs | 32 ++--- src/spec/ast-to-data/full-tree.mjs | 2 - src/spec/ast-to-string.mjs | 40 ++++++ src/spec/data-to-ast.mjs | 39 +++--- src/spec/data-to-string.mjs | 0 src/spec/{parser => from-primitive}/basic.mjs | 0 .../comment-only.mjs | 0 .../{parser => from-primitive}/comments.mjs | 0 .../multiline-value.mjs | 0 .../real.dbus-org.bluez.mjs | 0 .../real.dbus-org.freedesktop.Avahi.mjs | 0 ...eal.dbus-org.freedesktop.ModemManager1.mjs | 0 ...eal.dbus-org.freedesktop.nm-dispatcher.mjs | 0 .../real.display-manager.mjs | 0 .../real.maia-console@.mjs | 0 .../real.nix-daemon.mjs | 0 .../real.systemd-fsck-silent-root.mjs | 0 .../real.systemd-fsck-silent@.mjs | 0 .../repeated-settings.mjs | 0 .../weird-characters.mjs | 0 src/spec/string-to-ast.mjs | 32 ++--- .../{ast-to-data => to-primitive}/basic.mjs | 8 +- src/spec/to-primitive/comment-only.mjs | 9 ++ src/spec/to-primitive/comments.mjs | 65 +++++++++ src/spec/to-primitive/multiline-value.mjs | 57 ++++++++ src/spec/to-primitive/real.dbus-org.bluez.mjs | 108 ++++++++++++++ .../real.dbus-org.freedesktop.Avahi.mjs | 90 ++++++++++++ ...eal.dbus-org.freedesktop.ModemManager1.mjs | 132 ++++++++++++++++++ ...eal.dbus-org.freedesktop.nm-dispatcher.mjs | 66 +++++++++ .../to-primitive/real.display-manager.mjs | 90 ++++++++++++ src/spec/to-primitive/real.maia-console@.mjs | 104 ++++++++++++++ src/spec/to-primitive/real.nix-daemon.mjs | 99 +++++++++++++ .../real.systemd-fsck-silent-root.mjs | 88 ++++++++++++ .../real.systemd-fsck-silent@.mjs | 94 +++++++++++++ src/spec/to-primitive/repeated-settings.mjs | 45 ++++++ src/spec/to-primitive/weird-characters.mjs | 29 ++++ src/string-to-ast.mjs | 0 src/string-to-data.mjs | 0 src/visitor-creator.mjs | 0 50 files changed, 1183 insertions(+), 63 deletions(-) mode change 100755 => 100644 README.md mode change 100755 => 100644 package-lock.json mode change 100755 => 100644 package.json mode change 100755 => 100644 scripts/run-tests mode change 100755 => 100644 src/Lexer.mjs mode change 100755 => 100644 src/Parser.mjs mode change 100755 => 100644 src/ast-to-data.mjs mode change 100755 => 100644 src/ast-to-string.mjs mode change 100755 => 100644 src/data-to-ast.mjs mode change 100755 => 100644 src/data-to-string.mjs mode change 100755 => 100644 src/mod.mjs mode change 100755 => 100644 src/spec/ast-to-data.mjs delete mode 100755 src/spec/ast-to-data/full-tree.mjs mode change 100755 => 100644 src/spec/ast-to-string.mjs mode change 100755 => 100644 src/spec/data-to-ast.mjs delete mode 100755 src/spec/data-to-string.mjs rename src/spec/{parser => from-primitive}/basic.mjs (100%) mode change 100755 => 100644 rename src/spec/{parser => from-primitive}/comment-only.mjs (100%) mode change 100755 => 100644 rename src/spec/{parser => from-primitive}/comments.mjs (100%) mode change 100755 => 100644 rename src/spec/{parser => from-primitive}/multiline-value.mjs (100%) mode change 100755 => 100644 rename src/spec/{parser => from-primitive}/real.dbus-org.bluez.mjs (100%) mode change 100755 => 100644 rename src/spec/{parser => from-primitive}/real.dbus-org.freedesktop.Avahi.mjs (100%) mode change 100755 => 100644 rename src/spec/{parser => from-primitive}/real.dbus-org.freedesktop.ModemManager1.mjs (100%) mode change 100755 => 100644 rename src/spec/{parser => from-primitive}/real.dbus-org.freedesktop.nm-dispatcher.mjs (100%) mode change 100755 => 100644 rename src/spec/{parser => from-primitive}/real.display-manager.mjs (100%) mode change 100755 => 100644 rename src/spec/{parser => from-primitive}/real.maia-console@.mjs (100%) mode change 100755 => 100644 rename src/spec/{parser => from-primitive}/real.nix-daemon.mjs (100%) mode change 100755 => 100644 rename src/spec/{parser => from-primitive}/real.systemd-fsck-silent-root.mjs (100%) mode change 100755 => 100644 rename src/spec/{parser => from-primitive}/real.systemd-fsck-silent@.mjs (100%) mode change 100755 => 100644 rename src/spec/{parser => from-primitive}/repeated-settings.mjs (100%) mode change 100755 => 100644 rename src/spec/{parser => from-primitive}/weird-characters.mjs (100%) mode change 100755 => 100644 mode change 100755 => 100644 src/spec/string-to-ast.mjs rename src/spec/{ast-to-data => to-primitive}/basic.mjs (76%) mode change 100755 => 100644 create mode 100644 src/spec/to-primitive/comment-only.mjs create mode 100644 src/spec/to-primitive/comments.mjs create mode 100644 src/spec/to-primitive/multiline-value.mjs create mode 100644 src/spec/to-primitive/real.dbus-org.bluez.mjs create mode 100644 src/spec/to-primitive/real.dbus-org.freedesktop.Avahi.mjs create mode 100644 src/spec/to-primitive/real.dbus-org.freedesktop.ModemManager1.mjs create mode 100644 src/spec/to-primitive/real.dbus-org.freedesktop.nm-dispatcher.mjs create mode 100644 src/spec/to-primitive/real.display-manager.mjs create mode 100644 src/spec/to-primitive/real.maia-console@.mjs create mode 100644 src/spec/to-primitive/real.nix-daemon.mjs create mode 100644 src/spec/to-primitive/real.systemd-fsck-silent-root.mjs create mode 100644 src/spec/to-primitive/real.systemd-fsck-silent@.mjs create mode 100644 src/spec/to-primitive/repeated-settings.mjs create mode 100644 src/spec/to-primitive/weird-characters.mjs mode change 100755 => 100644 src/string-to-ast.mjs mode change 100755 => 100644 src/string-to-data.mjs mode change 100755 => 100644 src/visitor-creator.mjs diff --git a/README.md b/README.md old mode 100755 new mode 100644 diff --git a/package-lock.json b/package-lock.json old mode 100755 new mode 100644 diff --git a/package.json b/package.json old mode 100755 new mode 100644 diff --git a/scripts/run-tests b/scripts/run-tests old mode 100755 new mode 100644 diff --git a/src/Lexer.mjs b/src/Lexer.mjs old mode 100755 new mode 100644 diff --git a/src/Parser.mjs b/src/Parser.mjs old mode 100755 new mode 100644 diff --git a/src/ast-to-data.mjs b/src/ast-to-data.mjs old mode 100755 new mode 100644 diff --git a/src/ast-to-string.mjs b/src/ast-to-string.mjs old mode 100755 new mode 100644 index 4abcd61..cbde6e4 --- a/src/ast-to-string.mjs +++ b/src/ast-to-string.mjs @@ -1,16 +1,19 @@ function nodeToString(node) { switch (node.type) { case "unitFile": - return `${(node.comments || []).map(nodeToString).join('\n')} -${(node.sections || []).map(nodeToString).join('\n')}`; + return [ + (node.comments || []).map(nodeToString).join('\n'), + (node.sections || []).map(nodeToString).join('\n\n'), + ] + .filter(n => n !== '') + .join('\n'); case "comment": - return `# ${comment.value}`; + return `# ${node.value}`; case "section": - const titleComment = ` ${node.titleComment ? nodeToString(node.titleComment) : ''}`; - return `[${node.title}]${titleComment} - ${(node.body || []).map(nodeToString).join('\n')}`; + const titleComment = node.titleComment ? ' ' + nodeToString(node.titleComment) : ''; + return `[${node.title}]${titleComment}\n${(node.body || []).map(nodeToString).join('\n')}`; case "setting": - const comment = ` ${node.comment ? nodeToString(node.comment) : ''}`; + const comment = node.comment ? ' ' + nodeToString(node.comment) : ''; return `${node.name}=${node.value}${comment}`; default: throw new Error(`Unrecognized node type: ${node.type}`); diff --git a/src/data-to-ast.mjs b/src/data-to-ast.mjs old mode 100755 new mode 100644 diff --git a/src/data-to-string.mjs b/src/data-to-string.mjs old mode 100755 new mode 100644 diff --git a/src/mod.mjs b/src/mod.mjs old mode 100755 new mode 100644 diff --git a/src/spec/ast-to-data.mjs b/src/spec/ast-to-data.mjs old mode 100755 new mode 100644 index 5ee2b84..d22a6cf --- a/src/spec/ast-to-data.mjs +++ b/src/spec/ast-to-data.mjs @@ -7,7 +7,7 @@ function runTest(input, expectedOutput) { const resultString = JSON.stringify(result); if (expectedOutputString !== resultString) { console.dir(input, { depth: Infinity }); - throw new Error(`Mismatching result on testcase: + throw new Error(`Mismatching result on ast-to-data testcase: =======Result====== ${resultString} @@ -21,22 +21,22 @@ ${expectedOutputString}\n\n`); (async () => { const cases = await Promise.all([ - "./parser/basic.mjs", - "./parser/comments.mjs", - "./parser/comment-only.mjs", - "./parser/multiline-value.mjs", - "./parser/weird-characters.mjs", - "./parser/repeated-settings.mjs", - "./parser/real.nix-daemon.mjs", - "./parser/real.maia-console@.mjs", + "./from-primitive/basic.mjs", + "./from-primitive/comments.mjs", + "./from-primitive/comment-only.mjs", + "./from-primitive/multiline-value.mjs", + "./from-primitive/weird-characters.mjs", + "./from-primitive/repeated-settings.mjs", + "./from-primitive/real.nix-daemon.mjs", + "./from-primitive/real.maia-console@.mjs", /* - "./parser/real.dbus-org.bluez.mjs", - "./parser/real.display-manager.mjs", - "./parser/real.systemd-fsck-silent@.mjs", - "./parser/real.systemd-fsck-silent-root.mjs", - "./parser/real.dbus-org.freedesktop.Avahi.mjs", - "./parser/real.dbus-org.freedesktop.ModemManager1.mjs", - "./parser/real.dbus-org.freedesktop.nm-dispatcher.mjs", + "./from-primitive/real.dbus-org.bluez.mjs", + "./from-primitive/real.display-manager.mjs", + "./from-primitive/real.systemd-fsck-silent@.mjs", + "./from-primitive/real.systemd-fsck-silent-root.mjs", + "./from-primitive/real.dbus-org.freedesktop.Avahi.mjs", + "./from-primitive/real.dbus-org.freedesktop.ModemManager1.mjs", + "./from-primitive/real.dbus-org.freedesktop.nm-dispatcher.mjs", */ ].map(file => import(file))); const results = cases.forEach(({ ast, data }) => runTest(ast, data)); diff --git a/src/spec/ast-to-data/full-tree.mjs b/src/spec/ast-to-data/full-tree.mjs deleted file mode 100755 index 28fd0f0..0000000 --- a/src/spec/ast-to-data/full-tree.mjs +++ /dev/null @@ -1,2 +0,0 @@ -export const input = ; -export const result = ; diff --git a/src/spec/ast-to-string.mjs b/src/spec/ast-to-string.mjs old mode 100755 new mode 100644 index e69de29..8330e14 --- a/src/spec/ast-to-string.mjs +++ b/src/spec/ast-to-string.mjs @@ -0,0 +1,40 @@ +import astToString from "../ast-to-string.mjs"; + +function runTest(input, expectedString) { + const resultString = astToString(input); + + if (resultString !== expectedString) { + throw new Error(`mismatching result on ast-to-string testcase: + +=======result====== + +${JSON.stringify(resultString)} + +=======expected====== + +${JSON.stringify(expectedString)} + +`); + } +}; + +(async () => { + const cases = await Promise.all([ + "./to-primitive/basic.mjs", + "./to-primitive/comments.mjs", + "./to-primitive/comment-only.mjs", + "./to-primitive/multiline-value.mjs", + "./to-primitive/weird-characters.mjs", + "./to-primitive/repeated-settings.mjs", + "./to-primitive/real.nix-daemon.mjs", + "./to-primitive/real.maia-console@.mjs", + "./to-primitive/real.dbus-org.bluez.mjs", + "./to-primitive/real.display-manager.mjs", + "./to-primitive/real.systemd-fsck-silent@.mjs", + "./to-primitive/real.systemd-fsck-silent-root.mjs", + "./to-primitive/real.dbus-org.freedesktop.Avahi.mjs", + "./to-primitive/real.dbus-org.freedesktop.ModemManager1.mjs", + "./to-primitive/real.dbus-org.freedesktop.nm-dispatcher.mjs", + ].map(file => import(file))); + const results = cases.forEach(({ ast, string }) => runTest(ast, string)); +})(); diff --git a/src/spec/data-to-ast.mjs b/src/spec/data-to-ast.mjs old mode 100755 new mode 100644 index 444ed2f..6babd1c --- a/src/spec/data-to-ast.mjs +++ b/src/spec/data-to-ast.mjs @@ -1,13 +1,14 @@ -import astToData from "../data-to-ast.mjs"; +import dataToAst from "../data-to-ast.mjs"; function runTest(input, expectedOutput) { - const result = astToData(input); + const result = dataToAst(input); const expectedOutputString = JSON.stringify(expectedOutput); const resultString = JSON.stringify(result); if (expectedOutputString !== resultString) { console.dir(input, { depth: Infinity }); - throw new Error(`Mismatching result on testcase: + throw new Error(`Mismatching result on data-to-ast testcase: + =======Result====== ${resultString} @@ -21,24 +22,24 @@ ${expectedOutputString}\n\n`); (async () => { const cases = await Promise.all([ - "./parser/basic.mjs", - "./parser/comments.mjs", - "./parser/comment-only.mjs", - "./parser/multiline-value.mjs", - "./parser/weird-characters.mjs", - "./parser/repeated-settings.mjs", - "./parser/real.nix-daemon.mjs", - "./parser/real.maia-console@.mjs", + "./to-primitive/basic.mjs", + // "./to-primitive/comments.mjs", + // "./to-primitive/comment-only.mjs", + "./to-primitive/multiline-value.mjs", + "./to-primitive/weird-characters.mjs", + "./to-primitive/repeated-settings.mjs", + "./to-primitive/real.nix-daemon.mjs", + "./to-primitive/real.maia-console@.mjs", /* - "./parser/real.dbus-org.bluez.mjs", - "./parser/real.display-manager.mjs", - "./parser/real.systemd-fsck-silent@.mjs", - "./parser/real.systemd-fsck-silent-root.mjs", - "./parser/real.dbus-org.freedesktop.Avahi.mjs", - "./parser/real.dbus-org.freedesktop.ModemManager1.mjs", - "./parser/real.dbus-org.freedesktop.nm-dispatcher.mjs", + "./to-primitive/real.dbus-org.bluez.mjs", + "./to-primitive/real.display-manager.mjs", + "./to-primitive/real.systemd-fsck-silent@.mjs", + "./to-primitive/real.systemd-fsck-silent-root.mjs", + "./to-primitive/real.dbus-org.freedesktop.Avahi.mjs", + "./to-primitive/real.dbus-org.freedesktop.ModemManager1.mjs", + "./to-primitive/real.dbus-org.freedesktop.nm-dispatcher.mjs", */ ].map(file => import(file))); - const results = cases.forEach(({ ast, data }) => runTest(ast, data)); + const results = cases.forEach(({ data, ast }) => runTest(data, ast)); })(); diff --git a/src/spec/data-to-string.mjs b/src/spec/data-to-string.mjs deleted file mode 100755 index e69de29..0000000 diff --git a/src/spec/parser/basic.mjs b/src/spec/from-primitive/basic.mjs old mode 100755 new mode 100644 similarity index 100% rename from src/spec/parser/basic.mjs rename to src/spec/from-primitive/basic.mjs diff --git a/src/spec/parser/comment-only.mjs b/src/spec/from-primitive/comment-only.mjs old mode 100755 new mode 100644 similarity index 100% rename from src/spec/parser/comment-only.mjs rename to src/spec/from-primitive/comment-only.mjs diff --git a/src/spec/parser/comments.mjs b/src/spec/from-primitive/comments.mjs old mode 100755 new mode 100644 similarity index 100% rename from src/spec/parser/comments.mjs rename to src/spec/from-primitive/comments.mjs diff --git a/src/spec/parser/multiline-value.mjs b/src/spec/from-primitive/multiline-value.mjs old mode 100755 new mode 100644 similarity index 100% rename from src/spec/parser/multiline-value.mjs rename to src/spec/from-primitive/multiline-value.mjs diff --git a/src/spec/parser/real.dbus-org.bluez.mjs b/src/spec/from-primitive/real.dbus-org.bluez.mjs old mode 100755 new mode 100644 similarity index 100% rename from src/spec/parser/real.dbus-org.bluez.mjs rename to src/spec/from-primitive/real.dbus-org.bluez.mjs diff --git a/src/spec/parser/real.dbus-org.freedesktop.Avahi.mjs b/src/spec/from-primitive/real.dbus-org.freedesktop.Avahi.mjs old mode 100755 new mode 100644 similarity index 100% rename from src/spec/parser/real.dbus-org.freedesktop.Avahi.mjs rename to src/spec/from-primitive/real.dbus-org.freedesktop.Avahi.mjs diff --git a/src/spec/parser/real.dbus-org.freedesktop.ModemManager1.mjs b/src/spec/from-primitive/real.dbus-org.freedesktop.ModemManager1.mjs old mode 100755 new mode 100644 similarity index 100% rename from src/spec/parser/real.dbus-org.freedesktop.ModemManager1.mjs rename to src/spec/from-primitive/real.dbus-org.freedesktop.ModemManager1.mjs diff --git a/src/spec/parser/real.dbus-org.freedesktop.nm-dispatcher.mjs b/src/spec/from-primitive/real.dbus-org.freedesktop.nm-dispatcher.mjs old mode 100755 new mode 100644 similarity index 100% rename from src/spec/parser/real.dbus-org.freedesktop.nm-dispatcher.mjs rename to src/spec/from-primitive/real.dbus-org.freedesktop.nm-dispatcher.mjs diff --git a/src/spec/parser/real.display-manager.mjs b/src/spec/from-primitive/real.display-manager.mjs old mode 100755 new mode 100644 similarity index 100% rename from src/spec/parser/real.display-manager.mjs rename to src/spec/from-primitive/real.display-manager.mjs diff --git a/src/spec/parser/real.maia-console@.mjs b/src/spec/from-primitive/real.maia-console@.mjs old mode 100755 new mode 100644 similarity index 100% rename from src/spec/parser/real.maia-console@.mjs rename to src/spec/from-primitive/real.maia-console@.mjs diff --git a/src/spec/parser/real.nix-daemon.mjs b/src/spec/from-primitive/real.nix-daemon.mjs old mode 100755 new mode 100644 similarity index 100% rename from src/spec/parser/real.nix-daemon.mjs rename to src/spec/from-primitive/real.nix-daemon.mjs diff --git a/src/spec/parser/real.systemd-fsck-silent-root.mjs b/src/spec/from-primitive/real.systemd-fsck-silent-root.mjs old mode 100755 new mode 100644 similarity index 100% rename from src/spec/parser/real.systemd-fsck-silent-root.mjs rename to src/spec/from-primitive/real.systemd-fsck-silent-root.mjs diff --git a/src/spec/parser/real.systemd-fsck-silent@.mjs b/src/spec/from-primitive/real.systemd-fsck-silent@.mjs old mode 100755 new mode 100644 similarity index 100% rename from src/spec/parser/real.systemd-fsck-silent@.mjs rename to src/spec/from-primitive/real.systemd-fsck-silent@.mjs diff --git a/src/spec/parser/repeated-settings.mjs b/src/spec/from-primitive/repeated-settings.mjs old mode 100755 new mode 100644 similarity index 100% rename from src/spec/parser/repeated-settings.mjs rename to src/spec/from-primitive/repeated-settings.mjs diff --git a/src/spec/parser/weird-characters.mjs b/src/spec/from-primitive/weird-characters.mjs old mode 100755 new mode 100644 similarity index 100% rename from src/spec/parser/weird-characters.mjs rename to src/spec/from-primitive/weird-characters.mjs diff --git a/src/spec/string-to-ast.mjs b/src/spec/string-to-ast.mjs old mode 100755 new mode 100644 index 242e854..14c20f7 --- a/src/spec/string-to-ast.mjs +++ b/src/spec/string-to-ast.mjs @@ -6,7 +6,7 @@ function runTest(input, result) { const resultString = JSON.stringify(ast, null, 2); const expectedString = JSON.stringify(result, null, 2); if (resultString !== expectedString) { - throw new Error(`mismatching result on testcase: + throw new Error(`mismatching result on string-to-ast testcase: ${input} =======result====== @@ -23,21 +23,21 @@ ${expectedString} (async () => { const cases = await Promise.all([ - "./parser/basic.mjs", - "./parser/comments.mjs", - "./parser/comment-only.mjs", - "./parser/multiline-value.mjs", - "./parser/weird-characters.mjs", - "./parser/repeated-settings.mjs", - "./parser/real.nix-daemon.mjs", - "./parser/real.maia-console@.mjs", - "./parser/real.dbus-org.bluez.mjs", - "./parser/real.display-manager.mjs", - "./parser/real.systemd-fsck-silent@.mjs", - "./parser/real.systemd-fsck-silent-root.mjs", - "./parser/real.dbus-org.freedesktop.Avahi.mjs", - "./parser/real.dbus-org.freedesktop.ModemManager1.mjs", - "./parser/real.dbus-org.freedesktop.nm-dispatcher.mjs", + "./from-primitive/basic.mjs", + "./from-primitive/comments.mjs", + "./from-primitive/comment-only.mjs", + "./from-primitive/multiline-value.mjs", + "./from-primitive/weird-characters.mjs", + "./from-primitive/repeated-settings.mjs", + "./from-primitive/real.nix-daemon.mjs", + "./from-primitive/real.maia-console@.mjs", + "./from-primitive/real.dbus-org.bluez.mjs", + "./from-primitive/real.display-manager.mjs", + "./from-primitive/real.systemd-fsck-silent@.mjs", + "./from-primitive/real.systemd-fsck-silent-root.mjs", + "./from-primitive/real.dbus-org.freedesktop.Avahi.mjs", + "./from-primitive/real.dbus-org.freedesktop.ModemManager1.mjs", + "./from-primitive/real.dbus-org.freedesktop.nm-dispatcher.mjs", ].map(file => import(file))); const results = cases.forEach(({ string, ast }) => runTest(string, ast)); })(); diff --git a/src/spec/ast-to-data/basic.mjs b/src/spec/to-primitive/basic.mjs old mode 100755 new mode 100644 similarity index 76% rename from src/spec/ast-to-data/basic.mjs rename to src/spec/to-primitive/basic.mjs index 5bc459c..e7b382b --- a/src/spec/ast-to-data/basic.mjs +++ b/src/spec/to-primitive/basic.mjs @@ -1,11 +1,13 @@ -export const input = { +export const string = `[Unit] +Description=Idle manager for Wayland`; + +export const ast = { type: 'unitFile', comments: [], sections: [ { type: 'section', title: 'Unit', - titleComment: undefined, body: [ { type: 'setting', @@ -17,7 +19,7 @@ export const input = { ] }; -export const output = [ +export const data = [ { title: 'Unit', settings: { diff --git a/src/spec/to-primitive/comment-only.mjs b/src/spec/to-primitive/comment-only.mjs new file mode 100644 index 0000000..c9e2497 --- /dev/null +++ b/src/spec/to-primitive/comment-only.mjs @@ -0,0 +1,9 @@ +export const string = `# Start of file comment`; + +export const ast = { + type: 'unitFile', + comments: [ { type: 'comment', value: 'Start of file comment' } ], + sections: [], +}; + +export const data = []; diff --git a/src/spec/to-primitive/comments.mjs b/src/spec/to-primitive/comments.mjs new file mode 100644 index 0000000..dae940b --- /dev/null +++ b/src/spec/to-primitive/comments.mjs @@ -0,0 +1,65 @@ +export const string = `[Unit] # Heading comment +Description=Idle manager for Wayland # End of value comment +# Inline comment +ExecStart=echo\ + "some string" # End of value comment +Alias=asdf # Comment Without spaces + +[Install] +# Comment only in this body`; + +export const ast = { + type: 'unitFile', + comments: [], + sections: [ + { + type: 'section', + title: 'Unit', + titleComment: { type: 'comment', value: 'Heading comment' }, + body: [ + { + type: 'setting', + name: 'Description', + value: 'Idle manager for Wayland', + comment: { type: 'comment', value: 'End of value comment' } + }, + { type: 'comment', value: 'Inline comment' }, + { + type: 'setting', + name: 'ExecStart', + value: 'echo "some string"', + comment: { type: 'comment', value: 'End of value comment' } + }, + { + type: 'setting', + name: 'Alias', + value: 'asdf', + comment: { type: 'comment', value: 'Comment Without spaces' } + } + ] + }, + { + type: 'section', + title: 'Install', + titleComment: undefined, + body: [ + { type: 'comment', value: 'Comment only in this body' }, + ] + } + ] +}; + +export const data = [ + { + title: 'Unit', + settings: { + Description: 'Idle manager for Wayland', + ExecStart: 'echo "some string"', + Alias: 'asdf', + }, + }, + { + title: 'Install', + settings: {}, + } +]; diff --git a/src/spec/to-primitive/multiline-value.mjs b/src/spec/to-primitive/multiline-value.mjs new file mode 100644 index 0000000..a212341 --- /dev/null +++ b/src/spec/to-primitive/multiline-value.mjs @@ -0,0 +1,57 @@ +export const string = `[Service] +ExecStart=/usr/bin/swayidle -w \\ + timeout 600 'swaylock-bg' \\ + timeout 900 'swaymsg "output * dpms off"' \\ + resume 'swaymsg "output * dpms on"' \\ + after-resume 'swaylock-bg' +ExecStop=/usr/bin/swayidle -w \\ + after-resume 'swaylock-bg' +ExecPause=/usr/bin/swayidle -w \\ + after-resume 'swaylock-bg'`; + +export const ast = { + type: 'unitFile', + comments: [], + sections: [ + { + type: 'section', + title: 'Service', + body: [ + { + type: 'setting', + name: 'ExecStart', + value: '/usr/bin/swayidle -w \\\n' + + " timeout 600 'swaylock-bg' \\\n" + + ` timeout 900 'swaymsg "output * dpms off"' \\\n` + + ` resume 'swaymsg "output * dpms on"' \\\n` + + " after-resume 'swaylock-bg'", + }, + { + type: 'setting', + name: 'ExecStop', + value: "/usr/bin/swayidle -w \\\n after-resume 'swaylock-bg'", + }, + { + type: 'setting', + name: 'ExecPause', + value: "/usr/bin/swayidle -w \\\n after-resume 'swaylock-bg'", + } + ] + } + ] +}; + +export const data = [ + { + title: 'Service', + settings: { + ExecStart: '/usr/bin/swayidle -w \\\n' + + " timeout 600 'swaylock-bg' \\\n" + + ` timeout 900 'swaymsg "output * dpms off"' \\\n` + + ` resume 'swaymsg "output * dpms on"' \\\n` + + " after-resume 'swaylock-bg'", + ExecStop: "/usr/bin/swayidle -w \\\n after-resume 'swaylock-bg'", + ExecPause: "/usr/bin/swayidle -w \\\n after-resume 'swaylock-bg'", + }, + }, +]; diff --git a/src/spec/to-primitive/real.dbus-org.bluez.mjs b/src/spec/to-primitive/real.dbus-org.bluez.mjs new file mode 100644 index 0000000..8e448f8 --- /dev/null +++ b/src/spec/to-primitive/real.dbus-org.bluez.mjs @@ -0,0 +1,108 @@ +export const string = `[Unit] +Description=Bluetooth service +Documentation=man:bluetoothd(8) +ConditionPathIsDirectory=/sys/class/bluetooth + +[Service] +Type=dbus +BusName=org.bluez +ExecStart=/usr/lib/bluetooth/bluetoothd +NotifyAccess=main +CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE +LimitNPROC=1 +ProtectHome=true +ProtectSystem=full + +[Install] +WantedBy=bluetooth.target +Alias=dbus-org.bluez.service`; + +export const ast = { + "type": "unitFile", + "comments": [], + "sections": [ + { + "type": "section", + "title": "Unit", + "body": [ + { + "type": "setting", + "name": "Description", + "value": "Bluetooth service" + }, + { + "type": "setting", + "name": "Documentation", + "value": "man:bluetoothd(8)" + }, + { + "type": "setting", + "name": "ConditionPathIsDirectory", + "value": "/sys/class/bluetooth" + } + ] + }, + { + "type": "section", + "title": "Service", + "body": [ + { + "type": "setting", + "name": "Type", + "value": "dbus" + }, + { + "type": "setting", + "name": "BusName", + "value": "org.bluez" + }, + { + "type": "setting", + "name": "ExecStart", + "value": "/usr/lib/bluetooth/bluetoothd" + }, + { + "type": "setting", + "name": "NotifyAccess", + "value": "main" + }, + { + "type": "setting", + "name": "CapabilityBoundingSet", + "value": "CAP_NET_ADMIN CAP_NET_BIND_SERVICE" + }, + { + "type": "setting", + "name": "LimitNPROC", + "value": "1" + }, + { + "type": "setting", + "name": "ProtectHome", + "value": "true" + }, + { + "type": "setting", + "name": "ProtectSystem", + "value": "full" + } + ] + }, + { + "type": "section", + "title": "Install", + "body": [ + { + "type": "setting", + "name": "WantedBy", + "value": "bluetooth.target" + }, + { + "type": "setting", + "name": "Alias", + "value": "dbus-org.bluez.service" + } + ] + } + ] +}; diff --git a/src/spec/to-primitive/real.dbus-org.freedesktop.Avahi.mjs b/src/spec/to-primitive/real.dbus-org.freedesktop.Avahi.mjs new file mode 100644 index 0000000..6b265f3 --- /dev/null +++ b/src/spec/to-primitive/real.dbus-org.freedesktop.Avahi.mjs @@ -0,0 +1,90 @@ +export const string = `[Unit] +Description=Avahi mDNS/DNS-SD Stack +Requires=avahi-daemon.socket + +[Service] +Type=dbus +BusName=org.freedesktop.Avahi +ExecStart=/usr/bin/avahi-daemon -s +ExecReload=/usr/bin/avahi-daemon -r +NotifyAccess=main + +[Install] +WantedBy=multi-user.target +Also=avahi-daemon.socket +Alias=dbus-org.freedesktop.Avahi.service` + +export const ast = { + "type": "unitFile", + "comments": [], + "sections": [ + { + "type": "section", + "title": "Unit", + "body": [ + { + "type": "setting", + "name": "Description", + "value": "Avahi mDNS/DNS-SD Stack" + }, + { + "type": "setting", + "name": "Requires", + "value": "avahi-daemon.socket" + } + ] + }, + { + "type": "section", + "title": "Service", + "body": [ + { + "type": "setting", + "name": "Type", + "value": "dbus" + }, + { + "type": "setting", + "name": "BusName", + "value": "org.freedesktop.Avahi" + }, + { + "type": "setting", + "name": "ExecStart", + "value": "/usr/bin/avahi-daemon -s" + }, + { + "type": "setting", + "name": "ExecReload", + "value": "/usr/bin/avahi-daemon -r" + }, + { + "type": "setting", + "name": "NotifyAccess", + "value": "main" + } + ] + }, + { + "type": "section", + "title": "Install", + "body": [ + { + "type": "setting", + "name": "WantedBy", + "value": "multi-user.target" + }, + { + "type": "setting", + "name": "Also", + "value": "avahi-daemon.socket" + }, + { + "type": "setting", + "name": "Alias", + "value": "dbus-org.freedesktop.Avahi.service" + } + ] + } + ] +}; diff --git a/src/spec/to-primitive/real.dbus-org.freedesktop.ModemManager1.mjs b/src/spec/to-primitive/real.dbus-org.freedesktop.ModemManager1.mjs new file mode 100644 index 0000000..7742fca --- /dev/null +++ b/src/spec/to-primitive/real.dbus-org.freedesktop.ModemManager1.mjs @@ -0,0 +1,132 @@ +export const string = `[Unit] +Description=Modem Manager +After=polkit.service +Requires=polkit.service + +[Service] +Type=dbus +BusName=org.freedesktop.ModemManager1 +ExecStart=/usr/bin/ModemManager +StandardError=null +Restart=on-abort +CapabilityBoundingSet=CAP_SYS_ADMIN +ProtectSystem=true +ProtectHome=true +PrivateTmp=true +RestrictAddressFamilies=AF_NETLINK AF_UNIX +NoNewPrivileges=true +User=root + +[Install] +WantedBy=multi-user.target +Alias=dbus-org.freedesktop.ModemManager1.service`; + +export const ast = { + "type": "unitFile", + "comments": [], + "sections": [ + { + "type": "section", + "title": "Unit", + "body": [ + { + "type": "setting", + "name": "Description", + "value": "Modem Manager" + }, + { + "type": "setting", + "name": "After", + "value": "polkit.service" + }, + { + "type": "setting", + "name": "Requires", + "value": "polkit.service" + } + ] + }, + { + "type": "section", + "title": "Service", + "body": [ + { + "type": "setting", + "name": "Type", + "value": "dbus" + }, + { + "type": "setting", + "name": "BusName", + "value": "org.freedesktop.ModemManager1" + }, + { + "type": "setting", + "name": "ExecStart", + "value": "/usr/bin/ModemManager" + }, + { + "type": "setting", + "name": "StandardError", + "value": "null" + }, + { + "type": "setting", + "name": "Restart", + "value": "on-abort" + }, + { + "type": "setting", + "name": "CapabilityBoundingSet", + "value": "CAP_SYS_ADMIN" + }, + { + "type": "setting", + "name": "ProtectSystem", + "value": "true" + }, + { + "type": "setting", + "name": "ProtectHome", + "value": "true" + }, + { + "type": "setting", + "name": "PrivateTmp", + "value": "true" + }, + { + "type": "setting", + "name": "RestrictAddressFamilies", + "value": "AF_NETLINK AF_UNIX" + }, + { + "type": "setting", + "name": "NoNewPrivileges", + "value": "true" + }, + { + "type": "setting", + "name": "User", + "value": "root" + } + ] + }, + { + "type": "section", + "title": "Install", + "body": [ + { + "type": "setting", + "name": "WantedBy", + "value": "multi-user.target" + }, + { + "type": "setting", + "name": "Alias", + "value": "dbus-org.freedesktop.ModemManager1.service" + } + ] + } + ] +}; diff --git a/src/spec/to-primitive/real.dbus-org.freedesktop.nm-dispatcher.mjs b/src/spec/to-primitive/real.dbus-org.freedesktop.nm-dispatcher.mjs new file mode 100644 index 0000000..09abdd9 --- /dev/null +++ b/src/spec/to-primitive/real.dbus-org.freedesktop.nm-dispatcher.mjs @@ -0,0 +1,66 @@ +export const string = `[Unit] +Description=Network Manager Script Dispatcher Service + +[Service] +Type=dbus +BusName=org.freedesktop.nm_dispatcher +ExecStart=/usr/lib/nm-dispatcher +KillMode=process + +[Install] +Alias=dbus-org.freedesktop.nm-dispatcher.service`; + +export const ast = { + "type": "unitFile", + "comments": [], + "sections": [ + { + "type": "section", + "title": "Unit", + "body": [ + { + "type": "setting", + "name": "Description", + "value": "Network Manager Script Dispatcher Service" + } + ] + }, + { + "type": "section", + "title": "Service", + "body": [ + { + "type": "setting", + "name": "Type", + "value": "dbus" + }, + { + "type": "setting", + "name": "BusName", + "value": "org.freedesktop.nm_dispatcher" + }, + { + "type": "setting", + "name": "ExecStart", + "value": "/usr/lib/nm-dispatcher" + }, + { + "type": "setting", + "name": "KillMode", + "value": "process" + } + ] + }, + { + "type": "section", + "title": "Install", + "body": [ + { + "type": "setting", + "name": "Alias", + "value": "dbus-org.freedesktop.nm-dispatcher.service" + } + ] + } + ] +}; diff --git a/src/spec/to-primitive/real.display-manager.mjs b/src/spec/to-primitive/real.display-manager.mjs new file mode 100644 index 0000000..c0c35e1 --- /dev/null +++ b/src/spec/to-primitive/real.display-manager.mjs @@ -0,0 +1,90 @@ +export const string = `[Unit] +Description=TUI display manager +After=systemd-user-sessions.service plymouth-quit-wait.service +After=getty@tty2.service + +[Service] +Type=idle +ExecStart=/usr/bin/ly +StandardInput=tty +TTYPath=/dev/tty2 +TTYReset=yes +TTYVHangup=yes + +[Install] +Alias=display-manager.service`; + +export const ast = { + "type": "unitFile", + "comments": [], + "sections": [ + { + "type": "section", + "title": "Unit", + "body": [ + { + "type": "setting", + "name": "Description", + "value": "TUI display manager" + }, + { + "type": "setting", + "name": "After", + "value": "systemd-user-sessions.service plymouth-quit-wait.service" + }, + { + "type": "setting", + "name": "After", + "value": "getty@tty2.service" + } + ] + }, + { + "type": "section", + "title": "Service", + "body": [ + { + "type": "setting", + "name": "Type", + "value": "idle" + }, + { + "type": "setting", + "name": "ExecStart", + "value": "/usr/bin/ly" + }, + { + "type": "setting", + "name": "StandardInput", + "value": "tty" + }, + { + "type": "setting", + "name": "TTYPath", + "value": "/dev/tty2" + }, + { + "type": "setting", + "name": "TTYReset", + "value": "yes" + }, + { + "type": "setting", + "name": "TTYVHangup", + "value": "yes" + } + ] + }, + { + "type": "section", + "title": "Install", + "body": [ + { + "type": "setting", + "name": "Alias", + "value": "display-manager.service" + } + ] + } + ] +}; diff --git a/src/spec/to-primitive/real.maia-console@.mjs b/src/spec/to-primitive/real.maia-console@.mjs new file mode 100644 index 0000000..bae85eb --- /dev/null +++ b/src/spec/to-primitive/real.maia-console@.mjs @@ -0,0 +1,104 @@ +export const string = `[Unit] +Description=maia color scheme for the console +After=getty@%i.service + +[Service] +Type=oneshot +ExecStart=/usr/bin/maia-console +StandardOutput=tty +TTYPath=/dev/%i +TTYVTDisallocate=yes + +[Install] +WantedBy=getty@%i.service`; + +export const ast = { + "type": "unitFile", + "comments": [], + "sections": [ + { + "type": "section", + "title": "Unit", + "body": [ + { + "type": "setting", + "name": "Description", + "value": "maia color scheme for the console" + }, + { + "type": "setting", + "name": "After", + "value": "getty@%i.service" + } + ] + }, + { + "type": "section", + "title": "Service", + "body": [ + { + "type": "setting", + "name": "Type", + "value": "oneshot" + }, + { + "type": "setting", + "name": "ExecStart", + "value": "/usr/bin/maia-console" + }, + { + "type": "setting", + "name": "StandardOutput", + "value": "tty" + }, + { + "type": "setting", + "name": "TTYPath", + "value": "/dev/%i" + }, + { + "type": "setting", + "name": "TTYVTDisallocate", + "value": "yes" + } + ] + }, + { + "type": "section", + "title": "Install", + "body": [ + { + "type": "setting", + "name": "WantedBy", + "value": "getty@%i.service" + } + ] + } + ] +}; + +export const data = [ + { + title: 'Unit', + settings: { + Description: 'maia color scheme for the console', + After: 'getty@%i.service', + }, + }, + { + title: 'Service', + settings: { + Type: 'oneshot', + ExecStart: '/usr/bin/maia-console', + StandardOutput: 'tty', + TTYPath: '/dev/%i', + TTYVTDisallocate: 'yes', + }, + }, + { + title: 'Install', + settings: { + WantedBy: 'getty@%i.service', + }, + }, +]; diff --git a/src/spec/to-primitive/real.nix-daemon.mjs b/src/spec/to-primitive/real.nix-daemon.mjs new file mode 100644 index 0000000..146bbda --- /dev/null +++ b/src/spec/to-primitive/real.nix-daemon.mjs @@ -0,0 +1,99 @@ +export const string = `[Unit] +Description=Nix Daemon +RequiresMountsFor=/nix/store +RequiresMountsFor=/nix/var +ConditionPathIsReadWrite=/nix/var/nix/daemon-socket + +[Service] +ExecStart=@/nix/store/fwak7l5jjl0py4wldsqjbv7p7rdzql0b-nix-2.3.9/bin/nix-daemon nix-daemon --daemon +KillMode=process + +[Install] +WantedBy=multi-user.target`; + +export const ast = { + "type": "unitFile", + "comments": [], + "sections": [ + { + "type": "section", + "title": "Unit", + "body": [ + { + "type": "setting", + "name": "Description", + "value": "Nix Daemon" + }, + { + "type": "setting", + "name": "RequiresMountsFor", + "value": "/nix/store" + }, + { + "type": "setting", + "name": "RequiresMountsFor", + "value": "/nix/var" + }, + { + "type": "setting", + "name": "ConditionPathIsReadWrite", + "value": "/nix/var/nix/daemon-socket" + } + ] + }, + { + "type": "section", + "title": "Service", + "body": [ + { + "type": "setting", + "name": "ExecStart", + "value": "@/nix/store/fwak7l5jjl0py4wldsqjbv7p7rdzql0b-nix-2.3.9/bin/nix-daemon nix-daemon --daemon" + }, + { + "type": "setting", + "name": "KillMode", + "value": "process" + } + ] + }, + { + "type": "section", + "title": "Install", + "body": [ + { + "type": "setting", + "name": "WantedBy", + "value": "multi-user.target" + } + ] + } + ] +}; + +export const data = [ + { + title: 'Unit', + settings: { + Description: 'Nix Daemon', + RequiresMountsFor: [ + '/nix/store', + '/nix/var', + ], + ConditionPathIsReadWrite: '/nix/var/nix/daemon-socket', + }, + }, + { + title: 'Service', + settings: { + ExecStart: '@/nix/store/fwak7l5jjl0py4wldsqjbv7p7rdzql0b-nix-2.3.9/bin/nix-daemon nix-daemon --daemon', + KillMode: 'process', + }, + }, + { + title: 'Install', + settings: { + WantedBy: 'multi-user.target', + }, + }, +]; diff --git a/src/spec/to-primitive/real.systemd-fsck-silent-root.mjs b/src/spec/to-primitive/real.systemd-fsck-silent-root.mjs new file mode 100644 index 0000000..54f1374 --- /dev/null +++ b/src/spec/to-primitive/real.systemd-fsck-silent-root.mjs @@ -0,0 +1,88 @@ +export const string = `[Unit] +Description=File System Check on Root Device +Documentation=man:systemd-fsck-root.service(8) +DefaultDependencies=no +Before=local-fs.target shutdown.target +ConditionPathIsReadWrite=!/ + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/lib/systemd/systemd-fsck +StandardOutput=null +StandardError=journal+console +TimeoutSec=0`; + +export const ast = { + "type": "unitFile", + "comments": [], + "sections": [ + { + "type": "section", + "title": "Unit", + "body": [ + { + "type": "setting", + "name": "Description", + "value": "File System Check on Root Device" + }, + { + "type": "setting", + "name": "Documentation", + "value": "man:systemd-fsck-root.service(8)" + }, + { + "type": "setting", + "name": "DefaultDependencies", + "value": "no" + }, + { + "type": "setting", + "name": "Before", + "value": "local-fs.target shutdown.target" + }, + { + "type": "setting", + "name": "ConditionPathIsReadWrite", + "value": "!/" + } + ] + }, + { + "type": "section", + "title": "Service", + "body": [ + { + "type": "setting", + "name": "Type", + "value": "oneshot" + }, + { + "type": "setting", + "name": "RemainAfterExit", + "value": "yes" + }, + { + "type": "setting", + "name": "ExecStart", + "value": "/usr/lib/systemd/systemd-fsck" + }, + { + "type": "setting", + "name": "StandardOutput", + "value": "null" + }, + { + "type": "setting", + "name": "StandardError", + "value": "journal+console" + }, + { + "type": "setting", + "name": "TimeoutSec", + "value": "0" + } + ] + } + ] +}; diff --git a/src/spec/to-primitive/real.systemd-fsck-silent@.mjs b/src/spec/to-primitive/real.systemd-fsck-silent@.mjs new file mode 100644 index 0000000..3323338 --- /dev/null +++ b/src/spec/to-primitive/real.systemd-fsck-silent@.mjs @@ -0,0 +1,94 @@ +export const string = `[Unit] +Description=File System Check on %f +Documentation=man:systemd-fsck@.service(8) +DefaultDependencies=no +BindsTo=%i.device +After=%i.device systemd-fsck-silent-root.service local-fs-pre.target +Before=systemd-quotacheck.service shutdown.target + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/lib/systemd/systemd-fsck +StandardOutput=null +StandardError=journal+console +TimeoutSec=0`; + +export const ast = { + "type": "unitFile", + "comments": [], + "sections": [ + { + "type": "section", + "title": "Unit", + "body": [ + { + "type": "setting", + "name": "Description", + "value": "File System Check on %f" + }, + { + "type": "setting", + "name": "Documentation", + "value": "man:systemd-fsck@.service(8)" + }, + { + "type": "setting", + "name": "DefaultDependencies", + "value": "no" + }, + { + "type": "setting", + "name": "BindsTo", + "value": "%i.device" + }, + { + "type": "setting", + "name": "After", + "value": "%i.device systemd-fsck-silent-root.service local-fs-pre.target" + }, + { + "type": "setting", + "name": "Before", + "value": "systemd-quotacheck.service shutdown.target" + } + ] + }, + { + "type": "section", + "title": "Service", + "body": [ + { + "type": "setting", + "name": "Type", + "value": "oneshot" + }, + { + "type": "setting", + "name": "RemainAfterExit", + "value": "yes" + }, + { + "type": "setting", + "name": "ExecStart", + "value": "/usr/lib/systemd/systemd-fsck" + }, + { + "type": "setting", + "name": "StandardOutput", + "value": "null" + }, + { + "type": "setting", + "name": "StandardError", + "value": "journal+console" + }, + { + "type": "setting", + "name": "TimeoutSec", + "value": "0" + } + ] + } + ] +}; diff --git a/src/spec/to-primitive/repeated-settings.mjs b/src/spec/to-primitive/repeated-settings.mjs new file mode 100644 index 0000000..271c271 --- /dev/null +++ b/src/spec/to-primitive/repeated-settings.mjs @@ -0,0 +1,45 @@ +export const string = `[Install] +After=something.service +After=something-else.service +After=something-different.service`; + +export const ast = { + type: 'unitFile', + comments: [], + sections: [ + { + type: 'section', + title: 'Install', + body: [ + { + type: 'setting', + name: 'After', + value: 'something.service', + }, + { + type: 'setting', + name: 'After', + value: 'something-else.service', + }, + { + type: 'setting', + name: 'After', + value: 'something-different.service', + } + ] + } + ] +}; + +export const data = [ + { + title: 'Install', + settings: { + After: [ + 'something.service', + 'something-else.service', + 'something-different.service', + ], + }, + } +]; diff --git a/src/spec/to-primitive/weird-characters.mjs b/src/spec/to-primitive/weird-characters.mjs new file mode 100644 index 0000000..85278d9 --- /dev/null +++ b/src/spec/to-primitive/weird-characters.mjs @@ -0,0 +1,29 @@ +export const string = `[Install] +Description=Test description(1) https://something/? \\#`; + +export const ast = { + type: 'unitFile', + comments: [], + sections: [ + { + type: 'section', + title: 'Install', + body: [ + { + type: 'setting', + name: 'Description', + value: 'Test description(1) https://something/? \\#', + } + ] + } + ] +}; + +export const data = [ + { + title: 'Install', + settings: { + Description: 'Test description(1) https://something/? \\#', + }, + } +]; diff --git a/src/string-to-ast.mjs b/src/string-to-ast.mjs old mode 100755 new mode 100644 diff --git a/src/string-to-data.mjs b/src/string-to-data.mjs old mode 100755 new mode 100644 diff --git a/src/visitor-creator.mjs b/src/visitor-creator.mjs old mode 100755 new mode 100644