forked from melton1968/math
-
Notifications
You must be signed in to change notification settings - Fork 0
/
math-token-re.el
38 lines (29 loc) · 1.21 KB
/
math-token-re.el
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
(defconst math-tok-identifier-re
"[$a-zA-Z]+[$a-zA-Z0-9_]*"
"The regular expression for a Mathmatica identifier.")
(defconst math-tok-symbol-re
"\\\\\\[\\([A-Z][A-Za-z0-9]*\\)]"
"The regular expresion for a Mathematica syntax character.")
(defconst math-tok-string-re
"\"[^\"\\\\]*\\(?:\\\\.[^\"\\\\]*\\)*\""
"The regular expression for a Mathematica string.")
(defconst math-tok-number-re
"[0-9]*\\.?[0-9]+"
"The regular expression for a Mathematica number.")
(defconst math-tok-slot-re
"##?[0-9]*"
"The regular expression for a Mathematica slot.")
(defconst math-tok-out-re
"%+[0-9]*"
"The regular expression for a Mathematica output reference.")
(defconst math-tok-operator-list
'("::" "_" "<<" "\\+" "\\&" "\\%" "\\_" "\\!" "?" "[" "[[" "]"
"\\*" "++" "--" "@" "~" "/@" "//" "@@" "@@@" "!" "!!" "*" "'" "<>"
"^" "\\^" "\\@" "-" "+" "/" "\\/" "*" ";;" "==" "!=" ">" ">=" "<"
"<=" "===" "=!=" "&&" "||" ".." "..." "|" ":" "~~" "/;" "->" ":>"
"/." "//." "+=" "-=" "*=" "/=" "&" "=" ":=" "^=" "^:=" "/:" "=." ">>"
">>>" ";" "\\`" "," "(" ")" "{" "}")
"The Mathematica operators.")
(defconst math-tok-operator-re
(regexp-opt math-tok-operator-list))
(provide 'math-token-re)