nv-lex-simple-alter-q
v1.0.1
Published
nv-lex-simple-alterq =============== - nv-lex-simple-alterq - parse alternating quotation marks
Downloads
2
Readme
nv-lex-simple-alterq
- nv-lex-simple-alterq
- parse alternating quotation marks
install
- npm install nv-lex-simple-alterq
usage
const {parse_from_src} = require("nv-lex-simple-alterq")
example
> var src = `" a b ' c "efg" d ' "`
>
> var rt = parse_from_src(src)
> console.dir(rt.ary_,{depth:null})
[
[ ' a b ', [ ' c ', [ 'efg' ], ' d ' ], ' ' ]
]
>
> rt.flat()
[ ' a b ', ' c ', 'efg', ' d ', ' ' ]
>
> rt.toks_
[
TokNode [1 %230c8f84:1% ] { q: undefined, raw: undefined },
TokNode [2 %230c8f84:2% ] { q: '"', raw: undefined },
' a b ',
TokNode [4 %230c8f84:4% ] { q: "'", raw: undefined },
' c ',
TokNode [6 %230c8f84:6% ] { q: '"', raw: undefined },
'efg',
TokNode [6 %230c8f84:6% ] { q: '"', raw: undefined },
' d ',
TokNode [4 %230c8f84:4% ] { q: "'", raw: undefined },
' ',
TokNode [2 %230c8f84:2% ] { q: '"', raw: undefined },
TokNode [1 %230c8f84:1% ] { q: undefined, raw: undefined }
]
>
LICENSE
- ISC