diff options
author | rillig <rillig> | 2006-06-29 17:02:32 +0000 |
---|---|---|
committer | rillig <rillig> | 2006-06-29 17:02:32 +0000 |
commit | 38f1b8dcc8d20c80977f382a135c3951c53f5000 (patch) | |
tree | 4c80830e60bc2366d4719f0e3d11e9c8c29aec12 /pkgtools/pkglint | |
parent | 05af56c2e64783212c3eb6b2f62681b80db350fe (diff) | |
download | pkgsrc-38f1b8dcc8d20c80977f382a135c3951c53f5000.tar.gz |
Added examples for the (future) parser in pkglint.
Diffstat (limited to 'pkgtools/pkglint')
-rw-r--r-- | pkgtools/pkglint/files/doc/chap.future.xml | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/pkgtools/pkglint/files/doc/chap.future.xml b/pkgtools/pkglint/files/doc/chap.future.xml index f085aed6e49..284f8468f90 100644 --- a/pkgtools/pkglint/files/doc/chap.future.xml +++ b/pkgtools/pkglint/files/doc/chap.future.xml @@ -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> |