pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint/files/doc Added examples for the (fut...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/61b7ffa8b959
branches:  trunk
changeset: 515250:61b7ffa8b959
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Thu Jun 29 17:02:32 2006 +0000

description:
Added examples for the (future) parser in pkglint.

diffstat:

 pkgtools/pkglint/files/doc/chap.future.xml |  22 +++++++++++++++++++++-
 1 files changed, 21 insertions(+), 1 deletions(-)

diffs (36 lines):

diff -r 6e317fccdf4c -r 61b7ffa8b959 pkgtools/pkglint/files/doc/chap.future.xml
--- a/pkgtools/pkglint/files/doc/chap.future.xml        Thu Jun 29 16:40:53 2006 +0000
+++ b/pkgtools/pkglint/files/doc/chap.future.xml        Thu Jun 29 17:02:32 2006 +0000
@@ -1,4 +1,4 @@
-<!-- $NetBSD: chap.future.xml,v 1.2 2006/06/29 16:40:53 rillig Exp $ -->
+<!-- $NetBSD: chap.future.xml,v 1.3 2006/06/29 17:02:32 rillig Exp $ -->
 
 <chapter id="future">
 <title>Future directions</title>
@@ -43,6 +43,26 @@
        </tgroup>
        </table>
 
+       <para>Examples:</para>
+
+<programlisting>
+    WRKSRC=                 ${WRKDIR}
+    SUBST_SED.pkglint+=     -e s\|@DATADIR@\|${PREFIX:Q}/share/pkglint\|g
+</programlisting>
+
+       <para>The first line would be parsed as
+       <literal>assign(var("WRKSRC"), varuse("WRKDIR"))</literal>. The
+       second line would be parsed as
+       <literal>assign(var("SUBST_SED.pkglint"),
+       append(varuse("SUBST_SED.pkglint"), concat(concat(str("-e
+       s\\|@DATADIR@\\|"), quote(varuse("PREFIX"))),
+       str("/share/pkglint\\|g"))))</literal>.</para>
+
+       <para>At this point, unification together with a pattern matcher
+       on tree structures would come in handy, to allow the parser for
+       the shell commands to still operate on this parse tree. This
+       might eventually enable cross-language type inference.</para>
+
 </sect1>
 <sect1 id="future.vars">
 <title>Even more restricted variables</title>



Home | Main Index | Thread Index | Old Index