Skip to content

Commit e2edadb

Browse files
committed
[Tolk] v0.6 syntax: fun, import, var, types on the right, etc.
Lots of changes, actually. Most noticeable are: - traditional //comments - #include -> import - a rule "import what you use" - ~ found -> !found (for -1/0) - null() -> null - is_null?(v) -> v == null - throw is a keyword - catch with swapped arguments - throw_if, throw_unless -> assert - do until -> do while - elseif -> else if - drop ifnot, elseifnot - drop rarely used operators A testing framework also appears here. All tests existed earlier, but due to significant syntax changes, their history is useless.
1 parent 5a3e359 commit e2edadb

File tree

133 files changed

+8148
-2557
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+8148
-2557
lines changed

CMakeLists.txt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,30 @@ if (NOT NIX)
627627
endif()
628628
endif()
629629

630+
# Tolk tests
631+
if (NOT NIX)
632+
if (MSVC)
633+
set(PYTHON_VER "python")
634+
else()
635+
set(PYTHON_VER "python3")
636+
endif()
637+
add_test(
638+
NAME test-tolk
639+
COMMAND ${PYTHON_VER} tolk-tester.py tests/
640+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tolk-tester)
641+
if (WIN32)
642+
set_property(TEST test-tolk PROPERTY ENVIRONMENT
643+
"TOLK_EXECUTABLE=${CMAKE_CURRENT_BINARY_DIR}/tolk/tolk.exe"
644+
"FIFT_EXECUTABLE=${CMAKE_CURRENT_BINARY_DIR}/crypto/fift.exe"
645+
"FIFTPATH=${CMAKE_CURRENT_SOURCE_DIR}/crypto/fift/lib/")
646+
else()
647+
set_property(TEST test-tolk PROPERTY ENVIRONMENT
648+
"TOLK_EXECUTABLE=${CMAKE_CURRENT_BINARY_DIR}/tolk/tolk"
649+
"FIFT_EXECUTABLE=${CMAKE_CURRENT_BINARY_DIR}/crypto/fift"
650+
"FIFTPATH=${CMAKE_CURRENT_SOURCE_DIR}/crypto/fift/lib/")
651+
endif()
652+
endif()
653+
630654
#BEGIN internal
631655
if (NOT TON_ONLY_TONLIB)
632656
add_test(test-adnl test-adnl)

crypto/fift/lib/Asm.fif

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1589,6 +1589,9 @@ forget @proclist forget @proccnt
15891589
{ }END> b> } : }END>c
15901590
{ }END>c <s } : }END>s
15911591

1592+
// This is the way how FunC assigns method_id for reserved functions.
1593+
// Note, that Tolk entrypoints have other names (`onInternalMessage`, etc.),
1594+
// but method_id is assigned not by Fift, but by Tolk code generation.
15921595
0 constant recv_internal
15931596
-1 constant recv_external
15941597
-2 constant run_ticktock

0 commit comments

Comments
 (0)