Kaynağa Gözat

优化代码提示

mxd 3 yıl önce
ebeveyn
işleme
7d063e86b3

+ 1 - 9
magic-editor/src/console/src/scripts/parsing/index.js

@@ -291,15 +291,7 @@ class CharacterStream {
     }
 
     matchDigit(consume) {
-        if (this.index >= this.end)
-            return false;
-        let c = this.source.charAt(this.index);
-        if (c!== ' ' && !isNaN(c)) {
-            if (consume)
-                this.index++;
-            return true;
-        }
-        return false;
+        return this.matchAny('0123456789', consume)
     }
 
     matchIdentifierStart(consume) {