]> git.lyx.org Git - features.git/commitdiff
Move generally useful parser routines to parser_tools.
authorRichard Heck <rgheck@comcast.net>
Thu, 4 Nov 2010 15:44:32 +0000 (15:44 +0000)
committerRichard Heck <rgheck@comcast.net>
Thu, 4 Nov 2010 15:44:32 +0000 (15:44 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36065 a592a061-630c-0410-9148-cb99ea01b6c8

lib/lyx2lyx/lyx_2_0.py
lib/lyx2lyx/parser_tools.py

index 92e9cb767557d61b17e996b55c0d126ec56a75de..4241531484558c640d4bfdf3b6aae1ffbf3fe521 100644 (file)
@@ -23,7 +23,8 @@ import re, string
 import unicodedata
 import sys, os
 
-from parser_tools import find_token, find_end_of, find_tokens, get_value, get_value_string
+from parser_tools import find_token, find_end_of, find_tokens, \
+  find_end_of_inset, find_end_of_layout, get_value, get_value_string
 
 ####################################################################
 # Private helper functions
@@ -38,16 +39,6 @@ def remove_option(document, m, option):
     return True
 
 
-def find_end_of_inset(lines, i):
-    " Find end of inset, where lines[i] is included."
-    return find_end_of(lines, i, "\\begin_inset", "\\end_inset")
-
-
-def find_end_of_layout(lines, i):
-    " Find end of layout, where lines[i] is included."
-    return find_end_of(lines, i, "\\begin_layout", "\\end_layout")
-
-
 # Note that text can be either a list of lines or a single line.
 def add_to_preamble(document, text):
     """ Add text to the preamble if it is not already there.
index 9b63e00fd1f30b1424edee359e61e4fa87563bd9..0299ed7c4a4ffd0f7e063762367faf221ff99905 100644 (file)
@@ -231,3 +231,13 @@ def find_nonempty_line(lines, start, end = 0):
         if is_nonempty_line(lines[i]):
             return i
     return -1
+
+
+def find_end_of_inset(lines, i):
+    " Find end of inset, where lines[i] is included."
+    return find_end_of(lines, i, "\\begin_inset", "\\end_inset")
+
+
+def find_end_of_layout(lines, i):
+    " Find end of layout, where lines[i] is included."
+    return find_end_of(lines, i, "\\begin_layout", "\\end_layout")