mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-16 12:50:38 -07:00
feat: create trie programmatically in options
This commit is contained in:
committed by
Jun Yang
parent
8734e2e6ce
commit
befc33c4eb
@@ -1,16 +1,7 @@
|
||||
import { IDENTIFIER } from '../util/character'
|
||||
import { Trie } from '../util/operator-trie'
|
||||
|
||||
const trie = {
|
||||
a: { n: { d: { end: true, needBoundary: true } } },
|
||||
o: { r: { end: true, needBoundary: true } },
|
||||
c: { o: { n: { t: { a: { i: { n: { s: { end: true, needBoundary: true } } } } } } } },
|
||||
'=': { '=': { end: true } },
|
||||
'!': { '=': { end: true } },
|
||||
'>': { end: true, '=': { end: true } },
|
||||
'<': { end: true, '=': { end: true } }
|
||||
}
|
||||
|
||||
export function matchOperator (str: string, begin: number, end = str.length) {
|
||||
export function matchOperator (str: string, begin: number, trie: Trie, end = str.length) {
|
||||
let node = trie
|
||||
let i = begin
|
||||
let info
|
||||
|
||||
Reference in New Issue
Block a user