Reviving the conditional example
This commit is contained in:
3
examples/conditional/debugtest1.hlog
Normal file
3
examples/conditional/debugtest1.hlog
Normal file
@@ -0,0 +1,3 @@
|
||||
Debug mode!
|
||||
debug mode
|
||||
This is the secret debug ending!
|
||||
18
examples/conditional/main.hank
Normal file
18
examples/conditional/main.hank
Normal file
@@ -0,0 +1,18 @@
|
||||
{if (DEBUG) "Debug mode!"}
|
||||
{if (!DEBUG) "Not debug mode" else "debug mode"}
|
||||
|
||||
// Make sure flow can fall through embedded blocks
|
||||
```
|
||||
if (DEBUG) {
|
||||
, -> debug_only_section
|
||||
}
|
||||
else {
|
||||
, This will fall through!
|
||||
}
|
||||
```
|
||||
|
||||
This is the production ending!
|
||||
|
||||
== debug_only_section
|
||||
|
||||
This is the secret debug ending!
|
||||
3
examples/conditional/test1.hlog
Normal file
3
examples/conditional/test1.hlog
Normal file
@@ -0,0 +1,3 @@
|
||||
Not debug mode
|
||||
This will fall through!
|
||||
This is the production ending!
|
||||
Reference in New Issue
Block a user