Browse Source

Version 2.5.6

python3
Volker Birk 4 years ago
parent
commit
e6367ce8f3
3 changed files with 27 additions and 4 deletions
  1. +22
    -0
      backend.py
  2. +1
    -1
      heading.en.yhtml2
  3. +4
    -3
      yml2.py

+ 22
- 0
backend.py View File

@ -626,6 +626,28 @@ def codegen(obj):
result += codegen(Symbol(u'lineQuote', u'| ' + l[space:]))
return code(result)
elif ctype == "textsectionu":
result = u''
ll = obj[1].splitlines()
space = len(ll[-1]) - 2
for l in ll[1:-1]:
m = re.match(bqq, l)
if m:
cmd = m.group(1)
try:
r, x = parseLine(cmd, _inner, [], True, comment)
if x: raise SyntaxError(cmd)
result += _finish(r)
except SyntaxError:
if included:
raise SyntaxError(u"in " + included + u":" + u(line) + u": syntax error in executing command: " + cmd.strip())
else:
raise SyntaxError(u"in " + u(line) + u": syntax error in executing command: " + cmd.strip())
else:
if result != u'': result += u' '
result += codegen(Symbol(u'quote', [u'> ' + l[space:]]))
return code(result)
elif ctype == "lineQuote" or ctype == "quote":
m, text, base, inds = None, u"", 0, 0


+ 1
- 1
heading.en.yhtml2 View File

@ -13,7 +13,7 @@ decl ne is a {
div id=headline {
p > YML – Why a Markup Language?!
div class=small {
"YML 2.5.5 of We Aug 24 2016 – Copyleft 2007-2016, "
"YML 2.5.6 of We Aug 24 2016 – Copyleft 2007-2017, "
a "http://blog.fdik.org", "Volker Birk";
" – "
a "http://fdik.org/yml2.tar.bz2", "Download YML 2";


+ 4
- 3
yml2.py View File

@ -1,4 +1,4 @@
# YML 2.5.3 language definition
# YML 2.5.6 language definition
# written by VB.
@ -77,12 +77,13 @@ def operator(): return 0, keyword("define"), keyword("operator"), literal, k
def constant(): return 0, keyword("define"), [pointer, symbol], "=", literal, 0, [";", "."]
def in_ns(): return keyword("in"), xmlSymbol, [_decl, ("{", -2, _decl, "}")]
_decl = keyword("decl"), listing(decl), [";", "."]
def textsection(): return r(r'(\|\|(\>*).*?\|\|(\>*))|(\>\>.*?\>\>)', re.S)
def textsection(): return r(r'(\|\|(\>*).*?\|\|(\>*))', re.S)
def textsectionu(): return r(r'(\>\>.*?\>\>)', re.S)
def include(): return keyword("include"), 0, reverse, 0, [ktext, kxml], filename, 0, [";", "."]
def func(): return _func, 0, content
def funclist(): return listing(func)
_cmd = funclist, 0, [";", "."]
_inner = [include, textsection, pythonCall, _cmd, quote, lineQuote, tagQuote, pyExp]
_inner = [include, textsection, textsectionu, pythonCall, _cmd, quote, lineQuote, tagQuote, pyExp]
_cc = "{", -1, _inner, "}"
def content_plain(): return [ (_l, 0, _p, 0, _b, 0, _cc), (_p, 0, _b, 0, _cc), (_b, 0, _cc), _cc ]
content_plain.__name__ = "content"


Loading…
Cancel
Save