From c54af0f297e4e37e7d25871ce9c802158c3dfd05 Mon Sep 17 00:00:00 2001 From: sagie gur ari Date: Wed, 5 Feb 2020 17:39:30 +0000 Subject: [PATCH] minor stuff --- README.md | 6 +++--- docs/_includes/content.md | 6 +++--- duckscript_sdk/src/utils/condition.rs | 5 +---- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 216d889..9da5064 100644 --- a/README.md +++ b/README.md @@ -300,7 +300,7 @@ The SDK enables users to develop their scripts and have a good starting point wi #### Commands Instead Of Language Features As mentioned before, duckscript is really simple and only has few basic rules.
In order to provide a more richer development experience, common language features such as functions and conditional blocks have been implemented as commands.
-This is an example of the [function command](https://github.com/sagiegurari/duckscript/blob/master/docs/sdk.md#std__Function): +This is an example of the [function command](https://github.com/sagiegurari/duckscript/blob/master/docs/sdk.md#std__flowcontrol__Function): ```sh function print_first_and_second_argument @@ -319,7 +319,7 @@ run_flow This example demonstrates how functions as a concept do not need to be part of the language and can be implemented by anyone as a command.
This also means that other developers can replace the function command with their implementation to provide additional/different functionality.
-Below an example of loops using the [for/in command](https://github.com/sagiegurari/duckscript/blob/master/docs/sdk.md#std__ForIn): +Below an example of loops using the [for/in command](https://github.com/sagiegurari/duckscript/blob/master/docs/sdk.md#std__flowcontrol__ForIn): ```sh values = range 1 10 @@ -333,7 +333,7 @@ end release ${values} ``` -Below an example of [if/else command](https://github.com/sagiegurari/duckscript/blob/master/docs/sdk.md#std__If): +Below an example of [if/else command](https://github.com/sagiegurari/duckscript/blob/master/docs/sdk.md#std__flowcontrol__If): ```sh echo Enter Full Name: diff --git a/docs/_includes/content.md b/docs/_includes/content.md index 7dabbea..9af612d 100755 --- a/docs/_includes/content.md +++ b/docs/_includes/content.md @@ -256,7 +256,7 @@ The SDK enables users to develop their scripts and have a good starting point wi #### Commands Instead Of Language Features As mentioned before, duckscript is really simple and only has few basic rules.
In order to provide a more richer development experience, common language features such as functions and conditional blocks have been implemented as commands.
-This is an example of the [function command](https://github.com/sagiegurari/duckscript/blob/master/docs/sdk.md#std__Function): +This is an example of the [function command](https://github.com/sagiegurari/duckscript/blob/master/docs/sdk.md#std__flowcontrol__Function): ```sh function print_first_and_second_argument @@ -275,7 +275,7 @@ run_flow This example demonstrates how functions as a concept do not need to be part of the language and can be implemented by anyone as a command.
This also means that other developers can replace the function command with their implementation to provide additional/different functionality.
-Below an example of loops using the [for/in command](https://github.com/sagiegurari/duckscript/blob/master/docs/sdk.md#std__ForIn): +Below an example of loops using the [for/in command](https://github.com/sagiegurari/duckscript/blob/master/docs/sdk.md#std__flowcontrol__ForIn): ```sh values = range 1 10 @@ -289,7 +289,7 @@ end release ${values} ``` -Below an example of [if/else command](https://github.com/sagiegurari/duckscript/blob/master/docs/sdk.md#std__If): +Below an example of [if/else command](https://github.com/sagiegurari/duckscript/blob/master/docs/sdk.md#std__flowcontrol__If): ```sh echo Enter Full Name: diff --git a/duckscript_sdk/src/utils/condition.rs b/duckscript_sdk/src/utils/condition.rs index 1fc39d8..8b46378 100644 --- a/duckscript_sdk/src/utils/condition.rs +++ b/duckscript_sdk/src/utils/condition.rs @@ -29,10 +29,7 @@ pub(crate) fn eval_condition( Ok(is_true(None)) } else { let eval_statement = if arguments.len() == 1 { - match commands.get(&arguments[0]) { - Some(_) => true, - None => false, - } + commands.exists(&arguments[0]) } else { true };