Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions docs/lcb/notes/14893.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# LiveCode Builder Language
## Identifiers

* Identifiers are now expected to match `[A-Z0-9_.]`.

## Syntax

* Syntax keywords are no longer permitted to match `[A-Z0-9_.]`.

# LiveCode Builder Tools
## lc-compile
### Warnings

* A new warning has been added for identifiers that may conflict with
syntax keywords.

# [14893] Emit warnings for identifiers that may cause problems.
4 changes: 3 additions & 1 deletion tests/lc-run/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@ check:
$(LC_COMPILE) --modulepath $(TEST_DIR) --modulepath $(MODULE_DIR) \
lc-run-test.mlc --output $(TEST_DIR)/lc-run-test.lcm
$(LC_RUN) -l $(TEST_DIR)/lc-run-lib.lcm $(TEST_DIR)/lc-run-test.lcm
test "`$(LC_RUN) -l $(TEST_DIR)/lc-run-lib.lcm --list-handlers $(TEST_DIR)/lc-run-test.lcm`" = "main"
test "`$(LC_RUN) -l $(TEST_DIR)/lc-run-lib.lcm --list-handlers $(TEST_DIR)/lc-run-test.lcm`" = "Main"
$(LC_RUN) $(TEST_DIR)/lc-run-lib.lcm
test "`$(LC_RUN) --list-handlers $(TEST_DIR)/lc-run-lib.lcm`" = "main"
3 changes: 2 additions & 1 deletion tests/lc-run/lc-run-lib.mlc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module com.livecode.lc_run_lib

public handler lib_main()
-- Intentional lower-case handler name
public handler main()
-- Do nothing
end handler

Expand Down
4 changes: 2 additions & 2 deletions tests/lc-run/lc-run-test.mlc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ module com.livecode.lc_run_test

use com.livecode.lc_run_lib

public handler main()
lib_main()
public handler Main()
main()
end handler

end module
26 changes: 13 additions & 13 deletions tests/lcb/stdlib/arithmetic.lcb
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
module com.livecode.arithmetic.tests

public handler TestUnarySigns()
variable t
put 10 into t
test "unary−" when -t is -10
variable tNum
put 10 into tNum
test "unary−" when -tNum is -10

put -10 into t
test "unary+" when +t is -10
put -10 into tNum
test "unary+" when +tNum is -10
end handler

public handler TestAdd()
Expand Down Expand Up @@ -176,11 +176,11 @@ public handler TestFormatString()
test diagnostic "TODO -1 formatted as string (bug 14594)"
broken test "format as string (int)" when (-1) formatted as string is "-1" because "bug 14546"

variable t
put (-1.0) formatted as string into t
variable tNum
put (-1.0) formatted as string into tNum
test diagnostic "TODO test full string, not just prefix"
test diagnostic t
test "format as string (real)" when t begins with "-1."
test diagnostic tNum
test "format as string (real)" when tNum begins with "-1."
end handler

public handler TestParseString()
Expand All @@ -199,12 +199,12 @@ end handler
public handler TestParseStringList()
test "parsed list" when ["-1", "+2.2"] parsed as list of number is [-1, 2.2]

variable t
variable tList
parse ["-1", "+2.2", "x"] as list of number
put the result into t
put the result into tList

test "parse list (defined)" when element 1 to 2 of t is [-1, 2.2]
test "parse list (undefined)" when element 3 of t is not defined
test "parse list (defined)" when element 1 to 2 of tList is [-1, 2.2]
test "parse list (undefined)" when element 3 of tList is not defined
end handler

end module
20 changes: 10 additions & 10 deletions tests/lcb/stdlib/byte.lcb
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,25 @@ handler TestByteWithCode_Overflow()
return the byte with code 256
end handler
public handler TestByteWithCode()
variable t
put the byte with code 0 into t
variable tString
put the byte with code 0 into tString

test "code->byte" when the number of bytes in t is 1
test "code->byte" when the number of bytes in tString is 1

MCUnitTestHandlerThrows(TestByteWithCode_Negative, "code->byte (negative)")
MCUnitTestHandlerThrows(TestByteWithCode_Overflow, "code->byte (overflow)")
end handler

handler TestCodeOfByte_Long()
variable t
put the byte with code 0 into t
put t after t
return the code of t
variable tString
put the byte with code 0 into tString
put tString after tString
return the code of tString
end handler
handler TestCodeOfByte_Empty()
variable t
put the empty data into t
return the code of t
variable tString
put the empty data into tString
return the code of tString
end handler
public handler TestCodeOfByte()
test "byte->code" when the code of (the byte with code 1) is 1
Expand Down
Loading