1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
Define_Type: 'C_Integer', -prototype;
local: 'format' = array;
local: 'value' = integer;
Define_Tag: 'onCreate', -optional='value';
if: (local_defined: 'value');
self->'value' = #value;
/if;
/Define_Tag;
Define_Tag: 'onAssign';
params->(get: 1)->type;
self->'value' = (integer: params->(get: 1));
return: true;
/Define_Tag;
Define_Tag: '+=';
self->'value' += params->(get: 1);
return: true;
/Define_Tag;
Define_Tag: '-=';
self->'value' -= params->(get: 1);
return: true;
//it was expected to return a value, but that errors
//this is probably because of the order of calling that is invoked
//due to the implementation of onAssign and onConvert
/Define_Tag;
Define_Tag: '*=';
self->'value' *= params->(get: 1);
return: true;
/Define_Tag;
Define_Tag: '/=';
self->'value' /= params->(get: 1);
return: true;
/Define_Tag;
Define_Tag: 'onConvert';
select: params->(get: 1);
case: 'string';
null->\setFormat->(run: -name='setFormat', -owner=self->'value', -params=self->'format');
return: (string: self->'value');
case: 'integer';
return: (integer: self->'value');
case: 'decimal';
return: (decimal: self->'value');
/select;
/Define_Tag;
Define_Tag: '_unknownTag';
local: 'tag' = integer->properties->second->(find: tag_name);
local: 'result' = null;
if: #tag == null;
#tag = null->properties->second->(find: tag_name);
/if;
if: #tag != null;
#result = #tag->(run: -name=tag_name, -owner=self->'value', -params=params);
else;
fail: -9948, 'No tag, type or constant was defined under the name ' + self->type + '->' + tag_name + ' with arguments ' + params;
/if;
/Define_Tag;
Define_Tag: 'setFormat';
self->'format' = params;
/Define_Tag;
/Define_Type;
|