[latexila] Structure: improve TODO/FIXME regex



commit 4c11312b3e17afcd75e69a7fb2103f2d91b37ccb
Author: SÃbastien Wilmet <swilmet src gnome org>
Date:   Sat Jul 23 18:17:06 2011 +0200

    Structure: improve TODO/FIXME regex

 src/document_structure.vala |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/src/document_structure.vala b/src/document_structure.vala
index 16d7d4a..021cbb8 100644
--- a/src/document_structure.vala
+++ b/src/document_structure.vala
@@ -94,14 +94,15 @@ public class DocumentStructure : GLib.Object
             {
                 _chars_regex = new Regex ("\\\\|%");
 
-                _comment_regex =
-                    new Regex ("^(?P<type>TODO|FIXME)[[:space:]:]*(?P<text>.*)$");
+                _comment_regex = new Regex (
+                    "^(?P<type>TODO|FIXME)[[:space:]]+:?[[:space:]]*(?P<text>.*)$",
+                    RegexCompileFlags.OPTIMIZE);
 
                 // the LaTeX command can contain some optional arguments
                 // TODO a better implementation of this regex would be to parse the line
                 // character by character, so we can verify if some chars are escaped.
-                _command_name_regex =
-                    new Regex ("^(?P<name>[a-z]+\\*?)[[:space:]]*(\\[[^\\]]*\\][[:space:]]*)*{");
+                _command_name_regex = new Regex (
+                    "^(?P<name>[a-z]+\\*?)[[:space:]]*(\\[[^\\]]*\\][[:space:]]*)*{");
             }
             catch (RegexError e)
             {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]