MCPcopy Index your code
hub / github.com/ygs-code/vue / parseBracket

Function parseBracket

vue.js:10048–10068  ·  view source on GitHub ↗
(chr)

Source from the content-addressed store, hash-verified

10046
10047 //检测 匹配[] 一对这样的=括号
10048 function parseBracket(chr) {
10049 var inBracket = 1;
10050 expressionPos = index$1;
10051 while (!eof()) {
10052 chr = next();
10053 if (isStringStart(chr)) { //如果是 " 或者 ' 的时候返回真
10054 parseString(chr); //循环匹配一对''或者""符号
10055 continue
10056 }
10057 if (chr === 0x5B) { // 匹配上
10058 inBracket++;
10059 }
10060 if (chr === 0x5D) { //匹配上 ]
10061 inBracket--;
10062 }
10063 if (inBracket === 0) { //如果匹配上一对 [] 的时候就跳出循环
10064 expressionEndPos = index$1;
10065 break
10066 }
10067 }
10068 }
10069 //循环匹配一对''或者""符号
10070 function parseString(chr) {
10071 var stringQuote = chr; //记录当前的'或者"

Callers 1

parseModelFunction · 0.85

Calls 4

eofFunction · 0.85
nextFunction · 0.85
isStringStartFunction · 0.85
parseStringFunction · 0.85

Tested by

no test coverage detected