Add parenthesis
This commit is contained in:
parent
6ee8e90f40
commit
4a4e275e55
11
README.md
11
README.md
@ -31,6 +31,7 @@ Table of contents for the Omega spec
|
|||||||
- [General syntax](#general-syntax)
|
- [General syntax](#general-syntax)
|
||||||
- [Expressions](#expressions)
|
- [Expressions](#expressions)
|
||||||
- [Scopes](#scopes)
|
- [Scopes](#scopes)
|
||||||
|
- [Parenthesis](#parenthesis)
|
||||||
- [Values](#values)
|
- [Values](#values)
|
||||||
- [Keywords](#keywords)
|
- [Keywords](#keywords)
|
||||||
|
|
||||||
@ -150,6 +151,16 @@ variable = this_is_scoped; // Exception! Cannot access inner-scope.
|
|||||||
|
|
||||||
As is visible in the example, variables defined in the scope are no longer accessible outside the scope. Scopes exist in their individual "environments", where they can access the variables in their upper scopes, but not inner scopes.
|
As is visible in the example, variables defined in the scope are no longer accessible outside the scope. Scopes exist in their individual "environments", where they can access the variables in their upper scopes, but not inner scopes.
|
||||||
|
|
||||||
|
## Parenthesis
|
||||||
|
Parenthesis`()` can be added to surround any [operators](#operators), [expressions](#expressions), [values](#values) or [keywords](#keywords) to guide on what order and how the code should be run.
|
||||||
|
|
||||||
|
For example:
|
||||||
|
- `(2 + 3) * 5` = `5 * 5` = `25`
|
||||||
|
- `!(true ^ true)`
|
||||||
|
- `(print("test"))` Here parenthesis won't do much through
|
||||||
|
- `2 + (3)` Here parenthesis are somewhat useless aswell.
|
||||||
|
- `(unwrap optional) * 5`
|
||||||
|
|
||||||
## Values
|
## Values
|
||||||
There are a number of values you can assign to your variables, as of Omega 1.0, only primitive values are possible. Such types are:
|
There are a number of values you can assign to your variables, as of Omega 1.0, only primitive values are possible. Such types are:
|
||||||
- `string`, a basic piece of text, defined as followes: `"String here"`.
|
- `string`, a basic piece of text, defined as followes: `"String here"`.
|
||||||
|
Loading…
Reference in New Issue
Block a user