You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 31, 2021. It is now read-only.
Copy file name to clipboardExpand all lines: docs/specs/livecode_builder_language_reference.md
+10-12Lines changed: 10 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,7 @@ Strings use backslash ('\') as an escape - the following are understood:
39
39
40
40
## Case-Sensitivity
41
41
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.
43
43
44
44
> **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).
45
45
@@ -56,7 +56,7 @@ It is highly recommended that the following naming conventions be used for ident
56
56
57
57
By following this convention, there will not be any ambiguity between identifiers and keywords. (All keywords are all lower-case).
58
58
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.
60
60
61
61
# Typing
62
62
@@ -65,20 +65,18 @@ Modular LiveCode is a typed language, although typing is completely optional in
65
65
The range of core types is relatively small, comprising the following:
66
66
67
67
-**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
76
76
-**any**: a value of any type
77
77
78
78
Additionally, all types can be annotated with **optional**. An optional annotation means the value may be the original type or the undefined value.
79
79
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
-
82
80
> **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.
0 commit comments