1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-07-03 07:24:58 +03:00
inform7/inter/Tests/Valid/misc.intert
2022-10-23 13:20:55 +01:00

100 lines
3.4 KiB
Plaintext

# This is a miscellany of tests.
packagetype _plain
packagetype _code
primitive !return val -> void
primitive !modulo val val -> val
primitive !plus val val -> val
pragma target_I6 "$MAX_STATIC_DATA=180000"
package main _plain
typename K_number = int32
typename K_truth_state = int2
variable (K_number) V_banana = 100
constant (K_number) C_death = -5
constant (K_number) C_taxes = 14
variable (K_number) V_anxiety = C_death
constant (K_number) C_x = 0x7f2a
constant (K_number) cornelius = dw"frogs"
constant (K_number) gaius = dw"toads"
constant emptytext = ""
constant IMPROBABLE_VALUE = 0xdeadce11
splat "" "" "Sing a song of \"six splats\"...\nand don't wait up"
typename K_colour = enum
instance (K_colour) I_green = 1
instance (K_colour) I_red = 17
variable (K_colour) V_shade = I_red
typename K_list_of_number = list of /main/K_number
constant (K_list_of_number) C_primes = { 2, 3, 5, 7, 11, 13, 17, 19 }
constant (K_list_of_number) C_concealed = C_primes
variable (K_list_of_number) V_watch_list = C_concealed
typename K_text = text
constant (K_text) C_complaint = "This is already quite a long test case."
constant (K_number) C_raw = glob"SOME_I6_DRIVEL"
typename K_odour = enum
instance (K_odour) I_citrus = 5
instance (K_odour) I_leather = 10
property (K_number) P_strength
permission for K_odour to have P_strength
propertyvalue P_strength of I_citrus = 20
propertyvalue P_strength of I_leather = 7
property (K_number) P_lingeringness
permission for K_odour to have P_lingeringness
propertyvalue P_lingeringness of I_citrus = 1
propertyvalue P_lingeringness of I_leather = 3
propertyvalue P_lingeringness of K_odour = 2
typename K_table = table
typename K_column_of_number = column of /main/K_number
typename K_column_of_colour = column of /main/K_colour
constant (K_column_of_number) C_egtable_col1 = { 1, 4, 9, 16 }
constant (K_column_of_colour) C_egtable_col2 = { I_green, !undef, I_red }
constant (K_table) C_egtable = { C_egtable_col1, C_egtable_col2 }
typename K_object = enum
instance (K_object) I_board = 1
typename K_piece <= K_object
instance (K_piece) I_bishop = 2
instance (K_piece) I_rook = 3
typename K_list_of_objects = list of /main/K_object
constant (K_list_of_objects) C_majors = { I_bishop, I_rook }
permission for I_bishop to have P_lingeringness
typename K_func = function /main/K_colour /main/K_number -> /main/K_odour
typename K_rule = rule void -> void
typename K_rulebook = rulebook of /main/K_rule
typename K_stuff = struct /main/K_number /main/K_colour /main/K_odour
constant (K_stuff) S_stuff = struct{ 5, I_red, I_citrus }
package (K_rule) R_after1 _code
package (K_rule) R_after2 _code
constant (K_rulebook) RB_after = { R_after1, R_after2 }
typename K_colour____colour = function /main/K_colour -> /main/K_colour
package (K_colour____colour) R_101 _code
local (/main/K_colour) x
code
inv /main/R_102
val (/main/K_colour) /main/I_green
inv !return
inv !modulo
inv !plus
cast /main/K_number <- /main/K_colour
val (/main/K_colour) x
val (/main/K_number) 1
val (/main/K_truth_state) glob"a b"
package (K_colour____colour) R_102 _code
local (/main/K_colour) x
code
inv !return
val (/main/K_colour) /main/I_red
constant (K_number) amount = sum{ 2, C_taxes }
package glk_buffer_to_upper_case_uni _code
local _vararg_count
local ret
code
inv @glk
val 289
val _vararg_count
val ret
inv !return
val ret
constant (text) ^text = "A = B"