From b710a0448248e58dbb8a229a2f322b404c33738e Mon Sep 17 00:00:00 2001 From: Matteo Cristino <102997993+matteo-cristino@users.noreply.github.com> Date: Tue, 17 Sep 2024 11:02:11 +0200 Subject: [PATCH] feat: add autocomplete and computed grammar (#199) * feat: add autocomplete for some Given statement examples * chore: change to snippet completition * feat: autogenerate list of autocomplete statements * ci: now grammar build is not automatic with packages installation * fix: include missing file * chore: add missing license headers * add pnpm build to build:grammar * feat: add case Insensitive grammar and syntax highlighting * chore: make autocomplete case insensitive * fix: fix error in then autocomplete * chore: add autocomplete for then statements * fix: add G for complete Given statements * fix(grammar): add missing single quotes * ci(grammar): use correct command to build grammar package * chore: apply prettier to grammar code --------- Co-authored-by: FilippoTrotter --- .github/workflows/grammar.yml | 2 + .gitignore | 5 +- .prettierignore | 4 + grammar/package.json | 7 +- grammar/rollup.config.js | 25 +- grammar/src/complete.ts | 59 +++ grammar/src/index.ts | 69 ++-- grammar/src/syntax.grammar | 361 ++++++++--------- grammar/src/syntax.grammar.d.ts | 4 +- grammar/src/syntax.grammar.terms.d.ts | 2 +- grammar/src/tokens.js | 399 ++++++++++++++++++- grammar/test/cases.txt | 551 +++++++++++++++----------- grammar/test/test.js | 25 +- grammar/tsconfig.json | 17 +- grammar/utils/package.json | 28 ++ grammar/utils/package.json.license | 3 + grammar/utils/prepare_complete.mjs | 71 ++++ package.json | 3 +- pnpm-lock.yaml | 318 ++++++--------- pnpm-workspace.yaml | 1 + 20 files changed, 1247 insertions(+), 707 deletions(-) create mode 100644 grammar/src/complete.ts create mode 100644 grammar/utils/package.json create mode 100644 grammar/utils/package.json.license create mode 100644 grammar/utils/prepare_complete.mjs diff --git a/.github/workflows/grammar.yml b/.github/workflows/grammar.yml index 997bdd96..573e5b51 100644 --- a/.github/workflows/grammar.yml +++ b/.github/workflows/grammar.yml @@ -26,6 +26,8 @@ jobs: steps: - name: 🛠️ Prepare pnpm workspace uses: dyne/pnpm@main + with: + build: pnpm build:grammar - name: 📦 Releases working-directory: ./grammar run: npx semantic-release diff --git a/.gitignore b/.gitignore index b55f7165..afe12af8 100644 --- a/.gitignore +++ b/.gitignore @@ -79,5 +79,6 @@ node_modules !/grammar/.releaserc !/grammar/src/syntax.grammar.terms.d.ts !/grammar/src/tokens.js - - +!/grammar/src/complete.ts +!/grammar/utils/package.json +!/grammar/utils/prepare_complete.mjs diff --git a/.prettierignore b/.prettierignore index 7b0ce354..a0473a26 100644 --- a/.prettierignore +++ b/.prettierignore @@ -28,3 +28,7 @@ pkg/*/node_modules/ !/pkg/**/*.test.ts !docs/.vitepress/config.mts + +# grammar +!/grammar/src/index.ts +!/grammar/utils/prepare_complete.mjs diff --git a/grammar/package.json b/grammar/package.json index a8cb35d6..48516f47 100644 --- a/grammar/package.json +++ b/grammar/package.json @@ -4,7 +4,7 @@ "description": "Slangroom lezer grammar for syntax highlighting on Codemirror", "scripts": { "test": "mocha test/test.js", - "prepare": "rollup -c" + "build": "pnpm -C utils run grammar-prepare && rollup -c" }, "author": { "name": "Filippo Trotter" @@ -42,10 +42,11 @@ "mocha": "^9.0.1", "rollup": "^2.60.2", "rollup-plugin-dts": "^4.0.1", - "rollup-plugin-ts": "^3.0.2", "semantic-release": "^24.1.0", "semantic-release-commit-filter": "^1.0.2", - "typescript": "^4.3.4" + "typescript": "^4.3.4", + "@rollup/plugin-typescript": "^11.1.6", + "@rollup/plugin-json": "^6.0.0" }, "license": "AGPL-3.0-or-later" } diff --git a/grammar/rollup.config.js b/grammar/rollup.config.js index 0320af25..2e3fbfd8 100644 --- a/grammar/rollup.config.js +++ b/grammar/rollup.config.js @@ -2,15 +2,20 @@ // // SPDX-License-Identifier: AGPL-3.0-or-later -import typescript from "rollup-plugin-ts" -import {lezer} from "@lezer/generator/rollup" +import typescript from '@rollup/plugin-typescript'; +import { lezer } from '@lezer/generator/rollup'; export default { - input: "src/index.ts", - external: id => id != "tslib" && !/^(\.?\/|\w:)/.test(id), - output: [ - {file: "dist/index.cjs", format: "cjs"}, - {dir: "./dist", format: "es"} - ], - plugins: [lezer(), typescript()] -} + input: 'src/index.ts', + external: (id) => id != 'tslib' && !/^(\.?\/|\w:)/.test(id), + output: [ + { file: 'dist/index.cjs', format: 'cjs' }, + { dir: './dist', format: 'es' }, + ], + plugins: [ + typescript({ + exclude: ['./utils/*'], + }), + lezer(), + ], +}; diff --git a/grammar/src/complete.ts b/grammar/src/complete.ts new file mode 100644 index 00000000..b473c074 --- /dev/null +++ b/grammar/src/complete.ts @@ -0,0 +1,59 @@ +// SPDX-FileCopyrightText: 2024 Dyne.org foundation +// +// SPDX-License-Identifier: AGPL-3.0-or-later + +import { CompletionContext, snippetCompletion } from '@codemirror/autocomplete'; +import { fullStatementTemplates } from './complete_statement'; + +// Helper function to strip quotes from matched strings +function stripQuotes(s: string) { + return s.replace(/^'|'$/g, ''); +} + +const fullStatementSnippets = fullStatementTemplates.map((x) => { + let n = 1; + return snippetCompletion( + x.label.replace(/''/g, () => `'\${${n++}:}'`), + x, + ); +}); + +export function completeStatement(context: CompletionContext) { + const line = context.state.doc.lineAt(context.pos); + let textBefore = context.state.sliceDoc(line.from, context.pos); + const triggerMatch = /^[GT].*$/i.exec(textBefore); + + if (triggerMatch) { + const strings = textBefore.match(/'([^']*)'/g); + textBefore = textBefore.toLowerCase(); + if (!strings) { + return { + from: context.pos - triggerMatch[0].length, + options: fullStatementSnippets, + validFor: /^.*$/, + }; + } + + const strippedStrings = strings.map(stripQuotes); + + const templateOption = fullStatementTemplates.map((x) => { + let n = 1; + let m = 0; + return snippetCompletion( + x.label.replace(/''/g, () => `'\${${n}:${strippedStrings[n++ - 1] || ''}}'`), + { + label: x.label.replace(/''/g, () => `${strings[m++] || "''"}`), + type: x.type, + }, + ); + }); + + return { + from: context.pos - textBefore.length, + options: templateOption, + validFor: /^.*$/, + }; + } + + return null; +} diff --git a/grammar/src/index.ts b/grammar/src/index.ts index a7159dae..dc5f040a 100644 --- a/grammar/src/index.ts +++ b/grammar/src/index.ts @@ -2,52 +2,55 @@ // // SPDX-License-Identifier: AGPL-3.0-or-later -import { parser } from "./syntax.grammar" -import { LRLanguage, LanguageSupport, HighlightStyle, syntaxHighlighting } from "@codemirror/language" -import { styleTags, tags as t } from "@lezer/highlight" -import { completeFromList } from "@codemirror/autocomplete" +import { parser } from './syntax.grammar'; +import { + LRLanguage, + LanguageSupport, + HighlightStyle, + syntaxHighlighting, +} from '@codemirror/language'; +import { styleTags, tags as t } from '@lezer/highlight'; +import { completeStatement } from './complete'; const syntax_colors = syntaxHighlighting( HighlightStyle.define( - [ - { tag: t.heading, color: "purple" }, - { tag: t.heading1, color: "gray" }, - {tag: t.variableName, color: "red"}, - { tag: t.keyword, color: "green" }, - {tag: t.string, color: "blue"}, - {tag: t.lineComment, color: "gray"}, - {tag: t.heading2, color: "black"} - ], - { all: { color: "black" } } - ) - ); + [ + { tag: t.heading, color: 'purple' }, + { tag: t.heading1, color: 'gray' }, + { tag: t.variableName, color: 'red' }, + { tag: t.keyword, color: 'green' }, + { tag: t.string, color: 'blue' }, + { tag: t.lineComment, color: 'gray' }, + { tag: t.heading2, color: 'black' }, + ], + { all: { color: 'black' } }, + ), +); + export const SlangroomLanguage = LRLanguage.define({ parser: parser.configure({ props: [ styleTags({ - "Given Then When and in inside If EndIf Foreach EndForeach" : t.variableName, - "have send open connect print output" : t.keyword, - "Rule VersionRule! UnknownIgnoreRule! GenericRule!": t.heading, - " Scenario ScenarioType/... ScenarioComment!": t.heading1, - "DbAction! EthereumAction! FsAction! GitAction! HelpersAction! HttpAction! JsonSchemaAction! OAuthAction! PocketbaseAction! QrCodeAction! RedisAction! ShellAction! TimestampAction! WalletAction! ZencodeAction!": t.heading2, + 'given then when and in inside if endif foreach endforeach': t.variableName, + 'have send open connect print output': t.keyword, + 'rule VersionRule! GenericRule!': t.heading, + 'scenario ScenarioType/... ScenarioComment!': t.heading1, + 'DbAction! EthereumAction! FsAction! GitAction! HelpersAction! HttpAction! JsonSchemaAction! OAuthAction! PocketbaseAction! QrCodeAction! RedisAction! ShellAction! TimestampAction! WalletAction! ZencodeAction!': + t.heading2, StringLiteral: t.string, Comment: t.lineComment, - }) - ] + }), + ], }), languageData: { - commentTokens: { line: "#" } - } -}) + commentTokens: { line: '#' }, + }, +}); const ac = SlangroomLanguage.data.of({ - autocomplete: completeFromList([ - { label: "given", type: "keyword" }, - { label: "then", type: "keyword" }, - { label: "when", type: "keyword" } - ]) -}) + autocomplete: completeStatement, +}); export function Slangroom() { - return new LanguageSupport(SlangroomLanguage, [syntax_colors, ac]) + return new LanguageSupport(SlangroomLanguage, [syntax_colors, ac]); } diff --git a/grammar/src/syntax.grammar b/grammar/src/syntax.grammar index bd7f7c08..acc90533 100644 --- a/grammar/src/syntax.grammar +++ b/grammar/src/syntax.grammar @@ -15,11 +15,11 @@ SlangroomStatement { } RuleStatement { - kw<"Rule"> (VersionRule | UnknownIgnoreRule | GenericRule) ( newline+ | eof ) + rule (VersionRule | GenericRule) ( newline+ | eof ) } ScenarioStatement { - kw<"Scenario"> ScenarioType ScenarioComment? ( newline+ | eof ) + scenario ScenarioType ScenarioComment? ( newline+ | eof ) } ScenarioType { (StringLiteral| Identifier | Keywords) @@ -28,11 +28,7 @@ ScenarioComment { ":" (Identifier | Keywords | StringLiteral)* } VersionRule { - kw<"version"> VersionNumber -} - -UnknownIgnoreRule { - kw<"unknown"> kw<"ignore"> + version VersionNumber } GenericRule { @@ -48,396 +44,383 @@ VersionNumber { } GivenStatement { - kw<"Given"> kw<"I"> + given I (DbStatement | EthereumStatement | FsStatement | GitStatement | HelpersStatement | HttpStatement | JsonSchemaStatement | OAuthStatement | PocketbaseStatement | QrCodeStatement | RedisStatement | ShellStatement | TimestampStatement | WalletStatement | ZencodeStatement) ( newline+ | eof ) } ThenStatement { - kw<"Then"> kw<"I"> + then I (DbStatement | EthereumStatement | FsStatement | GitStatement | HelpersStatement | HttpStatement | JsonSchemaStatement | OAuthStatement | PocketbaseStatement | QrCodeStatement | RedisStatement | ShellStatement | TimestampStatement | WalletStatement | ZencodeStatement) ( newline+ | eof ) } ThenPrint { - kw<"Then"> kw<"I">? kw<"print"> (StringLiteral | Identifier | Keywords)+ (newline kw<"and"> +kw<"I"> kw<"print"> (StringLiteral | Identifier | Keywords)+)* ( newline+ | eof ) + then I? print (StringLiteral | Identifier | Keywords)+ (newline and +I print (StringLiteral | Identifier | Keywords)+)* ( newline+ | eof ) } GivenHaveStatement { - kw<"Given"> kw<"that">? kw<"I"> kw<"have"> (kw<"a">? | kw<"my">? | kw<"the">?) kw<"valid">? StringLiteral kw<"named">? StringLiteral? (kw<"inside"> | kw<"in">)? kw<"named">? StringLiteral? - (newline* kw <"and"> kw<"I"> kw<"have"> (kw<"a">? | kw<"my">?) kw<"valid">? StringLiteral kw<"named">? StringLiteral? (kw<"inside"> | kw<"in">)? kw<"named">? StringLiteral?)* ( newline+ | eof ) + given that? I have (a? | my? | the?) valid? StringLiteral named? StringLiteral? (inside | in)? named? StringLiteral? + (newline* and I have (a? | my?) valid? StringLiteral named? StringLiteral? (inside | in)? named? StringLiteral?)* ( newline+ | eof ) } HaveStatement{ - newline+ kw<"and"> kw<"I"> kw<"have"> (kw<"a">? | kw<"my">?) kw<"valid">? StringLiteral kw<"named">? StringLiteral? (kw<"inside"> | kw<"in">)? kw<"named">? StringLiteral? + newline+ and I have (a? | my?) valid? StringLiteral named? StringLiteral? (inside | in)? named? StringLiteral? } GivenName { - ((kw<"Given"> kw<"I"> kw<"am"> - (kw<"known"> kw<"as">)? StringLiteral) | - (kw<"Given"> kw<"I">? kw<"my"> kw<"name"> kw<"is"> + ((given I am + (known as)? StringLiteral) | + (given I? my name is (Identifier | Keywords | StringLiteral)+)) HaveStatement* ( newline+ | eof ) } WhenStatement { - kw<"When"> kw<"I"> (Identifier | Keywords | StringLiteral)+ (newline kw<"and"> kw<"I"> (Identifier | Keywords | StringLiteral)+)* (newline+ | eof) + when I (Identifier | Keywords | StringLiteral)+ (newline and I (Identifier | Keywords | StringLiteral)+)* (newline+ | eof) } IfEndifStatement{ - Condition+ ( GivenStatement | WhenStatement | ThenStatement | ThenPrint)* kw<"EndIf"> ( newline+ | eof ) + Condition+ ( GivenStatement | WhenStatement | ThenStatement | ThenPrint)* endif ( newline+ | eof ) } Condition { - kw<"If"> kw<"I"> kw<"verify"> (Identifier | Keywords | StringLiteral)+ ( newline+ | eof ) + if I verify (Identifier | Keywords | StringLiteral)+ ( newline+ | eof ) } ForEachStatement { - kw<"Foreach"> (StringLiteral | Identifier | Keywords) (kw<"in"> | kw<"inside">) (StringLiteral | Identifier | Keywords)+ newline+ (GivenStatement | WhenStatement | ThenStatement | ThenPrint)* - kw<"EndForeach"> ( newline+ | eof ) + foreach (StringLiteral | Identifier | Keywords) (in | inside) (StringLiteral | Identifier | Keywords)+ newline+ (GivenStatement | WhenStatement | ThenStatement | ThenPrint)* + endforeach ( newline+ | eof ) } // ===== Plugin-Specific Statements ===== DbStatement { - DbConnectAction (kw<"and">? SaveAction)* + DbConnectAction (and? SaveAction)* } EthereumStatement { - EthereumConnectAction (kw<"and">? SaveAction)* + EthereumConnectAction (and? SaveAction)* } FsStatement { - FsConnectAction (kw<"and">? SaveAction)* + FsConnectAction (and? SaveAction)* } GitStatement { - GitOpenOrConnectAction (kw<"and">? SaveAction)* + GitOpenOrConnectAction (and? SaveAction)* } HelpersStatement { - (HelpersSend | HelpersAction) (kw<"and">? SaveAction)* + (HelpersSend | HelpersAction) (and? SaveAction)* } HttpStatement { - HttpConnectAction (kw<"and">? SaveAction)* + HttpConnectAction (and? SaveAction)* } JsonSchemaStatement { - JsonSchemaSend (kw<"and">? SaveAction)* + JsonSchemaSend (and? SaveAction)* } OAuthStatement { - OAuthSend (kw<"and">? SaveAction)* + OAuthSend (and? SaveAction)* } PocketbaseStatement { - PocketbaseConnectAction (kw<"and">? SaveAction)* + PocketbaseConnectAction (and? SaveAction)* } QrCodeStatement { - QrCodeSend (kw<"and">? SaveAction)* + QrCodeSend (and? SaveAction)* } RedisStatement { - RedisConnectAction (kw<"and">? SaveAction)* + RedisConnectAction (and? SaveAction)* } ShellStatement { - ShellSend (kw<"and">? SaveAction)* + ShellSend (and? SaveAction)* } TimestampStatement { - TimestampAction (kw<"and">? SaveAction)* + TimestampAction (and? SaveAction)* } WalletStatement { - (WalletSend| WalletAction) (kw<"and">? SaveAction)* + (WalletSend| WalletAction) (and? SaveAction)* } ZencodeStatement { - ZencodeSend (kw<"and">? SaveAction)* + ZencodeSend (and? SaveAction)* } // ===== Connect Actions ===== DbConnectAction { - ((kw<"connect"> kw<"to"> StringLiteral) kw<"and">)? DbSend + ((connect to StringLiteral) and)? DbSend } EthereumConnectAction { - ((kw<"connect"> kw<"to"> StringLiteral) kw<"and">)? (EthereumSend | EthereumAction) + ((connect to StringLiteral) and)? (EthereumSend | EthereumAction) } FsConnectAction { - ((kw<"connect"> kw<"to"> StringLiteral) kw<"and">)? FsSend + ((connect to StringLiteral) and)? FsSend } GitOpenOrConnectAction { - ((kw<"open"> kw<"the"> StringLiteral | kw<"connect"> kw<"to"> StringLiteral) kw<"and">)? (GitSend | GitAction) + ((open the StringLiteral | connect to StringLiteral) and)? (GitSend | GitAction) } HttpConnectAction { - ((kw<"connect"> kw<"to"> StringLiteral) kw<"and">)? (HttpSend | HttpAction) + ((connect to StringLiteral) and)? (HttpSend | HttpAction) } PocketbaseConnectAction { - ((kw<"connect"> kw<"to"> StringLiteral) kw<"and">)? (PocketbaseSend | PocketbaseAction) + ((connect to StringLiteral) and)? (PocketbaseSend | PocketbaseAction) } RedisConnectAction { - ((kw<"connect"> kw<"to"> StringLiteral) kw<"and">)? RedisSend + ((connect to StringLiteral) and)? RedisSend } // ===== Send Actions ===== DbSend { - ((kw<"send"> (kw<"statement"> | kw<"parameters"> | kw<"record"> | kw<"table"> | kw<"variable"> | kw<"name">) StringLiteral) kw<"and">) - (DbAction | DbSend) + ((send (statement | parameters | record | table | variable | name) StringLiteral) and) + (DbAction | DbSend ) } EthereumSend { - ((kw<"send"> (kw<"address"> | kw<"transaction_id"> | kw<"addresses"> | kw<"transaction"> | kw<"sc">) StringLiteral) kw<"and">) + ((send (address | transaction_id | addresses | transaction | sc) StringLiteral) and) (EthereumAction | EthereumSend) } FsSend { - ((kw<"send"> (kw<"path"> | kw<"content">) StringLiteral) kw<"and">) + ((send (path | content) StringLiteral) and) (FsAction | FsSend) } GitSend { - ((kw<"send"> (kw<"path"> | kw<"commit">) StringLiteral) kw<"and">) GitAction + ((send (path | commit) StringLiteral) and) GitAction } HelpersSend { - ((kw<"send"> (kw<"path"> | kw<"paths"> | kw<"object"> | kw<"value"> | kw<"sources"> | kw<"array"> | kw<"values"> | kw<"properties">) StringLiteral) kw<"and">) + ((send (path | paths | object | value | sources | array | values | properties) StringLiteral) and) (HelpersAction | HelpersSend) } HttpSend { - ((kw<"send"> (kw<"headers"> | kw<"object">) StringLiteral) kw<"and">) + ((send (headers | object) StringLiteral) and) (HttpAction | HttpSend) } JsonSchemaSend { - ((kw<"send"> (kw<"json_data"> | kw<"json_schema">) StringLiteral) kw<"and">) + ((send (json_data | json_schema) StringLiteral) and) (JsonSchemaAction | JsonSchemaSend) } OAuthSend { - ((kw<"send"> (kw<"request"> | kw<"server_data"> | kw<"client"> | kw<"expires_in"> | kw<"token"> | kw<"request_uri"> | kw<"data">) StringLiteral) kw<"and">) + ((send (request | server_data | client | expires_in | token | request_uri | data) StringLiteral) and) (OAuthAction | OAuthSend) } PocketbaseSend { - ((kw<"send"> (kw<"my_credentials"> | kw<"email"> | kw<"list_parameters"> | kw<"show_parameters"> | kw<"create_parameters"> | kw<"record_parameters"> | kw<"update_parameters"> | kw<"delete_parameters"> | kw<"url"> | kw<"send_parameters">) StringLiteral) kw<"and">) + ((send (my_credentials | email | list_parameters | show_parameters | create_parameters | record_parameters | update_parameters | delete_parameters | url | send_parameters) StringLiteral) and) (PocketbaseAction | PocketbaseSend) } QrCodeSend { - ((kw<"send"> kw<"text"> StringLiteral) kw<"and">) QrCodeAction + ((send text StringLiteral) and) QrCodeAction } RedisSend { - ((kw<"send"> (kw<"key"> | kw<"object">) StringLiteral) kw<"and">) + ((send (key | object) StringLiteral) and) (RedisAction | RedisSend) } ShellSend { - ((kw<"send"> (kw<"command">) StringLiteral) kw<"and">) ShellAction + ((send (command) StringLiteral) and) ShellAction } WalletSend { - ((kw<"send"> (kw<"jwk"> | kw<"object"> | kw<"holder"> | kw<"fields"> | kw<"verifier_url"> | kw<"issued_vc"> | kw<"disclosed"> | kw<"nonce"> | kw<"sk"> | kw<"token">) StringLiteral) kw<"and">) + ((send (jwk | object | holder | fields | verifier_url | issued_vc | disclosed | nonce | sk | token) StringLiteral) and) (WalletAction | WalletSend) } ZencodeSend { - ((kw<"send"> (kw<"script"> | kw<"data"> | kw<"keys"> | kw<"extra"> | kw<"conf">) StringLiteral) kw<"and">) + ((send (script | data | keys | extra | conf) StringLiteral) and) (ZencodeAction | ZencodeSend) } // ===== Execute Actions ===== DbAction { - kw<"execute"> kw<"sql"> kw<"statement"> | - kw<"execute"> kw<"sql"> kw<"statement"> kw<"with"> kw<"parameters"> | - kw<"read"> kw<"the"> kw<"record"> kw<"of"> kw<"the"> kw<"table"> | - kw<"save"> kw<"the"> kw<"variable"> kw<"in"> kw<"the"> kw<"database"> kw<"table"> + execute sql statement | + execute sql statement with parameters | + read the record of the table | + save the variable in the database table } EthereumAction { - kw<"read"> kw<"the"> kw<"ethereum">? kw<"nonce"> | - kw<"read"> kw<"the"> kw<"ethereum">? kw<"bytes"> | - kw<"read"> kw<"the"> kw<"ethereum">? kw<"balance"> | - kw<"read"> kw<"the"> kw<"ethereum">? kw<"suggested"> kw<"gas"> kw<"price"> | - kw<"read"> kw<"the"> kw<"ethereum">? kw<"transaction"> kw<"id"> kw<"after"> kw<"broadcast"> | - kw<"read"> kw<"the"> kw<"erc20"> kw<"decimals"> | - kw<"read"> kw<"the"> kw<"erc20"> kw<"name"> | - kw<"read"> kw<"the"> kw<"erc20"> kw<"symbol"> | - kw<"read"> kw<"the"> kw<"erc20"> kw<"balance"> | - kw<"read"> kw<"the"> kw<"erc20"> kw<"total"> kw<"supply"> | - kw<"read"> kw<"the"> kw<"erc721"> kw<"id"> kw<"in"> kw<"transaction"> | - kw<"read"> kw<"the"> kw<"erc721"> kw<"owner"> | - kw<"read"> kw<"the"> kw<"erc721"> kw<"asset"> + read the ethereum? nonce | + read the ethereum? bytes | + read the ethereum? balance | + read the ethereum? suggested gas price | + read the ethereum? transaction id after broadcast | + read the erc20 decimals | + read the erc20 name | + read the erc20 symbol | + read the erc20 balance | + read the erc20 total supply | + read the erc721 id in transaction | + read the erc721 owner | + read the erc721 asset } FsAction { - kw<"download"> kw<"and"> kw<"extract"> | - kw<"read"> kw<"file"> kw<"content"> | - kw<"read"> kw<"verbatim"> kw<"file"> kw<"content"> | - kw<"store"> kw<"in"> kw<"file"> | - kw<"list"> kw<"directory"> kw<"content"> | - kw<"verify"> kw<"file"> kw<"exists"> | - kw<"verify"> kw<"file"> kw<"does"> kw<"not"> kw<"exist"> + download and extract | + read file content | + read verbatim file content | + store in file | + list directory content | + verify file exists | + verify file does not exist } GitAction { - kw<"verify"> kw<"git"> kw<"repository"> | - kw<"clone"> kw<"repository"> | - kw<"create"> kw<"new"> kw<"git"> kw<"commit"> + verify git repository | + clone repository | + create new git commit } HelpersAction { - kw<"manipulate"> kw<"and"> kw<"get"> | - kw<"manipulate"> kw<"and"> kw<"set"> | - kw<"manipulate"> kw<"and"> kw<"merge"> | - kw<"manipulate"> kw<"and"> kw<"omit"> | - kw<"manipulate"> kw<"and"> kw<"concat"> | - kw<"manipulate"> kw<"and"> kw<"compact"> | - kw<"manipulate"> kw<"and"> kw<"pick"> | - kw<"manipulate"> kw<"and"> kw<"delete"> + manipulate and get | + manipulate and set | + manipulate and merge | + manipulate and omit | + manipulate and concat | + manipulate and compact | + manipulate and pick | + manipulate and delete } HttpAction { - kw<"do"> kw<"get"> | - kw<"do"> kw<"sequential"> kw<"get"> | - kw<"do"> kw<"parallel"> kw<"get"> | - kw<"do"> kw<"same"> kw<"get"> | - kw<"do"> kw<"post"> | - kw<"do"> kw<"sequential"> kw<"post"> | - kw<"do"> kw<"parallel"> kw<"post"> | - kw<"do"> kw<"same"> kw<"post"> | - kw<"do"> kw<"put"> | - kw<"do"> kw<"sequential"> kw<"put"> | - kw<"do"> kw<"parallel"> kw<"put"> | - kw<"do"> kw<"same"> kw<"put"> | - kw<"do"> kw<"patch"> | - kw<"do"> kw<"sequential"> kw<"patch"> | - kw<"do"> kw<"parallel"> kw<"patch"> | - kw<"do"> kw<"same"> kw<"patch"> | - kw<"do"> kw<"delete"> | - kw<"do"> kw<"sequential"> kw<"delete"> | - kw<"do"> kw<"parallel"> kw<"delete"> | - kw<"do"> kw<"same"> kw<"delete"> + do get | + do sequential get | + do parallel get | + do same get | + do post | + do sequential post | + do parallel post | + do same post | + do put | + do sequential put | + do parallel put | + do same put | + do patch | + do sequential patch | + do parallel patch | + do same patch | + do delete | + do sequential delete | + do parallel delete | + do same delete } JsonSchemaAction { - kw<"validate"> kw<"json"> + validate json } OAuthAction { - kw<"generate"> kw<"access"> kw<"token"> | - kw<"verify"> kw<"request"> kw<"parameters"> | - kw<"generate"> kw<"authorization"> kw<"code"> | - kw<"generate"> kw<"request"> kw<"uri"> | - kw<"get"> kw<"authorization"> kw<"details"> kw<"from"> kw<"token"> | - kw<"add"> kw<"data"> kw<"to"> kw<"authorization"> kw<"details"> + generate access token | + verify request parameters | + generate authorization code | + generate request uri | + get authorization details from token | + add data to authorization details } PocketbaseAction { - kw<"start"> kw<"pb"> kw<"client"> | - kw<"start"> kw<"capacitor"> kw<"pb"> kw<"client"> | - kw<"login"> | - kw<"ask"> kw<"password"> kw<"reset"> | - kw<"get"> kw<"some"> kw<"records"> | - kw<"get"> kw<"one"> kw<"record"> | - kw<"create"> kw<"record"> | - kw<"update"> kw<"record"> | - kw<"delete"> kw<"record"> | - kw<"send"> kw<"request"> + start pb client | + start capacitor pb client | + login | + ask password reset | + get some records | + get one record | + create record | + update record | + delete record | + send request } QrCodeAction { - kw<"create"> kw<"qr"> kw<"code"> + create qr code } RedisAction { - kw<"write"> kw<"object"> kw<"into"> kw<"key"> kw<"in"> kw<"redis"> | - kw<"read"> kw<"key"> kw<"from"> kw<"redis"> | - kw<"delete"> kw<"key"> kw<"from"> kw<"redis"> + write object into key in redis | + read key from redis | + delete key from redis } ShellAction { - kw<"execute"> kw<"in"> kw<"shell"> + execute in shell } TimestampAction { - kw<"fetch"> kw<"the"> kw<"local"> kw<"timestamp"> kw<"in"> kw<"milliseconds"> | - kw<"fetch"> kw<"the"> kw<"local"> kw<"timestamp"> kw<"in"> kw<"seconds"> + fetch the local timestamp in milliseconds | + fetch the local timestamp in seconds } WalletAction { - kw<"create"> kw<"vc"> kw<"sd"> kw<"jwt"> | - kw<"present"> kw<"vc"> kw<"sd"> kw<"jwt"> | - kw<"verify"> kw<"vc"> kw<"sd"> kw<"jwt"> | - kw<"create"> kw<"p-256"> kw<"key"> | - kw<"create"> kw<"p-256"> kw<"public"> kw<"key"> | - kw<"pretty"> kw<"print"> kw<"sd"> kw<"jwt"> + create vc sd jwt | + present vc sd jwt | + verify vc sd jwt | + create p256 key | + create p256 public key | + pretty print sd jwt } ZencodeAction { - kw<"execute"> kw<"zencode"> + execute zencode } SaveAction { - kw<"output"> (Keywords | Identifier | StringLiteral)? kw<"into"> StringLiteral -} - -kw { - @specialize[@name={term}] + output (Keywords | Identifier | StringLiteral)? into StringLiteral } Keywords { - kw<"version"> | kw<"ignore"> | - kw<"have"> | kw<"a"> | kw<"my"> | kw<"that"> | kw<"valid"> | kw<"inside"> | kw<"named"> | kw<"am"> | kw<"known"> | - kw<"as"> | kw<"connect"> | kw<"to"> | kw<"and"> | kw<"send"> | - kw<"statement"> | kw<"parameters"> | kw<"record"> | kw<"table"> | - kw<"variable"> | kw<"name"> | kw<"address"> | kw<"transaction_id"> | - kw<"addresses"> | kw<"transaction"> | kw<"sc"> | kw<"path"> | - kw<"content"> | kw<"commit"> | kw<"paths"> | kw<"array"> | - kw<"values"> | kw<"value"> | kw<"sources"> | kw<"properties"> | kw<"headers"> | kw<"object"> | - kw<"json_data"> | kw<"json_schema"> | kw<"request"> | kw<"server_data"> | - kw<"client"> | kw<"expires_in"> | kw<"token"> | kw<"request_uri"> | - kw<"data"> | kw<"my_credentials"> | kw<"email"> | kw<"list_parameters"> | - kw<"show_parameters"> | kw<"create_parameters"> | kw<"record_parameters"> | - kw<"update_parameters"> | kw<"delete_parameters"> | kw<"url"> | - kw<"text"> | kw<"command"> | kw<"jwk"> | kw<"holder"> | kw<"fields"> | - kw<"verifier_url"> | kw<"issued_vc"> | kw<"disclosed"> | kw<"nonce"> | - kw<"sk"> | kw<"script"> | kw<"key"> | kw<"keys"> | kw<"extra"> | kw<"conf"> | - kw<"execute"> | kw<"sql"> | kw<"with"> | kw<"read"> | kw<"the"> | - kw<"of"> | kw<"database"> | kw<"save"> | kw<"ethereum"> | kw<"bytes"> | - kw<"balance"> | kw<"suggested"> | kw<"gas"> | kw<"price"> | - kw<"transaction"> | kw<"id"> | kw<"after"> | kw<"broadcast"> | - kw<"erc20"> | kw<"decimals"> | kw<"name"> | kw<"symbol"> | kw<"total"> | - kw<"supply"> | kw<"erc721"> | kw<"in"> | kw<"owner"> | - kw<"asset"> | kw<"download"> | kw<"extract"> | kw<"verbatim"> | - kw<"store"> | kw<"list"> | kw<"directory"> | kw<"exists"> | - kw<"does"> | kw<"not"> | kw<"exist"> | kw<"verify"> | kw<"repository"> | - kw<"clone"> | kw<"create"> | kw<"new"> | kw<"manipulate"> | - kw<"get"> | kw<"set"> | kw<"merge"> | kw<"omit"> | kw<"concat"> | - kw<"compact"> | kw<"pick"> | kw<"do"> | kw<"sequential"> | - kw<"parallel"> | kw<"same"> | kw<"post"> | kw<"put"> | kw<"patch"> | - kw<"validate"> | kw<"json"> | kw<"generate"> | - kw<"access"> | kw<"authorization"> | kw<"code"> | kw<"details"> | kw<"from"> | - kw<"add"> | kw<"to"> | kw<"start"> | kw<"pb"> | kw<"capacitor"> | - kw<"login"> | kw<"ask"> | kw<"password"> | kw<"reset"> | kw<"some"> | - kw<"records"> | kw<"one"> | kw<"qr"> | kw<"write"> | kw<"into"> | - kw<"redis"> | kw<"delete"> | kw<"shell"> | kw<"fetch"> | - kw<"local"> | kw<"timestamp"> | kw<"milliseconds"> | kw<"seconds"> | - kw<"vc"> | kw<"sd"> | kw<"jwt"> | kw<"p-256"> | kw<"public"> | - kw<"pretty"> | kw<"print"> | kw<"zencode"> | kw<"output"> | kw<"is"> | - kw<"Given"> | kw<"Then"> | kw<"When"> | kw<"Rule"> | kw<"Scenario"> | kw<"If"> | kw<"EndIf"> | kw<"Foreach"> | kw<"EndForeach"> | kw<"I"> + version | unknown | ignore | have | a | my | that | valid | inside | named | am | known | as | connect | to | open | and | send | statement | parameters | record | table | variable | name | address | transaction_id | + addresses | transaction | sc | path | content | commit | paths | array | values | value | sources | properties | headers | object | json_data | json_schema | request | uri | server_data | client | expires_in | + token | request_uri | data | my_credentials | email | list_parameters | show_parameters | create_parameters | record_parameters | update_parameters | delete_parameters | send_parameters | url | text | command | jwk | + holder | fields | verifier_url | issued_vc | disclosed | nonce | sk | script | key | keys | extra | conf | execute | sql | with | read | file | the | of | database | save | ethereum | bytes | balance | suggested | + gas | price | id | after | broadcast | erc20 | decimals | symbol | total | supply | erc721 | in | owner | asset | download | extract | verbatim | store | list | directory | exists | does | not | exist | verify | git | + repository | clone | create | new | manipulate | get | set | merge | omit | concat | compact | pick | do | sequential | parallel | same | post | put | patch | validate | json | generate | access | authorization | code | + details | from | add | start | pb | capacitor | login | ask | password | reset | some | records | one | qr | update | write | into | redis | delete | shell | fetch | local | timestamp | milliseconds | seconds | present | vc | + sd | jwt | p256 | public | pretty | print | zencode | output | is | given | then | when | rule | scenario | if | endif | foreach | endforeach | I +} + +@external specialize {Identifier} keywords from "./tokens" { + given[@name=given], version[@name=version], unknown[@name=unknown], ignore[@name=ignore], have[@name=have], a[@name=a], my[@name=my], that[@name=that], valid[@name=valid], inside[@name=inside], named[@name=named], am[@name=am], known[@name=known], + as[@name=as], connect[@name=connect], to[@name=to], open[@name=open] and[@name=and], send[@name=send], statement[@name=statement], parameters[@name=parameters], record[@name=record], table[@name=table], variable[@name=variable], name[@name=name], + address[@name=address], transaction_id[@name=transaction_id], addresses[@name=addresses], transaction[@name=transaction], sc[@name=sc], path[@name=path], content[@name=content], commit[@name=commit], paths[@name=paths], + array[@name=array], values[@name=values], value[@name=value], sources[@name=sources], properties[@name=properties], headers[@name=headers], object[@name=object], json_data[@name=json_data], json_schema[@name=json_schema], + request[@name=request], server_data[@name=server_data], client[@name=client], expires_in[@name=expires_in], token[@name=token], request_uri[@name=request_uri], data[@name=data], my_credentials[@name=my_credentials], + email[@name=email], list_parameters[@name=list_parameters], show_parameters[@name=show_parameters], create_parameters[@name=create_parameters], record_parameters[@name=record_parameters], update_parameters[@name=update_parameters], + delete_parameters[@name=delete_parameters], send_parameters[@name=send_parameters], url[@name=url], text[@name=text], command[@name=command], jwk[@name=jwk], holder[@name=holder], fields[@name=fields], verifier_url[@name=verifier_url], issued_vc[@name=issued_vc], + disclosed[@name=disclosed], nonce[@name=nonce], sk[@name=sk], script[@name=script], key[@name=key], keys[@name=keys], extra[@name=extra], conf[@name=conf], execute[@name=execute], sql[@name=sql], with[@name=with], read[@name=read], + file[@name=file], the[@name=the], of[@name=of], database[@name=database], save[@name=save], ethereum[@name=ethereum], bytes[@name=bytes], balance[@name=balance], suggested[@name=suggested], gas[@name=gas], price[@name=price], id[@name=id], + after[@name=after], broadcast[@name=broadcast], erc20[@name=erc20], decimals[@name=decimals], symbol[@name=symbol], total[@name=total], supply[@name=supply], erc721[@name=erc721], in[@name=in], owner[@name=owner], + asset[@name=asset], download[@name=download], extract[@name=extract], verbatim[@name=verbatim], store[@name=store], list[@name=list], directory[@name=directory], exists[@name=exists], does[@name=does], + not[@name=not], exist[@name=exist], verify[@name=verify], git[@name=git], repository[@name=repository], clone[@name=clone], create[@name=create], new[@name=new], manipulate[@name=manipulate], get[@name=get], set[@name=set], merge[@name=merge], + omit[@name=omit],uri[@name=uri], concat[@name=concat], compact[@name=compact], pick[@name=pick], do[@name=do], sequential[@name=sequential], parallel[@name=parallel], same[@name=same], post[@name=post], put[@name=put], patch[@name=patch], + validate[@name=validate], json[@name=json], generate[@name=generate], access[@name=access], authorization[@name=authorization], code[@name=code], details[@name=details], from[@name=from], add[@name=add], start[@name=start], + pb[@name=pb], capacitor[@name=capacitor], login[@name=login], ask[@name=ask], password[@name=password], reset[@name=reset], some[@name=some], records[@name=records], one[@name=one], update[@name=update], qr[@name=qr], write[@name=write], + into[@name=into], redis[@name=redis], delete[@name=delete], shell[@name=shell], fetch[@name=fetch], local[@name=local], timestamp[@name=timestamp], milliseconds[@name=milliseconds], seconds[@name=seconds], present[@name=present] + vc[@name=vc], sd[@name=sd], jwt[@name=jwt], public[@name=public], pretty[@name=pretty], print[@name=print], zencode[@name=zencode], output[@name=output], is[@name=is], then[@name=then], + when[@name=when], rule[@name=rule], scenario[@name=scenario], if[@name=if], endif[@name=endif], foreach[@name=foreach], endforeach[@name=endforeach], I[@name=I], p256[@name=p256] + } @tokens { @@ -450,4 +433,4 @@ Keywords { Number { $[0-9]+ } } -@external tokens token from "./tokens.js" { eof } +@external tokens Eoftoken from "./tokens.js" { eof } diff --git a/grammar/src/syntax.grammar.d.ts b/grammar/src/syntax.grammar.d.ts index a9ceb9c7..bbdabde3 100644 --- a/grammar/src/syntax.grammar.d.ts +++ b/grammar/src/syntax.grammar.d.ts @@ -2,6 +2,6 @@ // // SPDX-License-Identifier: AGPL-3.0-or-later -import {LRParser} from "@lezer/lr" +import { LRParser } from '@lezer/lr'; -export declare const parser: LRParser +export declare const parser: LRParser; diff --git a/grammar/src/syntax.grammar.terms.d.ts b/grammar/src/syntax.grammar.terms.d.ts index 6b4aa902..fcd3978b 100644 --- a/grammar/src/syntax.grammar.terms.d.ts +++ b/grammar/src/syntax.grammar.terms.d.ts @@ -2,4 +2,4 @@ // // SPDX-License-Identifier: AGPL-3.0-or-later -export const eof: number +export const eof: number; diff --git a/grammar/src/tokens.js b/grammar/src/tokens.js index b0004332..f418327c 100644 --- a/grammar/src/tokens.js +++ b/grammar/src/tokens.js @@ -2,14 +2,397 @@ // // SPDX-License-Identifier: AGPL-3.0-or-later -import {ExternalTokenizer} from "@lezer/lr" -import { eof } from "./syntax.grammar.terms" +import { ExternalTokenizer } from '@lezer/lr'; +import { + eof, + version, + unknown, + ignore, + have, + a, + my, + that, + valid, + inside, + named, + am, + known, + as, + connect, + open, + to, + and, + send, + statement, + parameters, + record, + table, + variable, + name, + address, + transaction_id, + addresses, + transaction, + sc, + path, + content, + commit, + paths, + array, + values, + value, + sources, + properties, + headers, + object, + json_data, + json_schema, + request, + uri, + server_data, + client, + expires_in, + token, + request_uri, + data, + my_credentials, + email, + list_parameters, + show_parameters, + create_parameters, + record_parameters, + update_parameters, + delete_parameters, + send_parameters, + url, + text, + command, + jwk, + holder, + fields, + verifier_url, + issued_vc, + disclosed, + nonce, + sk, + script, + key, + keys, + extra, + conf, + execute, + sql, + _with, + read, + file, + the, + of, + database, + save, + ethereum, + bytes, + balance, + suggested, + gas, + price, + id, + after, + broadcast, + erc20, + decimals, + symbol, + total, + supply, + erc721, + _in, + owner, + asset, + download, + extract, + verbatim, + store, + list, + directory, + exists, + does, + not, + exist, + verify, + git, + repository, + clone, + create, + _new, + manipulate, + get, + set, + merge, + omit, + concat, + compact, + pick, + _do, + sequential, + parallel, + same, + post, + put, + patch, + validate, + json, + generate, + access, + authorization, + code, + details, + from, + add, + start, + pb, + capacitor, + login, + ask, + password, + reset, + some, + records, + one, + update, + qr, + write, + into, + redis, + _delete, + shell, + fetch, + local, + timestamp, + milliseconds, + seconds, + present, + vc, + sd, + jwt, + p256, + _public, + pretty, + print, + zencode, + output, + is, + given, + then, + when, + rule, + scenario, + _if, + endif, + foreach, + endforeach, + I, +} from './syntax.grammar.terms'; -export const token = new ExternalTokenizer( +export const Eoftoken = new ExternalTokenizer( (input) => { - if (input.next < 0) { - input.acceptToken(eof); - } + if (input.next < 0) { + input.acceptToken(eof); + } }, - { contextual: true, fallback: true } - ); + { contextual: true, fallback: true }, +); +const keywordMap = { + version, + unknown, + ignore, + have, + a, + my, + that, + valid, + inside, + named, + am, + known, + as, + connect, + to, + open, + and, + send, + statement, + parameters, + record, + table, + variable, + name, + address, + transaction_id, + addresses, + transaction, + sc, + path, + content, + commit, + paths, + array, + values, + value, + sources, + properties, + headers, + object, + json_data, + json_schema, + request, + uri, + server_data, + client, + expires_in, + token, + request_uri, + data, + my_credentials, + email, + list_parameters, + show_parameters, + create_parameters, + record_parameters, + update_parameters, + delete_parameters, + send_parameters, + url, + text, + command, + jwk, + holder, + fields, + verifier_url, + issued_vc, + disclosed, + nonce, + sk, + script, + key, + keys, + extra, + conf, + execute, + sql, + with: _with, + read, + file, + the, + of, + database, + save, + ethereum, + bytes, + balance, + suggested, + gas, + price, + id, + after, + broadcast, + erc20, + decimals, + symbol, + total, + supply, + erc721, + in: _in, + owner, + asset, + download, + extract, + verbatim, + store, + list, + directory, + exists, + does, + not, + exist, + verify, + git, + repository, + clone, + create, + new: _new, + manipulate, + get, + set, + merge, + omit, + concat, + compact, + pick, + do: _do, + sequential, + parallel, + same, + post, + put, + patch, + validate, + json, + generate, + access, + authorization, + code, + details, + from, + add, + start, + pb, + capacitor, + login, + ask, + password, + reset, + some, + records, + one, + update, + qr, + write, + into, + redis, + delete: _delete, + shell, + fetch, + local, + timestamp, + milliseconds, + seconds, + present, + vc, + sd, + jwt, + public: _public, + pretty, + print, + zencode, + output, + is, + given, + then, + when, + rule, + scenario, + if: _if, + endif, + foreach, + endforeach, + I, + p256, +}; + +export function keywords(name) { + if (name == 'I') { + return keywordMap[name]; + } + + let found = keywordMap[name.toLowerCase()]; + return found == null ? -1 : found; +} diff --git a/grammar/test/cases.txt b/grammar/test/cases.txt index 85822463..3e0b94ad 100644 --- a/grammar/test/cases.txt +++ b/grammar/test/cases.txt @@ -3,8 +3,7 @@ Given I fetch the local timestamp in seconds ==> - -Statement(SlangroomStatement(GivenStatement(Given,I,TimestampStatement(TimestampAction(fetch,the,local,timestamp,in,seconds))))) +Statement(SlangroomStatement(GivenStatement(given,I,TimestampStatement(TimestampAction(fetch,the,local,timestamp,in,seconds))))) #Db example @@ -17,9 +16,9 @@ Then print the 'result' ==> -Statement(RuleStatement(Rule,UnknownIgnoreRule(unknown,ignore)),SlangroomStatement(GivenStatement(Given,I,DbStatement(DbConnectAction(connect,to,StringLiteral,and, -DbSend(send,record,StringLiteral,and,DbSend(send,table,StringLiteral,and,DbAction(read,the,record,of,the,table)))),and,SaveAction(output,into,StringLiteral)))), -SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral,named,StringLiteral)),SlangroomStatement(ThenPrint(Then,print,Keywords(the),StringLiteral))) +Statement(RuleStatement(rule,GenericRule(Keywords(unknown),Keywords(ignore))),SlangroomStatement(GivenStatement(given,I,DbStatement(DbConnectAction(connect,to,StringLiteral,and, + DbSend(send,record,StringLiteral,and,DbSend(send,table,StringLiteral,and,DbAction(read,the,record,of,the,table)))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral)),SlangroomStatement(ThenPrint(then,print,Keywords(the),StringLiteral))) #Ethereum complex example @@ -52,20 +51,15 @@ Then I connect to 'ethereum' and send transaction 'signed_ethereum_transaction' ==> -Statement(RuleStatement(Rule,UnknownIgnoreRule(unknown,ignore)),ScenarioStatement(Scenario,ScenarioType(StringLiteral),ScenarioComment(Identifier,Identifier,Keywords(object),Identifier,Identifier)), - SlangroomStatement(GivenStatement(Given,I,EthereumStatement(EthereumConnectAction(connect,to,StringLiteral,and,EthereumSend(send,address,StringLiteral,and,EthereumAction(read,the,ethereum,nonce))),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(GivenStatement(Given,I,EthereumStatement(EthereumConnectAction(connect,to,StringLiteral,and,EthereumAction(read,the,suggested,gas,price)),and,SaveAction(output,into,StringLiteral)))),Comment, - SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral)), - SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral)),Comment, - SlangroomStatement(GivenHaveStatement(Given,I,have,the,StringLiteral)),Comment, - SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral,named,StringLiteral)), - SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral,named,StringLiteral)), - SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral)),Comment, - SlangroomStatement(WhenStatement(When,I,Keywords(create),Keywords(the),Keywords(ethereum),Keywords(transaction),Keywords(to),StringLiteral)), - SlangroomStatement(WhenStatement(When,I,Identifier,Keywords(the),Keywords(ethereum),Keywords(transaction),Keywords(to),Keywords(store),StringLiteral)), - SlangroomStatement(WhenStatement(When,I,Keywords(create),Keywords(the),Identifier,Keywords(ethereum),Keywords(transaction),Identifier,Identifier,StringLiteral)), - SlangroomStatement(ThenPrint(Then,print,Keywords(the),StringLiteral)), - SlangroomStatement(ThenStatement(Then,I,EthereumStatement(EthereumConnectAction(connect,to,StringLiteral,and,EthereumSend(send,transaction,StringLiteral,and,EthereumAction(read,the,ethereum,transaction,id,after,broadcast))),and,SaveAction(output,into,StringLiteral))))) +Statement(RuleStatement(rule,GenericRule(Keywords(unknown),Keywords(ignore))),ScenarioStatement(scenario,ScenarioType(StringLiteral),ScenarioComment(Keywords(store),Identifier,Keywords(object),Identifier,Identifier)), + SlangroomStatement(GivenStatement(given,I,EthereumStatement(EthereumConnectAction(connect,to,StringLiteral,and,EthereumSend(send,address,StringLiteral,and,EthereumAction(read,the,ethereum,nonce))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(GivenStatement(given,I,EthereumStatement(EthereumConnectAction(connect,to,StringLiteral,and,EthereumAction(read,the,suggested,gas,price)),and,SaveAction(output,into,StringLiteral)))),Comment, + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral)),SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral)),Comment,SlangroomStatement(GivenHaveStatement(given,I,have,the,StringLiteral)),Comment, + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral)),SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral)), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral)),Comment,SlangroomStatement(WhenStatement(when,I,Keywords(create),Keywords(the),Keywords(ethereum),Keywords(transaction),Keywords(to),StringLiteral)), + SlangroomStatement(WhenStatement(when,I,Identifier,Keywords(the),Keywords(ethereum),Keywords(transaction),Keywords(to),Keywords(store),StringLiteral)), + SlangroomStatement(WhenStatement(when,I,Keywords(create),Keywords(the),Identifier,Keywords(ethereum),Keywords(transaction),Identifier,Identifier,StringLiteral)),SlangroomStatement(ThenPrint(then,print,Keywords(the),StringLiteral)), + SlangroomStatement(ThenStatement(then,I,EthereumStatement(EthereumConnectAction(connect,to,StringLiteral,and,EthereumSend(send,transaction,StringLiteral,and,EthereumAction(read,the,ethereum,transaction,id,after,broadcast))),and,SaveAction(output,into,StringLiteral))))) #Fs example @@ -77,11 +71,10 @@ Then print the 'file_path_1' ==> -Statement(RuleStatement(Rule,UnknownIgnoreRule(unknown,ignore)), - SlangroomStatement(GivenStatement(Given,I,FsStatement(FsConnectAction(FsSend(send,path,StringLiteral,and,FsAction(verify,file,exists)))))), - SlangroomStatement(GivenStatement(Given,I,FsStatement(FsConnectAction(FsSend(send,path,StringLiteral,and,FsAction(verify,file,does,not,exist)))))), - SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral,named,StringLiteral)), - SlangroomStatement(ThenPrint(Then,print,Keywords(the),StringLiteral))) +Statement(RuleStatement(rule,GenericRule(Keywords(unknown),Keywords(ignore))),SlangroomStatement(GivenStatement(given,I,FsStatement(FsConnectAction(FsSend(send,path,StringLiteral,and,FsAction(verify,file,exists)))))), + SlangroomStatement(GivenStatement(given,I,FsStatement(FsConnectAction(FsSend(send,path,StringLiteral,and,FsAction(verify,file,does,not,exist)))))), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral)), + SlangroomStatement(ThenPrint(then,print,Keywords(the),StringLiteral))) #Git example @@ -94,10 +87,10 @@ Then print the data ==> -Statement(RuleStatement(Rule,UnknownIgnoreRule(unknown,ignore)), - SlangroomStatement(GivenStatement(Given,I,GitStatement(GitOpenOrConnectAction(connect,to,StringLiteral,and,GitSend(send,path,StringLiteral,and,GitAction(clone,repository)))))), - SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral,named,StringLiteral)), - SlangroomStatement(ThenPrint(Then,print,Keywords(the),Keywords(data)))) +Statement(RuleStatement(rule,GenericRule(Keywords(unknown),Keywords(ignore))), + SlangroomStatement(GivenStatement(given,I,GitStatement(GitOpenOrConnectAction(connect,to,StringLiteral,and,GitSend(send,path,StringLiteral,and,GitAction(clone,repository)))))), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral)), + SlangroomStatement(ThenPrint(then,print,Keywords(the),Keywords(data)))) #Helpers example @@ -111,11 +104,10 @@ Then print the data ==> -Statement(RuleStatement(Rule,UnknownIgnoreRule(unknown,ignore)), - SlangroomStatement(GivenStatement(Given,I,HelpersStatement(HelpersSend(send,array,StringLiteral,and,HelpersSend(send,values,StringLiteral,and,HelpersAction(manipulate,and,concat))), - and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral,named,StringLiteral)), - SlangroomStatement(ThenPrint(Then,print,Keywords(the),Keywords(data)))) +Statement(RuleStatement(rule,GenericRule(Keywords(unknown),Keywords(ignore))), + SlangroomStatement(GivenStatement(given,I,HelpersStatement(HelpersSend(send,array,StringLiteral,and,HelpersSend(send,values,StringLiteral,and,HelpersAction(manipulate,and,concat))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral)), + SlangroomStatement(ThenPrint(then,print,Keywords(the),Keywords(data)))) #Http example @@ -127,10 +119,10 @@ Then print the 'result' ==> -Statement(RuleStatement(Rule,UnknownIgnoreRule(unknown,ignore)), - SlangroomStatement(GivenStatement(Given,I,HttpStatement(HttpConnectAction(connect,to,StringLiteral,and,HttpAction(do,get)),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral,named,StringLiteral)), - SlangroomStatement(ThenPrint(Then,print,Keywords(the),StringLiteral))) +Statement(RuleStatement(rule,GenericRule(Keywords(unknown),Keywords(ignore))), + SlangroomStatement(GivenStatement(given,I,HttpStatement(HttpConnectAction(connect,to,StringLiteral,and,HttpAction(do,get)),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral)), + SlangroomStatement(ThenPrint(then,print,Keywords(the),StringLiteral))) #Json-schema example @@ -144,8 +136,10 @@ Then print the 'result' ==> -Statement(RuleStatement(Rule,UnknownIgnoreRule(unknown,ignore)),SlangroomStatement(GivenStatement(Given,I,JsonSchemaStatement(JsonSchemaSend(send,json_data,StringLiteral,and,JsonSchemaSend(send,json_schema,StringLiteral,and,JsonSchemaAction(validate,json))),and,SaveAction(output,into,StringLiteral)))),SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral,named,StringLiteral)),SlangroomStatement(ThenPrint(Then,print,Keywords(the),StringLiteral))) - +Statement(RuleStatement(rule,GenericRule(Keywords(unknown),Keywords(ignore))), + SlangroomStatement(GivenStatement(given,I,JsonSchemaStatement(JsonSchemaSend(send,json_data,StringLiteral,and,JsonSchemaSend(send,json_schema,StringLiteral,and,JsonSchemaAction(validate,json))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral)), + SlangroomStatement(ThenPrint(then,print,Keywords(the),StringLiteral))) #Oauth example @@ -164,11 +158,13 @@ Then I send request 'request' and send server_data 'server_data' and generate ac ==> -Statement(RuleStatement(Rule,UnknownIgnoreRule(unknown,ignore)),ScenarioStatement(Scenario,ScenarioType(StringLiteral),ScenarioComment(Keywords(url),Identifier)) - SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral,named,StringLiteral)),SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral,named,StringLiteral)), - SlangroomStatement(WhenStatement(When,I,Keywords(create),Keywords(the),Identifier,Keywords(get),Keywords(parameters),Keywords(from),StringLiteral,Identifier,Identifier,Identifier)), - SlangroomStatement(WhenStatement(When,I,Identifier,StringLiteral,Keywords(to),StringLiteral,Keywords(in),StringLiteral)),SlangroomStatement(ThenPrint(Then,print,Keywords(the),StringLiteral)), - SlangroomStatement(ThenStatement(Then,I,OAuthStatement(OAuthSend(send,request,StringLiteral,and,OAuthSend(send,server_data,StringLiteral,and,OAuthAction(generate,access,token))),and,SaveAction(output,into,StringLiteral))))) +Statement(RuleStatement(rule,GenericRule(Keywords(unknown),Keywords(ignore))),ScenarioStatement(scenario,ScenarioType(StringLiteral),ScenarioComment(Keywords(url),Identifier)), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral)), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral)), + SlangroomStatement(WhenStatement(when,I,Keywords(create),Keywords(the),Identifier,Keywords(get),Keywords(parameters),Keywords(from),StringLiteral,Identifier,Identifier,Identifier)), + SlangroomStatement(WhenStatement(when,I,Identifier,StringLiteral,Keywords(to),StringLiteral,Keywords(in),StringLiteral)), + SlangroomStatement(ThenPrint(then,print,Keywords(the),StringLiteral)), + SlangroomStatement(ThenStatement(then,I,OAuthStatement(OAuthSend(send,request,StringLiteral,and,OAuthSend(send,server_data,StringLiteral,and,OAuthAction(generate,access,token))),and,SaveAction(output,into,StringLiteral))))) #Pocketbase example @@ -184,11 +180,12 @@ Then print the 'result' ==> -Statement(RuleStatement(Rule,UnknownIgnoreRule(unknown,ignore)),SlangroomStatement(GivenStatement(Given,I,PocketbaseStatement(PocketbaseConnectAction(connect,to,StringLiteral,and,PocketbaseAction(start,pb,client))))), - SlangroomStatement(GivenStatement(Given,I,PocketbaseStatement(PocketbaseConnectAction(PocketbaseSend(send,my_credentials,StringLiteral,and,PocketbaseAction(login)))))), - SlangroomStatement(GivenStatement(Given,I,PocketbaseStatement(PocketbaseConnectAction(PocketbaseSend(send,create_parameters,StringLiteral,and,PocketbaseSend(send,record_parameters,StringLiteral,and,PocketbaseAction(create,record)))),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral,named,StringLiteral)), - SlangroomStatement(ThenPrint(Then,print,Keywords(the),StringLiteral))) +Statement(RuleStatement(rule,GenericRule(Keywords(unknown),Keywords(ignore))), + SlangroomStatement(GivenStatement(given,I,PocketbaseStatement(PocketbaseConnectAction(connect,to,StringLiteral,and,PocketbaseAction(start,pb,client))))), + SlangroomStatement(GivenStatement(given,I,PocketbaseStatement(PocketbaseConnectAction(PocketbaseSend(send,my_credentials,StringLiteral,and,PocketbaseAction(login)))))), + SlangroomStatement(GivenStatement(given,I,PocketbaseStatement(PocketbaseConnectAction(PocketbaseSend(send,create_parameters,StringLiteral,and,PocketbaseSend(send,record_parameters,StringLiteral,and,PocketbaseAction(create,record)))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral)), + SlangroomStatement(ThenPrint(then,print,Keywords(the),StringLiteral))) #Qrcode example @@ -201,7 +198,10 @@ Then print the 'result' ==> -Statement(RuleStatement(Rule,UnknownIgnoreRule(unknown,ignore)),SlangroomStatement(GivenStatement(Given,I,QrCodeStatement(QrCodeSend(send,text,StringLiteral,and,QrCodeAction(create,qr,code)),and,SaveAction(output,into,StringLiteral)))),SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral,named,StringLiteral)),SlangroomStatement(ThenPrint(Then,print,Keywords(the),StringLiteral))) +Statement(RuleStatement(rule,GenericRule(Keywords(unknown),Keywords(ignore))), + SlangroomStatement(GivenStatement(given,I,QrCodeStatement(QrCodeSend(send,text,StringLiteral,and,QrCodeAction(create,qr,code)),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral)), + SlangroomStatement(ThenPrint(then,print,Keywords(the),StringLiteral))) #Redis example @@ -214,8 +214,10 @@ Then print the 'result' ==> -Statement(RuleStatement(Rule,UnknownIgnoreRule(unknown,ignore)),SlangroomStatement(GivenStatement(Given,I,RedisStatement(RedisConnectAction(connect,to,StringLiteral,and,RedisSend(send,key,StringLiteral,and,RedisAction(delete,key,from,redis))),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral,named,StringLiteral)),SlangroomStatement(ThenPrint(Then,print,Keywords(the),StringLiteral))) +Statement(RuleStatement(rule,GenericRule(Keywords(unknown),Keywords(ignore))), + SlangroomStatement(GivenStatement(given,I,RedisStatement(RedisConnectAction(connect,to,StringLiteral,and,RedisSend(send,key,StringLiteral,and,RedisAction(delete,key,from,redis))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral)), + SlangroomStatement(ThenPrint(then,print,Keywords(the),StringLiteral))) #Shell example @@ -228,8 +230,10 @@ Then print the 'result' ==> -Statement(RuleStatement(Rule,UnknownIgnoreRule(unknown,ignore)),SlangroomStatement(GivenStatement(Given,I,ShellStatement(ShellSend(send,command,StringLiteral,and,ShellAction(execute,in,shell)),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral,named,StringLiteral)),SlangroomStatement(ThenPrint(Then,print,Keywords(the),StringLiteral))) +Statement(RuleStatement(rule,GenericRule(Keywords(unknown),Keywords(ignore))), + SlangroomStatement(GivenStatement(given,I,ShellStatement(ShellSend(send,command,StringLiteral,and,ShellAction(execute,in,shell)),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral)), + SlangroomStatement(ThenPrint(then,print,Keywords(the),StringLiteral))) #Timestamp example @@ -245,12 +249,13 @@ Then print the 'result_in_milliseconds' ==> -Statement(RuleStatement(Rule,UnknownIgnoreRule(unknown,ignore)),SlangroomStatement(GivenStatement(Given,I,TimestampStatement(TimestampAction(fetch,the,local,timestamp,in,seconds),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(GivenStatement(Given,I,TimestampStatement(TimestampAction(fetch,the,local,timestamp,in,milliseconds),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral,named,StringLiteral)),SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral,named,StringLiteral)), - SlangroomStatement(ThenPrint(Then,print,Keywords(the),StringLiteral)),SlangroomStatement(ThenPrint(Then,print,Keywords(the),StringLiteral))) - - +Statement(RuleStatement(rule,GenericRule(Keywords(unknown),Keywords(ignore))), + SlangroomStatement(GivenStatement(given,I,TimestampStatement(TimestampAction(fetch,the,local,timestamp,in,seconds),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(GivenStatement(given,I,TimestampStatement(TimestampAction(fetch,the,local,timestamp,in,milliseconds),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral)), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral)), + SlangroomStatement(ThenPrint(then,print,Keywords(the),StringLiteral)), + SlangroomStatement(ThenPrint(then,print,Keywords(the),StringLiteral))) #Zencode example @@ -263,8 +268,10 @@ Then print the 'result' ==> -Statement(RuleStatement(Rule,UnknownIgnoreRule(unknown,ignore)),SlangroomStatement(GivenStatement(Given,I,ZencodeStatement(ZencodeSend(send,keys,StringLiteral,and,ZencodeSend(send,data,StringLiteral,and,ZencodeSend(send,script,StringLiteral,and,ZencodeAction(execute,zencode)))),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral,named,StringLiteral)),SlangroomStatement(ThenPrint(Then,print,Keywords(the),StringLiteral))) +Statement(RuleStatement(rule,GenericRule(Keywords(unknown),Keywords(ignore))), + SlangroomStatement(GivenStatement(given,I,ZencodeStatement(ZencodeSend(send,keys,StringLiteral,and,ZencodeSend(send,data,StringLiteral,and,ZencodeSend(send,script,StringLiteral,and,ZencodeAction(execute,zencode)))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral)), + SlangroomStatement(ThenPrint(then,print,Keywords(the),StringLiteral))) #Test from Didroom 1 @@ -313,32 +320,32 @@ Then I send request 'request' and send server_data 'server' and verify request p ==> -Statement(ScenarioStatement(Scenario,ScenarioType(StringLiteral)),ScenarioStatement(Scenario,ScenarioType(StringLiteral),ScenarioComment(Keywords(create),Keywords(jwk))),RuleStatement(Rule,UnknownIgnoreRule(unknown,ignore)), - SlangroomStatement(GivenStatement(Given,I,FsStatement(FsConnectAction(FsSend(send,path,StringLiteral,and,FsAction(read,file,content))),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(GivenStatement(Given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersAction(manipulate,and,get))),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(GivenStatement(Given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersAction(manipulate,and,get))),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(GivenStatement(Given,I,FsStatement(FsConnectAction(FsSend(send,path,StringLiteral,and,FsAction(read,file,content))),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral,named,StringLiteral)),Comment, - SlangroomStatement(GivenName(Given,my,name,is,Keywords(in),Keywords(a),StringLiteral,Keywords(named),StringLiteral)), - SlangroomStatement(GivenHaveStatement(Given,I,have,the,StringLiteral,in,StringLiteral)), - SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral,named,StringLiteral)), - SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral,named,StringLiteral)), - SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral,named,StringLiteral)), - SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral,named,StringLiteral)),Comment, - SlangroomStatement(WhenStatement(When,I,Identifier,Keywords(from),Keywords(path),StringLiteral)), - SlangroomStatement(WhenStatement(When,I,Identifier,StringLiteral,Keywords(to),StringLiteral,Keywords(in),StringLiteral)), - SlangroomStatement(WhenStatement(When,I,Keywords(create),Keywords(jwk),Keywords(of),Identifier,Keywords(public),Keywords(key),Keywords(with),Identifier,Keywords(key))), - SlangroomStatement(WhenStatement(When,I,Identifier,StringLiteral,Keywords(in),StringLiteral)),Comment, - SlangroomStatement(WhenStatement(When,I,Keywords(set),StringLiteral,Keywords(to),StringLiteral,Keywords(as),StringLiteral)), - SlangroomStatement(WhenStatement(When,I,Keywords(create),Keywords(the),Keywords(url),Keywords(from),StringLiteral)), - SlangroomStatement(WhenStatement(When,I,Identifier,StringLiteral,Keywords(as),Identifier,Keywords(request),Keywords(to),StringLiteral)), - SlangroomStatement(WhenStatement(When,I,Identifier,Keywords(the),Identifier,Identifier,Keywords(of),StringLiteral,Keywords(as),Identifier,Keywords(request),Keywords(to),StringLiteral)), - SlangroomStatement(WhenStatement(When,I,Identifier,Keywords(the),Identifier,StringLiteral,Keywords(bytes),Keywords(of),StringLiteral)), - SlangroomStatement(WhenStatement(When,I,Identifier,Keywords(the),StringLiteral,Keywords(to),StringLiteral)), - SlangroomStatement(WhenStatement(When,I,Identifier,StringLiteral,Keywords(in),StringLiteral)), - SlangroomStatement(ThenPrint(Then,print,Keywords(the),StringLiteral)), - SlangroomStatement(ThenPrint(Then,print,Keywords(the),StringLiteral)), - SlangroomStatement(ThenStatement(Then,I,OAuthStatement(OAuthSend(send,request,StringLiteral,and,OAuthSend(send,server_data,StringLiteral,and,OAuthAction(verify,request,parameters))))))) +Statement(ScenarioStatement(scenario,ScenarioType(StringLiteral)),ScenarioStatement(scenario,ScenarioType(StringLiteral),ScenarioComment(Keywords(create),Keywords(jwk))),RuleStatement(rule,GenericRule(Keywords(unknown),Keywords(ignore))), + SlangroomStatement(GivenStatement(given,I,FsStatement(FsConnectAction(FsSend(send,path,StringLiteral,and,FsAction(read,file,content))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(GivenStatement(given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersAction(manipulate,and,get))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(GivenStatement(given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersAction(manipulate,and,get))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(GivenStatement(given,I,FsStatement(FsConnectAction(FsSend(send,path,StringLiteral,and,FsAction(read,file,content))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral)),Comment, + SlangroomStatement(GivenName(given,my,name,is,Keywords(in),Keywords(a),StringLiteral,Keywords(named),StringLiteral)), + SlangroomStatement(GivenHaveStatement(given,I,have,the,StringLiteral,in,StringLiteral)), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral)), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral)), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral)), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral)),Comment, + SlangroomStatement(WhenStatement(when,I,Identifier,Keywords(from),Keywords(path),StringLiteral)), + SlangroomStatement(WhenStatement(when,I,Identifier,StringLiteral,Keywords(to),StringLiteral,Keywords(in),StringLiteral)), + SlangroomStatement(WhenStatement(when,I,Keywords(create),Keywords(jwk),Keywords(of),Identifier,Keywords(public),Keywords(key),Keywords(with),Identifier,Keywords(key))), + SlangroomStatement(WhenStatement(when,I,Identifier,StringLiteral,Keywords(in),StringLiteral)),Comment, + SlangroomStatement(WhenStatement(when,I,Keywords(set),StringLiteral,Keywords(to),StringLiteral,Keywords(as),StringLiteral)), + SlangroomStatement(WhenStatement(when,I,Keywords(create),Keywords(the),Keywords(url),Keywords(from),StringLiteral)), + SlangroomStatement(WhenStatement(when,I,Identifier,StringLiteral,Keywords(as),Identifier,Keywords(request),Keywords(to),StringLiteral)), + SlangroomStatement(WhenStatement(when,I,Identifier,Keywords(the),Identifier,Identifier,Keywords(of),StringLiteral,Keywords(as),Identifier,Keywords(request),Keywords(to),StringLiteral)), + SlangroomStatement(WhenStatement(when,I,Identifier,Keywords(the),Identifier,StringLiteral,Keywords(bytes),Keywords(of),StringLiteral)), + SlangroomStatement(WhenStatement(when,I,Identifier,Keywords(the),StringLiteral,Keywords(to),StringLiteral)), + SlangroomStatement(WhenStatement(when,I,Identifier,StringLiteral,Keywords(in),StringLiteral)), + SlangroomStatement(ThenPrint(then,print,Keywords(the),StringLiteral)), + SlangroomStatement(ThenPrint(then,print,Keywords(the),StringLiteral)), + SlangroomStatement(ThenStatement(then,I,OAuthStatement(OAuthSend(send,request,StringLiteral,and,OAuthSend(send,server_data,StringLiteral,and,OAuthAction(verify,request,parameters))))))) #Test from Didroom 2 @@ -392,40 +399,39 @@ Then print the data ==> -Statement(Comment,SlangroomStatement(GivenStatement(Given,I,FsStatement(FsConnectAction(FsSend(send,path,StringLiteral,and,FsAction(read,file,content))),and,SaveAction(output,Identifier,into,StringLiteral)))), - SlangroomStatement(GivenStatement(Given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersAction(manipulate,and,get))),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(GivenStatement(Given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersAction(manipulate,and,get))),and,SaveAction(output,Identifier,into,StringLiteral)))),Comment, - SlangroomStatement(GivenStatement(Given,I,FsStatement(FsConnectAction(FsSend(send,path,StringLiteral,and,FsAction(read,file,content))),and,SaveAction(output,into,StringLiteral)))),Comment, - SlangroomStatement(GivenStatement(Given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))), - SlangroomStatement(GivenStatement(Given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))), - SlangroomStatement(GivenStatement(Given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))), - SlangroomStatement(GivenStatement(Given,I,FsStatement(FsConnectAction(FsSend(send,path,StringLiteral,and,FsAction(read,verbatim,file,content))),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(GivenStatement(Given,I,ZencodeStatement(ZencodeSend(send,keys,StringLiteral,and,ZencodeSend(send,data,StringLiteral,and,ZencodeSend(send,script,StringLiteral,and,ZencodeAction(execute,zencode)))),and,SaveAction(output,into,StringLiteral)))),Comment, - SlangroomStatement(GivenStatement(Given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersAction(manipulate,and,get))),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(GivenStatement(Given,I,HttpStatement(HttpConnectAction(connect,to,StringLiteral,and,HttpAction(do,get)),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(GivenStatement(Given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersAction(manipulate,and,get))),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(GivenStatement(Given,I,FsStatement(FsConnectAction(FsSend(send,path,StringLiteral,and,FsAction(read,verbatim,file,content))),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(GivenStatement(Given,I,ZencodeStatement(ZencodeSend(send,keys,StringLiteral,and,ZencodeSend(send,data,StringLiteral,and,ZencodeSend(send,script,StringLiteral,and,ZencodeAction(execute,zencode)))),and,SaveAction(output,into,StringLiteral)))),Comment, - SlangroomStatement(GivenStatement(Given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersAction(manipulate,and,get))),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(GivenStatement(Given,I,HttpStatement(HttpConnectAction(connect,to,StringLiteral,and,HttpAction(do,get)),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(GivenStatement(Given,I,FsStatement(FsConnectAction(FsSend(send,path,StringLiteral,and,FsAction(read,verbatim,file,content))),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(GivenStatement(Given,I,ZencodeStatement(ZencodeSend(send,keys,StringLiteral,and,ZencodeSend(send,data,StringLiteral,and,ZencodeSend(send,script,StringLiteral,and,ZencodeAction(execute,zencode)))),and,SaveAction(output,into,StringLiteral)))),Comment, - SlangroomStatement(GivenStatement(Given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersAction(manipulate,and,get))),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(GivenStatement(Given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersAction(manipulate,and,get))),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(GivenStatement(Given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))), - SlangroomStatement(GivenStatement(Given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))), - SlangroomStatement(GivenStatement(Given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))), - SlangroomStatement(GivenStatement(Given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))), - SlangroomStatement(GivenStatement(Given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))), - SlangroomStatement(GivenStatement(Given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))), - SlangroomStatement(GivenStatement(Given,I,FsStatement(FsConnectAction(FsSend(send,path,StringLiteral,and,FsAction(read,verbatim,file,content))),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(GivenStatement(Given,I,ZencodeStatement(ZencodeSend(send,keys,StringLiteral,and,ZencodeSend(send,data,StringLiteral,and,ZencodeSend(send,script,StringLiteral,and,ZencodeAction(execute,zencode)))),and,SaveAction(output,into,StringLiteral)))),Comment, - SlangroomStatement(GivenStatement(Given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersAction(manipulate,and,get))),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(GivenStatement(Given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersAction(manipulate,and,get))),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(GivenStatement(Given,I,HttpStatement(HttpConnectAction(connect,to,StringLiteral,and,HttpSend(send,object,StringLiteral,and,HttpAction(do,post))),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral,named,StringLiteral)), - SlangroomStatement(ThenPrint(Then,print,Keywords(the),Keywords(data)))) - +Statement(Comment,SlangroomStatement(GivenStatement(given,I,FsStatement(FsConnectAction(FsSend(send,path,StringLiteral,and,FsAction(read,file,content))),and,SaveAction(output,Identifier,into,StringLiteral)))), + SlangroomStatement(GivenStatement(given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersAction(manipulate,and,get))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(GivenStatement(given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersAction(manipulate,and,get))),and,SaveAction(output,Identifier,into,StringLiteral)))),Comment, + SlangroomStatement(GivenStatement(given,I,FsStatement(FsConnectAction(FsSend(send,path,StringLiteral,and,FsAction(read,file,content))),and,SaveAction(output,into,StringLiteral)))),Comment, + SlangroomStatement(GivenStatement(given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))), + SlangroomStatement(GivenStatement(given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))), + SlangroomStatement(GivenStatement(given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))), + SlangroomStatement(GivenStatement(given,I,FsStatement(FsConnectAction(FsSend(send,path,StringLiteral,and,FsAction(read,verbatim,file,content))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(GivenStatement(given,I,ZencodeStatement(ZencodeSend(send,keys,StringLiteral,and,ZencodeSend(send,data,StringLiteral,and,ZencodeSend(send,script,StringLiteral,and,ZencodeAction(execute,zencode)))),and,SaveAction(output,into,StringLiteral)))),Comment, + SlangroomStatement(GivenStatement(given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersAction(manipulate,and,get))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(GivenStatement(given,I,HttpStatement(HttpConnectAction(connect,to,StringLiteral,and,HttpAction(do,get)),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(GivenStatement(given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersAction(manipulate,and,get))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(GivenStatement(given,I,FsStatement(FsConnectAction(FsSend(send,path,StringLiteral,and,FsAction(read,verbatim,file,content))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(GivenStatement(given,I,ZencodeStatement(ZencodeSend(send,keys,StringLiteral,and,ZencodeSend(send,data,StringLiteral,and,ZencodeSend(send,script,StringLiteral,and,ZencodeAction(execute,zencode)))),and,SaveAction(output,into,StringLiteral)))),Comment, + SlangroomStatement(GivenStatement(given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersAction(manipulate,and,get))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(GivenStatement(given,I,HttpStatement(HttpConnectAction(connect,to,StringLiteral,and,HttpAction(do,get)),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(GivenStatement(given,I,FsStatement(FsConnectAction(FsSend(send,path,StringLiteral,and,FsAction(read,verbatim,file,content))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(GivenStatement(given,I,ZencodeStatement(ZencodeSend(send,keys,StringLiteral,and,ZencodeSend(send,data,StringLiteral,and,ZencodeSend(send,script,StringLiteral,and,ZencodeAction(execute,zencode)))),and,SaveAction(output,into,StringLiteral)))),Comment, + SlangroomStatement(GivenStatement(given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersAction(manipulate,and,get))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(GivenStatement(given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersAction(manipulate,and,get))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(GivenStatement(given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))), + SlangroomStatement(GivenStatement(given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))), + SlangroomStatement(GivenStatement(given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))), + SlangroomStatement(GivenStatement(given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))), + SlangroomStatement(GivenStatement(given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))), + SlangroomStatement(GivenStatement(given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))), + SlangroomStatement(GivenStatement(given,I,FsStatement(FsConnectAction(FsSend(send,path,StringLiteral,and,FsAction(read,verbatim,file,content))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(GivenStatement(given,I,ZencodeStatement(ZencodeSend(send,keys,StringLiteral,and,ZencodeSend(send,data,StringLiteral,and,ZencodeSend(send,script,StringLiteral,and,ZencodeAction(execute,zencode)))),and,SaveAction(output,into,StringLiteral)))),Comment, + SlangroomStatement(GivenStatement(given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersAction(manipulate,and,get))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(GivenStatement(given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersAction(manipulate,and,get))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(GivenStatement(given,I,HttpStatement(HttpConnectAction(connect,to,StringLiteral,and,HttpSend(send,object,StringLiteral,and,HttpAction(do,post))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral)), + SlangroomStatement(ThenPrint(then,print,Keywords(the),Keywords(data)))) #Test from Didroom 3 @@ -502,60 +508,59 @@ Then I manipulate and delete and output into 'parresult' ==> -Statement(SlangroomStatement(GivenStatement(Given,I,FsStatement(FsConnectAction(FsSend(send,path,StringLiteral,and,FsAction(read,file,content))),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral,named,StringLiteral)),Comment, - SlangroomStatement(GivenName(Given,my,name,is,Keywords(in),Keywords(a),StringLiteral,Keywords(named),StringLiteral)), - SlangroomStatement(GivenHaveStatement(Given,I,have,the,StringLiteral,in,StringLiteral)), - SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral,named,StringLiteral)), - SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral,named,StringLiteral)), - SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral,named,StringLiteral)), - SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral,named,StringLiteral)),Comment, - SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral,named,StringLiteral)), - SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral,named,StringLiteral)), - SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral,named,StringLiteral)), - SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral,named,StringLiteral)), - SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral,named,StringLiteral)), - SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral,named,StringLiteral)), - SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral,named,StringLiteral)), - SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral,named,StringLiteral)), - SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral,named,StringLiteral,inside,StringLiteral)), - SlangroomStatement(WhenStatement(When,I,Identifier,StringLiteral,Keywords(to),StringLiteral)),Comment, - SlangroomStatement(WhenStatement(When,I,Keywords(set),StringLiteral,Keywords(to),StringLiteral,Keywords(as),StringLiteral)), - SlangroomStatement(WhenStatement(When,I,Keywords(create),Keywords(the),Keywords(url),Keywords(from),StringLiteral)), - SlangroomStatement(WhenStatement(When,I,Identifier,StringLiteral,Keywords(as),Identifier,Keywords(request),Keywords(to),StringLiteral)), - SlangroomStatement(WhenStatement(When,I,Identifier,StringLiteral,Keywords(as),Identifier,Keywords(request),Keywords(to),StringLiteral)), - SlangroomStatement(WhenStatement(When,I,Identifier,StringLiteral,Keywords(as),Identifier,Keywords(request),Keywords(to),StringLiteral)), - SlangroomStatement(WhenStatement(When,I,Identifier,StringLiteral,Keywords(as),Identifier,Keywords(request),Keywords(to),StringLiteral)), - SlangroomStatement(WhenStatement(When,I,Identifier,StringLiteral,Keywords(as),Identifier,Keywords(request),Keywords(to),StringLiteral)), - SlangroomStatement(WhenStatement(When,I,Identifier,Keywords(the),Identifier,Identifier,Keywords(of),StringLiteral,Keywords(as),Identifier,Keywords(request),Keywords(to),StringLiteral)), - SlangroomStatement(WhenStatement(When,I,Keywords(create),Keywords(the),Keywords(json),Identifier,Identifier,Keywords(of),StringLiteral)), - SlangroomStatement(WhenStatement(When,I,Identifier,Keywords(the),StringLiteral,Keywords(to),StringLiteral)), - SlangroomStatement(WhenStatement(When,I,Identifier,Keywords(the),StringLiteral,Keywords(to),StringLiteral)), - SlangroomStatement(WhenStatement(When,I,Identifier,Keywords(the),Identifier,Identifier,Keywords(of),StringLiteral,Keywords(as),Identifier,Keywords(request),Keywords(to),StringLiteral)), - SlangroomStatement(WhenStatement(When,I,Identifier,Keywords(the),Identifier,StringLiteral,Keywords(bytes),Keywords(of),StringLiteral)), - SlangroomStatement(WhenStatement(When,I,Identifier,Keywords(the),StringLiteral,Keywords(to),StringLiteral)), - SlangroomStatement(WhenStatement(When,I,Identifier,StringLiteral,Keywords(in),StringLiteral)),Comment, - SlangroomStatement(WhenStatement(When,I,Identifier,Keywords(the),StringLiteral,Keywords(to),StringLiteral,Keywords(in),StringLiteral)), - SlangroomStatement(WhenStatement(When,I,Identifier,StringLiteral,Keywords(in),StringLiteral)), - SlangroomStatement(WhenStatement(When,I,Identifier,Keywords(the),StringLiteral,Keywords(to),StringLiteral,Keywords(in),StringLiteral)), - SlangroomStatement(WhenStatement(When,I,Keywords(create),Identifier,Keywords(of),Identifier,StringLiteral,Keywords(from),Keywords(array),StringLiteral)), - SlangroomStatement(WhenStatement(When,I,Identifier,Keywords(the),StringLiteral,Keywords(to),StringLiteral)), - SlangroomStatement(WhenStatement(When,I,Identifier,StringLiteral,Keywords(in),StringLiteral)),Comment, - SlangroomStatement(WhenStatement(When,I,Identifier,Keywords(from),Keywords(path),StringLiteral)), - SlangroomStatement(WhenStatement(When,I,Identifier,StringLiteral,Keywords(to),StringLiteral,Keywords(in),StringLiteral)), - SlangroomStatement(WhenStatement(When,I,Keywords(create),Keywords(jwk),Keywords(of),Identifier,Keywords(public),Keywords(key),Keywords(with),Identifier,Keywords(key))), - SlangroomStatement(WhenStatement(When,I,Identifier,StringLiteral,Keywords(in),StringLiteral)), - SlangroomStatement(ThenPrint(Then,print,Keywords(the),StringLiteral)), - SlangroomStatement(ThenPrint(Then,print,Keywords(the),StringLiteral)), - SlangroomStatement(ThenPrint(Then,print,Keywords(the),StringLiteral)), - SlangroomStatement(ThenStatement(Then,I,OAuthStatement(OAuthSend(send,request,StringLiteral,and,OAuthSend(send,client,StringLiteral,and,OAuthSend(send,server_data,StringLiteral,and,OAuthSend(send,expires_in,StringLiteral,and,OAuthAction(generate,request,uri))))),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(ThenStatement(Then,I,HelpersStatement(HelpersAction(manipulate,and,delete),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(ThenStatement(Then,I,HelpersStatement(HelpersAction(manipulate,and,delete),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(ThenStatement(Then,I,HelpersStatement(HelpersAction(manipulate,and,delete),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(ThenStatement(Then,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersAction(manipulate,and,get))),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(ThenStatement(Then,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersAction(manipulate,and,get))),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(ThenStatement(Then,I,HelpersStatement(HelpersAction(manipulate,and,delete),and,SaveAction(output,into,StringLiteral))))) - +Statement(SlangroomStatement(GivenStatement(given,I,FsStatement(FsConnectAction(FsSend(send,path,StringLiteral,and,FsAction(read,file,content))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral)),Comment, + SlangroomStatement(GivenName(given,my,name,is,Keywords(in),Keywords(a),StringLiteral,Keywords(named),StringLiteral)), + SlangroomStatement(GivenHaveStatement(given,I,have,the,StringLiteral,in,StringLiteral)), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral)), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral)), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral)), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral)),Comment, + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral)), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral)), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral)), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral)), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral)), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral)), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral)), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral)), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral,inside,StringLiteral)), + SlangroomStatement(WhenStatement(when,I,Identifier,StringLiteral,Keywords(to),StringLiteral)),Comment, + SlangroomStatement(WhenStatement(when,I,Keywords(set),StringLiteral,Keywords(to),StringLiteral,Keywords(as),StringLiteral)), + SlangroomStatement(WhenStatement(when,I,Keywords(create),Keywords(the),Keywords(url),Keywords(from),StringLiteral)), + SlangroomStatement(WhenStatement(when,I,Identifier,StringLiteral,Keywords(as),Identifier,Keywords(request),Keywords(to),StringLiteral)), + SlangroomStatement(WhenStatement(when,I,Identifier,StringLiteral,Keywords(as),Identifier,Keywords(request),Keywords(to),StringLiteral)), + SlangroomStatement(WhenStatement(when,I,Identifier,StringLiteral,Keywords(as),Identifier,Keywords(request),Keywords(to),StringLiteral)), + SlangroomStatement(WhenStatement(when,I,Identifier,StringLiteral,Keywords(as),Identifier,Keywords(request),Keywords(to),StringLiteral)), + SlangroomStatement(WhenStatement(when,I,Identifier,StringLiteral,Keywords(as),Identifier,Keywords(request),Keywords(to),StringLiteral)), + SlangroomStatement(WhenStatement(when,I,Identifier,Keywords(the),Identifier,Identifier,Keywords(of),StringLiteral,Keywords(as),Identifier,Keywords(request),Keywords(to),StringLiteral)), + SlangroomStatement(WhenStatement(when,I,Keywords(create),Keywords(the),Keywords(json),Identifier,Identifier,Keywords(of),StringLiteral)), + SlangroomStatement(WhenStatement(when,I,Identifier,Keywords(the),StringLiteral,Keywords(to),StringLiteral)), + SlangroomStatement(WhenStatement(when,I,Identifier,Keywords(the),StringLiteral,Keywords(to),StringLiteral)), + SlangroomStatement(WhenStatement(when,I,Identifier,Keywords(the),Identifier,Identifier,Keywords(of),StringLiteral,Keywords(as),Identifier,Keywords(request),Keywords(to),StringLiteral)), + SlangroomStatement(WhenStatement(when,I,Identifier,Keywords(the),Identifier,StringLiteral,Keywords(bytes),Keywords(of),StringLiteral)), + SlangroomStatement(WhenStatement(when,I,Identifier,Keywords(the),StringLiteral,Keywords(to),StringLiteral)), + SlangroomStatement(WhenStatement(when,I,Identifier,StringLiteral,Keywords(in),StringLiteral)),Comment, + SlangroomStatement(WhenStatement(when,I,Identifier,Keywords(the),StringLiteral,Keywords(to),StringLiteral,Keywords(in),StringLiteral)), + SlangroomStatement(WhenStatement(when,I,Identifier,StringLiteral,Keywords(in),StringLiteral)), + SlangroomStatement(WhenStatement(when,I,Identifier,Keywords(the),StringLiteral,Keywords(to),StringLiteral,Keywords(in),StringLiteral)), + SlangroomStatement(WhenStatement(when,I,Keywords(create),Identifier,Keywords(of),Identifier,StringLiteral,Keywords(from),Keywords(array),StringLiteral)), + SlangroomStatement(WhenStatement(when,I,Identifier,Keywords(the),StringLiteral,Keywords(to),StringLiteral)), + SlangroomStatement(WhenStatement(when,I,Identifier,StringLiteral,Keywords(in),StringLiteral)),Comment, + SlangroomStatement(WhenStatement(when,I,Identifier,Keywords(from),Keywords(path),StringLiteral)), + SlangroomStatement(WhenStatement(when,I,Identifier,StringLiteral,Keywords(to),StringLiteral,Keywords(in),StringLiteral)), + SlangroomStatement(WhenStatement(when,I,Keywords(create),Keywords(jwk),Keywords(of),Identifier,Keywords(public),Keywords(key),Keywords(with),Identifier,Keywords(key))), + SlangroomStatement(WhenStatement(when,I,Identifier,StringLiteral,Keywords(in),StringLiteral)), + SlangroomStatement(ThenPrint(then,print,Keywords(the),StringLiteral)), + SlangroomStatement(ThenPrint(then,print,Keywords(the),StringLiteral)), + SlangroomStatement(ThenPrint(then,print,Keywords(the),StringLiteral)), + SlangroomStatement(ThenStatement(then,I,OAuthStatement(OAuthSend(send,request,StringLiteral,and,OAuthSend(send,client,StringLiteral,and,OAuthSend(send,server_data,StringLiteral,and,OAuthSend(send,expires_in,StringLiteral,and,OAuthAction(generate,request,uri))))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(ThenStatement(then,I,HelpersStatement(HelpersAction(manipulate,and,delete),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(ThenStatement(then,I,HelpersStatement(HelpersAction(manipulate,and,delete),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(ThenStatement(then,I,HelpersStatement(HelpersAction(manipulate,and,delete),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(ThenStatement(then,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersAction(manipulate,and,get))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(ThenStatement(then,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersAction(manipulate,and,get))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(ThenStatement(then,I,HelpersStatement(HelpersAction(manipulate,and,delete),and,SaveAction(output,into,StringLiteral))))) #Test from Didroom 4 @@ -672,58 +677,56 @@ Then I manipulate and delete and output into 'secrets' ==> -Statement(RuleStatement(Rule,GenericRule(Keywords(output),Identifier,Identifier)),ScenarioStatement(Scenario,ScenarioType(Identifier)),ScenarioStatement(Scenario,ScenarioType(Identifier)), - ScenarioStatement(Scenario,ScenarioType(Keywords(ethereum))),ScenarioStatement(Scenario,ScenarioType(Identifier)),ScenarioStatement(Scenario,ScenarioType(Identifier)),ScenarioStatement(Scenario,ScenarioType(Identifier)), - ScenarioStatement(Scenario,ScenarioType(Identifier)),ScenarioStatement(Scenario,ScenarioType(Identifier)),Comment, - SlangroomStatement(GivenStatement(Given,I,ShellStatement(ShellSend(send,command,StringLiteral,and,ShellAction(execute,in,shell)),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(GivenStatement(Given,I,FsStatement(FsConnectAction(FsSend(send,path,StringLiteral,and,FsAction(verify,file,does,not,exist)))))),Comment, - SlangroomStatement(GivenStatement(Given,I,FsStatement(FsConnectAction(FsSend(send,path,StringLiteral,and,FsAction(read,verbatim,file,content))),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(GivenStatement(Given,I,ZencodeStatement(ZencodeSend(send,keys,StringLiteral,and,ZencodeSend(send,data,StringLiteral,and,ZencodeSend(send,script,StringLiteral,and,ZencodeAction(execute,zencode)))),and,SaveAction(output,Identifier,into,StringLiteral)))),Comment, - SlangroomStatement(GivenStatement(Given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersAction(manipulate,and,get))),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(GivenStatement(Given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersAction(manipulate,and,get))),and,SaveAction(output,Identifier,into,StringLiteral)))),Comment, - SlangroomStatement(GivenStatement(Given,I,FsStatement(FsConnectAction(FsSend(send,path,StringLiteral,and,FsAction(read,file,content))),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral,named,StringLiteral)), - SlangroomStatement(GivenName(Given,I,my,name,is,Keywords(in),Keywords(a),StringLiteral,Keywords(named),StringLiteral,HaveStatement(and,I,have,a,StringLiteral,named,StringLiteral),HaveStatement(and,I,have,a,StringLiteral,in,StringLiteral),HaveStatement(and,I,have,a,StringLiteral,named,StringLiteral))), - SlangroomStatement(IfEndifStatement(Condition(If,I,verify,StringLiteral,Keywords(is),Identifier,Keywords(in),StringLiteral),WhenStatement(When,I,Identifier,Keywords(from),Keywords(path),StringLiteral,and,I,Identifier,StringLiteral,Keywords(to),StringLiteral),EndIf)), - SlangroomStatement(IfEndifStatement(Condition(If,I,verify,StringLiteral,Keywords(is),Keywords(not),Identifier,Keywords(in),StringLiteral),WhenStatement(When,I,Identifier,StringLiteral,Keywords(to),StringLiteral),EndIf)), - SlangroomStatement(WhenStatement(When,I,Keywords(create),Keywords(the),Identifier,Keywords(public),Keywords(key),and,I,Keywords(create),Keywords(the),Identifier,Keywords(public),Keywords(key),and,I,Keywords(create),Keywords(the),Keywords(ethereum),Keywords(address),and,I,Keywords(create),Keywords(the),Identifier,Keywords(public),Keywords(key),and,I,Keywords(create),Keywords(the),Identifier,Keywords(public),Keywords(key),and,I,Keywords(create),Keywords(the),Identifier,Keywords(public),Keywords(key),and,I,Keywords(create),Keywords(the),Identifier,Keywords(public),Keywords(key),and,I,Keywords(create),Keywords(the),Identifier,Keywords(public),Keywords(key),and,I,Keywords(create),Keywords(the),Identifier,Keywords(public),Keywords(key))), - SlangroomStatement(ThenPrint(Then,I,print,Keywords(the),StringLiteral,and,I,print,Keywords(the),StringLiteral,and,I,print,Keywords(the),StringLiteral,and,I,print,Keywords(the),StringLiteral,and,I,print,Keywords(the),StringLiteral,and,I,print,Keywords(the),StringLiteral,and,I,print,Keywords(the),StringLiteral,Keywords(as),StringLiteral,and,I,print,Keywords(the),StringLiteral,and,I,print,Keywords(the),StringLiteral,and,I,print,Keywords(my),Keywords(name),Keywords(in),StringLiteral,and,I,print,Keywords(the),StringLiteral,and,I,print,Keywords(the),StringLiteral)),Comment,Comment, - SlangroomStatement(ThenStatement(Then,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))), - SlangroomStatement(ThenStatement(Then,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))), - SlangroomStatement(ThenStatement(Then,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))), - SlangroomStatement(ThenStatement(Then,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))), - SlangroomStatement(ThenStatement(Then,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))), - SlangroomStatement(ThenStatement(Then,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))), - SlangroomStatement(ThenStatement(Then,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))), - SlangroomStatement(ThenStatement(Then,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))), - SlangroomStatement(ThenStatement(Then,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))), - SlangroomStatement(ThenStatement(Then,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))), - SlangroomStatement(ThenStatement(Then,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))),Comment, - SlangroomStatement(ThenStatement(Then,I,FsStatement(FsConnectAction(FsSend(send,path,StringLiteral,and,FsAction(read,verbatim,file,content))),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(ThenStatement(Then,I,ZencodeStatement(ZencodeSend(send,keys,StringLiteral,and,ZencodeSend(send,data,StringLiteral,and,ZencodeSend(send,script,StringLiteral,and,ZencodeAction(execute,zencode)))),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(ThenStatement(Then,I,HelpersStatement(HelpersAction(manipulate,and,delete),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(ThenStatement(Then,I,HelpersStatement(HelpersAction(manipulate,and,delete),and,SaveAction(output,into,StringLiteral)))),Comment, - SlangroomStatement(ThenStatement(Then,I,HttpStatement(HttpConnectAction(connect,to,StringLiteral,and,HttpSend(send,object,StringLiteral,and,HttpAction(do,post))),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(ThenStatement(Then,I,HelpersStatement(HelpersAction(manipulate,and,delete),and,SaveAction(output,into,StringLiteral)))),Comment, - SlangroomStatement(ThenStatement(Then,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersAction(manipulate,and,get))),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(ThenStatement(Then,I,HttpStatement(HttpConnectAction(connect,to,StringLiteral,and,HttpSend(send,object,StringLiteral,and,HttpAction(do,post))),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(ThenStatement(Then,I,HelpersStatement(HelpersAction(manipulate,and,delete),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(ThenStatement(Then,I,HelpersStatement(HelpersAction(manipulate,and,delete),and,SaveAction(output,into,StringLiteral)))),Comment, - SlangroomStatement(ThenStatement(Then,I,FsStatement(FsConnectAction(FsSend(send,path,StringLiteral,and,FsAction(read,file,content))),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(ThenStatement(Then,I,FsStatement(FsConnectAction(FsSend(send,path,StringLiteral,and,FsAction(read,verbatim,file,content))),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(ThenStatement(Then,I,ZencodeStatement(ZencodeSend(send,keys,StringLiteral,and,ZencodeSend(send,data,StringLiteral,and,ZencodeSend(send,script,StringLiteral,and,ZencodeAction(execute,zencode)))),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(ThenStatement(Then,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersAction(manipulate,and,get))),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(ThenStatement(Then,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))), - SlangroomStatement(ThenStatement(Then,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))), - SlangroomStatement(ThenStatement(Then,I,FsStatement(FsConnectAction(FsSend(send,path,StringLiteral,and,FsSend(send,content,StringLiteral,and,FsAction(store,in,file))))))), - SlangroomStatement(ThenStatement(Then,I,ShellStatement(ShellSend(send,command,StringLiteral,and,ShellAction(execute,in,shell))))), - SlangroomStatement(ThenStatement(Then,I,FsStatement(FsConnectAction(FsSend(send,path,StringLiteral,and,FsSend(send,content,StringLiteral,and,FsAction(store,in,file))))))), - SlangroomStatement(ThenStatement(Then,I,HelpersStatement(HelpersAction(manipulate,and,delete),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(ThenStatement(Then,I,HelpersStatement(HelpersAction(manipulate,and,delete),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(ThenStatement(Then,I,HelpersStatement(HelpersAction(manipulate,and,delete),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(ThenStatement(Then,I,HelpersStatement(HelpersAction(manipulate,and,delete),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(ThenStatement(Then,I,HelpersStatement(HelpersAction(manipulate,and,delete),and,SaveAction(output,into,StringLiteral)))), - SlangroomStatement(ThenStatement(Then,I,HelpersStatement(HelpersAction(manipulate,and,delete),and,SaveAction(output,into,StringLiteral))))) +Statement(RuleStatement(rule,GenericRule(Keywords(output),Identifier,Identifier)),ScenarioStatement(scenario,ScenarioType(Identifier)),ScenarioStatement(scenario,ScenarioType(Identifier)),ScenarioStatement(scenario,ScenarioType(Keywords(ethereum))),ScenarioStatement(scenario,ScenarioType(Identifier)),ScenarioStatement(scenario,ScenarioType(Identifier)),ScenarioStatement(scenario,ScenarioType(Identifier)),ScenarioStatement(scenario,ScenarioType(Identifier)),ScenarioStatement(scenario,ScenarioType(Identifier)),Comment, + SlangroomStatement(GivenStatement(given,I,ShellStatement(ShellSend(send,command,StringLiteral,and,ShellAction(execute,in,shell)),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(GivenStatement(given,I,FsStatement(FsConnectAction(FsSend(send,path,StringLiteral,and,FsAction(verify,file,does,not,exist)))))),Comment, + SlangroomStatement(GivenStatement(given,I,FsStatement(FsConnectAction(FsSend(send,path,StringLiteral,and,FsAction(read,verbatim,file,content))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(GivenStatement(given,I,ZencodeStatement(ZencodeSend(send,keys,StringLiteral,and,ZencodeSend(send,data,StringLiteral,and,ZencodeSend(send,script,StringLiteral,and,ZencodeAction(execute,zencode)))),and,SaveAction(output,Identifier,into,StringLiteral)))),Comment, + SlangroomStatement(GivenStatement(given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersAction(manipulate,and,get))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(GivenStatement(given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersAction(manipulate,and,get))),and,SaveAction(output,Identifier,into,StringLiteral)))),Comment, + SlangroomStatement(GivenStatement(given,I,FsStatement(FsConnectAction(FsSend(send,path,StringLiteral,and,FsAction(read,file,content))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral)), + SlangroomStatement(GivenName(given,I,my,name,is,Keywords(in),Keywords(a),StringLiteral,Keywords(named),StringLiteral,HaveStatement(and,I,have,a,StringLiteral,named,StringLiteral),HaveStatement(and,I,have,a,StringLiteral,in,StringLiteral),HaveStatement(and,I,have,a,StringLiteral,named,StringLiteral))), + SlangroomStatement(IfEndifStatement(Condition(if,I,verify,StringLiteral,Keywords(is),Identifier,Keywords(in),StringLiteral),WhenStatement(when,I,Identifier,Keywords(from),Keywords(path),StringLiteral,and,I,Identifier,StringLiteral,Keywords(to),StringLiteral),endif)), + SlangroomStatement(IfEndifStatement(Condition(if,I,verify,StringLiteral,Keywords(is),Keywords(not),Identifier,Keywords(in),StringLiteral),WhenStatement(when,I,Identifier,StringLiteral,Keywords(to),StringLiteral),endif)), + SlangroomStatement(WhenStatement(when,I,Keywords(create),Keywords(the),Identifier,Keywords(public),Keywords(key),and,I,Keywords(create),Keywords(the),Identifier,Keywords(public),Keywords(key),and,I,Keywords(create),Keywords(the),Keywords(ethereum),Keywords(address),and,I,Keywords(create),Keywords(the),Identifier,Keywords(public),Keywords(key),and,I,Keywords(create),Keywords(the),Identifier,Keywords(public),Keywords(key),and,I,Keywords(create),Keywords(the),Identifier,Keywords(public),Keywords(key),and,I,Keywords(create),Keywords(the),Identifier,Keywords(public),Keywords(key),and,I,Keywords(create),Keywords(the),Identifier,Keywords(public),Keywords(key),and,I,Keywords(create),Keywords(the),Identifier,Keywords(public),Keywords(key))), + SlangroomStatement(ThenPrint(then,I,print,Keywords(the),StringLiteral,and,I,print,Keywords(the),StringLiteral,and,I,print,Keywords(the),StringLiteral,and,I,print,Keywords(the),StringLiteral,and,I,print,Keywords(the),StringLiteral,and,I,print,Keywords(the),StringLiteral,and,I,print,Keywords(the),StringLiteral,Keywords(as),StringLiteral,and,I,print,Keywords(the),StringLiteral,and,I,print,Keywords(the),StringLiteral,and,I,print,Keywords(my),Keywords(name),Keywords(in),StringLiteral,and,I,print,Keywords(the),StringLiteral,and,I,print,Keywords(the),StringLiteral)),Comment,Comment, + SlangroomStatement(ThenStatement(then,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))), + SlangroomStatement(ThenStatement(then,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))), + SlangroomStatement(ThenStatement(then,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))), + SlangroomStatement(ThenStatement(then,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))), + SlangroomStatement(ThenStatement(then,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))), + SlangroomStatement(ThenStatement(then,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))), + SlangroomStatement(ThenStatement(then,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))), + SlangroomStatement(ThenStatement(then,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))), + SlangroomStatement(ThenStatement(then,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))), + SlangroomStatement(ThenStatement(then,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))), + SlangroomStatement(ThenStatement(then,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))),Comment, + SlangroomStatement(ThenStatement(then,I,FsStatement(FsConnectAction(FsSend(send,path,StringLiteral,and,FsAction(read,verbatim,file,content))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(ThenStatement(then,I,ZencodeStatement(ZencodeSend(send,keys,StringLiteral,and,ZencodeSend(send,data,StringLiteral,and,ZencodeSend(send,script,StringLiteral,and,ZencodeAction(execute,zencode)))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(ThenStatement(then,I,HelpersStatement(HelpersAction(manipulate,and,delete),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(ThenStatement(then,I,HelpersStatement(HelpersAction(manipulate,and,delete),and,SaveAction(output,into,StringLiteral)))),Comment, + SlangroomStatement(ThenStatement(then,I,HttpStatement(HttpConnectAction(connect,to,StringLiteral,and,HttpSend(send,object,StringLiteral,and,HttpAction(do,post))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(ThenStatement(then,I,HelpersStatement(HelpersAction(manipulate,and,delete),and,SaveAction(output,into,StringLiteral)))),Comment, + SlangroomStatement(ThenStatement(then,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersAction(manipulate,and,get))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(ThenStatement(then,I,HttpStatement(HttpConnectAction(connect,to,StringLiteral,and,HttpSend(send,object,StringLiteral,and,HttpAction(do,post))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(ThenStatement(then,I,HelpersStatement(HelpersAction(manipulate,and,delete),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(ThenStatement(then,I,HelpersStatement(HelpersAction(manipulate,and,delete),and,SaveAction(output,into,StringLiteral)))),Comment, + SlangroomStatement(ThenStatement(then,I,FsStatement(FsConnectAction(FsSend(send,path,StringLiteral,and,FsAction(read,file,content))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(ThenStatement(then,I,FsStatement(FsConnectAction(FsSend(send,path,StringLiteral,and,FsAction(read,verbatim,file,content))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(ThenStatement(then,I,ZencodeStatement(ZencodeSend(send,keys,StringLiteral,and,ZencodeSend(send,data,StringLiteral,and,ZencodeSend(send,script,StringLiteral,and,ZencodeAction(execute,zencode)))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(ThenStatement(then,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersAction(manipulate,and,get))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(ThenStatement(then,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))), + SlangroomStatement(ThenStatement(then,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersSend(send,value,StringLiteral,and,HelpersAction(manipulate,and,set))))))), + SlangroomStatement(ThenStatement(then,I,FsStatement(FsConnectAction(FsSend(send,path,StringLiteral,and,FsSend(send,content,StringLiteral,and,FsAction(store,in,file))))))), + SlangroomStatement(ThenStatement(then,I,ShellStatement(ShellSend(send,command,StringLiteral,and,ShellAction(execute,in,shell))))), + SlangroomStatement(ThenStatement(then,I,FsStatement(FsConnectAction(FsSend(send,path,StringLiteral,and,FsSend(send,content,StringLiteral,and,FsAction(store,in,file))))))), + SlangroomStatement(ThenStatement(then,I,HelpersStatement(HelpersAction(manipulate,and,delete),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(ThenStatement(then,I,HelpersStatement(HelpersAction(manipulate,and,delete),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(ThenStatement(then,I,HelpersStatement(HelpersAction(manipulate,and,delete),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(ThenStatement(then,I,HelpersStatement(HelpersAction(manipulate,and,delete),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(ThenStatement(then,I,HelpersStatement(HelpersAction(manipulate,and,delete),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(ThenStatement(then,I,HelpersStatement(HelpersAction(manipulate,and,delete),and,SaveAction(output,into,StringLiteral))))) #Comment after Scenario @@ -732,7 +735,7 @@ Scenario eddsa: verify presentation ==> -Statement(ScenarioStatement(Scenario,ScenarioType(Identifier),ScenarioComment(Keywords(verify),Identifier)),Comment) +Statement(ScenarioStatement(scenario,ScenarioType(Identifier),ScenarioComment(Keywords(verify),Identifier)),Comment) #Foreach script @@ -755,10 +758,86 @@ Then print 'numbers' ==> -Statement(SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral,named,StringLiteral)),SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral,named,StringLiteral,inside,StringLiteral)), - SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral,named,StringLiteral,inside,StringLiteral)),SlangroomStatement(GivenHaveStatement(Given,I,have,a,StringLiteral,named,StringLiteral,inside,StringLiteral)), - SlangroomStatement(WhenStatement(When,I,Keywords(create),Keywords(the),StringLiteral,Keywords(named),StringLiteral)),SlangroomStatement(ForEachStatement(Foreach,StringLiteral,inside,StringLiteral, - WhenStatement(When,I,Keywords(create),Keywords(the),Identifier,Keywords(of),StringLiteral),WhenStatement(When,I,Identifier,StringLiteral,Keywords(in),StringLiteral),EndForeach)), - SlangroomStatement(WhenStatement(When,I,Keywords(create),Keywords(the),StringLiteral,Keywords(named),StringLiteral)),SlangroomStatement(ForEachStatement(Foreach,StringLiteral,in,Identifier,Keywords(from),StringLiteral,Keywords(to),StringLiteral,Keywords(with),Identifier,StringLiteral, - WhenStatement(When,I,Identifier,StringLiteral,Keywords(in),StringLiteral),EndForeach)),SlangroomStatement(ThenPrint(Then,print,StringLiteral)),SlangroomStatement(ThenPrint(Then,print,StringLiteral)), - SlangroomStatement(ThenPrint(Then,print,StringLiteral))) +Statement( + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral)), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral,inside,StringLiteral)), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral,inside,StringLiteral)), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral,inside,StringLiteral)), + SlangroomStatement(WhenStatement(when,I,Keywords(create),Keywords(the),StringLiteral,Keywords(named),StringLiteral)), + SlangroomStatement(ForEachStatement(foreach,StringLiteral,inside,StringLiteral,WhenStatement(when,I,Keywords(create),Keywords(the),Identifier,Keywords(of),StringLiteral),WhenStatement(when,I,Identifier,StringLiteral,Keywords(in),StringLiteral),endforeach)), + SlangroomStatement(WhenStatement(when,I,Keywords(create),Keywords(the),StringLiteral,Keywords(named),StringLiteral)), + SlangroomStatement(ForEachStatement(foreach,StringLiteral,in,Identifier,Keywords(from),StringLiteral,Keywords(to),StringLiteral,Keywords(with),Identifier,StringLiteral,WhenStatement(when,I,Identifier,StringLiteral,Keywords(in),StringLiteral),endforeach)), + SlangroomStatement(ThenPrint(then,print,StringLiteral)), + SlangroomStatement(ThenPrint(then,print,StringLiteral)), + SlangroomStatement(ThenPrint(then,print,StringLiteral))) + +# Case Insensitive Test + +SCENARIO 'HTTP' +SCENARIO 'W3C': CREATE JWK +RULE UNKNOWN IGNORE + +GIVEN I SEND PATH 'SECRETS_PATH' AND READ FILE CONTENT AND OUTPUT INTO 'SECRETS' +GIVEN I SEND OBJECT 'SECRETS' AND SEND PATH 'CONTROLLER_PATH' AND MANIPULATE AND GET AND OUTPUT INTO 'CONTROLLER' +GIVEN I SEND OBJECT 'SECRETS' AND SEND PATH 'CONTROLLER' AND MANIPULATE AND GET AND OUTPUT INTO 'PERSONAL_KEYRING' + +GIVEN I SEND PATH 'WELL-KNOWN_PATH' AND READ FILE CONTENT AND OUTPUT INTO 'WELL-KNOWN' +GIVEN I HAVE A 'STRING DICTIONARY' NAMED 'WELL-KNOWN' + +# LOADING THE PRIVATE KEYS +GIVEN MY NAME IS IN A 'STRING' NAMED 'CONTROLLER' +GIVEN I HAVE THE 'KEYRING' IN 'PERSONAL_KEYRING' + +GIVEN I HAVE A 'STRING DICTIONARY' NAMED 'SERVER' +GIVEN I HAVE A 'STRING DICTIONARY' NAMED 'REQUEST' +GIVEN I HAVE A 'STRING' NAMED 'REQUEST_URI' +GIVEN I HAVE A 'STRING' NAMED 'CLIENT_ID' + +# SERVER DATA +WHEN I PICKUP FROM PATH 'WELL-KNOWN.ISSUER' +WHEN I MOVE 'ISSUER' TO 'URL' IN 'SERVER' +WHEN I CREATE JWK OF ES256 PUBLIC KEY WITH PRIVATE KEY +WHEN I MOVE 'JWK' IN 'SERVER' + +# REQUEST.BODY +WHEN I SET 'BASE-URL' TO 'HTTP://' AS 'STRING' +WHEN I CREATE THE URL FROM 'BASE-URL' +WHEN I APPEND 'CLIENT_ID' AS HTTP REQUEST TO 'URL' +WHEN I APPEND THE PERCENT ENCODING OF 'REQUEST_URI' AS HTTP REQUEST TO 'URL' +WHEN I SPLIT THE LEFTMOST '8' BYTES OF 'URL' +WHEN I RENAME THE 'URL' TO 'BODY' +WHEN I MOVE 'BODY' IN 'REQUEST' + +THEN PRINT THE 'SERVER' +THEN PRINT THE 'REQUEST' + +THEN I SEND REQUEST 'REQUEST' AND SEND SERVER_DATA 'SERVER' AND VERIFY REQUEST PARAMETERS + +==> + +Statement(ScenarioStatement(scenario,ScenarioType(StringLiteral)),ScenarioStatement(scenario,ScenarioType(StringLiteral),ScenarioComment(Keywords(create),Keywords(jwk))),RuleStatement(rule,GenericRule(Keywords(unknown),Keywords(ignore))), + SlangroomStatement(GivenStatement(given,I,FsStatement(FsConnectAction(FsSend(send,path,StringLiteral,and,FsAction(read,file,content))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(GivenStatement(given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersAction(manipulate,and,get))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(GivenStatement(given,I,HelpersStatement(HelpersSend(send,object,StringLiteral,and,HelpersSend(send,path,StringLiteral,and,HelpersAction(manipulate,and,get))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(GivenStatement(given,I,FsStatement(FsConnectAction(FsSend(send,path,StringLiteral,and,FsAction(read,file,content))),and,SaveAction(output,into,StringLiteral)))), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral)),Comment, + SlangroomStatement(GivenName(given,my,name,is,Keywords(in),Keywords(a),StringLiteral,Keywords(named),StringLiteral)), + SlangroomStatement(GivenHaveStatement(given,I,have,the,StringLiteral,in,StringLiteral)), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral)), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral)), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral)), + SlangroomStatement(GivenHaveStatement(given,I,have,a,StringLiteral,named,StringLiteral)),Comment, + SlangroomStatement(WhenStatement(when,I,Identifier,Keywords(from),Keywords(path),StringLiteral)), + SlangroomStatement(WhenStatement(when,I,Identifier,StringLiteral,Keywords(to),StringLiteral,Keywords(in),StringLiteral)), + SlangroomStatement(WhenStatement(when,I,Keywords(create),Keywords(jwk),Keywords(of),Identifier,Keywords(public),Keywords(key),Keywords(with),Identifier,Keywords(key))), + SlangroomStatement(WhenStatement(when,I,Identifier,StringLiteral,Keywords(in),StringLiteral)),Comment, + SlangroomStatement(WhenStatement(when,I,Keywords(set),StringLiteral,Keywords(to),StringLiteral,Keywords(as),StringLiteral)), + SlangroomStatement(WhenStatement(when,I,Keywords(create),Keywords(the),Keywords(url),Keywords(from),StringLiteral)), + SlangroomStatement(WhenStatement(when,I,Identifier,StringLiteral,Keywords(as),Identifier,Keywords(request),Keywords(to),StringLiteral)), + SlangroomStatement(WhenStatement(when,I,Identifier,Keywords(the),Identifier,Identifier,Keywords(of),StringLiteral,Keywords(as),Identifier,Keywords(request),Keywords(to),StringLiteral)), + SlangroomStatement(WhenStatement(when,I,Identifier,Keywords(the),Identifier,StringLiteral,Keywords(bytes),Keywords(of),StringLiteral)), + SlangroomStatement(WhenStatement(when,I,Identifier,Keywords(the),StringLiteral,Keywords(to),StringLiteral)), + SlangroomStatement(WhenStatement(when,I,Identifier,StringLiteral,Keywords(in),StringLiteral)), + SlangroomStatement(ThenPrint(then,print,Keywords(the),StringLiteral)), + SlangroomStatement(ThenPrint(then,print,Keywords(the),StringLiteral)), + SlangroomStatement(ThenStatement(then,I,OAuthStatement(OAuthSend(send,request,StringLiteral,and,OAuthSend(send,server_data,StringLiteral,and,OAuthAction(verify,request,parameters))))))) diff --git a/grammar/test/test.js b/grammar/test/test.js index 009f7231..b3ee96dc 100644 --- a/grammar/test/test.js +++ b/grammar/test/test.js @@ -2,20 +2,23 @@ // // SPDX-License-Identifier: AGPL-3.0-or-later -import {SlangroomLanguage} from "../dist/index.js" -import {fileTests} from "@lezer/generator/dist/test" +import { SlangroomLanguage } from '../dist/index.js'; +import { fileTests } from '@lezer/generator/dist/test'; -import * as fs from "fs" -import * as path from "path" +import * as fs from 'fs'; +import * as path from 'path'; import { fileURLToPath } from 'url'; -let caseDir = path.dirname(fileURLToPath(import.meta.url)) +let caseDir = path.dirname(fileURLToPath(import.meta.url)); for (let file of fs.readdirSync(caseDir)) { - if (!/\.txt$/.test(file)) continue + if (!/\.txt$/.test(file)) continue; - let name = /^[^\.]*/.exec(file)[0] - describe(name, () => { - for (let {name, run} of fileTests(fs.readFileSync(path.join(caseDir, file), "utf8"), file)) - it(name, () => run(SlangroomLanguage.parser)) - }) + let name = /^[^\.]*/.exec(file)[0]; + describe(name, () => { + for (let { name, run } of fileTests( + fs.readFileSync(path.join(caseDir, file), 'utf8'), + file, + )) + it(name, () => run(SlangroomLanguage.parser)); + }); } diff --git a/grammar/tsconfig.json b/grammar/tsconfig.json index d8761521..cb62f1a4 100644 --- a/grammar/tsconfig.json +++ b/grammar/tsconfig.json @@ -1,11 +1,10 @@ { - "compilerOptions": { - "strict": true, - "target": "es6", - "module": "es2020", - "newLine": "lf", - "declaration": true, - "moduleResolution": "node" - }, - "include": ["src/*.ts"] + "compilerOptions": { + "strict": true, + "target": "es6", + "module": "es2020", + "newLine": "lf", + "moduleResolution": "node" + }, + "include": ["src/*.ts"] } diff --git a/grammar/utils/package.json b/grammar/utils/package.json new file mode 100644 index 00000000..17274982 --- /dev/null +++ b/grammar/utils/package.json @@ -0,0 +1,28 @@ +{ + "name": "grammar-utils", + "version": "0.0.0", + "main": "prepare_complete.mjs", + "module": "prepare_complete.mjs", + "scripts": { + "grammar-prepare": "node ./prepare_complete.mjs" + }, + "dependencies": {}, + "devDependencies": { + "@slangroom/core": "workspace:*", + "@slangroom/db": "workspace:*", + "@slangroom/ethereum": "workspace:*", + "@slangroom/fs": "workspace:*", + "@slangroom/git": "workspace:*", + "@slangroom/helpers": "workspace:*", + "@slangroom/http": "workspace:*", + "@slangroom/json-schema": "workspace:*", + "@slangroom/oauth": "workspace:*", + "@slangroom/pocketbase": "workspace:*", + "@slangroom/qrcode": "workspace:*", + "@slangroom/redis": "workspace:*", + "@slangroom/shell": "workspace:*", + "@slangroom/timestamp": "workspace:*", + "@slangroom/wallet": "workspace:*", + "@slangroom/zencode": "workspace:*" + } +} diff --git a/grammar/utils/package.json.license b/grammar/utils/package.json.license new file mode 100644 index 00000000..e7fc1c66 --- /dev/null +++ b/grammar/utils/package.json.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2024 Dyne.org foundation + +SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/grammar/utils/prepare_complete.mjs b/grammar/utils/prepare_complete.mjs new file mode 100644 index 00000000..f15f99a0 --- /dev/null +++ b/grammar/utils/prepare_complete.mjs @@ -0,0 +1,71 @@ +// SPDX-FileCopyrightText: 2024 Dyne.org foundation +// +// SPDX-License-Identifier: AGPL-3.0-or-later + +import { promises as pfs } from 'fs'; + +// slangroom +import { Slangroom } from "@slangroom/core"; + +// packages +import { db } from "@slangroom/db"; +import { ethereum } from "@slangroom/ethereum"; +import { fs } from "@slangroom/fs"; +import { git } from "@slangroom/git"; +import { helpers } from "@slangroom/helpers"; +import { http } from "@slangroom/http"; +import { JSONSchema } from "@slangroom/json-schema"; +import { oauth } from "@slangroom/oauth"; +import { pocketbase } from "@slangroom/pocketbase"; +import { qrcode } from "@slangroom/qrcode"; +import { redis } from "@slangroom/redis"; +import { shell } from "@slangroom/shell"; +import { timestamp } from "@slangroom/timestamp"; +import { wallet } from "@slangroom/wallet"; +import { zencode } from "@slangroom/zencode"; + +const fullStatementTemplates = []; + +const generateStatements = (plugin) => { + const p = new Slangroom(plugin).getPlugin() + p.forEach(([k]) => { + let openConnect = ''; + let params = ''; + if (k.openconnect) { + openConnect = k.openconnect == 'connect' ? `connect to '' and ` : `open '' and `; + } + if (k.params) { + k.params.forEach((param) => { + params = params.concat(`send ${param} '' and `); + }) + } + const statement = `I ${openConnect}${params}${k.phrase}`; + const lowerCaseStatement = `I ${openConnect}${params.toLowerCase()}${k.phrase.toLowerCase()}`; + fullStatementTemplates.push( + { label: `given ${lowerCaseStatement}`, displayLabel:`Given ${statement}`, apply: `Given ${statement}`, type: "keyword" }, + { label: `then ${lowerCaseStatement}`, displayLabel: `Then ${statement}`, apply: `Then ${statement}`, type: "keyword" }, + { label: `given ${lowerCaseStatement} and output into ''`, displayLabel: `Given ${statement} and output into ''`, apply: `Given ${statement} and output into ''`, type: "keyword" }, + { label: `then ${lowerCaseStatement} and output into ''`, displayLabel: `Then ${statement} and output into ''`, apply: `Then ${statement} and output into ''`, type: "keyword" } + ); + }); +} + +[ + db, + ethereum, + fs, + git, + helpers, + http, + JSONSchema, + oauth, + pocketbase, + qrcode, + redis, + shell, + timestamp, + wallet, + zencode +].map(x => generateStatements(x)) + +await pfs.writeFile('../src/complete_statement.ts', `export const fullStatementTemplates = ${JSON.stringify(fullStatementTemplates, null, 4)}`, 'utf-8') diff --git a/package.json b/package.json index 2e0fef92..1bc5a634 100644 --- a/package.json +++ b/package.json @@ -18,10 +18,11 @@ "lint": "eslint --ext .ts pkg/*/src pkg/*/test", "format": "prettier --ignore-path .gitignore --write '**/*.+(js|ts|json|html)'", "test": "pnpm build && pnpm -F @slangroom/* exec ava --verbose build/esm/test", - "test:grammar": "pnpm -F codemirror-lang-slangroom test", + "test:grammar": "pnpm build:grammar && pnpm -F codemirror-lang-slangroom test", "coverage": "c8 -r text -r lcov -o .coverage --exclude '**/test/' pnpm test", "clean": "rm -rf .coverage && pnpm -F @slangroom/* exec -- rm -rf build", "build": "pnpm -F @slangroom/* exec tsc --outdir build/esm", + "build:grammar": "pnpm build && pnpm -F codemirror-lang-slangroom build", "publish:ci": "lerna version --no-changelog --conventional-commits --yes && pnpm publish -r --no-git-checks --filter './pkg/*'", "docs:api": "node docs/statements/index.mjs", "docs:examples": "node docs/examples/index.mjs", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 751e5819..89056ac4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -129,6 +129,12 @@ importers: '@lezer/generator': specifier: ^1.0.0 version: 1.7.1 + '@rollup/plugin-json': + specifier: ^6.0.0 + version: 6.1.0(rollup@2.79.1) + '@rollup/plugin-typescript': + specifier: ^11.1.6 + version: 11.1.6(rollup@2.79.1)(tslib@2.6.3)(typescript@4.9.5) '@semantic-release/changelog': specifier: ^6.0.3 version: 6.0.3(semantic-release@24.1.0(typescript@4.9.5)) @@ -153,9 +159,6 @@ importers: rollup-plugin-dts: specifier: ^4.0.1 version: 4.2.3(rollup@2.79.1)(typescript@4.9.5) - rollup-plugin-ts: - specifier: ^3.0.2 - version: 3.4.5(rollup@2.79.1)(typescript@4.9.5) semantic-release: specifier: ^24.1.0 version: 24.1.0(typescript@4.9.5) @@ -166,6 +169,57 @@ importers: specifier: ^4.3.4 version: 4.9.5 + grammar/utils: + devDependencies: + '@slangroom/core': + specifier: workspace:* + version: link:../../pkg/core + '@slangroom/db': + specifier: workspace:* + version: link:../../pkg/db + '@slangroom/ethereum': + specifier: workspace:* + version: link:../../pkg/ethereum + '@slangroom/fs': + specifier: workspace:* + version: link:../../pkg/fs + '@slangroom/git': + specifier: workspace:* + version: link:../../pkg/git + '@slangroom/helpers': + specifier: workspace:* + version: link:../../pkg/helpers + '@slangroom/http': + specifier: workspace:* + version: link:../../pkg/http + '@slangroom/json-schema': + specifier: workspace:* + version: link:../../pkg/json-schema + '@slangroom/oauth': + specifier: workspace:* + version: link:../../pkg/oauth + '@slangroom/pocketbase': + specifier: workspace:* + version: link:../../pkg/pocketbase + '@slangroom/qrcode': + specifier: workspace:* + version: link:../../pkg/qrcode + '@slangroom/redis': + specifier: workspace:* + version: link:../../pkg/redis + '@slangroom/shell': + specifier: workspace:* + version: link:../../pkg/shell + '@slangroom/timestamp': + specifier: workspace:* + version: link:../../pkg/timestamp + '@slangroom/wallet': + specifier: workspace:* + version: link:../../pkg/wallet + '@slangroom/zencode': + specifier: workspace:* + version: link:../../pkg/zencode + pkg/browser: dependencies: '@slangroom/core': @@ -1041,9 +1095,6 @@ packages: resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} hasBin: true - '@mdn/browser-compat-data@5.5.49': - resolution: {integrity: sha512-FNYbYIA8WEff/+A8iMGstZhArpgy5ZxZ9uQRsBQ+qXsiKTYn3WjxpCmJRw3CFUOqFlQSZDkC3v1y3BijRnE1Pg==} - '@meeco/sd-jwt-vc@0.0.4': resolution: {integrity: sha512-5mLSJ/pEqlkTYiy7p5CeOX9Z52QsprYlepWc5db+nV5h5TOS8VOBl8r0Xu+QKpORVyaX2bsgD71pNCgg7U2tsQ==} engines: {node: '>=18', npm: '>=8.0.0'} @@ -1268,6 +1319,28 @@ packages: resolution: {integrity: sha512-/ZjE18HRzMd80eXIIUIPcH81UoZpwulbo8FmbElrjPqH0QC0SeIKu1BOU49bO5trM5g895kAjhvalt5h77q+4A==} engines: {node: '>=14'} + '@rollup/plugin-json@6.1.0': + resolution: {integrity: sha512-EGI2te5ENk1coGeADSIwZ7G2Q8CJS2sF120T7jLw4xFw9n7wIOXHo+kIYRAoVpJAN+kmqZSoO3Fp4JtoNF4ReA==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + + '@rollup/plugin-typescript@11.1.6': + resolution: {integrity: sha512-R92yOmIACgYdJ7dJ97p4K69I8gg6IEHt8M7dUBxN3W6nrO8uUxX5ixl0yU/N3aZTi8WhPuICvOHXQvF6FaykAA==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^2.14.0||^3.0.0||^4.0.0 + tslib: '*' + typescript: '>=3.7.0' + peerDependenciesMeta: + rollup: + optional: true + tslib: + optional: true + '@rollup/pluginutils@4.2.1': resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} engines: {node: '>= 8.0.0'} @@ -1495,9 +1568,6 @@ packages: '@types/ms@0.7.34': resolution: {integrity: sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==} - '@types/node@17.0.45': - resolution: {integrity: sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==} - '@types/node@20.10.4': resolution: {integrity: sha512-D08YG6rr8X90YB56tSIuBaddy/UXAA9RKJoFvrsnogAum/0pmjkgi4+2nx96A330FmioegBWmEYQ+syqCFaveg==} @@ -1507,18 +1577,12 @@ packages: '@types/normalize-package-data@2.4.4': resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} - '@types/object-path@0.11.4': - resolution: {integrity: sha512-4tgJ1Z3elF/tOMpA8JLVuR9spt9Ynsf7+JjqsQ2IqtiPJtcLoHoXcT6qU4E10cPFqyXX5HDm9QwIzZhBSkLxsw==} - '@types/qrcode@1.5.5': resolution: {integrity: sha512-CdfBi/e3Qk+3Z/fXYShipBT13OJ2fDO2Q2w5CIP5anLTLIndQG9z6P1cnm+8zCWSpm5dnxMFd/uREtb0EXuQzg==} '@types/semver@7.5.8': resolution: {integrity: sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==} - '@types/ua-parser-js@0.7.39': - resolution: {integrity: sha512-P/oDfpofrdtF5xw433SPALpdSchtJmY7nsJItf8h3KXqOslkbySh8zq4dSWXH2oTjRvJ5PczVEoCZPow6GicLg==} - '@types/validator@13.11.9': resolution: {integrity: sha512-FCTsikRozryfayPuiI46QzH3fnrOoctTjvOYZkho9BTFLCOZ2rgZJHMOVgCOfttjPJcgOx52EpkY0CMfy87MIw==} @@ -1697,10 +1761,6 @@ packages: '@vueuse/shared@10.9.0': resolution: {integrity: sha512-Uud2IWncmAfJvRaFYzv5OHDli+FbOzxiVEQdLCKQKLyhz94PIyFC3CHcH7EDMwIn8NPtD06+PNbC/PiO0LGLtw==} - '@wessberg/stringutil@1.0.19': - resolution: {integrity: sha512-9AZHVXWlpN8Cn9k5BC/O0Dzb9E9xfEMXzYrNunwvkUTvuK7xgQPVRZpLo+jWCOZ5r8oBa8NIrHuPEu1hzbb6bg==} - engines: {node: '>=8.0.0'} - JSONStream@1.3.5: resolution: {integrity: sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==} hasBin: true @@ -1785,10 +1845,6 @@ packages: resolution: {integrity: sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==} engines: {node: '>=6'} - ansi-colors@4.1.3: - resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} - engines: {node: '>=6'} - ansi-escapes@4.3.2: resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} engines: {node: '>=8'} @@ -1954,15 +2010,6 @@ packages: browser-stdout@1.3.1: resolution: {integrity: sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==} - browserslist-generator@2.1.0: - resolution: {integrity: sha512-ZFz4mAOgqm0cbwKaZsfJbYDbTXGoPANlte7qRsRJOfjB9KmmISQrXJxAVrnXG8C8v/QHNzXyeJt0Cfcks6zZvQ==} - engines: {node: '>=16.15.1', npm: '>=7.0.0', pnpm: '>=3.2.0', yarn: '>=1.13'} - - browserslist@4.23.3: - resolution: {integrity: sha512-btwCFJVjI4YWDNfau8RhZ+B1Q/VLoUITrm3RlP6y1tYGWIOa+InuYiRGXUBXo8nA1qKmHMyLB/iVQg5TT4eFoA==} - engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} - hasBin: true - bs58@5.0.0: resolution: {integrity: sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ==} @@ -2015,9 +2062,6 @@ packages: resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} engines: {node: '>=10'} - caniuse-lite@1.0.30001653: - resolution: {integrity: sha512-XGWQVB8wFQ2+9NZwZ10GxTYC5hk0Fa+q8cSkr0tgvMhYhMHP/QC+WTgrePMDBWiWc/pV+1ik82Al20XOK25Gcw==} - cbor@9.0.2: resolution: {integrity: sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ==} engines: {node: '>=16'} @@ -2169,12 +2213,6 @@ packages: compare-func@2.0.0: resolution: {integrity: sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==} - compatfactory@3.0.0: - resolution: {integrity: sha512-WD5kF7koPwVoyKL8p0LlrmIZtilrD46sQStyzzxzTFinMKN2Dxk1hN+sddLSQU1mGIZvQfU8c+ONSghvvM40jg==} - engines: {node: '>=14.9.0'} - peerDependencies: - typescript: '>=3.x || >= 4.x || >= 5.x' - concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} @@ -2275,10 +2313,6 @@ packages: resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} engines: {node: '>= 8'} - crosspath@2.0.0: - resolution: {integrity: sha512-ju88BYCQ2uvjO2bR+SsgLSTwTSctU+6Vp2ePbKPgSCZyy4MWZxYsT738DlKVRE5utUjobjPRm1MkTYKJxCmpTA==} - engines: {node: '>=14.9.0'} - crypto-random-string@4.0.0: resolution: {integrity: sha512-x8dy3RnvYdlUcPOjkEHqozhiwzKNSq7GcPuXFbnyMOCHxX8V3OgIg/pYuabl2sbUPfIJaeAQB7PMOK8DFIdoRA==} engines: {node: '>=12'} @@ -2431,9 +2465,6 @@ packages: eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} - electron-to-chromium@1.5.13: - resolution: {integrity: sha512-lbBcvtIJ4J6sS4tb5TLp1b4LyfCdMkwStzXPyAgVgTRAsep4bvrAGaBOP7ZJtQMNJpSQ9SqG4brWOroNaQtm7Q==} - emittery@1.0.3: resolution: {integrity: sha512-tJdCJitoy2lrC2ldJcqN4vkqJ00lT+tOWNT1hBJjO/3FDMJa5TTIiYGCKGkn/WfCyOzUMObeohbVTj00fhiLiA==} engines: {node: '>=14.16'} @@ -2912,10 +2943,6 @@ packages: has-unicode@2.0.1: resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} - hasown@2.0.0: - resolution: {integrity: sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==} - engines: {node: '>= 0.4'} - hasown@2.0.2: resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} engines: {node: '>= 0.4'} @@ -2924,10 +2951,6 @@ packages: resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} hasBin: true - helpertypes@0.0.19: - resolution: {integrity: sha512-J00e55zffgi3yVnUp0UdbMztNkr2PnizEkOe9URNohnrNhW5X0QpegkuLpOmFQInpi93Nb8MCjQRHAiCDF42NQ==} - engines: {node: '>=10.0.0'} - highlight.js@10.7.3: resolution: {integrity: sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==} @@ -3188,10 +3211,6 @@ packages: isarray@1.0.0: resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==} - isbot@3.8.0: - resolution: {integrity: sha512-vne1mzQUTR+qsMLeCBL9+/tgnDXRyc2pygLGl/WsgA+EZKIiB5Ehu0CiVTHIIk30zhJ24uGz4M5Ppse37aR0Hg==} - engines: {node: '>=12'} - isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} @@ -3688,9 +3707,6 @@ packages: engines: {node: '>= 10.12.0'} hasBin: true - node-releases@2.0.18: - resolution: {integrity: sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==} - nofilter@3.1.0: resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} engines: {node: '>=12.19'} @@ -3849,10 +3865,6 @@ packages: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} engines: {node: '>=0.10.0'} - object-path@0.11.8: - resolution: {integrity: sha512-YJjNZrlXJFM42wTBn6zgOJVar9KFJvzx6sTWDte8sWZF//cnjl0BxHNpfZx+ZffXX63A9q0b1zsFiBX4g4X5KA==} - engines: {node: '>= 10.12.0'} - once@1.4.0: resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} @@ -4035,6 +4047,9 @@ packages: resolution: {integrity: sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==} engines: {node: '>=12'} + path-parse@1.0.7: + resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + path-scurry@1.10.1: resolution: {integrity: sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==} engines: {node: '>=16 || 14 >=14.17'} @@ -4059,9 +4074,6 @@ packages: picocolors@1.0.0: resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} - picocolors@1.0.1: - resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} - picomatch@2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} @@ -4270,6 +4282,10 @@ packages: resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} engines: {node: '>=8'} + resolve@1.22.8: + resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==} + hasBin: true + restore-cursor@3.1.0: resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} engines: {node: '>=8'} @@ -4300,35 +4316,6 @@ packages: rollup: ^2.55 typescript: ^4.1 - rollup-plugin-ts@3.4.5: - resolution: {integrity: sha512-9iCstRJpEZXSRQuXitlSZAzcGlrqTbJg1pE4CMbEi6xYldxVncdPyzA2I+j6vnh73wBymZckerS+Q/iEE/M3Ow==} - engines: {node: '>=16.15.1', npm: '>=7.0.0', pnpm: '>=3.2.0', yarn: '>=1.13'} - peerDependencies: - '@babel/core': '>=7.x' - '@babel/plugin-transform-runtime': '>=7.x' - '@babel/preset-env': '>=7.x' - '@babel/preset-typescript': '>=7.x' - '@babel/runtime': '>=7.x' - '@swc/core': '>=1.x' - '@swc/helpers': '>=0.2' - rollup: '>=1.x || >=2.x || >=3.x' - typescript: '>=3.2.x || >= 4.x || >= 5.x' - peerDependenciesMeta: - '@babel/core': - optional: true - '@babel/plugin-transform-runtime': - optional: true - '@babel/preset-env': - optional: true - '@babel/preset-typescript': - optional: true - '@babel/runtime': - optional: true - '@swc/core': - optional: true - '@swc/helpers': - optional: true - rollup@2.79.1: resolution: {integrity: sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==} engines: {node: '>=10.0.0'} @@ -4667,6 +4654,10 @@ packages: resolution: {integrity: sha512-2rn0BZ+/f7puLOHZm1HOJfwBggfaHXUpPUSSG/SWM4TWp5KCfmNYwnC3hruy2rZlMnmWZ+QAGpZfchu3f3695A==} engines: {node: '>=14.18'} + supports-preserve-symlinks-flag@1.0.0: + resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} + engines: {node: '>= 0.4'} + tabbable@6.2.0: resolution: {integrity: sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew==} @@ -4753,12 +4744,6 @@ packages: peerDependencies: typescript: '>=4.2.0' - ts-clone-node@3.0.0: - resolution: {integrity: sha512-egavvyHbIoelkgh1IC2agNB1uMNjB8VJgh0g/cn0bg2XXTcrtjrGMzEk4OD3Fi2hocICjP3vMa56nkzIzq0FRg==} - engines: {node: '>=14.9.0'} - peerDependencies: - typescript: ^3.x || ^4.x || ^5.x - ts-node@10.9.2: resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} hasBin: true @@ -4842,9 +4827,6 @@ packages: engines: {node: '>=14.17'} hasBin: true - ua-parser-js@1.0.38: - resolution: {integrity: sha512-Aq5ppTOfvrCMgAPneW1HfWj66Xi7XL+/mIy996R1/CLS/rcyJQm6QZdsKrUeivDFQ+Oc9Wyuwor8Ze8peEoUoQ==} - uglify-js@3.17.4: resolution: {integrity: sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==} engines: {node: '>=0.8.0'} @@ -4889,12 +4871,6 @@ packages: resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==} engines: {node: '>= 10.0.0'} - update-browserslist-db@1.1.0: - resolution: {integrity: sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ==} - hasBin: true - peerDependencies: - browserslist: '>= 4.21.0' - uri-js@4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} @@ -5848,8 +5824,6 @@ snapshots: - encoding - supports-color - '@mdn/browser-compat-data@5.5.49': {} - '@meeco/sd-jwt-vc@0.0.4': dependencies: '@meeco/sd-jwt': 0.0.3 @@ -6165,6 +6139,21 @@ snapshots: generic-pool: 3.9.0 yallist: 4.0.0 + '@rollup/plugin-json@6.1.0(rollup@2.79.1)': + dependencies: + '@rollup/pluginutils': 5.1.0(rollup@2.79.1) + optionalDependencies: + rollup: 2.79.1 + + '@rollup/plugin-typescript@11.1.6(rollup@2.79.1)(tslib@2.6.3)(typescript@4.9.5)': + dependencies: + '@rollup/pluginutils': 5.1.0(rollup@2.79.1) + resolve: 1.22.8 + typescript: 4.9.5 + optionalDependencies: + rollup: 2.79.1 + tslib: 2.6.3 + '@rollup/pluginutils@4.2.1': dependencies: estree-walker: 2.0.2 @@ -6410,8 +6399,6 @@ snapshots: '@types/ms@0.7.34': {} - '@types/node@17.0.45': {} - '@types/node@20.10.4': dependencies: undici-types: 5.26.5 @@ -6422,16 +6409,12 @@ snapshots: '@types/normalize-package-data@2.4.4': {} - '@types/object-path@0.11.4': {} - '@types/qrcode@1.5.5': dependencies: '@types/node': 20.11.30 '@types/semver@7.5.8': {} - '@types/ua-parser-js@0.7.39': {} - '@types/validator@13.11.9': {} '@types/web-bluetooth@0.0.20': {} @@ -6662,8 +6645,6 @@ snapshots: - '@vue/composition-api' - vue - '@wessberg/stringutil@1.0.19': {} - JSONStream@1.3.5: dependencies: jsonparse: 1.3.1 @@ -6757,8 +6738,6 @@ snapshots: ansi-colors@4.1.1: {} - ansi-colors@4.1.3: {} - ansi-escapes@4.3.2: dependencies: type-fest: 0.21.3 @@ -6939,26 +6918,6 @@ snapshots: browser-stdout@1.3.1: {} - browserslist-generator@2.1.0: - dependencies: - '@mdn/browser-compat-data': 5.5.49 - '@types/object-path': 0.11.4 - '@types/semver': 7.5.8 - '@types/ua-parser-js': 0.7.39 - browserslist: 4.23.3 - caniuse-lite: 1.0.30001653 - isbot: 3.8.0 - object-path: 0.11.8 - semver: 7.6.0 - ua-parser-js: 1.0.38 - - browserslist@4.23.3: - dependencies: - caniuse-lite: 1.0.30001653 - electron-to-chromium: 1.5.13 - node-releases: 2.0.18 - update-browserslist-db: 1.1.0(browserslist@4.23.3) - bs58@5.0.0: dependencies: base-x: 4.0.0 @@ -7051,8 +7010,6 @@ snapshots: camelcase@6.3.0: {} - caniuse-lite@1.0.30001653: {} - cbor@9.0.2: dependencies: nofilter: 3.1.0 @@ -7209,11 +7166,6 @@ snapshots: array-ify: 1.0.0 dot-prop: 5.3.0 - compatfactory@3.0.0(typescript@4.9.5): - dependencies: - helpertypes: 0.0.19 - typescript: 4.9.5 - concat-map@0.0.1: {} concordance@5.0.4: @@ -7340,10 +7292,6 @@ snapshots: shebang-command: 2.0.0 which: 2.0.2 - crosspath@2.0.0: - dependencies: - '@types/node': 17.0.45 - crypto-random-string@4.0.0: dependencies: type-fest: 1.4.0 @@ -7450,8 +7398,6 @@ snapshots: eastasianwidth@0.2.0: {} - electron-to-chromium@1.5.13: {} - emittery@1.0.3: {} emoji-regex@10.3.0: {} @@ -7893,7 +7839,7 @@ snapshots: function-bind: 1.1.2 has-proto: 1.0.1 has-symbols: 1.0.3 - hasown: 2.0.0 + hasown: 2.0.2 get-intrinsic@1.2.4: dependencies: @@ -8050,18 +7996,12 @@ snapshots: has-unicode@2.0.1: {} - hasown@2.0.0: - dependencies: - function-bind: 1.1.2 - hasown@2.0.2: dependencies: function-bind: 1.1.2 he@1.2.0: {} - helpertypes@0.0.19: {} - highlight.js@10.7.3: {} hook-std@3.0.0: {} @@ -8292,8 +8232,6 @@ snapshots: isarray@1.0.0: {} - isbot@3.8.0: {} - isexe@2.0.0: {} isexe@3.1.1: {} @@ -8820,8 +8758,6 @@ snapshots: - supports-color optional: true - node-releases@2.0.18: {} - nofilter@3.1.0: {} nopt@5.0.0: @@ -8921,8 +8857,6 @@ snapshots: object-assign@4.1.1: {} - object-path@0.11.8: {} - once@1.4.0: dependencies: wrappy: 1.0.2 @@ -9118,6 +9052,8 @@ snapshots: path-key@4.0.0: {} + path-parse@1.0.7: {} + path-scurry@1.10.1: dependencies: lru-cache: 10.2.0 @@ -9135,8 +9071,6 @@ snapshots: picocolors@1.0.0: {} - picocolors@1.0.1: {} - picomatch@2.3.1: {} picomatch@3.0.1: {} @@ -9339,6 +9273,12 @@ snapshots: resolve-from@5.0.0: {} + resolve@1.22.8: + dependencies: + is-core-module: 2.13.1 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 + restore-cursor@3.1.0: dependencies: onetime: 5.1.2 @@ -9364,21 +9304,6 @@ snapshots: optionalDependencies: '@babel/code-frame': 7.24.2 - rollup-plugin-ts@3.4.5(rollup@2.79.1)(typescript@4.9.5): - dependencies: - '@rollup/pluginutils': 5.1.0(rollup@2.79.1) - '@wessberg/stringutil': 1.0.19 - ansi-colors: 4.1.3 - browserslist: 4.23.3 - browserslist-generator: 2.1.0 - compatfactory: 3.0.0(typescript@4.9.5) - crosspath: 2.0.0 - magic-string: 0.30.8 - rollup: 2.79.1 - ts-clone-node: 3.0.0(typescript@4.9.5) - tslib: 2.6.3 - typescript: 4.9.5 - rollup@2.79.1: optionalDependencies: fsevents: 2.3.3 @@ -9765,6 +9690,8 @@ snapshots: has-flag: 4.0.0 supports-color: 7.2.0 + supports-preserve-symlinks-flag@1.0.0: {} + tabbable@6.2.0: {} tar-fs@2.1.1: @@ -9853,11 +9780,6 @@ snapshots: dependencies: typescript: 5.4.3 - ts-clone-node@3.0.0(typescript@4.9.5): - dependencies: - compatfactory: 3.0.0(typescript@4.9.5) - typescript: 4.9.5 - ts-node@10.9.2(@types/node@20.11.30)(typescript@5.4.3): dependencies: '@cspotcode/source-map-support': 0.8.1 @@ -9931,8 +9853,6 @@ snapshots: typescript@5.4.3: {} - ua-parser-js@1.0.38: {} - uglify-js@3.17.4: optional: true @@ -9970,12 +9890,6 @@ snapshots: universalify@2.0.1: {} - update-browserslist-db@1.1.0(browserslist@4.23.3): - dependencies: - browserslist: 4.23.3 - escalade: 3.1.2 - picocolors: 1.0.1 - uri-js@4.4.1: dependencies: punycode: 2.3.1 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 74a2bf05..39ebb896 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -6,3 +6,4 @@ packages: - pkg/* - docs/statements - grammar + - grammar/utils