File tree Expand file tree Collapse file tree 1 file changed +20
-8
lines changed Expand file tree Collapse file tree 1 file changed +20
-8
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ EChar <- 'a' -> ea
5454 / ([0-9] [0-9]? [0-9]?) -> Char10
5555 / ('u{' {X16*} '}') -> CharUtf8
5656Symbol <- ({} {
57- [:|,;<>()?+#{}]
57+ [:|,;<>()?+#{}.* ]
5858 / '[]'
5959 / '...'
6060 / '['
@@ -744,30 +744,42 @@ local function parseCodePattern(parent)
744744 local codeOffset
745745 local finishOffset
746746 local content
747- for i = 2 , 8 do
747+ local i = 2
748+ while true do
748749 local next , nextContent = peekToken (i )
749750 if not next or TokenFinishs [Ci + i - 1 ] + 1 ~= TokenStarts [Ci + i ] then
750751 if codeOffset then
751- finishOffset = i
752+ finishOffset = i - 1
752753 break
753754 end
754755 --- 不连续的name,无效的
755756 return nil
756757 end
757- if next == ' code' then
758- if codeOffset and content ~= nextContent then
758+ if next == ' name' then
759+ pattern = pattern .. nextContent
760+ elseif next == ' code' then
761+ if codeOffset then
759762 -- 暂时不支持多generic
760763 return nil
761764 end
762765 codeOffset = i
763766 pattern = pattern .. " %s"
764767 content = nextContent
765- elseif next ~= ' name' then
766- return nil
768+ elseif codeOffset then
769+ -- should be match with Parser "name" mask
770+ if next == ' integer' then
771+ pattern = pattern .. nextContent
772+ elseif next == ' symbol' and (nextContent == ' .' or nextContent == ' *' or nextContent == ' -' ) then
773+ pattern = pattern .. nextContent
774+ else
775+ return nil
776+ end
767777 else
768- pattern = pattern .. nextContent
778+ return nil
769779 end
780+ i = i + 1
770781 end
782+ nextToken ()
771783 local start = getStart ()
772784 for _ = 2 , finishOffset do
773785 nextToken ()
You can’t perform that action at this time.
0 commit comments