Changeset 521


Ignore:
Timestamp:
Dec 24, 2007, 11:34:54 PM (14 years ago)
Author:
Peter Johansson
Message:

changing format of parsing codons in config file

Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/.svndigest/config

    r519 r521  
    3131### Section for setting parsing modes
    3232### The format of the entries is:
    33 ###   file-name-pattern = start-code : end-code
     33###   file-name-pattern = "start-code" : "end-code"
    3434### The file-name-pattern may contain wildcards (such as '*' and '?').
    35 ### String "<NEWLINE>" can be used for codons containing newline
    36 ### character: '\n'
     35### String "\n" can be used for codons containing newline
     36### character.
    3737[parsing-codons]
    38 *.ac = # : <NEWLINE>  ;  dnl : <NEWLINE>
    39 *.am = # : <NEWLINE>  ;  dnl : <NEWLINE>
    40 *.m4 = # : <NEWLINE>  ;  dnl : <NEWLINE>
    41 *.c = // : <NEWLINE>  ;  /* : */
    42 *.cc = // : <NEWLINE>  ;  /* : */
    43 *.cpp = // : <NEWLINE>  ;  /* : */
    44 *.cxx = // : <NEWLINE>  ;  /* : */
    45 *.h = // : <NEWLINE>  ;  /* : */
    46 *.hh = // : <NEWLINE>  ;  /* : */
    47 *.hpp = // : <NEWLINE>  ;  /* : */
    48 *.java = // : <NEWLINE>  ;  /* : */
    49 *.pl = # : <NEWLINE>
    50 *.pm = # : <NEWLINE>
    51 *.sh = # : <NEWLINE>
    52 *config = # : <NEWLINE>
    53 bootstrap = # : <NEWLINE>
    54 Makefile = # : <NEWLINE>
    55 *.tex = % : <NEWLINE>
    56 *.m = % : <NEWLINE>
    57 *.jsp = <!-- : -->
    58 *.html = <%-- : --%>
    59 *.xml = <!-- : -->  ;  <!-- : -->
    60 *.xsl = <!-- : -->
    61 *.xsd = <!-- : -->
    62 *.xhtml = <!-- : -->
    63 *.shtml = <!-- : -->
    64 *.css = <!-- : -->
    65 *.rss = <!-- : -->
    66 *.sgml = <!-- : -->
    67 *.bat = <NEWLINE>REM : <NEWLINE>  ;  <NEWLINE>rem : <NEWLINE>
     38*.ac = "#":"\n"  ;  "dnl":"\n"
     39*.am = "#":"\n"  ;  "dnl":"\n"
     40*.m4 = "#":"\n"  ;  "dnl":"\n"
     41*.c = "//":"\n"  ;  "/*":"*/"
     42*.cc = "//":"\n"  ;  "/*":"*/"
     43*.cpp = "//":"\n"  ;  "/*":"*/"
     44*.cxx = "//":"\n"  ;  "/*":"*/"
     45*.h = "//":"\n"  ;  "/*":"*/"
     46*.hh = "//":"\n"  ;  "/*":"*/"
     47*.hpp = "//":"\n"  ;  "/*":"*/"
     48*.java = "//":"\n"  ;  "/*":"*/"
     49*.pl = "#":"\n"
     50*.pm = "#":"\n"
     51*.sh = "#":"\n"
     52*config = "#":"\n"
     53bootstrap = "#":"\n"
     54Makefile = "#":"\n"
     55*.tex = "%":"\n"
     56*.m = "%":"\n"
     57*.jsp = "<!--":"-->"
     58*.html = "<%--":"--%>"
     59*.xml = "<!--":"-->"  ;  "<!--":"-->"
     60*.xsl = "<!--":"-->"
     61*.xsd = "<!--":"-->"
     62*.xhtml = "<!--":"-->"
     63*.shtml = "<!--":"-->"
     64*.css = "<!--":"-->"
     65*.rss = "<!--":"-->"
     66*.sgml = "<!--":"-->"
     67*.bat = "\nREM":"\n"  ;  "\nrem":"\n"
  • trunk/lib/Configuration.cc

    r519 r521  
    221221        while (getline(ss, start, ':')) {
    222222          start = trim(start);
     223          start = start.substr(1, start.size()-2);
    223224          std::string end;
    224225          getline(ss, end, ';');
    225226          end = trim(end);
     227          end = end.substr(1, end.size()-2);
    226228          if (!start.empty() && !end.empty()) {
    227             replace(start, "<NEWLINE>", "\n");
    228             replace(end, "<NEWLINE>", "\n");
     229            replace(start, "\\n", "\n");
     230            replace(end, "\\n", "\n");
    229231            add_codon(lhs, start, end);
    230232          }
    231233          else if (!start.empty() || !end.empty()) {
     234            std::cout << start << "\n" << end << std::endl;
    232235            std::stringstream mess;
    233236            mess << "svndigest: invalid config file\n"
     
    324327  {
    325328    if (str.size()>0 && str[str.size()-1]=='\n')
    326       return str.substr(0, str.size()-1) + std::string("<NEWLINE>");
     329      return str.substr(0, str.size()-1) + std::string("\\n");
    327330    return str;
    328331  }
     
    332335  {
    333336    if (str.size()>0 && str[0]=='\n')
    334       return std::string("<NEWLINE>") + str.substr(1);
     337      return std::string("\\n") + str.substr(1);
    335338    return str;
    336339  }
     
    464467         << "### Section for setting parsing modes\n"
    465468         << "### The format of the entries is:\n"
    466          << "###   file-name-pattern = start-code : end-code\n"
     469         << "###   file-name-pattern = \"start-code\" : \"end-code\"\n"
    467470         << "### The file-name-pattern may contain wildcards (such as '*' "
    468471         << "and '?').\n"
    469          << "### String \"<NEWLINE>\" can be used for codons containing newline"
    470          << "\n### character: '\\n'\n"
     472         << "### String \"\\n\" can be used for codons containing newline"
     473         << "\n### character.\n"
    471474         << "[parsing-codons]\n";
    472475      for (size_t i=0; i<conf.string2codons_.size(); ++i) {
     
    475478          if (j)
    476479            os << "  ;  ";
    477           os << trans_beg_code(conf.string2codons_[i].second[j].first)
    478              << " : "
    479              << trans_end_code(conf.string2codons_[i].second[j].second);
     480          os << "\"" << trans_beg_code(conf.string2codons_[i].second[j].first)
     481             << "\":\""
     482             << trans_end_code(conf.string2codons_[i].second[j].second)
     483             << "\"";
    480484        }
    481485        os << "\n";
  • trunk/test/repo/db/current

    r516 r521  
    1 56 1l 1
     157 1l 1
Note: See TracChangeset for help on using the changeset viewer.