forked from hedyorg/hedy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
definition.py
81 lines (73 loc) · 1.2 KB
/
definition.py
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
# This file defines the special regexes
# list of symbols recognized as characters (with non-Latin characters)
CHARACTER = '[\\p{Lu}\\p{Ll}\\p{Lt}\\p{Lm}\\p{Lo}\\p{Nl}_\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}·]'
# definition of word
WORD = '(' + CHARACTER + "+)"
# space
SPACE = "( +)"
# beginning and end of one line, including space
START_LINE = '(^ *)'
END_LINE = '( *$)'
# beginning and end of words
START_WORD = '(^| )'
END_WORD = '(?!' + CHARACTER + ')'
DIGIT = '[__DIGIT__]'
TRANSLATE_WORDS = [
"add",
"and",
"ask",
"at",
"black",
"blue",
"brown",
"call",
"clear",
"color",
"comma",
"def",
"define",
"echo",
"elif",
"else",
"false",
"False",
"for",
"forward",
"from",
"gray",
"green",
"if",
"in",
"input",
"is",
"left",
"length",
"not_in",
"or",
"orange",
"pink",
"play",
"pressed",
"print",
"purple",
"random",
"range",
"red",
"remove",
"repeat",
"return",
"right",
"sleep",
"step",
"times",
"to_list",
"to",
"true",
"True",
"turn",
"while",
"white",
"with",
"yellow",
]
TOKEN_CONSTANT = "text"