1 module hipddf;
2 /** 
3  * HipDDF = Hipreme D Data Format, based on the D syntax 
4  *
5  *  Version: 0.3:
6  *      - Supports basic types, and arrays.
7  *      - Associative array support
8  *      - __FILE__ and __LINE__ keywords
9  *
10  *  Planned to future:
11  *      1.0 : Data parsing only
12  *      1.1 : Concatenation support for string and arrays
13  *      1.2 : Arithmetic operations
14  *      1.3 : Self reference values
15  *      1.4 : Aliases 
16  */
17 
18 
19 public import hipddf.parser : parseHipDDF;
20 public import hipddf.types;
21 
22 
23 enum HipDDFSample = q{
24     struct Vector2
25     {
26         int a;
27         int b;
28     }
29     
30     
31     Vector2[] vArr = [
32         Vector2(50, 100),
33         Vector2(400, 300)
34     ];
35     Vector2[] vArr2 = [
36         {b: 350, a: 100},
37         {a: 400,b: 300}
38     ];
39 
40     /**
41     *   HipDDF sample of how it works. This file is being used as a test too for each supported thing.
42     */
43     int[] testArray_Multi = 
44     [
45         -1,
46         -2,
47         -3
48     ];
49 
50     string filename = __FILE__;
51 
52     int a = 500;
53     int b = a;
54 
55     Vector2 v = Vector2(500, 200);
56     Vector2 v2 = {a : 3000, b : 5000}
57     Vector2 v3 = v;
58 
59     string multiLineStringTest = "
60     Lorem ipsum this is really boring.
61     " //Look! Optional semicolon (maybe only for now)
62 
63     int lineCheckerTest = __LINE__;
64     int[] testArray_Single = [1, 4, 30, 90, 99];
65     string abilityType = "Test helper";
66 
67     int[string] testAA = [
68         "ABC" : 500,
69         "Hundred" : 100
70     ];
71 
72     // int[][] testMultiArr = [
73     //     [1, 2, 3],
74     //     [3, 2, 1]
75     // ];
76 
77     Vector2[string] testAAStruc = [
78         "hello" : Vector2(50, 100),
79         "world" : Vector2(200, 300)
80     ];
81 
82 
83     int[4] testArray_Bounded = [
84         10,20,30,40
85     ];
86     int[10] testArray_Value = 5;
87 };