Skip to content

Update examples for language version 0.6#3

Merged
yarb00 merged 2 commits into
masterfrom
tssl-0.6-examples
Dec 5, 2025
Merged

Update examples for language version 0.6#3
yarb00 merged 2 commits into
masterfrom
tssl-0.6-examples

Conversation

@yarb00

@yarb00 yarb00 commented Dec 5, 2025

Copy link
Copy Markdown
Owner

Rewrite files under examples/ for TSSL v0.6. Notepad++ UDL has also been updated for correct syntax highlighting of these examples.

@yarb00 yarb00 added this to the v0.6.0 milestone Dec 5, 2025
@yarb00 yarb00 self-assigned this Dec 5, 2025
@yarb00 yarb00 added the enhancement New feature or request label Dec 5, 2025
@yarb00 yarb00 merged commit 5192fc6 into master Dec 5, 2025
4 checks passed
@yarb00 yarb00 deleted the tssl-0.6-examples branch December 5, 2025 10:09
@yarb00

yarb00 commented Dec 5, 2025

Copy link
Copy Markdown
Owner Author

Another example of TSSL 0.6 code to test syntax highlighting:

#!/usr/bin/env TsslInterpreter
!TooSimpleScriptingLanguage 0.6

# Print text and a new line character(s), LF or CR+LF
print line> Welcome here! It's a demo program that tests the 0.6 update of TSSL!
# An empty line
print line>

@ask
# Print text as it is (without beginning a new line)
print> [whoami/greet/exit]:
# Read user input and save it to the value (variable) named "option"
ask line> option
# If user input equals "whoami", jump to the "print_user" label
<print_user ?equals> \{option};whoami
# If user input equals "greet", jump to the "greet" label
<greet ?equals> \{option};greet
# If user input equals "exit", jump to the "end" label
<end ?equals> \{option};exit
# Otherwise, ask for input again (jump back to the "ask" label)
<ask

@print_user
# Run the "whoami" command and pause execution of the script until it finishes
execute wait> whoami
# If whoami ran successfully (did not exit with 0), ask for input again
<ask ?equals> \{_last_execute_status};0
# If it returned a non-zero code, let user know
print line> An error occurred.
# And only then ask for input
<ask

@greet
print> Your name:
ask line> name
print line> \{name}, hi!
<ask

@end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant