             }
             
         }
+        //所有字符消耗完毕，输出是否成功识别此语言，以及识别到的所有token
         return (ok: ok, tokens: tokens)
     }
 }

                    }
                }
            } else if let tokenTo = lastTerminatorParentIndex, let tokenFrom = workingStringLocation {
                let tokenRange = Range(uncheckedBounds: (lower: tokenFrom, upper: tokenTo))
                let tokenString = source.substring(with: tokenRange)
                let token = RecognizedToken(range: tokenRange, string: tokenString)

        self = .node(key, Array(tmp))
    }
    
    //递归合并两个trie，只有相同的key的node或两个terminator可以合并，其他情况会返回nil
    static func merge(lhs: Trie, rhs: Trie) -> Trie? {
        switch (lhs, rhs) {
        case (.node(let lKey, let lChildren), .node(let rKey, let rChildren)):
