瀏覽代碼

Shell: Remove '[' and ']' as special shell characters

This makes the test utility work, when invoked as '['
Peter Elliott 5 年之前
父節點
當前提交
9c1da8fca1
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      Shell/Parser.cpp

+ 2 - 2
Shell/Parser.cpp

@@ -450,7 +450,7 @@ RefPtr<AST::Node> Parser::parse_expression()
         return expr;
         return expr;
     };
     };
 
 
-    if (strchr("&|[]){} ;<>\n", starting_char) != nullptr)
+    if (strchr("&|){} ;<>\n", starting_char) != nullptr)
         return nullptr;
         return nullptr;
 
 
     if (isdigit(starting_char)) {
     if (isdigit(starting_char)) {
@@ -728,7 +728,7 @@ RefPtr<AST::Node> Parser::parse_bareword()
     auto rule_start = push_start();
     auto rule_start = push_start();
     StringBuilder builder;
     StringBuilder builder;
     auto is_acceptable_bareword_character = [](char c) {
     auto is_acceptable_bareword_character = [](char c) {
-        return strchr("\\\"'*$&#|()[]{} ?;<>\n", c) == nullptr;
+        return strchr("\\\"'*$&#|(){} ?;<>\n", c) == nullptr;
     };
     };
     while (!at_end()) {
     while (!at_end()) {
         char ch = peek();
         char ch = peek();