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 The "future directions" cha...
details: https://anonhg.NetBSD.org/pkgsrc/rev/6f4be8860635
branches: trunk
changeset: 513257:6f4be8860635
user: rillig <rillig%pkgsrc.org@localhost>
date: Tue May 23 08:10:37 2006 +0000
description:
The "future directions" chapter gives a vision of what pkglint may do if
I find too much time.
diffstat:
pkgtools/pkglint/files/doc/Makefile | 3 +-
pkgtools/pkglint/files/doc/chap.future.xml | 48 ++++++++++++++++++++++++++++++
pkgtools/pkglint/files/doc/pkglint.xml | 4 +-
3 files changed, 53 insertions(+), 2 deletions(-)
diffs (91 lines):
diff -r 6eb0a608a3d1 -r 6f4be8860635 pkgtools/pkglint/files/doc/Makefile
--- a/pkgtools/pkglint/files/doc/Makefile Tue May 23 07:41:07 2006 +0000
+++ b/pkgtools/pkglint/files/doc/Makefile Tue May 23 08:10:37 2006 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2006/02/27 02:01:04 rillig Exp $
+# $NetBSD: Makefile,v 1.3 2006/05/23 08:10:37 rillig Exp $
#
XMLDOCS+= pkglint.xml
@@ -7,6 +7,7 @@
XMLDOCS+= chap.types.xml
XMLDOCS+= chap.code.xml
XMLDOCS+= chap.statemachines.xml
+XMLDOCS+= chap.future.xml
IMAGES+= statemachine.patch.png
IMAGES+= statemachine.shellcmd.png
diff -r 6eb0a608a3d1 -r 6f4be8860635 pkgtools/pkglint/files/doc/chap.future.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/pkgtools/pkglint/files/doc/chap.future.xml Tue May 23 08:10:37 2006 +0000
@@ -0,0 +1,48 @@
+<!-- $NetBSD: chap.future.xml,v 1.1 2006/05/23 08:10:37 rillig Exp $ -->
+
+<chapter id="future">
+<title>Future directions</title>
+
+<sect1 id="future.tokenize">
+<title>Tokenizing the input</title>
+
+ <para>For providing more exact diagnostics, it would be nice if
+ &pkglint; could point the user to the exact character position
+ of the smallest problematic text in a file. To do this, the
+ file's contents has to be splitted into tokens.</para>
+
+ <para>Doing this is nontrivial, since the tokenizing scheme
+ depends on the context in which the tokens are used. For
+ example, the <varname>COMMENT</varname> variable may contain
+ arbitrary characters (including <literal>'</literal> and
+ <literal>"</literal>), whereas in many other contexts these are
+ parts of quoted shell words.</para>
+
+</sect1>
+<sect1 id="future.ast">
+<title>Working on abstract syntax trees (AST)</title>
+
+ <para>When the tokenizing above is done, the tokens could be
+ parsed by a grammar to form abstract syntax trees. These would
+ consist mainly of function application so that pkglint can infer
+ types and valid values over these trees. The following functions
+ are likely to appear.</para>
+
+ <table id="future.ast.func">
+ <title>Functions in the abstract syntax trees</title>
+ <tgroup cols="2">
+ <thead><row><entry>Function</entry><entry>Purpose</entry></row></thead>
+ <tbody>
+ <row><entry><function>quote</function>(Val)</entry><entry>The <literal>:Q</literal> modifier</entry></row>
+ <row><entry><function>append</function>(Val, Val)</entry><entry>The <literal>+=</literal> operator</entry></row>
+ <row><entry><function>concat</function>(Val, Val)</entry><entry>The direct concatenation of two values</entry></row>
+ <row><entry><function>subst</function>(Val, Subst)</entry><entry>The <literal>:S</literal> and <literal>:C</literal> modifiers</entry></row>
+ <row><entry><function>shell</function>(Val)</entry><entry>The <literal>!=</literal> operator and the <literal>:sh</literal> modifier</entry></row>
+ <row><entry><function>literal</function>(Val)</entry><entry>Introduces literal values</entry></row>
+ </tbody>
+ </tgroup>
+ </table>
+
+</sect1>
+
+</chapter>
diff -r 6eb0a608a3d1 -r 6f4be8860635 pkgtools/pkglint/files/doc/pkglint.xml
--- a/pkgtools/pkglint/files/doc/pkglint.xml Tue May 23 07:41:07 2006 +0000
+++ b/pkgtools/pkglint/files/doc/pkglint.xml Tue May 23 08:10:37 2006 +0000
@@ -11,9 +11,10 @@
<!ENTITY chap.types SYSTEM "chap.types.xml">
<!ENTITY chap.code SYSTEM "chap.code.xml">
<!ENTITY chap.statemachines SYSTEM "chap.statemachines.xml">
+ <!ENTITY chap.future SYSTEM "chap.future.xml">
]>
-<!-- $NetBSD: pkglint.xml,v 1.2 2006/02/28 11:40:15 rillig Exp $ -->
+<!-- $NetBSD: pkglint.xml,v 1.3 2006/05/23 08:10:37 rillig Exp $ -->
<book>
<title>Design and implementation of &pkglint;</title>
@@ -32,5 +33,6 @@
&chap.types;
&chap.code;
&chap.statemachines;
+&chap.future;
</book>
Home |
Main Index |
Thread Index |
Old Index