diff --git a/docs/examples/greeting.txt b/docs/examples/greeting.txt new file mode 100644 index 0000000..c35f8f7 --- /dev/null +++ b/docs/examples/greeting.txt @@ -0,0 +1,20 @@ +NewLang 0 + +BeginNote +Copyright 2021 Jookia +SPDX-License-Identifier: LGPL-2.1-or-later +This is a comment and should be ignored by the parser +EndNote + +System Print BeginText Hello, there! EndText Done +System Print BeginText Please enter your name: EndText Done +Set Name To System Read EndSet BeginNote Reads an entire line EndNote +Set Prefix To BeginText Hi there, EndText EndSet +Set Greeting To Prefix Append Name EndSet + +If Name Equals BeginText Jookia EndText +Then System Print BeginText Hi creator! EndText +Else System Print Greeting +EndIf + +System Exit Done diff --git a/docs/examples/menu.txt b/docs/examples/menu.txt new file mode 100644 index 0000000..c111925 --- /dev/null +++ b/docs/examples/menu.txt @@ -0,0 +1,17 @@ +NewLang 0 + +System Print BeginText Type 'Hi' for a greeting EndText Done +System Print BeginText Type 'Exit' to exit EndText Done +Set Command To System Read EndSet + +If Command Equals BeginText Hi EndText +Then System Print BeginText Hey there! EndText +Else True BeginNote Does nothing EndNote +EndIf + +If Command Equals BeginText Exit EndText +Then System Exit +Else True +EndIf + +System Print BeginText What next? EndText Done diff --git a/examples/code.txt b/examples/code.txt deleted file mode 100755 index dd2ae41..0000000 --- a/examples/code.txt +++ /dev/null @@ -1,21 +0,0 @@ -#!../src/main.py -NewLang 0 - -BeginNote -Copyright 2021 Jookia -SPDX-License-Identifier: LGPL-2.1-or-later -This is a comment and should be ignored by the parser -EndNote - -System Print BeginText Hello, there! EndText Done -System Print BeginText Please enter your name: EndText Done -Set Name To System Read EndSet BeginNote Reads an entire line EndNote -Set Prefix To BeginText Hi there, EndText EndSet -Set Greeting To Prefix Append Name EndSet - -If Name Equals BeginText Jookia EndText -Then System Print BeginText Hi creator! EndText -Else System Print Greeting -EndIf - -System Exit Done diff --git a/examples/guessmyname.txt b/examples/guessmyname.txt deleted file mode 100755 index 426dbaf..0000000 --- a/examples/guessmyname.txt +++ /dev/null @@ -1,18 +0,0 @@ -#!../src/main.py -NewLang 0 - -System Print BeginText Type 'Hi' for a greeting EndText Done -System Print BeginText Type 'Exit' to exit EndText Done -Set Command To System Read EndSet - -If Command Equals BeginText Hi EndText -Then System Print BeginText Hey there! EndText -Else True BeginNote Does nothing EndNote -EndIf - -If Command Equals BeginText Exit EndText -Then System Exit -Else True -EndIf - -System Print BeginText What next? EndText Done