README.md (1706B)
1 # nisse, the not intricate serialised s expressions 2 3 ``` 4 nisse __ 5 .-' | 6 / <\| 7 / \' 8 |_.- o-o 9 / C -._)\ 10 /', | 11 | `-,_,__,' 12 (,,)====[_]=| 13 '. ____/ 14 | -|-|_ 15 |____)_) 16 ``` 17 18 19 ### Typesystem: 20 - Entries starting with any of `1234567890-.` are interpreted as numbers 21 - And if the number contains a `.` it is considered a float 22 - Entries starting with \` are a raw strings \`like this\` 23 - They can contain raw new lines and other characters, does not support escaped characters. 24 - Entries starting with `(` are arrays, and they are ended with a `)` 25 - Other entries are interpreted as whitespace delimited words 26 27 28 A common behaviour is to have a string as the first element of an array, where that string is the tag or variable name. 29 30 ### API 31 32 The C library exposes the AST directly, to write to a file you must generate 33 one yourself. There are macros and functions to make this step easier. 34 35 A parsed file returns a generated AST. There are functions that help you 36 verify formats and for getting tagged arrays/variables. 37 38 **View nisse.h for information about the functions.** 39 40 ### example .nisse file 41 ```lisp 42 (player 43 (hp 2.000000) 44 (items 45 (sword (type weapon) (damage 10)) 46 (knife (damage 4)) 47 (bow (type weapon) (damage 10) (range 15)) 48 (crossbow 49 (type `ranged weapon`) 50 (damage 16) 51 (range 25) 52 (properties poison fire) 53 ) 54 (sling (damage 4) (range 3)) 55 ) 56 ) 57 (items 58 (test) 59 () 60 (()) 61 (sword (damage 10)) 62 ) 63 (`v3 array` 64 (1.000000 2.000000 3.000000) 65 (4.000000 5.000000 6.000000) 66 (7.000000 8.000000 9.000000) 67 (10.000000 0.000010 420.690002) 68 ) 69 70 ```