|
1
2
3
4
5
6
|
'''
Created on 24 sty 2014
@author: mlenart
'''
|
|
7
|
from morfeuszbuilder.segrules import preprocessor
|
|
8
9
10
11
12
13
14
15
|
if __name__ == '__main__':
text = '''
dupa
#define asd XXX
#define X(x) a x b
#define Y(x) X(x) c
#define B(x) X(x)
|
|
16
17
|
#define Z(x) Y( X(x) jhg) d
#define A_B(asd) dupa asd dupa asfda_asdfa
|
|
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
Y(Z(a) b X(c) Y(d))
#ifdef extra
asdfasa
#ifdef extra
asdfasdfasdfa
#endif
#ifdef superextra
aaaa asd
#endif
#endif
#ifdef superextra
asdfasdfada
#endif
|
|
33
|
A_B( (x)+ x)
|
|
34
|
'''
|
|
35
|
for line in preprocessor.preprocess(enumerate(text.split('\n')), ['extra', 'superextra']):
|
|
36
|
print line
|