Add parenthesis

This commit is contained in:
Teascade 2017-08-26 23:55:04 +00:00
parent 6ee8e90f40
commit 4a4e275e55

View File

@ -31,6 +31,7 @@ Table of contents for the Omega spec
- [General syntax](#general-syntax)
- [Expressions](#expressions)
- [Scopes](#scopes)
- [Parenthesis](#parenthesis)
- [Values](#values)
- [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.
## 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
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"`.