Changeset 217


Ignore:
Timestamp:
Oct 1, 2006, 9:58:52 AM (13 years ago)
Author:
Peter Johansson
Message:

refs #69 fixed so it works for '#' and '%'

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Parser.cc

    r214 r217  
    3838  {
    3939    std::ifstream is(path.c_str());
    40     if (match_end(path.begin(), path.end(), ".ac") ||
    41         match_end(path.begin(), path.end(), ".am") ||
    42         match_end(path.begin(), path.end(), ".pl") ||
    43         match_end(path.begin(), path.end(), ".pm") ||
    44         match_end(path.begin(), path.end(), ".sh"))
     40    if (match_end(path.rbegin(), path.rend(), ".ac") ||
     41        match_end(path.rbegin(), path.rend(), ".am") ||
     42        match_end(path.rbegin(), path.rend(), ".pl") ||
     43        match_end(path.rbegin(), path.rend(), ".pm") ||
     44        match_end(path.rbegin(), path.rend(), ".sh"))
    4545      line_com_mode(is, "#");
    46     else if (match_end(path.begin(), path.end(), ".tex"))
     46    else if (match_end(path.rbegin(), path.rend(), ".tex"))
    4747      line_com_mode(is, "%");
    4848    else
  • trunk/lib/utility.h

    r214 r217  
    7070  }
    7171
    72   inline bool match_end(std::string::const_iterator first,
    73                         std::string::const_iterator last,
     72  inline bool match_end(std::string::const_reverse_iterator first,
     73                        std::string::const_reverse_iterator last,
    7474                        const std::string& str)
    7575  { return (std::distance(first,last)>=static_cast<int>(str.size()) &&
  • trunk/test/Makefile.am

    r171 r217  
    2222# 02111-1307, USA.
    2323
    24 TESTS = directory file gnuplot_pipe
     24TESTS = directory file gnuplot_pipe parser
    2525
    2626check_PROGRAMS = $(TESTS)
     
    3333file_SOURCES = file.cc
    3434gnuplot_pipe_SOURCES = gnuplot_pipe.cc
     35parser_SOURCES = parser.cc
    3536
    3637clean-local:
    37   rm -rf *.png *~
     38  rm -rf *.png *.tmp *~
Note: See TracChangeset for help on using the changeset viewer.