--fields=+nKZe
--sort=no

--langdef=X
--langmap=X:.mtable
--kinddef-X=v,var,variables
--kinddef-X=f,fun,functions

--_tabledef-X=main
--_tabledef-X=comment_sharp_sa
--_tabledef-X=comment_sharp_sharp
--_tabledef-X=char
--_tabledef-X=string
--_tabledef-X=varlist
--_tabledef-X=func
--_tabledef-X=fbody
--_tabledef-X=generic

--_mtable-regex-X=generic/\/\*//{tenter=comment_sharp_sa}
--_mtable-regex-X=generic/\/\///{tenter=comment_sharp_sharp}
--_mtable-regex-X=generic/'//{tenter=char}
--_mtable-regex-X=generic/"//{tenter=string}

--_mtable-extend-X=main+generic
--_mtable-regex-X=main/var//{tenter=varlist}
--_mtable-regex-X=main/function//{tenter=func}
--_mtable-regex-X=main/.//

--_mtable-regex-X=comment_sharp_sa/\*\///{tleave}
--_mtable-regex-X=comment_sharp_sa/.//

--_mtable-regex-X=comment_sharp_sharp/\n//{tleave}
--_mtable-regex-X=comment_sharp_sharp/.//

--_mtable-regex-X=char/'//{tleave}
--_mtable-regex-X=char/.//

--_mtable-regex-X=string/"//{tleave}
--_mtable-regex-X=string/.//

--_mtable-extend-X=varlist+generic
--_mtable-regex-X=varlist/([a-zA-Z]+)/\1/v/{scope=ref}
--_mtable-regex-X=varlist/;//{tleave}
--_mtable-regex-X=varlist/.//

--_mtable-extend-X=func+generic
--_mtable-regex-X=func/([a-zA-Z]+)/\1/f/{scope=push}
--_mtable-regex-X=func/\{//{tjump=fbody}
--_mtable-regex-X=func/.//

--_mtable-extend-X=fbody+generic
--_mtable-regex-X=fbody/\}//{tleave}{scope=pop}
--_mtable-regex-X=fbody/var//{tenter=varlist}
--_mtable-regex-X=fbody/function//{tenter=func}
--_mtable-regex-X=fbody/.//
