Jean-Marc Lasgouttes wrote: > The following patch (against 1.3.5cvs, but 1.4.0cvs should be > similar enough) fixes LaTeX::deplog in the following ways: > > - when a file is found on a line, the rest of the line is parsed > nevertheless: useful for a line like > (file1.tex (file2.tex) > > - when checking whether a file exists do not strip its path (why has > this ever been done?). This was breaking having files in different > directories > > I am willing to commit that to 1.3 eventually, but of course I'd > rather have people comment on it. I will adapt it to HEAD.
I'm not saying that the regexes are wrong, but I'm not so sure that they say what you say they say or that they do the job very well. Below are some statements saying in words what the regexes actually do say. + // "(foo " or "(foo)" + regex reg1("\\)* *\\(([^ )]+)(.*)"); * zero or more closing parenthesis, ')'/ * zero or more spaces * an opening parenthesis, '(' * a group consisting of * one or more characters that aren't ' ' or ')'. * a group consisting of * zero or more instances of any character. Presumably, the first two patterns of the regex clean up any crud left over from last time? Why is the last grouping a grouping and, if you're interested in matching '[ )]*', why not match that instead of '.*', all of which, except ' )' is caught by the previous pattern? Continuing: + // "File: foo." + regex reg2("File: ([^ ]+)(.*)"); * "File: " * a grouping consisting of * one or more non-space characters. * a grouping consisting of * zero or more instances of any character. Once again, I don't think that the comment matches the regex. Which one is meant to be correct. + // "No file foo." + regex reg3("No file ([^ ]+)\\.(.*)"); * "No file " * a grouping consisting of * one or more non-space characters. * a literal '.'. * a grouping consisting of * zero or more instances of any character. + // "openout0=`foo'." + regex reg4("\\\\openout[0-9]+.*=.*`([^ ]+)'\\.(.*)"); * '\openout' * one or more digits. * zero or more instances of any character. * "=". * zero or more instances of any character. * "`" * a grouping consisting of * one or more non-space characters. * "'.". * a grouping consisting of * zero or more instances of any character. + // "Writing index file foo" (for MikTeX) + regex reg5("Writing index file ([^ ]+)(.*)"); * "Writing index file " * a grouping consisting of * one or more non-space characters. * a grouping consisting of * zero or more instances of any character. -- Angus