equal
deleted
inserted
replaced
1 # YML 2.5.9 language definition |
1 # YML 2.5.10 language definition |
2 |
2 |
3 # written by VB. |
3 # written by VB. |
4 |
4 |
5 import re |
5 import re |
6 from pyPEG import keyword, _and, _not |
6 from pyPEG import keyword, _and, _not |
49 |
49 |
50 _xmlSymbol = u"(" + NameStartChar + u")(" + NameChar + u")*" |
50 _xmlSymbol = u"(" + NameStartChar + u")(" + NameChar + u")*" |
51 xmlSymbol = r(_xmlSymbol) |
51 xmlSymbol = r(_xmlSymbol) |
52 aliasSymbol = r(ur"-|(" + _xmlSymbol + ur")") |
52 aliasSymbol = r(ur"-|(" + _xmlSymbol + ur")") |
53 |
53 |
54 literal = [r(r'""".*?"""', re.S), r(r"'''.*?'''", re.S), r(r"""-?\d+\.\d*|-?\.\d+|-?\d+|".*?"|'.*?'""")] |
54 literal = [r(r'""".*?"""', re.S), r(r"'''.*?'''", re.S), r(r"""0x[a-f0-9]+|-?\d+\.\d*|-?\.\d+|-?\d+|".*?"|'.*?'""")] |
55 filename = [("'", r(r"[^']*"), "'"), ('"', r(r'[^"]*'), '"'), r(r"[^\s;]+")] |
55 filename = [("'", r(r"[^']*"), "'"), ('"', r(r'[^"]*'), '"'), r(r"[^\s;]+")] |
56 ws = r(r"\s+", re.U) |
56 ws = r(r"\s+", re.U) |
57 |
57 |
58 def pyExp(): return "!", r(r"(!=|\\!|[^!])+"), "!" |
58 def pyExp(): return "!", r(r"(!=|\\!|[^!])+"), "!" |
59 value = [literal, pyExp] |
59 value = [literal, pyExp] |