Changeset 524

Dec 25, 2007, 3:53:32 AM (13 years ago)
Peter Johansson

adding text on how to configure parsing codons - fixes ticket:283

2 edited


  • trunk/NEWS

    r519 r524  
    55Version 0.7 (released DATE)
     6  - parsing rules can be set in config file (ticket:283)
    78  A complete list of closed tickets can be found here [[br]]
  • trunk/doc/readme.txt

    r520 r524  
    2727== Different linetypes ==
    29 Svndigest parses each file to detect whether lines are `code`,
    30 `comment`, or `other`. Depending on the file name, different
     29Svndigest parses each file to decide whether a line is ''code'',
     30''comment'', or ''other''. Depending on the file name different
    3131parsing modes are used, which means different sets of rules what is
    32 `code` or `comment` are employed. Common for all modes is that
     32''code'' or ''comment'' are employed. Common for all modes is that
    3333comment blocks are identified by a start code (e.g. '/*' in a C file)
    3434and a stop code (e.g. '*/' in a C file). If a line contains
    3737alphanumeric characters inside a comment block, the line is considered
    3838to be a line of ''comment''. Otherwise the line is considered to be
    39 ''other''. At the time being the following comment identifiers are
    40 used:
    42  * cc-mode
    43    * files: *.c, *.cc, *.cpp, *.cxx, *.h, *.hh, *.hpp, and *.java
    44    * identifier: /* <comment> */
    45    * identifier: // <comment> end-of-line
    46  * m4-mode
    47    * files: *.ac *.am *.m4
    48    * identifier: dnl <comment> end-of-line
    49    * identifier: # <comment> end-of-line
    50  * shell-mode
    51    * files: *.sh *.pl *.pm *config bootstrap Makefile
    52    * identifier: # <comment> end-of-line
    53  * tex-mode
    54    * files: *.tex *.m
    55    * identifier: % <comment> end-of-line
    56  * jsp-mode
    57    * files: *.jsp
    58    * identifier: <!-- <comment> -->
    59    * identifier: <%-- <comment> --%>
    60  * sgml-mode
    61    * files: *.sgml, *.html, *.shtml, *.xml, *.xsl, *.xsd, *.css, and *.rss
    62    * identifier: <!-- <comment> -->
    63  * text-mode
    64    * files: all files not matching any other mode
    65    * identifier: not applicable. All text is considered comments,
    66      i.e., lines are either ''comments'' or ''other''
     41From svndigest 0.7 which rules to be used for different files can be
     42set in the configuration file. For more on configuration file see
     43below. If no configuration file is given or no rules are given, a set
     44of default rules are used. For files named `*.h`, for example, use
     45rules allowing to detect comments as either `// ... \n` or `/*
     46... */`. This rule can be set in the configuration file using a
     47one-liner like:
    68 There is one exception to these rules. If the files name ends with
    69 `.in`, the trailing `.in` is ignored and the file name rules above are
    70 applied on the remaining part of the file name. An example is
    71 `test/` that is parsed using the shell-mode rules.
     49`*.h = "//":"\n"  ;  "/*":"*/"`
     51The first string (`*h`) is a file-name-pattern describing which files
     52this rule will be used on. The second block, `"//":"\n"`, is the first
     53rule saying one way to mark comments is to start with a ''start
     54code'', `//`, and end with an ''end code'', `\n`. The start and end
     55codes are surrounded by `""` and separated by `:`. Similarily, the
     56second block describes comments also could come as `/* ... */`.
    7358== Different file types ==
Note: See TracChangeset for help on using the changeset viewer.