[augeas-devel] [PATCH 4 of 6] Add comments for NaturalDocs parsing

Raphael Pinson raphink at gmail.com
Tue Sep 9 09:52:46 UTC 2008


# HG changeset patch
# User Raphael Pinson <raphink at gmail.com>
# Date 1220952869 -7200
# Node ID 9084870d2319af0b2894b918c970fb7b7e5678a7
# Parent  bbf431c214430d63ec2473d48267f43535b79a45
Add comments for NaturalDocs parsing

diff -r bbf431c21443 -r 9084870d2319 lenses/util.aug
--- a/lenses/util.aug	Tue Sep 09 11:32:23 2008 +0200
+++ b/lenses/util.aug	Tue Sep 09 11:34:29 2008 +0200
@@ -1,36 +1,96 @@
-(* Simple utilities used in several places *)
+(*
+Module: Util
+  Generic module providing useful primitives
+
+Author: David Lutterkort
+
+About: License
+  This file is licensed under the GPL.
+*)
+
+
 module Util =
+
+
+(*
+Variable: del_str
+  Delete a string and default to it
+
+  Parameters:
+     s:string - the string to delete and default to
+*)
   let del_str (s:string) = del s s
 
+(*
+Variable: del_ws
+  Delete mandatory whitespace
+*)
   let del_ws = del /[ \t]+/
+
+(*
+Variable: del_ws_spc
+  Delete mandatory whitespace, default to single space
+*)
   let del_ws_spc = del_ws " "
+
+(*
+Variable: del_ws_tab
+  Delete mandatory whitespace, default to single tab
+*)
   let del_ws_tab = del_ws "\t"
 
+
+(*
+Variable: del_opt_ws
+  Delete optional whitespace
+*)
   let del_opt_ws = del /[ \t]*/
 
+
+(*
+Variable: eol
+  Delete end of line, including optional trailing whitespace
+*)
   let eol = del /[ \t]*\n/ "\n"
+
+(*
+Variable: indent
+  Delete indentation, including leading whitespace
+*)
   let indent = del /[ \t]*/ ""
 
-  (* comment and empty
+(* Group: Comment and empty
      This is a general definition of comment and empty.
      It allows indentation for comments, removes the leading and trailing spaces
      of comments and stores them in nodes, except for empty comments which are 
      ignored together with empty lines
-  *)
+
+View: comment
+  Map comments into "#comment" nodes
+*)
   let comment = 
     [ indent . label "#comment" . del /#[ \t]*/ "# " 
         . store /([^ \t\n].*[^ \t\n]|[^ \t\n])/ . eol ]
 
+(*
+View: empty
+  Map empty lines, including empty comments
+*)
   let empty   = [ del /[ \t]*#?[ \t]*\n/ "\n" ]
 
-  (* Split (SEP . ELT)* into an array-like tree where each match for ELT *)
-  (* appears in a separate subtree. The labels for the subtrees are      *)
-  (* consecutive numbers, starting at 0                                  *)
+(* View: Split *)
+(* Split (SEP . ELT)* into an array-like tree where each match for ELT *)
+(* appears in a separate subtree. The labels for the subtrees are      *)
+(* consecutive numbers, starting at 0                                  *)
   let split (elt:lens) (sep:lens) =
     let sym = gensym "split" in
     counter sym . ( [ seq sym . sep . elt ] ) *
 
-  (* Exclusion for files that are commonly not wanted/needed              *)
+(* Group: Exclusions
+
+Variable: stdexcl
+  Exclusion for files that are commonly not wanted/needed
+*)
   let stdexcl = (excl "*~") . (excl "*.rpmnew") . (excl "*.rpmsave")
 
 (* Local Variables: *)




More information about the augeas-devel mailing list