Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 954c5a3

Browse files
committed
[[ LCB ]] Update reference to adjust for changes in case-sensitivity rules.
1 parent de5e211 commit 954c5a3

1 file changed

Lines changed: 10 additions & 12 deletions

File tree

docs/specs/livecode_builder_language_reference.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Strings use backslash ('\') as an escape - the following are understood:
3939
4040
## Case-Sensitivity
4141

42-
At the moment, due to the nature of the parser being used, identifiers and keywords are all case-sensitive and keywords are reserved. The result of this is that, using all lower-case identifiers for names of definitions should be avoided.
42+
At the moment, due to the nature of the parser being used, keywords are all case-sensitive and reserved. The result of this is that, using all lower-case identifiers for names of definitions should be avoided. However, identifiers *are* case-insensitive - so a variable with name pFoo can also be referenced as PFOO, PfOO, pfoO etc.
4343

4444
> **Aside:** The current parser and syntax rules for LiveCode Builder are constructed at build-time of the LiveCode Builder compiler and uses *bison* (a standard parser generator tool) to build the parser. Unfortunately, this means that any keywords have to be reserved as the parser cannot distinguish the use of an identifier in context (whether it is a keyword at a particular point, or a name of a definition).
4545
@@ -56,7 +56,7 @@ It is highly recommended that the following naming conventions be used for ident
5656

5757
By following this convention, there will not be any ambiguity between identifiers and keywords. (All keywords are all lower-case).
5858

59-
> **Note:** The intent is that LiveCode Builder scripts will be case-insensitive like LiveCode Script; however this will require the Open Language parser infrastructure which is being developed for the next major version of LiveCode Builder.
59+
> **Note:** When we have a better parsing technology we will be evaluating whether to make keywords case-insensitive as well. At the very least, at that point, we expect to be able to make all keywords unreserved.
6060
6161
# Typing
6262

@@ -65,20 +65,18 @@ Modular LiveCode is a typed language, although typing is completely optional in
6565
The range of core types is relatively small, comprising the following:
6666

6767
- **undefined**: the single value *undefined*
68-
- **boolean**: one of *true* or *false*
69-
- **integer**: any integral numeric value (size limitations apply)
70-
- **real**: any numeric value (size and accuracy limitations apply)
71-
- **number**: any integer or real value
72-
- **string**: a sequence of UTF-16 code units
73-
- **data**: a sequence of bytes
74-
- **list**: a sequence of any values
75-
- **array**: a mapping from strings to values
68+
- **Boolean**: one of *true* or *false*
69+
- **Integer**: any integral numeric value (size limitations apply)
70+
- **Real**: any numeric value (size and accuracy limitations apply)
71+
- **Number**: any integer or real value
72+
- **String**: a sequence of UTF-16 code units
73+
- **Data**: a sequence of bytes
74+
- **List**: a sequence of any values
75+
- **Array**: a mapping from strings to values
7676
- **any**: a value of any type
7777

7878
Additionally, all types can be annotated with **optional**. An optional annotation means the value may be the original type or the undefined value.
7979

80-
> **Note:** As it stands *any* does not include the undefined type and so *optional any* makes sense. There is an argument, however, that *any* should be implicitly optional as (technically) the undefined type is also a type. It is possible this aspect might be revised.
81-
8280
> **Note:** The current compiler does not do type-checking; all type-checking happens at runtime. However, this is being worked on so there will soon be a compiler which will give you type errors at compile-time.
8381
8482
# Modules

0 commit comments

Comments
 (0)