-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest
More file actions
118 lines (84 loc) · 2.4 KB
/
Copy pathtest
File metadata and controls
118 lines (84 loc) · 2.4 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/*spec define MACROS call_func("test", 5) spec*/
/*spec def CROSS_FILE=cross_file_define("test", 1) spec*/
/*spec def BACKSLASHED_MACRO:Hello \spec*/
WORLD spec*/
BACKSLASHED_MACRO
"trying to CROSS_FILE cheat parser /*spec "
/* if not ENABLE */
Up and down is simple comments
/* else */
'trying to cheat parser spec*/ '
/*spec define FUNC(i) 20 + i spec*/
FUNC(5)
/*spec define LAMBDA_FUNC (lambda i : 20 + i) spec*/
LAMBDA_FUNC(5)
/*spec exec global multilineFunc
def multilineFunc(v):
return v + r' World'
def localFunc(v):
return v
print(multilineFunc(r'Hello '))
spec*/
multilineFunc('Other ')
/*spec direct incriment define INCRIMENT_FUNC(i) i + spec*/
/*spec incriment 10 spec*/
INCRIMENT_FUNC(5)
/*spec incriment 15 spec*/
INCRIMENT_FUNC(5)
/*spec incriment 20 spec*/
INCRIMENT_FUNC(5)
/*spec define REC_FUNC(i) 1 + REC_FUNC(i) spec*/
/*spec define REC_FUNC2(i) 1 + REC_FUNC(i) spec*/
REC_FUNC(10)
REC_FUNC2(10)
/*spec define SUB_CALL_FUNC(i=(1,2,3)) i[0] spec*/
SUB_CALL_FUNC((2,3))
/*spec define CALC_MACROS r'123456789'[5:-1] spec*/
CALC_MACROS
/*spec define RECURSE_FOO (4 + RECURSE_FOO) spec*/
/*spec define RECURSE_X (4 + RECURSE_Y) spec*/
/*spec define RECURSE_Y (2 * RECURSE_X) spec*/
/*spec define CORRECT_RECURSE_X (4 + CORRECT_RECURSE_Y) spec*/
/*spec define CORRECT_RECURSE_Y (r'2 * ' + CORRECT_RECURSE_X) spec*/
RECURSE_FOO
RECURSE_X
RECURSE_Y
CORRECT_RECURSE_Y
/*spec define __len__ 10 spec*/
/*spec define __len__ 0 spec*/
main(args)
{
/*spec include 'inc1' once spec*/
/*spec include_once 'inc1' spec*/
/*spec require 'inc2' 1 spec*/
/*spec require 'inc2' 5 spec*/
/*spec undef CROSS_FILE spec*/
/*spec include_once 'inc1' spec*/
/*spec require 'inc2' once spec*/
/*spec if not IN_INCLUDE spec*/
ERROR: IN_INCLUDE must defined
/*spec endif spec*/
MACROS
/*spec if not ENABLE spec*/
/*spec define ENABLE spec*/
/*spec endif spec*/
/*spec if ENABLE spec*/
Enabled code
/*spec else spec*/
ERROR: ENABLE must defined
/*spec endif spec*/
/*spec if CHOOSE spec*/
ERROR: CHOOSE must be undefined
/*spec elif not CHOOSE spec*/
No has CHOOSE
/*spec fi spec*/
/*spec if ELSE spec*/
ERROR: ELSE must be undefined
/*spec else spec*/
No has ELSE
/*spec fi spec*/
/*spec undef MACROS spec*/
/*spec if MACROS spec*/
ERROR: MACROS must be undefined
/*spec fi spec*/
}