ClassBrowsers: added code to treat source texts like Python (universal newline).

Tue, 25 Aug 2020 14:53:43 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 25 Aug 2020 14:53:43 +0200
changeset 7676
0f67b4562d98
parent 7675
7d23e502fe85
child 7677
d4d33990b355

ClassBrowsers: added code to treat source texts like Python (universal newline).

eric6/Utilities/ClassBrowsers/idlclbr.py file | annotate | diff | comparison | revisions
eric6/Utilities/ClassBrowsers/jsclbr.py file | annotate | diff | comparison | revisions
eric6/Utilities/ClassBrowsers/protoclbr.py file | annotate | diff | comparison | revisions
eric6/Utilities/ClassBrowsers/pyclbr.py file | annotate | diff | comparison | revisions
eric6/Utilities/ClassBrowsers/rbclbr.py file | annotate | diff | comparison | revisions
eric6/Utilities/ModuleParser.py file | annotate | diff | comparison | revisions
--- a/eric6/Utilities/ClassBrowsers/idlclbr.py	Mon Aug 24 18:12:22 2020 +0200
+++ b/eric6/Utilities/ClassBrowsers/idlclbr.py	Tue Aug 25 14:53:43 2020 +0200
@@ -240,6 +240,8 @@
         # can't do anything with this module
         _modules[module] = dictionary
         return dictionary
+    # convert eol markers the Python style
+    src = src.replace("\r\n", "\n").replace("\r", "\n")
 
     lineno, last_lineno_pos = 1, 0
     lastGlobalEntry = None
--- a/eric6/Utilities/ClassBrowsers/jsclbr.py	Mon Aug 24 18:12:22 2020 +0200
+++ b/eric6/Utilities/ClassBrowsers/jsclbr.py	Tue Aug 25 14:53:43 2020 +0200
@@ -313,6 +313,8 @@
         # can't do anything with this module
         _modules[module] = dictionary
         return dictionary
+    # convert eol markers the Python style
+    src = src.replace("\r\n", "\n").replace("\r", "\n")
     
     visitor = Visitor(src, module, file)
     dictionary = visitor.parse()
--- a/eric6/Utilities/ClassBrowsers/protoclbr.py	Mon Aug 24 18:12:22 2020 +0200
+++ b/eric6/Utilities/ClassBrowsers/protoclbr.py	Tue Aug 25 14:53:43 2020 +0200
@@ -230,6 +230,8 @@
         # can't do anything with this module
         _modules[module] = dictionary
         return dictionary
+    # convert eol markers the Python style
+    src = src.replace("\r\n", "\n").replace("\r", "\n")
 
     lineno, last_lineno_pos = 1, 0
     lastGlobalEntry = None
--- a/eric6/Utilities/ClassBrowsers/pyclbr.py	Mon Aug 24 18:12:22 2020 +0200
+++ b/eric6/Utilities/ClassBrowsers/pyclbr.py	Tue Aug 25 14:53:43 2020 +0200
@@ -386,6 +386,8 @@
         # can't do anything with this module
         _modules[module] = dictionary
         return dictionary
+    # convert eol markers the Python style
+    src = src.replace("\r\n", "\n").replace("\r", "\n")
 
     lineno, last_lineno_pos = 1, 0
     lastGlobalEntry = None
--- a/eric6/Utilities/ClassBrowsers/rbclbr.py	Mon Aug 24 18:12:22 2020 +0200
+++ b/eric6/Utilities/ClassBrowsers/rbclbr.py	Tue Aug 25 14:53:43 2020 +0200
@@ -288,6 +288,8 @@
         # can't do anything with this module
         _modules[module] = dictionary
         return dictionary
+    # convert eol markers the Python style
+    src = src.replace("\r\n", "\n").replace("\r", "\n")
 
     lineno, last_lineno_pos = 1, 0
     cur_obj = None
--- a/eric6/Utilities/ModuleParser.py	Mon Aug 24 18:12:22 2020 +0200
+++ b/eric6/Utilities/ModuleParser.py	Tue Aug 25 14:53:43 2020 +0200
@@ -497,6 +497,8 @@
         
         @param src the source text to be scanned (string)
         """
+        # convert eol markers the Python style
+        src = src.replace("\r\n", "\n").replace("\r", "\n")
         if self.type in [PY_SOURCE, PTL_SOURCE]:
             self.__py_scan(src)
         elif self.type == RB_SOURCE:

eric ide

mercurial