From 64a814d49375b8eb63f96a51aa9847b7e56f226f Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Mon, 18 Jul 2022 12:14:16 +0100 Subject: Examples and fixes --- docs/tour.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/tour.md b/docs/tour.md index 452b5a9..6f434aa 100644 --- a/docs/tour.md +++ b/docs/tour.md @@ -27,10 +27,16 @@ See also the built-in functions. ### Identifiers -Identifiers can be any string starting with a later (upper or lower case) or underscore (`_`), followed by the same type of character or a numeric value. +Identifiers can be any string starting with a letter (upper or lower case) or underscore (`_`), followed by the same type of character or a numeric value. An identifier can't be a reserved word. +```micro +var example number; +var _example number; +var example2 number; +``` + ### Blocks and scope Micro has series of statements in blocks delimited with `{` and `}`, and a block defines a lexical scope. @@ -103,7 +109,7 @@ var a number = fn(); See functions for more information about the "func" type. -Number supports the following formats: +Numbers support the following formats: * 0 decimal * 0x00 hexadecimal @@ -134,7 +140,7 @@ fn(); Constants are immutable values. -Constants can be literals or expressions that get evaluated at compilation time. +Constants can be literals or expressions that get evaluated at parsing time. ```micro const K number = 10; @@ -463,10 +469,9 @@ These are available on the interpreter. | `len` | returns the size in elements of a variable of type array | `len(arr);` | | `panic` | ends execution with a message and a runtime error | `panic("message");` | | `println` | writes to standard output a variable list of expressions, followed by an end of line; returns number of bytes written | `println("value: ", a);` | -| `str` | used with arrays of uint8 to convert them as a printable string | `println(str(arr));` | ## To do -See [TODO](todo.md) for features that are planned but not yet implemented. +See [TODO](../todo.md) for features that are planned but not yet implemented. -- cgit v1.2.3