mirror of
https://github.com/ganelson/inform.git
synced 2024-07-05 16:44:21 +03:00
97 lines
3.3 KiB
Plaintext
97 lines
3.3 KiB
Plaintext
# This is a miscellany of tests.
|
|
|
|
packagetype _plain
|
|
packagetype _code
|
|
packagetype _linkage
|
|
|
|
primitive !return val -> void
|
|
primitive !modulo val val -> val
|
|
primitive !plus val val -> val
|
|
|
|
pragma target_I6 "$MAX_STATIC_DATA=180000"
|
|
|
|
package main _plain
|
|
kind K_number int32
|
|
kind K_truth_state int2
|
|
defaultvalue K_number = 47
|
|
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 __hex
|
|
link early "alpha" "beta" "gamma" "delta"
|
|
link before "alpha" "" "" ""
|
|
link instead "" "beta" "" ""
|
|
link after "" "" "gamma" ""
|
|
constant (K_number) cornelius = dw'frogs'
|
|
constant (K_number) gaius = dw'toads'
|
|
splat &"Sing a song of \"six splats\"...\nand don't wait up"
|
|
kind K_colour enum
|
|
instance I_green K_colour = 1
|
|
instance I_red K_colour = 17
|
|
variable (K_colour) V_shade = I_red
|
|
kind K_list_of_number list of 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
|
|
kind K_text text
|
|
constant (K_text) C_complaint = "This is already quite a long test case."
|
|
constant (K_number) C_raw = &"SOME_I6_DRIVEL"
|
|
kind K_odour enum
|
|
instance I_citrus K_odour = 5
|
|
instance I_leather K_odour = 10
|
|
property P_strength K_number __property_name="strength"
|
|
permission P_strength K_odour
|
|
propertyvalue P_strength I_citrus = 20
|
|
propertyvalue P_strength I_leather = 7
|
|
property P_lingeringness K_number
|
|
permission P_lingeringness K_odour
|
|
propertyvalue P_lingeringness I_citrus = 1
|
|
propertyvalue P_lingeringness I_leather = 3
|
|
propertyvalue P_lingeringness K_odour = 2
|
|
kind K_table table
|
|
kind K_column_of_number column of K_number
|
|
kind K_column_of_colour column of 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 }
|
|
kind K_object enum
|
|
instance I_board K_object = 1
|
|
kind K_piece <= K_object
|
|
instance I_bishop K_piece = 2
|
|
instance I_rook K_piece = 3
|
|
kind K_list_of_objects list of K_object
|
|
constant (K_list_of_objects) C_majors = { I_bishop, I_rook }
|
|
permission P_lingeringness I_bishop
|
|
kind K_func function K_colour K_number -> K_odour
|
|
kind K_rule rule void -> void
|
|
kind K_rulebook rulebook of K_rule
|
|
kind K_stuff struct K_number K_colour K_odour
|
|
constant (K_stuff) S_stuff = { 5, I_red, I_citrus }
|
|
package R_after1_B _code
|
|
package R_after2_B _code
|
|
constant (K_rule) R_after1 = R_after1_B
|
|
constant (K_rule) R_after2 = R_after2_B
|
|
constant (K_rulebook) RB_after = { R_after1, R_after2 }
|
|
kind K_colour____colour function K_colour -> K_colour
|
|
package R_101_B _code
|
|
local (/main/K_colour) x __argument
|
|
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) &"a b"
|
|
constant (K_colour____colour) R_101 = R_101_B
|
|
package R_102_B _code
|
|
local (/main/K_colour) x __argument
|
|
code
|
|
inv !return
|
|
val (/main/K_colour) /main/I_red
|
|
constant (K_colour____colour) R_102 = R_102_B
|
|
constant (K_number) amount = sum{ 2, C_taxes }
|