Changeset 2735


Ignore:
Timestamp:
02/02/10 16:15:16 (10 years ago)
Author:
epitzer
Message:

fix TypeNameParser: allow underscores in identifiers (#802)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Persistence Test/HeuristicLab.Persistence/3.3/Auxiliary/TypeNameParser.cs

    r1795 r2735  
    3131      Version := '\d+\.\d+\.\d+\.\d+)'
    3232
    33       IDENTIFIER = [a-zA-Z][a-ZA-Z0-9]*
     33      IDENTIFIER = [_a-zA-Z][_a-ZA-Z0-9]*
    3434    */
    3535
     
    3838      private static Dictionary<string, string> tokens =
    3939        new Dictionary<string, string> {
     40          {"-", "DASH"},
    4041          {"&", "AMPERSAND"},
    4142          {".", "DOT"},
    42           {"-", "DASH"},
    4343          {"+", "PLUS"},
    4444          {",", "COMMA"},
     
    5050          {"`", "BACKTICK"} };
    5151      private static Regex NumberRegex = new Regex("^\\d+$");
    52       private static Regex TokenRegex = new Regex("[-&.+,\\[\\]* =`]|\\d+|[a-zA-Z][a-zA-Z0-9]*");
     52      private static Regex TokenRegex = new Regex("[-&.+,\\[\\]* =`]|\\d+|[_a-zA-Z][_a-zA-Z0-9]*");
    5353      public string Name { get; private set; }
    5454      public string Value { get; private set; }
Note: See TracChangeset for help on using the changeset viewer.