-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test case for non-expansion in string variables
- Loading branch information
Showing
3 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--============================================================================== | ||
-- BUG: String parameters may contain Alan special $ symbols, which can lead to | ||
-- infinite recursion when the player types "$1". | ||
--============================================================================== | ||
|
||
THE room IsA LOCATION | ||
Has text "". | ||
VERB write | ||
DOES | ||
"You write ""$1""." | ||
Set text of room to str. | ||
END VERB write. | ||
END THE room. | ||
|
||
-- Verb Write | ||
SYNTAX write = write (str) | ||
WHERE str IsA string | ||
ELSE "You can only use strings with this verb." | ||
|
||
|
||
-- Verb Read | ||
SYNTAX read = read. | ||
|
||
VERB read | ||
DOES | ||
Say text of room. | ||
END VERB read. | ||
|
||
Start at room. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
########## dollar_in_player_input ########## | ||
|
||
No warnings or errors detected. | ||
|
||
|
||
|
||
Room | ||
|
||
> read | ||
|
||
> write "Hello world." | ||
You write "Hello world.". | ||
|
||
> read | ||
Hello world. | ||
|
||
> write "Hello.$pWorld" | ||
You write "Hello.$pWorld". | ||
|
||
> read | ||
Hello.$pWorld | ||
|
||
> write "Hello.$1" | ||
You write "Hello.$1". | ||
|
||
> read | ||
Hello.$1 | ||
|
||
> write "$1" | ||
You write "$1". | ||
|
||
> | ||
|
||
Do you want to UNDO, RESTART, RESTORE or QUIT ? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
read | ||
write "Hello world." | ||
read | ||
write "Hello.$pWorld" | ||
read | ||
write "Hello.$1" | ||
read | ||
write "$1" |