From 266f98a8888b7b8e4f7c8af50c85d89e906d0d6f Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Sun, 16 Sep 2018 11:25:37 +0200 Subject: [PATCH] doc --- docs/source/programming.rst | 2 ++ docs/source/syntaxreference.rst | 17 ++++++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/docs/source/programming.rst b/docs/source/programming.rst index 927532a15..00566f0cf 100644 --- a/docs/source/programming.rst +++ b/docs/source/programming.rst @@ -182,6 +182,8 @@ for instance. There must be a way to tell the compiler which variables you require to be in Zeropage: ``zeropage`` modifier keyword on vardecl perhaps? + option to omit the array size on the vardecl if an initialization array value is given? + Variables that represent CPU hardware registers ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/docs/source/syntaxreference.rst b/docs/source/syntaxreference.rst index 1926f16e1..00b9c4437 100644 --- a/docs/source/syntaxreference.rst +++ b/docs/source/syntaxreference.rst @@ -260,9 +260,14 @@ type identifier type storage size example var declara - When a binary number has 9 to 16 digits, for example ``%1100110011``, it is seen as a ``word`` otherwise as a ``byte``. - You can force a byte value into a word value by adding the ``.w`` datatype suffix to the number: ``$2a.w`` is equivalent to ``$002a``. -**@todo pointers/addresses? (as opposed to normal WORDs)** -**@todo signed integers (byte and word)?** +.. todo:: + + omit the array size in the var decl if an initialization array is given? + + **@todo pointers/addresses? (as opposed to normal WORDs)** + + **@todo signed integers (byte and word)?** Memory mapped variables @@ -279,10 +284,12 @@ Constants ^^^^^^^^^ All variables can be assigned new values unless you use the ``const`` keyword. -The initial value will now be evaluated at compile time (it must be a compile time constant expression) -and no storage is allocated for the constant:: +The initial value will now be evaluated at compile time (it must be a compile time constant expression). +Storage is allocated only for the constant values that remain a the end of this process and that +require it (floats, strings, arrays, matrices):: const byte max_age = 99 + const str someName = "Peter" Reserved names @@ -306,7 +313,7 @@ If used in the place of a literal value, it expands into the actual array of val .. todo:: - this may be used later in the for-loop as well. Add 'step' to range expression as well? + this may be used later in the for-loop as well. Add 'step' to range expression? Operators