-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpriority.hpp
More file actions
34 lines (25 loc) · 779 Bytes
/
priority.hpp
File metadata and controls
34 lines (25 loc) · 779 Bytes
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
#pragma once
#include <string>
namespace pl {
auto priority(std::string RtOperator) -> short {
if (RtOperator == "->") return 19;
if (RtOperator == "|") return 18;
if (RtOperator == "&") return 18;
if (RtOperator == ">>") return 18;
if (RtOperator == "<<") return 18;
if (RtOperator == "*") return 17;
if (RtOperator == "/") return 17;
if (RtOperator == "+") return 16;
if (RtOperator == "-") return 16;
if (RtOperator == "==") return 15;
if (RtOperator == "!=") return 15;
if (RtOperator == "<=") return 15;
if (RtOperator == ">=") return 15;
if (RtOperator == "<") return 15;
if (RtOperator == ">") return 15;
if (RtOperator == "&&") return 14;
if (RtOperator == "||") return 13;
if (RtOperator == "=") return 12;
return -1;
}
}