mirror of
https://github.com/sagiegurari/duckscript
synced 2024-07-01 06:34:19 +00:00
minor stuff
This commit is contained in:
parent
151c4ff217
commit
c54af0f297
|
@ -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.<br>
|
||||
In order to provide a more richer development experience, common language features such as functions and conditional blocks have been implemented as commands.<br>
|
||||
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.<br>
|
||||
This also means that other developers can replace the function command with their implementation to provide additional/different functionality.<br>
|
||||
|
||||
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:
|
||||
|
|
|
@ -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.<br>
|
||||
In order to provide a more richer development experience, common language features such as functions and conditional blocks have been implemented as commands.<br>
|
||||
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.<br>
|
||||
This also means that other developers can replace the function command with their implementation to provide additional/different functionality.<br>
|
||||
|
||||
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:
|
||||
|
|
|
@ -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
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user