From db7a06aaf2b92f7fb72bd5429aaf3f80dbd77bf0 Mon Sep 17 00:00:00 2001 From: "David A. Mellis" Date: Sat, 15 Mar 2008 17:49:14 +0000 Subject: [PATCH] Changing the regex for stripping multi-line comments because on Windows the old one was overflowing the stack. (Switched from a non-greedy to a greedy regexp.) --- app/preproc/PdePreprocessor.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/preproc/PdePreprocessor.java b/app/preproc/PdePreprocessor.java index 40bd31330..9c44e8963 100755 --- a/app/preproc/PdePreprocessor.java +++ b/app/preproc/PdePreprocessor.java @@ -99,7 +99,7 @@ public class PdePreprocessor { // whitespace "\\s+" + "|" + // multi-line comment - "(/\\*(?:.|\\n)*?\\*/)" + "|" + + "(/\\*[^*]*(?:\\*(?!/)[^*]*)*\\*/)" + "|" + // single-line comment "(//.*?$)" + "|" + // pre-processor directive @@ -134,7 +134,7 @@ public class PdePreprocessor { // double-quoted string "(\"(?:[^\"\\\\]|\\\\.)*\")" + "|" + // multi-line comment - "(/\\*(?:.|\\n)*?\\*/)" + "|" + + "(/\\*[^*]*(?:\\*(?!/)[^*]*)*\\*/)" + "|" + // single-line comment "(//.*?$)" + "|" + // pre-processor directive @@ -183,7 +183,7 @@ public class PdePreprocessor { return buffer.toString(); } - private List prototypes(String in) throws MalformedPatternException { + public List prototypes(String in) throws MalformedPatternException { in = collapseBraces(strip(in)); PatternMatcherInput input = new PatternMatcherInput(in);