File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ void mathS::Lexer::get(mathS::Token& token) {
16
16
switch (token.type ){
17
17
case Token::OPERATOR:
18
18
if ((c == ' =' || c == ' <' || c == ' >' ) && index < content.length ()) {
19
- if (content[index] == ' =' || content[index] == c)
19
+ if (/* content[index] == '=' || */ content[index] == c)
20
20
token.text += content[index++];
21
21
}
22
22
if (c == ' -' && index < content.length ()) {
@@ -28,7 +28,7 @@ void mathS::Lexer::get(mathS::Token& token) {
28
28
while (index < content.length ()) {
29
29
if (checkType (content[index]) != Token::NUMORSYMB) break ;
30
30
token.text += content[index++];
31
- }
31
+ }
32
32
break ;
33
33
case Token::STRING:
34
34
while (index < content.length ()) {
Original file line number Diff line number Diff line change @@ -17,23 +17,23 @@ int main() {
17
17
18
18
/* // Compute测试
19
19
while (true) {
20
- std::cin >> str;
20
+ getline( std::cin, str) ;
21
21
auto obj = Parse(str);
22
22
while (Compute(obj, obj));
23
23
std::cout << obj->GetString() << std::endl;
24
24
}
25
25
// Rule模块测试
26
26
while (true) {
27
27
std::cout << "Source pattern: ";
28
- std::cin >> str;
28
+ getline( std::cin, str) ;
29
29
auto srcpattern = Parse(str);
30
30
31
31
std::cout << "Target pattern: ";
32
- std::cin >> str;
32
+ getline( std::cin, str) ;
33
33
auto tarpattern = Parse(str);
34
34
35
35
std::cout << "Object: ";
36
- std::cin >> str;
36
+ getline( std::cin, str) ;
37
37
auto obj = Parse(str);
38
38
39
39
auto rule = MakeRule(srcpattern, tarpattern);
@@ -46,7 +46,7 @@ int main() {
46
46
47
47
// 计算器程序;测试LBAssembler
48
48
while (true ) {
49
- std::cin >> str;
49
+ getline ( std::cin, str) ;
50
50
auto mobj = Parse (str);
51
51
52
52
// 检查表达式是否合法,并输出错误信息
You can’t perform that action at this time.
0 commit comments