feature: default function is used as a template
authorVolker Birk <vb@pep-project.org>
Fri, 15 Feb 2019 10:45:50 +0100
changeset 29 6a8a7951d8e6
parent 28 e9a51b1d5587
child 30 a1ecf17c60eb
feature: default function is used as a template
backend.py
heading.en.yhtml2
yml2c
yml2proc
--- a/backend.py	Tue Feb 05 17:45:35 2019 +0100
+++ b/backend.py	Fri Feb 15 10:45:50 2019 +0100
@@ -1,4 +1,4 @@
-# 2.5.8 backend
+# 2.5.10 backend
 
 # written by VB.
 
@@ -6,7 +6,7 @@
 import fileinput
 import sys, traceback, exceptions, os
 from xml.sax.saxutils import escape, quoteattr
-from copy import deepcopy
+from copy import copy, deepcopy
 from glob import glob
 from pyPEG import code, parse, parseLine, u, Symbol
 from yml2 import ymlCStyle, comment, _inner
@@ -495,11 +495,15 @@
 
         try:
             ymlFunc[name]
-        except:
+        except KeyError:
             try:
-                ymlFunc["_"]
-                return codegen(('func', ['_', ('content', [('funclist', [obj])])]))
-            except:
+                if ymlFunc["_"].alias != u"-":
+                    return codegen(('func', ['_', ('content', [('funclist', [obj])])]))
+                else:
+                    ymlFunc[name] = copy(ymlFunc["_"])
+                    ymlFunc[name].alias = name.replace("_", "-")
+                    return codegen(obj)
+            except KeyError:
                 ymlFunc[name] = YF(name)
         
         if ymlFunc[name].alias == "-": avoidTag = True
--- a/heading.en.yhtml2	Tue Feb 05 17:45:35 2019 +0100
+++ b/heading.en.yhtml2	Fri Feb 15 10:45:50 2019 +0100
@@ -13,7 +13,7 @@
 div id=headline {
     p > YML – Why a Markup Language?!
     div class=small {
-        "YML 2.5.9 of Tu 20 Nov 2018  –  Copyleft 2007-2018, "
+        "YML 2.5.10 of Tu 15 Feb 2019  –  Copyleft 2007-2019, "
         a "http://blog.fdik.org", "Volker Birk";
         " – "
         a "http://fdik.org/yml2.tar.bz2", "Download YML 2";
--- a/yml2c	Tue Feb 05 17:45:35 2019 +0100
+++ b/yml2c	Fri Feb 15 10:45:50 2019 +0100
@@ -2,7 +2,7 @@
 # vim: set fileencoding=utf-8 :
 
 """\
-YML 2 compiler version 5.9
+YML 2 compiler version 5.10
 Copyleft (c), 2009-2018, Volker Birk  http://fdik.org/yml/
 
 """
--- a/yml2proc	Tue Feb 05 17:45:35 2019 +0100
+++ b/yml2proc	Fri Feb 15 10:45:50 2019 +0100
@@ -2,7 +2,7 @@
 # vim: set fileencoding=utf-8 :
 
 """\
-YML/YSLT 2 processor version 5.9
+YML/YSLT 2 processor version 5.10
 Copyleft (c), 2009-2018 Volker Birk  http://fdik.org/yml/
 
 """