From 31557d6805d1314f6332995e391b861eb635df3b Mon Sep 17 00:00:00 2001 From: Artemy Date: Mon, 8 Aug 2022 19:03:16 +0300 Subject: [PATCH] doc: scopes, update and publish version --- Cargo.lock | 2 +- Cargo.toml | 2 +- doc/main.md | 8 ++++++++ examples/example.json5 | 11 +++++++++++ 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3dffedc..4ac48a3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -197,7 +197,7 @@ checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1" [[package]] name = "onlang" -version = "0.1.0" +version = "0.2.0" dependencies = [ "clap", "colored", diff --git a/Cargo.toml b/Cargo.toml index 862d935..7de7d98 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "onlang" -version = "0.1.0" +version = "0.2.0" edition = "2021" authors = ["artegoser"] license = "MIT" diff --git a/doc/main.md b/doc/main.md index 6205e2e..3b92161 100644 --- a/doc/main.md +++ b/doc/main.md @@ -152,3 +152,11 @@ works only with numbers (and variables with number type) { delete: "name" }, //deletes variable from memory ] ``` + +## Create scope + +```json5 +[ + {scope:[..commands]} +] +``` diff --git a/examples/example.json5 b/examples/example.json5 index efaf3d7..1a13054 100644 --- a/examples/example.json5 +++ b/examples/example.json5 @@ -245,6 +245,17 @@ ], }, + "\n\nCheck scopes of visibility", + { + scope: [ + { let: { scoped: "Value" } }, + ["scoped = ", { var: "scoped" }], + ['isExist("scoped"): ', { isExist: "scoped" }], + ], + }, + "After scope", + ['isExist("scoped"): ', { isExist: "scoped" }], + "\nInput a var", { let: {