OSDN Git Service

FolderCompare: Display folder size
authorTakashi Sawanaka <sdottaka@users.sourceforge.net>
Sun, 17 Mar 2019 03:32:59 +0000 (12:32 +0900)
committerTakashi Sawanaka <sdottaka@users.sourceforge.net>
Sun, 17 Mar 2019 03:32:59 +0000 (12:32 +0900)
* * *
editlib: Remove CCrystalTextView dependency from line parsers
* * *
editlib: Remove CCrystalTextView dependency from line parsers (2)

60 files changed:
Externals/crystaledit/Sample/SampleStatic.vs2015.vcxproj
Externals/crystaledit/Sample/SampleStatic.vs2015.vcxproj.filters
Externals/crystaledit/Sample/SampleStatic.vs2017.vcxproj
Externals/crystaledit/Sample/SampleStatic.vs2017.vcxproj.filters
Externals/crystaledit/Sample/SampleStatic.vs2019.vcxproj
Externals/crystaledit/Sample/SampleStatic.vs2019.vcxproj.filters
Externals/crystaledit/editlib/asp.cpp
Externals/crystaledit/editlib/basic.cpp
Externals/crystaledit/editlib/batch.cpp
Externals/crystaledit/editlib/ccrystaltextview.cpp
Externals/crystaledit/editlib/ccrystaltextview.h
Externals/crystaledit/editlib/cplusplus.cpp
Externals/crystaledit/editlib/crystaleditviewex.cpp
Externals/crystaledit/editlib/crystaleditviewex.h
Externals/crystaledit/editlib/crystallineparser.h [new file with mode: 0644]
Externals/crystaledit/editlib/crystaltextblock.cpp
Externals/crystaledit/editlib/crystaltextblock.h
Externals/crystaledit/editlib/csharp.cpp
Externals/crystaledit/editlib/css.cpp
Externals/crystaledit/editlib/dcl.cpp
Externals/crystaledit/editlib/fortran.cpp
Externals/crystaledit/editlib/go.cpp
Externals/crystaledit/editlib/html.cpp
Externals/crystaledit/editlib/ini.cpp
Externals/crystaledit/editlib/innosetup.cpp
Externals/crystaledit/editlib/is.cpp
Externals/crystaledit/editlib/java.cpp
Externals/crystaledit/editlib/lisp.cpp
Externals/crystaledit/editlib/nsis.cpp
Externals/crystaledit/editlib/pascal.cpp
Externals/crystaledit/editlib/perl.cpp
Externals/crystaledit/editlib/php.cpp
Externals/crystaledit/editlib/plain.cpp [new file with mode: 0644]
Externals/crystaledit/editlib/po.cpp
Externals/crystaledit/editlib/powershell.cpp
Externals/crystaledit/editlib/python.cpp
Externals/crystaledit/editlib/rexx.cpp
Externals/crystaledit/editlib/rsrc.cpp
Externals/crystaledit/editlib/ruby.cpp
Externals/crystaledit/editlib/rust.cpp
Externals/crystaledit/editlib/sgml.cpp
Externals/crystaledit/editlib/sh.cpp
Externals/crystaledit/editlib/siod.cpp
Externals/crystaledit/editlib/sql.cpp
Externals/crystaledit/editlib/string_util.cpp
Externals/crystaledit/editlib/string_util.h
Externals/crystaledit/editlib/tcl.cpp
Externals/crystaledit/editlib/tex.cpp
Externals/crystaledit/editlib/verilog.cpp
Externals/crystaledit/editlib/vhdl.cpp
Externals/crystaledit/editlib/xml.cpp
Src/DirScan.cpp
Src/Merge.vs2015.vcxproj
Src/Merge.vs2015.vcxproj.filters
Src/Merge.vs2017.vcxproj
Src/Merge.vs2017.vcxproj.filters
Src/Merge.vs2019.vcxproj
Src/Merge.vs2019.vcxproj.filters
Src/MergeEditView.cpp
Src/MergeEditView.h

index b79569c..8b290d2 100644 (file)
     <ClCompile Include="..\editlib\pascal.cpp" />\r
     <ClCompile Include="..\editlib\perl.cpp" />\r
     <ClCompile Include="..\editlib\php.cpp" />\r
+    <ClCompile Include="..\editlib\plain.cpp" />\r
     <ClCompile Include="..\editlib\po.cpp" />\r
     <ClCompile Include="..\editlib\powershell.cpp" />\r
     <ClCompile Include="..\editlib\python.cpp" />\r
     <ClInclude Include="..\editlib\fpattern.h" />\r
     <ClInclude Include="..\editlib\gotodlg.h" />\r
     <ClInclude Include="..\editlib\LineInfo.h" />\r
+    <ClInclude Include="..\editlib\crystallineparser.h" />\r
     <ClInclude Include="..\editlib\memcombo.h" />\r
     <ClInclude Include="..\editlib\registry.h" />\r
     <ClInclude Include="..\editlib\splash.h" />\r
index eab9d16..830bf40 100644 (file)
     <ClCompile Include="..\editlib\wcwidth.cpp">\r
       <Filter>editlib</Filter>\r
     </ClCompile>\r
+    <ClCompile Include="..\editlib\plain.cpp">\r
+      <Filter>editlib\parsers</Filter>\r
+    </ClCompile>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <ResourceCompile Include="Sample.rc">\r
     <ClInclude Include="..\editlib\wcwidth.h">\r
       <Filter>editlib</Filter>\r
     </ClInclude>\r
+    <ClInclude Include="..\editlib\crystallineparser.h">\r
+      <Filter>editlib\parsers</Filter>\r
+    </ClInclude>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <Image Include="res\mg_icons.bmp">\r
index f2043cd..1da5677 100644 (file)
     <ClCompile Include="..\editlib\pascal.cpp" />\r
     <ClCompile Include="..\editlib\perl.cpp" />\r
     <ClCompile Include="..\editlib\php.cpp" />\r
+    <ClCompile Include="..\editlib\plain.cpp" />\r
     <ClCompile Include="..\editlib\po.cpp" />\r
     <ClCompile Include="..\editlib\powershell.cpp" />\r
     <ClCompile Include="..\editlib\python.cpp" />\r
     <ClInclude Include="..\editlib\fpattern.h" />\r
     <ClInclude Include="..\editlib\gotodlg.h" />\r
     <ClInclude Include="..\editlib\LineInfo.h" />\r
+    <ClInclude Include="..\editlib\crystallineparser.h" />\r
     <ClInclude Include="..\editlib\memcombo.h" />\r
     <ClInclude Include="..\editlib\registry.h" />\r
     <ClInclude Include="..\editlib\splash.h" />\r
index eab9d16..830bf40 100644 (file)
     <ClCompile Include="..\editlib\wcwidth.cpp">\r
       <Filter>editlib</Filter>\r
     </ClCompile>\r
+    <ClCompile Include="..\editlib\plain.cpp">\r
+      <Filter>editlib\parsers</Filter>\r
+    </ClCompile>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <ResourceCompile Include="Sample.rc">\r
     <ClInclude Include="..\editlib\wcwidth.h">\r
       <Filter>editlib</Filter>\r
     </ClInclude>\r
+    <ClInclude Include="..\editlib\crystallineparser.h">\r
+      <Filter>editlib\parsers</Filter>\r
+    </ClInclude>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <Image Include="res\mg_icons.bmp">\r
index 43348b8..86e02da 100644 (file)
     <ClCompile Include="..\editlib\pascal.cpp" />
     <ClCompile Include="..\editlib\perl.cpp" />
     <ClCompile Include="..\editlib\php.cpp" />
+    <ClCompile Include="..\editlib\plain.cpp" />
     <ClCompile Include="..\editlib\po.cpp" />
     <ClCompile Include="..\editlib\powershell.cpp" />
     <ClCompile Include="..\editlib\python.cpp" />
     <ClInclude Include="..\editlib\fpattern.h" />
     <ClInclude Include="..\editlib\gotodlg.h" />
     <ClInclude Include="..\editlib\LineInfo.h" />
+    <ClInclude Include="..\editlib\crystallineparser.h" />
     <ClInclude Include="..\editlib\memcombo.h" />
     <ClInclude Include="..\editlib\registry.h" />
     <ClInclude Include="..\editlib\splash.h" />
index 86c587e..259d561 100644 (file)
     <ClCompile Include="..\editlib\ctextmarkerdlg.cpp">
       <Filter>editlib</Filter>
     </ClCompile>
-    <ClCompile Include="..\editlib\wcwidth.cpp">\r
-      <Filter>editlib</Filter>\r
-    </ClCompile>\r
+    <ClCompile Include="..\editlib\wcwidth.cpp">
+      <Filter>editlib</Filter>
+    </ClCompile>
+    <ClCompile Include="..\editlib\plain.cpp">
+      <Filter>editlib\parsers</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ResourceCompile Include="Sample.rc">
     <ClInclude Include="..\editlib\ctextmarkerdlg.h">
       <Filter>editlib</Filter>
     </ClInclude>
-    <ClInclude Include="..\editlib\wcwidth.h">\r
-      <Filter>editlib</Filter>\r
-    </ClInclude>\r
+    <ClInclude Include="..\editlib\wcwidth.h">
+      <Filter>editlib</Filter>
+    </ClInclude>
+    <ClInclude Include="..\editlib\crystallineparser.h">
+      <Filter>editlib\parsers</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <Image Include="res\mg_icons.bmp">
index 45d7ca9..df61d0e 100644 (file)
@@ -15,7 +15,7 @@
 ////////////////////////////////////////////////////////////////////////////
 
 #include "StdAfx.h"
-#include "ccrystaltextview.h"
+#include "crystallineparser.h"
 #include "SyntaxColors.h"
 #include "string_util.h"
 
@@ -564,34 +564,12 @@ IsAspNumber (LPCTSTR pszChars, int nLength)
   return true;
 }
 
-#define DEFINE_BLOCK(pos, colorindex)   \
-ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != nullptr)\
-  {\
-    if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
-        if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
-        pBuf[nActualItems].m_nCharPos = (pos);\
-        pBuf[nActualItems].m_nColorIndex = (colorindex);\
-        pBuf[nActualItems].m_nBgColorIndex = COLORINDEX_BKGND;\
-        nActualItems ++;}\
-  }
-
-#define COOKIE_COMMENT          0x0001
-#define COOKIE_PREPROCESSOR     0x0002
-#define COOKIE_EXT_COMMENT      0x0004
-#define COOKIE_STRING           0x0008
-#define COOKIE_CHAR             0x0010
-#define COOKIE_USER1            0x0020
-#define COOKIE_EXT_USER1        0x0040
-
-DWORD CCrystalTextView::
-ParseLineAsp (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems)
+DWORD
+CrystalLineParser::ParseLineAsp (DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems)
 {
-  int nLength = GetLineLength (nLineIndex);
   if (nLength == 0)
     return dwCookie & (COOKIE_EXT_COMMENT|COOKIE_EXT_USER1);
 
-  LPCTSTR pszChars = GetLineChars (nLineIndex);
   bool bFirstChar = (dwCookie & ~(COOKIE_EXT_COMMENT|COOKIE_EXT_USER1)) == 0;
   bool bRedefineBlock = true;
   bool bDecIndex = false;
index 59ff7f3..357802e 100644 (file)
@@ -15,7 +15,7 @@
 ////////////////////////////////////////////////////////////////////////////
 
 #include "StdAfx.h"
-#include "ccrystaltextview.h"
+#include "crystallineparser.h"
 #include "SyntaxColors.h"
 #include "string_util.h"
 
@@ -339,32 +339,12 @@ IsBasicNumber (LPCTSTR pszChars, int nLength)
   return true;
 }
 
-#define DEFINE_BLOCK(pos, colorindex)   \
-ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != nullptr)\
-  {\
-    if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
-        if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
-        pBuf[nActualItems].m_nCharPos = (pos);\
-        pBuf[nActualItems].m_nColorIndex = (colorindex);\
-        pBuf[nActualItems].m_nBgColorIndex = COLORINDEX_BKGND;\
-        nActualItems ++;}\
-  }
-
-#define COOKIE_COMMENT          0x0001
-#define COOKIE_PREPROCESSOR     0x0002
-#define COOKIE_EXT_COMMENT      0x0004
-#define COOKIE_STRING           0x0008
-#define COOKIE_CHAR             0x0010
-
-DWORD CCrystalTextView::
-ParseLineBasic (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems)
+DWORD
+CrystalLineParser::ParseLineBasic (DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems)
 {
-  int nLength = GetLineLength (nLineIndex);
   if (nLength == 0)
     return dwCookie & COOKIE_EXT_COMMENT;
 
-  LPCTSTR pszChars = GetLineChars (nLineIndex);
   bool bFirstChar = (dwCookie & ~COOKIE_EXT_COMMENT) == 0;
   bool bRedefineBlock = true;
   bool bDecIndex = false;
index 79e925c..4daa975 100644 (file)
@@ -15,7 +15,7 @@
 ////////////////////////////////////////////////////////////////////////////
 
 #include "StdAfx.h"
-#include "ccrystaltextview.h"
+#include "crystallineparser.h"
 #include "SyntaxColors.h"
 #include "string_util.h"
 
@@ -713,32 +713,12 @@ IsBatNumber (LPCTSTR pszChars, int nLength)
   return true;
 }
 
-#define DEFINE_BLOCK(pos, colorindex)   \
-ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != nullptr)\
-  {\
-    if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
-        if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
-        pBuf[nActualItems].m_nCharPos = (pos);\
-        pBuf[nActualItems].m_nColorIndex = (colorindex);\
-        pBuf[nActualItems].m_nBgColorIndex = COLORINDEX_BKGND;\
-        nActualItems ++;}\
-  }
-
-#define COOKIE_COMMENT          0x0001
-#define COOKIE_PREPROCESSOR     0x0002
-#define COOKIE_EXT_COMMENT      0x0004
-#define COOKIE_STRING           0x0008
-#define COOKIE_CHAR             0x0010
-
-DWORD CCrystalTextView::
-ParseLineBatch (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems)
+DWORD
+CrystalLineParser::ParseLineBatch (DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems)
 {
-  int nLength = GetLineLength (nLineIndex);
   if (nLength == 0)
     return dwCookie & COOKIE_EXT_COMMENT;
 
-  LPCTSTR pszChars = GetLineChars (nLineIndex);
   bool bFirstChar = (dwCookie & ~COOKIE_EXT_COMMENT) == 0;
   bool bRedefineBlock = true;
   bool bDecIndex = false;
index f5297b0..e19e704 100644 (file)
 #include "wcwidth.h"
 
 using std::vector;
+using CrystalLineParser::TEXTBLOCK;
 
 // Escaped character constants in range 0x80-0xFF are interpreted in current codepage
 // Using C locale gets us direct mapping to Unicode codepoints
@@ -285,42 +286,42 @@ EXPAND_PRIMITIVE (MoveCtrlEnd, TextEnd)
 // See ccrystaltextview.h for table declaration.
 CCrystalTextView::TextDefinition CCrystalTextView::m_SourceDefs[] =
   {
-    CCrystalTextView::SRC_PLAIN, _T ("Plain"), _T ("txt,doc,diz"), &CCrystalTextView::ParseLinePlain, SRCOPT_AUTOINDENT, /*4,*/ _T (""), _T (""), _T (""), (DWORD)-1,
-    CCrystalTextView::SRC_ASP, _T ("ASP"), _T ("asp,ascx"), &CCrystalTextView::ParseLineAsp, SRCOPT_AUTOINDENT|SRCOPT_BRACEANSI, /*2,*/ _T (""), _T (""), _T ("'"), (DWORD)-1,
-    CCrystalTextView::SRC_BASIC, _T ("Basic"), _T ("bas,vb,vbs,frm,dsm,cls,ctl,pag,dsr"), &CCrystalTextView::ParseLineBasic, SRCOPT_AUTOINDENT, /*4,*/ _T (""), _T (""), _T ("\'"), (DWORD)-1,
-    CCrystalTextView::SRC_BATCH, _T ("Batch"), _T ("bat,btm,cmd"), &CCrystalTextView::ParseLineBatch, SRCOPT_INSERTTABS|SRCOPT_AUTOINDENT, /*4,*/ _T (""), _T (""), _T ("rem "), (DWORD)-1,
-    CCrystalTextView::SRC_C, _T ("C"), _T ("c,cc,cpp,cxx,h,hpp,hxx,hm,inl,rh,tlh,tli,xs"), &CCrystalTextView::ParseLineC, SRCOPT_AUTOINDENT|SRCOPT_BRACEANSI, /*2,*/ _T ("/*"), _T ("*/"), _T ("//"), (DWORD)-1,
-    CCrystalTextView::SRC_CSHARP, _T ("C#"), _T ("cs"), &CCrystalTextView::ParseLineCSharp, SRCOPT_AUTOINDENT|SRCOPT_BRACEANSI, /*2,*/ _T ("/*"), _T ("*/"), _T ("//"), (DWORD)-1,
-    CCrystalTextView::SRC_CSS, _T ("CSS"), _T ("css"), &CCrystalTextView::ParseLineCss, SRCOPT_AUTOINDENT|SRCOPT_BRACEANSI, /*2,*/ _T ("/*"), _T ("*/"), _T (""), (DWORD)-1,
-    CCrystalTextView::SRC_DCL, _T ("DCL"), _T ("dcl,dcc"), &CCrystalTextView::ParseLineDcl, SRCOPT_AUTOINDENT|SRCOPT_BRACEGNU, /*2,*/ _T ("/*"), _T ("*/"), _T ("//"), (DWORD)-1,
-    CCrystalTextView::SRC_FORTRAN, _T ("Fortran"), _T ("f,f90,f9p,fpp,for,f77"), &CCrystalTextView::ParseLineFortran, SRCOPT_INSERTTABS|SRCOPT_AUTOINDENT, /*8,*/ _T (""), _T (""), _T ("!"), (DWORD)-1,
-    CCrystalTextView::SRC_GO, _T ("Go"), _T ("go"), &CCrystalTextView::ParseLineGo, SRCOPT_AUTOINDENT|SRCOPT_BRACEANSI, /*2,*/ _T ("/*"), _T ("*/"), _T ("//"), (DWORD)-1,
-    CCrystalTextView::SRC_HTML, _T ("HTML"), _T ("html,htm,shtml,ihtml,ssi,stm,stml,jsp"), &CCrystalTextView::ParseLineHtml, SRCOPT_AUTOINDENT|SRCOPT_BRACEANSI, /*2,*/ _T ("<!--"), _T ("-->"), _T (""), (DWORD)-1,
-    CCrystalTextView::SRC_INI, _T ("INI"), _T ("ini,reg,vbp,isl"), &CCrystalTextView::ParseLineIni, SRCOPT_AUTOINDENT|SRCOPT_BRACEGNU|SRCOPT_EOLNUNIX, /*2,*/ _T (""), _T (""), _T (";"), (DWORD)-1,
-    CCrystalTextView::SRC_INNOSETUP, _T ("InnoSetup"), _T ("iss"), &CCrystalTextView::ParseLineInnoSetup, SRCOPT_AUTOINDENT|SRCOPT_BRACEANSI, /*2,*/ _T ("{"), _T ("}"), _T (";"), (DWORD)-1,
-    CCrystalTextView::SRC_INSTALLSHIELD, _T ("InstallShield"), _T ("rul"), &CCrystalTextView::ParseLineIS, SRCOPT_AUTOINDENT|SRCOPT_BRACEANSI, /*2,*/ _T ("/*"), _T ("*/"), _T ("//"), (DWORD)-1,
-    CCrystalTextView::SRC_JAVA, _T ("Java"), _T ("java,jav,js"), &CCrystalTextView::ParseLineJava, SRCOPT_AUTOINDENT|SRCOPT_BRACEANSI, /*2,*/ _T ("/*"), _T ("*/"), _T ("//"), (DWORD)-1,
-    CCrystalTextView::SRC_LISP, _T ("AutoLISP"), _T ("lsp,dsl"), &CCrystalTextView::ParseLineLisp, SRCOPT_AUTOINDENT|SRCOPT_BRACEANSI, /*2,*/ _T (";|"), _T ("|;"), _T (";"), (DWORD)-1,
-    CCrystalTextView::SRC_NSIS, _T ("NSIS"), _T ("nsi,nsh"), &CCrystalTextView::ParseLineNsis, SRCOPT_AUTOINDENT|SRCOPT_BRACEANSI, /*2,*/ _T ("/*"), _T ("*/"), _T (";"), (DWORD)-1,
-    CCrystalTextView::SRC_PASCAL, _T ("Pascal"), _T ("pas"), &CCrystalTextView::ParseLinePascal, SRCOPT_AUTOINDENT|SRCOPT_BRACEANSI, /*2,*/ _T ("{"), _T ("}"), _T (""), (DWORD)-1,
-    CCrystalTextView::SRC_PERL, _T ("Perl"), _T ("pl,pm,plx"), &CCrystalTextView::ParseLinePerl, SRCOPT_AUTOINDENT|SRCOPT_EOLNUNIX, /*4,*/ _T (""), _T (""), _T ("#"), (DWORD)-1,
-    CCrystalTextView::SRC_PHP, _T ("PHP"), _T ("php,php3,php4,php5,phtml"), &CCrystalTextView::ParseLinePhp, SRCOPT_AUTOINDENT|SRCOPT_BRACEGNU, /*2,*/ _T ("/*"), _T ("*/"), _T ("//"), (DWORD)-1,
-    CCrystalTextView::SRC_PO, _T ("PO"), _T ("po,pot"), &CCrystalTextView::ParseLinePo, SRCOPT_AUTOINDENT|SRCOPT_EOLNUNIX, /*4,*/ _T (""), _T (""), _T ("#"), (DWORD)-1,
-    CCrystalTextView::SRC_POWERSHELL, _T ("PowerShell"), _T ("ps1"), &CCrystalTextView::ParseLinePowerShell, SRCOPT_AUTOINDENT|SRCOPT_BRACEANSI, /*2,*/ _T (""), _T (""), _T ("#"), (DWORD)-1,
-    CCrystalTextView::SRC_PYTHON, _T ("Python"), _T ("py"), &CCrystalTextView::ParseLinePython, SRCOPT_AUTOINDENT|SRCOPT_BRACEGNU, /*2,*/ _T ("/*"), _T ("*/"), _T ("//"), (DWORD)-1,
-    CCrystalTextView::SRC_REXX, _T ("REXX"), _T ("rex,rexx"), &CCrystalTextView::ParseLineRexx, SRCOPT_AUTOINDENT, /*4,*/ _T ("/*"), _T ("*/"), _T ("//"), (DWORD)-1,
-    CCrystalTextView::SRC_RSRC, _T ("Resources"), _T ("rc,dlg,r16,r32,rc2"), &CCrystalTextView::ParseLineRsrc, SRCOPT_AUTOINDENT, /*4,*/ _T ("/*"), _T ("*/"), _T ("//"), (DWORD)-1,
-       CCrystalTextView::SRC_RUBY, _T ("Ruby"), _T ("rb,rbw,rake,gemspec"), &CCrystalTextView::ParseLineRuby, SRCOPT_AUTOINDENT|SRCOPT_EOLNUNIX, /*4,*/ _T (""), _T (""), _T ("#"), (DWORD)-1,
-    CCrystalTextView::SRC_RUST, _T ("Rust"), _T ("rs"), &CCrystalTextView::ParseLineRust, SRCOPT_AUTOINDENT|SRCOPT_BRACEANSI, /*2,*/ _T ("/*"), _T ("*/"), _T ("//"), (DWORD)-1,
-    CCrystalTextView::SRC_SGML, _T ("Sgml"), _T ("sgml"), &CCrystalTextView::ParseLineSgml, SRCOPT_AUTOINDENT|SRCOPT_BRACEANSI, /*2,*/ _T ("<!--"), _T ("-->"), _T (""), (DWORD)-1,
-    CCrystalTextView::SRC_SH, _T ("Shell"), _T ("sh,conf"), &CCrystalTextView::ParseLineSh, SRCOPT_INSERTTABS|SRCOPT_AUTOINDENT|SRCOPT_EOLNUNIX, /*4,*/ _T (""), _T (""), _T ("#"), (DWORD)-1,
-    CCrystalTextView::SRC_SIOD, _T ("SIOD"), _T ("scm"), &CCrystalTextView::ParseLineSiod, SRCOPT_AUTOINDENT|SRCOPT_BRACEGNU, /*2,*/ _T (";|"), _T ("|;"), _T (";"), (DWORD)-1,
-    CCrystalTextView::SRC_SQL, _T ("SQL"), _T ("sql"), &CCrystalTextView::ParseLineSql, SRCOPT_AUTOINDENT, /*4,*/ _T ("/*"), _T ("*/"), _T ("//"), (DWORD)-1,
-    CCrystalTextView::SRC_TCL, _T ("TCL"), _T ("tcl"), &CCrystalTextView::ParseLineTcl, SRCOPT_AUTOINDENT|SRCOPT_BRACEGNU|SRCOPT_EOLNUNIX, /*2,*/ _T (""), _T (""), _T ("#"), (DWORD)-1,
-    CCrystalTextView::SRC_TEX, _T ("TEX"), _T ("tex,sty,clo,ltx,fd,dtx"), &CCrystalTextView::ParseLineTex, SRCOPT_AUTOINDENT, /*4,*/ _T (""), _T (""), _T ("%"), (DWORD)-1,
-    CCrystalTextView::SRC_VERILOG, _T ("Verilog"), _T ("v,vh"), &CCrystalTextView::ParseLineVerilog, SRCOPT_AUTOINDENT|SRCOPT_BRACEANSI, /*2,*/ _T ("/*"), _T ("*/"), _T ("//"), (DWORD)-1,
-    CCrystalTextView::SRC_VHDL, _T ("VHDL"), _T ("vhd,vhdl,vho"), &CCrystalTextView::ParseLineVhdl, SRCOPT_AUTOINDENT|SRCOPT_BRACEANSI, /*2,*/ _T (""), _T (""), _T ("--"), (DWORD)-1,
-    CCrystalTextView::SRC_XML, _T ("XML"), _T ("xml"), &CCrystalTextView::ParseLineXml, SRCOPT_AUTOINDENT|SRCOPT_BRACEANSI, /*2,*/ _T ("<!--"), _T ("-->"), _T (""), (DWORD)-1
+    CCrystalTextView::SRC_PLAIN, _T ("Plain"), _T ("txt,doc,diz"), &CrystalLineParser::ParseLinePlain, SRCOPT_AUTOINDENT, /*4,*/ _T (""), _T (""), _T (""), (DWORD)-1,
+    CCrystalTextView::SRC_ASP, _T ("ASP"), _T ("asp,ascx"), &CrystalLineParser::ParseLineAsp, SRCOPT_AUTOINDENT|SRCOPT_BRACEANSI, /*2,*/ _T (""), _T (""), _T ("'"), (DWORD)-1,
+    CCrystalTextView::SRC_BASIC, _T ("Basic"), _T ("bas,vb,vbs,frm,dsm,cls,ctl,pag,dsr"), &CrystalLineParser::ParseLineBasic, SRCOPT_AUTOINDENT, /*4,*/ _T (""), _T (""), _T ("\'"), (DWORD)-1,
+    CCrystalTextView::SRC_BATCH, _T ("Batch"), _T ("bat,btm,cmd"), &CrystalLineParser::ParseLineBatch, SRCOPT_INSERTTABS|SRCOPT_AUTOINDENT, /*4,*/ _T (""), _T (""), _T ("rem "), (DWORD)-1,
+    CCrystalTextView::SRC_C, _T ("C"), _T ("c,cc,cpp,cxx,h,hpp,hxx,hm,inl,rh,tlh,tli,xs"), &CrystalLineParser::ParseLineC, SRCOPT_AUTOINDENT|SRCOPT_BRACEANSI, /*2,*/ _T ("/*"), _T ("*/"), _T ("//"), (DWORD)-1,
+    CCrystalTextView::SRC_CSHARP, _T ("C#"), _T ("cs"), &CrystalLineParser::ParseLineCSharp, SRCOPT_AUTOINDENT|SRCOPT_BRACEANSI, /*2,*/ _T ("/*"), _T ("*/"), _T ("//"), (DWORD)-1,
+    CCrystalTextView::SRC_CSS, _T ("CSS"), _T ("css"), &CrystalLineParser::ParseLineCss, SRCOPT_AUTOINDENT|SRCOPT_BRACEANSI, /*2,*/ _T ("/*"), _T ("*/"), _T (""), (DWORD)-1,
+    CCrystalTextView::SRC_DCL, _T ("DCL"), _T ("dcl,dcc"), &CrystalLineParser::ParseLineDcl, SRCOPT_AUTOINDENT|SRCOPT_BRACEGNU, /*2,*/ _T ("/*"), _T ("*/"), _T ("//"), (DWORD)-1,
+    CCrystalTextView::SRC_FORTRAN, _T ("Fortran"), _T ("f,f90,f9p,fpp,for,f77"), &CrystalLineParser::ParseLineFortran, SRCOPT_INSERTTABS|SRCOPT_AUTOINDENT, /*8,*/ _T (""), _T (""), _T ("!"), (DWORD)-1,
+    CCrystalTextView::SRC_GO, _T ("Go"), _T ("go"), &CrystalLineParser::ParseLineGo, SRCOPT_AUTOINDENT|SRCOPT_BRACEANSI, /*2,*/ _T ("/*"), _T ("*/"), _T ("//"), (DWORD)-1,
+    CCrystalTextView::SRC_HTML, _T ("HTML"), _T ("html,htm,shtml,ihtml,ssi,stm,stml,jsp"), &CrystalLineParser::ParseLineHtml, SRCOPT_AUTOINDENT|SRCOPT_BRACEANSI, /*2,*/ _T ("<!--"), _T ("-->"), _T (""), (DWORD)-1,
+    CCrystalTextView::SRC_INI, _T ("INI"), _T ("ini,reg,vbp,isl"), &CrystalLineParser::ParseLineIni, SRCOPT_AUTOINDENT|SRCOPT_BRACEGNU|SRCOPT_EOLNUNIX, /*2,*/ _T (""), _T (""), _T (";"), (DWORD)-1,
+    CCrystalTextView::SRC_INNOSETUP, _T ("InnoSetup"), _T ("iss"), &CrystalLineParser::ParseLineInnoSetup, SRCOPT_AUTOINDENT|SRCOPT_BRACEANSI, /*2,*/ _T ("{"), _T ("}"), _T (";"), (DWORD)-1,
+    CCrystalTextView::SRC_INSTALLSHIELD, _T ("InstallShield"), _T ("rul"), &CrystalLineParser::ParseLineIS, SRCOPT_AUTOINDENT|SRCOPT_BRACEANSI, /*2,*/ _T ("/*"), _T ("*/"), _T ("//"), (DWORD)-1,
+    CCrystalTextView::SRC_JAVA, _T ("Java"), _T ("java,jav,js"), &CrystalLineParser::ParseLineJava, SRCOPT_AUTOINDENT|SRCOPT_BRACEANSI, /*2,*/ _T ("/*"), _T ("*/"), _T ("//"), (DWORD)-1,
+    CCrystalTextView::SRC_LISP, _T ("AutoLISP"), _T ("lsp,dsl"), &CrystalLineParser::ParseLineLisp, SRCOPT_AUTOINDENT|SRCOPT_BRACEANSI, /*2,*/ _T (";|"), _T ("|;"), _T (";"), (DWORD)-1,
+    CCrystalTextView::SRC_NSIS, _T ("NSIS"), _T ("nsi,nsh"), &CrystalLineParser::ParseLineNsis, SRCOPT_AUTOINDENT|SRCOPT_BRACEANSI, /*2,*/ _T ("/*"), _T ("*/"), _T (";"), (DWORD)-1,
+    CCrystalTextView::SRC_PASCAL, _T ("Pascal"), _T ("pas"), &CrystalLineParser::ParseLinePascal, SRCOPT_AUTOINDENT|SRCOPT_BRACEANSI, /*2,*/ _T ("{"), _T ("}"), _T (""), (DWORD)-1,
+    CCrystalTextView::SRC_PERL, _T ("Perl"), _T ("pl,pm,plx"), &CrystalLineParser::ParseLinePerl, SRCOPT_AUTOINDENT|SRCOPT_EOLNUNIX, /*4,*/ _T (""), _T (""), _T ("#"), (DWORD)-1,
+    CCrystalTextView::SRC_PHP, _T ("PHP"), _T ("php,php3,php4,php5,phtml"), &CrystalLineParser::ParseLinePhp, SRCOPT_AUTOINDENT|SRCOPT_BRACEGNU, /*2,*/ _T ("/*"), _T ("*/"), _T ("//"), (DWORD)-1,
+    CCrystalTextView::SRC_PO, _T ("PO"), _T ("po,pot"), &CrystalLineParser::ParseLinePo, SRCOPT_AUTOINDENT|SRCOPT_EOLNUNIX, /*4,*/ _T (""), _T (""), _T ("#"), (DWORD)-1,
+    CCrystalTextView::SRC_POWERSHELL, _T ("PowerShell"), _T ("ps1"), &CrystalLineParser::ParseLinePowerShell, SRCOPT_AUTOINDENT|SRCOPT_BRACEANSI, /*2,*/ _T (""), _T (""), _T ("#"), (DWORD)-1,
+    CCrystalTextView::SRC_PYTHON, _T ("Python"), _T ("py"), &CrystalLineParser::ParseLinePython, SRCOPT_AUTOINDENT|SRCOPT_BRACEGNU, /*2,*/ _T ("/*"), _T ("*/"), _T ("//"), (DWORD)-1,
+    CCrystalTextView::SRC_REXX, _T ("REXX"), _T ("rex,rexx"), &CrystalLineParser::ParseLineRexx, SRCOPT_AUTOINDENT, /*4,*/ _T ("/*"), _T ("*/"), _T ("//"), (DWORD)-1,
+    CCrystalTextView::SRC_RSRC, _T ("Resources"), _T ("rc,dlg,r16,r32,rc2"), &CrystalLineParser::ParseLineRsrc, SRCOPT_AUTOINDENT, /*4,*/ _T ("/*"), _T ("*/"), _T ("//"), (DWORD)-1,
+       CCrystalTextView::SRC_RUBY, _T ("Ruby"), _T ("rb,rbw,rake,gemspec"), &CrystalLineParser::ParseLineRuby, SRCOPT_AUTOINDENT|SRCOPT_EOLNUNIX, /*4,*/ _T (""), _T (""), _T ("#"), (DWORD)-1,
+    CCrystalTextView::SRC_RUST, _T ("Rust"), _T ("rs"), &CrystalLineParser::ParseLineRust, SRCOPT_AUTOINDENT|SRCOPT_BRACEANSI, /*2,*/ _T ("/*"), _T ("*/"), _T ("//"), (DWORD)-1,
+    CCrystalTextView::SRC_SGML, _T ("Sgml"), _T ("sgml"), &CrystalLineParser::ParseLineSgml, SRCOPT_AUTOINDENT|SRCOPT_BRACEANSI, /*2,*/ _T ("<!--"), _T ("-->"), _T (""), (DWORD)-1,
+    CCrystalTextView::SRC_SH, _T ("Shell"), _T ("sh,conf"), &CrystalLineParser::ParseLineSh, SRCOPT_INSERTTABS|SRCOPT_AUTOINDENT|SRCOPT_EOLNUNIX, /*4,*/ _T (""), _T (""), _T ("#"), (DWORD)-1,
+    CCrystalTextView::SRC_SIOD, _T ("SIOD"), _T ("scm"), &CrystalLineParser::ParseLineSiod, SRCOPT_AUTOINDENT|SRCOPT_BRACEGNU, /*2,*/ _T (";|"), _T ("|;"), _T (";"), (DWORD)-1,
+    CCrystalTextView::SRC_SQL, _T ("SQL"), _T ("sql"), &CrystalLineParser::ParseLineSql, SRCOPT_AUTOINDENT, /*4,*/ _T ("/*"), _T ("*/"), _T ("//"), (DWORD)-1,
+    CCrystalTextView::SRC_TCL, _T ("TCL"), _T ("tcl"), &CrystalLineParser::ParseLineTcl, SRCOPT_AUTOINDENT|SRCOPT_BRACEGNU|SRCOPT_EOLNUNIX, /*2,*/ _T (""), _T (""), _T ("#"), (DWORD)-1,
+    CCrystalTextView::SRC_TEX, _T ("TEX"), _T ("tex,sty,clo,ltx,fd,dtx"), &CrystalLineParser::ParseLineTex, SRCOPT_AUTOINDENT, /*4,*/ _T (""), _T (""), _T ("%"), (DWORD)-1,
+    CCrystalTextView::SRC_VERILOG, _T ("Verilog"), _T ("v,vh"), &CrystalLineParser::ParseLineVerilog, SRCOPT_AUTOINDENT|SRCOPT_BRACEANSI, /*2,*/ _T ("/*"), _T ("*/"), _T ("//"), (DWORD)-1,
+    CCrystalTextView::SRC_VHDL, _T ("VHDL"), _T ("vhd,vhdl,vho"), &CrystalLineParser::ParseLineVhdl, SRCOPT_AUTOINDENT|SRCOPT_BRACEANSI, /*2,*/ _T (""), _T (""), _T ("--"), (DWORD)-1,
+    CCrystalTextView::SRC_XML, _T ("XML"), _T ("xml"), &CrystalLineParser::ParseLineXml, SRCOPT_AUTOINDENT|SRCOPT_BRACEANSI, /*2,*/ _T ("<!--"), _T ("-->"), _T (""), (DWORD)-1
   };
 
 /////////////////////////////////////////////////////////////////////////////
@@ -1291,7 +1292,7 @@ GetParseCookie (int nLineIndex)
       if (L > 0)
         dwCookie = (*m_ParseCookies)[L - 1];
       ASSERT (dwCookie != - 1);
-      (*m_ParseCookies)[L] = ParseLine (dwCookie, L, nullptr, nBlocks);
+      (*m_ParseCookies)[L] = ParseLine (dwCookie, GetLineChars(L), GetLineLength(L), nullptr, nBlocks);
       ASSERT ((*m_ParseCookies)[L] != - 1);
       L++;
     }
@@ -1299,7 +1300,7 @@ GetParseCookie (int nLineIndex)
   return (*m_ParseCookies)[nLineIndex];
 }
 
-std::vector<CCrystalTextView::TEXTBLOCK> CCrystalTextView::
+std::vector<TEXTBLOCK> CCrystalTextView::
 GetAdditionalTextBlocks (int nLineIndex)
 {
   return {};
@@ -1568,7 +1569,7 @@ public:
   explicit IntArray(int len) { SetSize(len); }
 };
 
-std::vector<CCrystalTextView::TEXTBLOCK> CCrystalTextView::
+std::vector<TEXTBLOCK> CCrystalTextView::
 MergeTextBlocks (const std::vector<TEXTBLOCK>& blocks1, const std::vector<TEXTBLOCK>& blocks2) const
 {
   size_t i, j, k;
@@ -1641,7 +1642,7 @@ MergeTextBlocks (const std::vector<TEXTBLOCK>& blocks1, const std::vector<TEXTBL
   return mergedBlocks;
 }
 
-std::vector<CCrystalTextView::TEXTBLOCK>
+std::vector<TEXTBLOCK>
 CCrystalTextView::GetMarkerTextBlocks(int nLineIndex) const
 {
   std::vector<TEXTBLOCK> allblocks;
@@ -1694,7 +1695,7 @@ CCrystalTextView::GetMarkerTextBlocks(int nLineIndex) const
   return allblocks;
 }
 
-std::vector<CCrystalTextView::TEXTBLOCK>
+std::vector<TEXTBLOCK>
 CCrystalTextView::GetTextBlocks(int nLineIndex)
 {
   int nLength = GetViewableLineLength (nLineIndex);
@@ -1708,7 +1709,7 @@ CCrystalTextView::GetTextBlocks(int nLineIndex)
   blocks[0].m_nColorIndex = COLORINDEX_NORMALTEXT;
   blocks[0].m_nBgColorIndex = COLORINDEX_BKGND;
   nBlocks++;
-  (*m_ParseCookies)[nLineIndex] = ParseLine(dwCookie, nLineIndex, blocks.data(), nBlocks);
+  (*m_ParseCookies)[nLineIndex] = ParseLine(dwCookie, GetLineChars(nLineIndex), GetLineLength(nLineIndex), blocks.data(), nBlocks);
   ASSERT((*m_ParseCookies)[nLineIndex] != -1);
   blocks.resize(nBlocks);
   
@@ -2672,7 +2673,7 @@ int CCrystalTextView::CursorPointToCharPos( int nLineIndex, const CPoint &curPoi
         bDBCSLeadPrev = IsLeadByte(szLine[nIndex]);
     }
 
-  if (szLine && m_pTextBuffer->IsMBSTrail(nLineIndex, nIndex)) nIndex--;
+  if (szLine && IsMBSTrail(szLine, nIndex)) nIndex--;
 
   return nIndex;       
 }
@@ -4062,15 +4063,9 @@ OnSetFocus (CWnd * pOldWnd)
 }
 
 DWORD CCrystalTextView::
-ParseLinePlain (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems)
+ParseLine (DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems)
 {
-  return 0;
-}
-
-DWORD CCrystalTextView::
-ParseLine (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems)
-{
-  return (this->*(m_CurSourceDef->ParseLineX)) (dwCookie, nLineIndex, pBuf, nActualItems);
+  return m_CurSourceDef->ParseLineX (dwCookie, pszChars, nLength, pBuf, nActualItems);
 }
 
 int CCrystalTextView::
index 2037c66..eff164c 100644 (file)
@@ -36,6 +36,7 @@
 #include <vector>
 #include "cregexp.h"
 #include "crystalparser.h"
+#include "crystallineparser.h"
 
 ////////////////////////////////////////////////////////////////////////////
 // Forward class declarations
@@ -87,15 +88,6 @@ class EDITPADC_CLASS CCrystalTextView : public CView
 
     friend CCrystalParser;
 
-public:
-    //  Syntax coloring overrides
-    struct TEXTBLOCK
-    {
-        int m_nCharPos;
-        int m_nColorIndex;
-        int m_nBgColorIndex;
-    };
-
 protected:
     //  Search parameters
     bool m_bLastSearch;
@@ -586,20 +578,20 @@ protected:
        // function to draw a single screen line
        // (a wrapped line can consist of many screen lines
        virtual void DrawScreenLine( CDC *pdc, CPoint &ptOrigin, const CRect &rcClip,
-               const std::vector<TEXTBLOCK>& blocks, int &nActualItem,
+               const std::vector<CrystalLineParser::TEXTBLOCK>& blocks, int &nActualItem,
                COLORREF crText, COLORREF crBkgnd, bool bDrawWhitespace,
                LPCTSTR pszChars,
                int nOffset, int nCount, int &nActualOffset, CPoint ptTextPos );
        //END SW
 
-       std::vector<TEXTBLOCK> MergeTextBlocks(const std::vector<TEXTBLOCK>& blocks1, const std::vector<TEXTBLOCK>& blocks2) const;
-       std::vector<TEXTBLOCK> GetMarkerTextBlocks(int nLineIndex) const;
-       virtual std::vector<TEXTBLOCK> GetAdditionalTextBlocks (int nLineIndex);
+       std::vector<CrystalLineParser::TEXTBLOCK> MergeTextBlocks(const std::vector<CrystalLineParser::TEXTBLOCK>& blocks1, const std::vector<CrystalLineParser::TEXTBLOCK>& blocks2) const;
+       std::vector<CrystalLineParser::TEXTBLOCK> GetMarkerTextBlocks(int nLineIndex) const;
+       virtual std::vector<CrystalLineParser::TEXTBLOCK> GetAdditionalTextBlocks (int nLineIndex);
 
 public:
        virtual CString GetHTMLLine (int nLineIndex, LPCTSTR pszTag);
        virtual CString GetHTMLStyles ();
-       std::vector<TEXTBLOCK> GetTextBlocks(int nLineIndex);
+       std::vector<CrystalLineParser::TEXTBLOCK> GetTextBlocks(int nLineIndex);
 protected:
     virtual CString GetHTMLAttribute (int nColorIndex, int nBgColorIndex, COLORREF crText, COLORREF crBkgnd);
 
@@ -660,43 +652,7 @@ private:
 
 public :
     void GoToLine (int nLine, bool bRelative);
-    DWORD ParseLine (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems);
-    DWORD ParseLinePlain (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems);
-    DWORD ParseLineAsp (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems);
-    DWORD ParseLineBasic (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems);
-    DWORD ParseLineBatch (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems);
-    DWORD ParseLineC (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems);
-    DWORD ParseLineCSharp (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems);
-    DWORD ParseLineCss (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems);
-    DWORD ParseLineDcl (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems);
-    DWORD ParseLineFortran (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems);
-    DWORD ParseLineGo (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems);
-    DWORD ParseLineHtml (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems);
-    DWORD ParseLineIni (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems);
-    DWORD ParseLineInnoSetup (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems);
-    DWORD ParseLineIS (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems);
-    DWORD ParseLineJava (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems);
-    DWORD ParseLineLisp (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems);
-    DWORD ParseLineNsis (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems);
-    DWORD ParseLinePascal (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems);
-    DWORD ParseLinePerl (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems);
-    DWORD ParseLinePhp (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems);
-    DWORD ParseLinePo (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems);
-    DWORD ParseLinePowerShell (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems);
-    DWORD ParseLinePython (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems);
-    DWORD ParseLineRexx (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems);
-    DWORD ParseLineRsrc (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems);
-       DWORD ParseLineRuby (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems);
-    DWORD ParseLineRust (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems);
-    DWORD ParseLineSgml (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems);
-    DWORD ParseLineSh (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems);
-    DWORD ParseLineSiod (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems);
-    DWORD ParseLineSql (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems);
-    DWORD ParseLineTcl (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems);
-    DWORD ParseLineTex (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems);
-    DWORD ParseLineVerilog (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems);
-    DWORD ParseLineVhdl (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems);
-    DWORD ParseLineXml (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems);
+    DWORD ParseLine (DWORD dwCookie, const TCHAR *pszChars, int nLength, CrystalLineParser::TEXTBLOCK * pBuf, int &nActualItems);
 
     // Attributes
 public :
@@ -799,7 +755,7 @@ public :
         TextType type;
         TCHAR name[256];
         TCHAR exts[256];
-        DWORD (CCrystalTextView:: * ParseLineX) (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems);
+        DWORD (* ParseLineX) (DWORD dwCookie, const TCHAR *pszChars, int nLength, CrystalLineParser::TEXTBLOCK * pBuf, int &nActualItems);
         DWORD flags;
 //        DWORD tabsize;
         TCHAR opencomment[8];
index 0c225fc..e049cce 100644 (file)
@@ -26,8 +26,7 @@
 ////////////////////////////////////////////////////////////////////////////
 
 #include "StdAfx.h"
-#include "ccrystaltextview.h"
-#include "ccrystaltextbuffer.h"
+#include "crystallineparser.h"
 #include "SyntaxColors.h"
 #include "string_util.h"
 
@@ -289,32 +288,12 @@ IsCppNumber (LPCTSTR pszChars, int nLength)
   return true;
 }
 
-#define DEFINE_BLOCK(pos, colorindex)   \
-ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != nullptr)\
-  {\
-    if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
-        if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
-        pBuf[nActualItems].m_nCharPos = (pos);\
-        pBuf[nActualItems].m_nColorIndex = (colorindex);\
-        pBuf[nActualItems].m_nBgColorIndex = COLORINDEX_BKGND;\
-        nActualItems ++;}\
-  }
-
-#define COOKIE_COMMENT          0x0001
-#define COOKIE_PREPROCESSOR     0x0002
-#define COOKIE_EXT_COMMENT      0x0004
-#define COOKIE_STRING           0x0008
-#define COOKIE_CHAR             0x0010
-
-DWORD CCrystalTextView::
-ParseLineC (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems)
+DWORD
+CrystalLineParser::ParseLineC (DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems)
 {
-  int nLength = GetLineLength (nLineIndex);
   if (nLength == 0)
     return dwCookie & COOKIE_EXT_COMMENT;
 
-  LPCTSTR pszChars = GetLineChars (nLineIndex);
   bool bFirstChar = (dwCookie & ~COOKIE_EXT_COMMENT) == 0;
   LPCTSTR pszCommentBegin = nullptr;
   LPCTSTR pszCommentEnd = nullptr;
@@ -557,7 +536,7 @@ out:
         }
     }
 
-  if (pszChars[nLength - 1] != '\\' || m_pTextBuffer->IsMBSTrail(nLineIndex, nLength - 1))
+  if (pszChars[nLength - 1] != '\\' || IsMBSTrail(pszChars, nLength - 1))
     dwCookie &= COOKIE_EXT_COMMENT;
   return dwCookie;
 }
index 86145d1..ab8f847 100644 (file)
@@ -6,6 +6,7 @@
 #include "crystalparser.h"
 #include "crystaleditviewex.h"
 
+using CrystalLineParser::TEXTBLOCK;
 
 //////////////////////////////////////////////////////////////////////
 // Konstruktion/Destruktion
@@ -37,7 +38,7 @@ DWORD CCrystalEditViewEx::ParseLine( DWORD dwCookie, int nLineIndex,
        if( m_pSyntaxParser != nullptr )
        {
                CCrystalTextBlock       *pTextBlock = 
-                       pBuf? new CCrystalTextBlock( (CCrystalTextBlock::TEXTBLOCK*)pBuf, nActualItems ) : nullptr;
+                       pBuf? new CCrystalTextBlock( (TEXTBLOCK*)pBuf, nActualItems ) : nullptr;
                dwCookie = m_pSyntaxParser->ParseLine( dwCookie, nLineIndex, pTextBlock );
                
                if( pTextBlock != nullptr )
index c0eb8c0..042e148 100644 (file)
@@ -75,7 +75,7 @@ protected:
                The calculated flags for this line (see dwCookie).\r
        */\r
        virtual DWORD ParseLine( DWORD dwCookie, int nLineIndex, \r
-               TEXTBLOCK *pBuf, int &nActualItems );\r
+               CrystalLineParser::TEXTBLOCK *pBuf, int &nActualItems );\r
        \r
 /** @attributes */\r
 protected:\r
diff --git a/Externals/crystaledit/editlib/crystallineparser.h b/Externals/crystaledit/editlib/crystallineparser.h
new file mode 100644 (file)
index 0000000..2a5a914
--- /dev/null
@@ -0,0 +1,83 @@
+#pragma once\r
+\r
+#define DEFINE_BLOCK(pos, colorindex)   \\r
+ASSERT((pos) >= 0 && (pos) <= nLength);\\r
+if (pBuf != nullptr)\\r
+  {\\r
+    if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\\r
+        if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\\r
+        pBuf[nActualItems].m_nCharPos = (pos);\\r
+        pBuf[nActualItems].m_nColorIndex = (colorindex);\\r
+        pBuf[nActualItems].m_nBgColorIndex = COLORINDEX_BKGND;\\r
+        nActualItems ++;}\\r
+  }\r
+\r
+#define COOKIE_COMMENT          0x0001\r
+#define COOKIE_PREPROCESSOR     0x0002\r
+#define COOKIE_EXT_COMMENT      0x0004\r
+#define COOKIE_STRING           0x0008\r
+#define COOKIE_CHAR             0x0010\r
+#define COOKIE_USER1            0x0020\r
+#define COOKIE_EXT_USER1        0x0040\r
+#define COOKIE_SECTION          0x0080\r
+#define COOKIE_KEY              0x0100\r
+#define COOKIE_EXT_COMMENT2     0x0200\r
+#define COOKIE_USER2            0x0400\r
+#define COOKIE_VARIABLE         0x0800\r
+#define COOKIE_RAWSTRING        0x1000\r
+#define COOKIE_EXT_DEFINITION   0x2000\r
+#define COOKIE_EXT_VALUE        0x4000\r
+\r
+#define COOKIE_GET_EXT_COMMENT_DEPTH(cookie) (((cookie) & 0x0F000000) >> 24)\r
+#define COOKIE_SET_EXT_COMMENT_DEPTH(cookie, depth) (cookie) = (((cookie) & 0xF0FFFFFF) | ((depth) << 24))\r
+#define COOKIE_GET_RAWSTRING_NUMBER_COUNT(cookie) (((cookie) & 0xF0000000) >> 28)\r
+#define COOKIE_SET_RAWSTRING_NUMBER_COUNT(cookie, count) (cookie) = (((cookie) & 0x0FFFFFFF) | ((count) << 28))\r
+\r
+namespace CrystalLineParser\r
+{\r
+//  Syntax coloring overrides\r
+struct TEXTBLOCK\r
+{\r
+       int m_nCharPos;\r
+       int m_nColorIndex;\r
+       int m_nBgColorIndex;\r
+};\r
+\r
+DWORD ParseLinePlain(DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);\r
+DWORD ParseLineAsp(DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);\r
+DWORD ParseLineBasic(DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);\r
+DWORD ParseLineBatch(DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);\r
+DWORD ParseLineC(DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);\r
+DWORD ParseLineCSharp(DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);\r
+DWORD ParseLineCss(DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);\r
+DWORD ParseLineDcl(DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);\r
+DWORD ParseLineFortran(DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);\r
+DWORD ParseLineGo(DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);\r
+DWORD ParseLineHtml(DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);\r
+DWORD ParseLineIni(DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);\r
+DWORD ParseLineInnoSetup(DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);\r
+DWORD ParseLineIS(DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);\r
+DWORD ParseLineJava(DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);\r
+DWORD ParseLineLisp(DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);\r
+DWORD ParseLineNsis(DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);\r
+DWORD ParseLinePascal(DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);\r
+DWORD ParseLinePerl(DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);\r
+DWORD ParseLinePhp(DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);\r
+DWORD ParseLinePo(DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);\r
+DWORD ParseLinePowerShell(DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);\r
+DWORD ParseLinePython(DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);\r
+DWORD ParseLineRexx(DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);\r
+DWORD ParseLineRsrc(DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);\r
+DWORD ParseLineRuby(DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);\r
+DWORD ParseLineRust(DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);\r
+DWORD ParseLineSgml(DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);\r
+DWORD ParseLineSh(DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);\r
+DWORD ParseLineSiod(DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);\r
+DWORD ParseLineSql(DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);\r
+DWORD ParseLineTcl(DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);\r
+DWORD ParseLineTex(DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);\r
+DWORD ParseLineVerilog(DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);\r
+DWORD ParseLineVhdl(DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);\r
+DWORD ParseLineXml(DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems);\r
+\r
+}\r
index 87da305..84adfd5 100644 (file)
 ////////////////////////////////////////////////////////////////////////////
 
 #include "StdAfx.h"
+#include "crystallineparser.h"
 #include "crystaltextblock.h"
 
+using CrystalLineParser::TEXTBLOCK;
+
 #ifdef _DEBUG
 #define new DEBUG_NEW
 #endif
index d995c20..c50d791 100644 (file)
@@ -15,6 +15,8 @@
 
 #pragma once
 
+namespace CrystalLineParser { struct TEXTBLOCK; }
+
 /**
 Objects of this class are passed to CCrystalParser::ParseLine() to get the
 positions of color changes in a text line.
@@ -29,16 +31,9 @@ class EDITPADC_CLASS CCrystalTextBlock
        friend class CCrystalTextView;
        friend class CCrystalEditViewEx;
 
-protected:
-       struct TEXTBLOCK
-       {
-               int m_nCharPos;
-               int m_nColorIndex;
-       };
-
 // construction/destruction
 protected:
-       CCrystalTextBlock( TEXTBLOCK *pTextBlock, int &rnActualItems );
+       CCrystalTextBlock( CrystalLineParser::TEXTBLOCK *pTextBlock, int &rnActualItems );
 
 // operations
 public:
@@ -57,7 +52,7 @@ public:
 // attributes
 protected:
        /** text block to work on */
-       TEXTBLOCK       *m_pTextBlock;
+       CrystalLineParser::TEXTBLOCK    *m_pTextBlock;
 
        /** Index */
        int &m_rnActualItems;
index 76f2900..9277fde 100644 (file)
@@ -26,8 +26,7 @@
 ////////////////////////////////////////////////////////////////////////////
 
 #include "StdAfx.h"
-#include "ccrystaltextview.h"
-#include "ccrystaltextbuffer.h"
+#include "crystallineparser.h"
 #include "SyntaxColors.h"
 #include "string_util.h"
 
@@ -149,32 +148,12 @@ IsCppNumber (LPCTSTR pszChars, int nLength)
   return true;
 }
 
-#define DEFINE_BLOCK(pos, colorindex)   \
-ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != nullptr)\
-  {\
-    if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
-        if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
-        pBuf[nActualItems].m_nCharPos = (pos);\
-        pBuf[nActualItems].m_nColorIndex = (colorindex);\
-        pBuf[nActualItems].m_nBgColorIndex = COLORINDEX_BKGND;\
-        nActualItems ++;}\
-  }
-
-#define COOKIE_COMMENT          0x0001
-#define COOKIE_PREPROCESSOR     0x0002
-#define COOKIE_EXT_COMMENT      0x0004
-#define COOKIE_STRING           0x0008
-#define COOKIE_CHAR             0x0010
-
-DWORD CCrystalTextView::
-ParseLineCSharp (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems)
+DWORD
+CrystalLineParser::ParseLineCSharp (DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems)
 {
-  int nLength = GetLineLength (nLineIndex);
   if (nLength == 0)
     return dwCookie & COOKIE_EXT_COMMENT;
 
-  LPCTSTR pszChars = GetLineChars (nLineIndex);
   bool bFirstChar = (dwCookie & ~COOKIE_EXT_COMMENT) == 0;
   bool bRedefineBlock = true;
   bool bWasCommentStart = false;
@@ -411,7 +390,7 @@ out:
         }
     }
 
-  if (pszChars[nLength - 1] != '\\' || m_pTextBuffer->IsMBSTrail(nLineIndex, nLength - 1))
+  if (pszChars[nLength - 1] != '\\' || IsMBSTrail(pszChars, nLength - 1))
     dwCookie &= COOKIE_EXT_COMMENT;
   return dwCookie;
 }
index 85605d4..69e8afb 100644 (file)
@@ -15,8 +15,7 @@
 ////////////////////////////////////////////////////////////////////////////
 
 #include "StdAfx.h"
-#include "ccrystaltextview.h"
-#include "ccrystaltextbuffer.h"
+#include "crystallineparser.h"
 #include "SyntaxColors.h"
 #include "string_util.h"
 
@@ -202,34 +201,12 @@ IsCss2Keyword (LPCTSTR pszChars, int nLength)
   return IsXKeyword (s_apszCss2KeywordList, pszChars, nLength);
 }
 
-#define DEFINE_BLOCK(pos, colorindex)   \
-ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != nullptr)\
-  {\
-    if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
-        if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
-        pBuf[nActualItems].m_nCharPos = (pos);\
-        pBuf[nActualItems].m_nColorIndex = (colorindex);\
-        pBuf[nActualItems].m_nBgColorIndex = COLORINDEX_BKGND;\
-        nActualItems ++;}\
-  }
-
-#define COOKIE_COMMENT          0x0001
-#define COOKIE_PREPROCESSOR     0x0002
-#define COOKIE_EXT_COMMENT      0x0004
-#define COOKIE_STRING           0x0008
-#define COOKIE_CHAR             0x0010
-#define COOKIE_EXT_DEFINITION   0x0020
-#define COOKIE_EXT_VALUE        0x0040
-
-DWORD CCrystalTextView::
-ParseLineCss (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems)
+DWORD
+CrystalLineParser::ParseLineCss (DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems)
 {
-  int nLength = GetLineLength (nLineIndex);
   if (nLength == 0)
     return dwCookie & (COOKIE_EXT_COMMENT|COOKIE_EXT_DEFINITION|COOKIE_EXT_VALUE);
 
-  LPCTSTR pszChars = GetLineChars (nLineIndex);
   bool bFirstChar = (dwCookie & ~(COOKIE_EXT_COMMENT|COOKIE_EXT_DEFINITION|COOKIE_EXT_VALUE)) == 0;
   bool bRedefineBlock = true;
   bool bWasCommentStart = false;
index 0d880be..a241702 100644 (file)
@@ -15,7 +15,7 @@
 ////////////////////////////////////////////////////////////////////////////
 
 #include "StdAfx.h"
-#include "ccrystaltextview.h"
+#include "crystallineparser.h"
 #include "SyntaxColors.h"
 #include "string_util.h"
 
@@ -149,32 +149,12 @@ IsDclNumber (LPCTSTR pszChars, int nLength)
   return true;
 }
 
-#define DEFINE_BLOCK(pos, colorindex)   \
-ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != nullptr)\
-  {\
-    if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
-        if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
-        pBuf[nActualItems].m_nCharPos = (pos);\
-        pBuf[nActualItems].m_nColorIndex = (colorindex);\
-        pBuf[nActualItems].m_nBgColorIndex = COLORINDEX_BKGND;\
-        nActualItems ++;}\
-  }
-
-#define COOKIE_COMMENT          0x0001
-#define COOKIE_PREPROCESSOR     0x0002
-#define COOKIE_EXT_COMMENT      0x0004
-#define COOKIE_STRING           0x0008
-#define COOKIE_CHAR             0x0010
-
-DWORD CCrystalTextView::
-ParseLineDcl (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems)
+DWORD
+CrystalLineParser::ParseLineDcl (DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems)
 {
-  int nLength = GetLineLength (nLineIndex);
   if (nLength == 0)
     return dwCookie & COOKIE_EXT_COMMENT;
 
-  LPCTSTR pszChars = GetLineChars (nLineIndex);
   bool bFirstChar = (dwCookie & ~COOKIE_EXT_COMMENT) == 0;
   bool bRedefineBlock = true;
   bool bWasCommentStart = false;
index c7d71e9..c8d6972 100644 (file)
@@ -15,8 +15,7 @@
 ////////////////////////////////////////////////////////////////////////////
 
 #include "StdAfx.h"
-#include "ccrystaltextview.h"
-#include "ccrystaltextbuffer.h"
+#include "crystallineparser.h"
 #include "SyntaxColors.h"
 #include "string_util.h"
 
@@ -266,32 +265,12 @@ IsFortranNumber (LPCTSTR pszChars, int nLength)
   return true;
 }
 
-#define DEFINE_BLOCK(pos, colorindex)   \
-ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != nullptr)\
-  {\
-    if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
-        if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
-        pBuf[nActualItems].m_nCharPos = (pos);\
-        pBuf[nActualItems].m_nColorIndex = (colorindex);\
-        pBuf[nActualItems].m_nBgColorIndex = COLORINDEX_BKGND;\
-        nActualItems ++;}\
-  }
-
-#define COOKIE_COMMENT          0x0001
-#define COOKIE_PREPROCESSOR     0x0002
-#define COOKIE_EXT_COMMENT      0x0004
-#define COOKIE_STRING           0x0008
-#define COOKIE_CHAR             0x0010
-
-DWORD CCrystalTextView::
-ParseLineFortran (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems)
+DWORD
+CrystalLineParser::ParseLineFortran (DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems)
 {
-  int nLength = GetLineLength (nLineIndex);
   if (nLength == 0)
     return dwCookie & COOKIE_EXT_COMMENT;
 
-  LPCTSTR pszChars = GetLineChars (nLineIndex);
   bool bFirstChar = (dwCookie & ~COOKIE_EXT_COMMENT) == 0;
   bool bRedefineBlock = true;
   bool bDecIndex = false;
@@ -444,7 +423,7 @@ out:
         }
     }
 
-  if (pszChars[nLength - 1] != '\\' || m_pTextBuffer->IsMBSTrail(nLineIndex, nLength - 1))
+  if (pszChars[nLength - 1] != '\\' || IsMBSTrail(pszChars, nLength - 1))
     dwCookie &= COOKIE_EXT_COMMENT;
   return dwCookie;
 }
index 179b259..319e972 100644 (file)
@@ -15,8 +15,7 @@
 ////////////////////////////////////////////////////////////////////////////\r
 \r
 #include "StdAfx.h"\r
-#include "ccrystaltextview.h"\r
-#include "ccrystaltextbuffer.h"\r
+#include "crystallineparser.h"\r
 #include "SyntaxColors.h"\r
 #include "string_util.h"\r
 \r
@@ -135,32 +134,12 @@ IsGoNumber (LPCTSTR pszChars, int nLength)
   return true;\r
 }\r
 \r
-#define DEFINE_BLOCK(pos, colorindex)   \\r
-ASSERT((pos) >= 0 && (pos) <= nLength);\\r
-if (pBuf != nullptr)\\r
-  {\\r
-    if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\\r
-        if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\\r
-        pBuf[nActualItems].m_nCharPos = (pos);\\r
-        pBuf[nActualItems].m_nColorIndex = (colorindex);\\r
-        pBuf[nActualItems].m_nBgColorIndex = COLORINDEX_BKGND;\\r
-        nActualItems ++;}\\r
-  }\r
-\r
-#define COOKIE_COMMENT          0x0001\r
-#define COOKIE_EXT_COMMENT      0x0004\r
-#define COOKIE_STRING           0x0008\r
-#define COOKIE_CHAR             0x0010\r
-#define COOKIE_RAWSTRING        0x0020\r
-\r
-DWORD CCrystalTextView::\r
-ParseLineGo (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems)\r
+DWORD\r
+CrystalLineParser::ParseLineGo (DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems)\r
 {\r
-  int nLength = GetLineLength (nLineIndex);\r
   if (nLength == 0)\r
     return dwCookie & (COOKIE_EXT_COMMENT | COOKIE_RAWSTRING);\r
 \r
-  LPCTSTR pszChars = GetLineChars (nLineIndex);\r
   LPCTSTR pszCommentBegin = nullptr;\r
   LPCTSTR pszCommentEnd = nullptr;\r
   bool bRedefineBlock = true;\r
index 381a6a4..825e0e4 100644 (file)
@@ -15,7 +15,7 @@
 ////////////////////////////////////////////////////////////////////////////
 
 #include "StdAfx.h"
-#include "ccrystaltextview.h"
+#include "crystallineparser.h"
 #include "SyntaxColors.h"
 #include "string_util.h"
 
@@ -395,34 +395,12 @@ IsHtmlNumber (LPCTSTR pszChars, int nLength)
   return true;
 }
 
-#define DEFINE_BLOCK(pos, colorindex)   \
-ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != nullptr)\
-  {\
-    if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
-        if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
-        pBuf[nActualItems].m_nCharPos = (pos);\
-        pBuf[nActualItems].m_nColorIndex = (colorindex);\
-        pBuf[nActualItems].m_nBgColorIndex = COLORINDEX_BKGND;\
-        nActualItems ++;}\
-  }
-
-#define COOKIE_COMMENT          0x0001
-#define COOKIE_PREPROCESSOR     0x0002
-#define COOKIE_EXT_COMMENT      0x0004
-#define COOKIE_STRING           0x0008
-#define COOKIE_CHAR             0x0010
-#define COOKIE_USER1            0x0020
-#define COOKIE_EXT_USER1        0x0040
-
-DWORD CCrystalTextView::
-ParseLineHtml (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems)
+DWORD
+CrystalLineParser::ParseLineHtml (DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems)
 {
-  int nLength = GetLineLength (nLineIndex);
   if (nLength == 0)
     return dwCookie & (COOKIE_EXT_COMMENT|COOKIE_EXT_USER1);
 
-  LPCTSTR pszChars = GetLineChars (nLineIndex);
   bool bFirstChar = (dwCookie & ~(COOKIE_EXT_COMMENT|COOKIE_EXT_USER1)) == 0;
   bool bRedefineBlock = true;
   bool bDecIndex = false;
index 8889cfc..43db774 100644 (file)
@@ -16,8 +16,7 @@
 ////////////////////////////////////////////////////////////////////////////
 
 #include "StdAfx.h"
-#include "ccrystaltextview.h"
-#include "ccrystaltextbuffer.h"
+#include "crystallineparser.h"
 #include "SyntaxColors.h"
 #include "string_util.h"
 
@@ -51,34 +50,12 @@ IsIniNumber (LPCTSTR pszChars, int nLength)
   return true;
 }
 
-#define DEFINE_BLOCK(pos, colorindex)   \
-ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != nullptr)\
-  {\
-    if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
-        if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
-        pBuf[nActualItems].m_nCharPos = (pos);\
-        pBuf[nActualItems].m_nColorIndex = (colorindex);\
-        pBuf[nActualItems].m_nBgColorIndex = COLORINDEX_BKGND;\
-        nActualItems ++;}\
-  }
-
-#define COOKIE_COMMENT          0x0001
-#define COOKIE_PREPROCESSOR     0x0002
-#define COOKIE_EXT_COMMENT      0x0004
-#define COOKIE_STRING           0x0008
-#define COOKIE_CHAR             0x0010
-#define COOKIE_SECTION          0x0020
-#define COOKIE_KEY              0x0040
-
-DWORD CCrystalTextView::
-ParseLineIni (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems)
+DWORD
+CrystalLineParser::ParseLineIni (DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems)
 {
-  int nLength = GetLineLength (nLineIndex);
   if (nLength == 0)
     return dwCookie & COOKIE_EXT_COMMENT;
 
-  LPCTSTR pszChars = GetLineChars (nLineIndex);
   bool bFirstChar = (dwCookie & ~COOKIE_EXT_COMMENT) == 0;
   bool bRedefineBlock = true;
   bool bDecIndex = false;
index 4bc74d3..d224269 100644 (file)
@@ -15,8 +15,7 @@
 ////////////////////////////////////////////////////////////////////////////
 
 #include "StdAfx.h"
-#include "ccrystaltextview.h"
-#include "ccrystaltextbuffer.h"
+#include "crystallineparser.h"
 #include "SyntaxColors.h"
 #include "string_util.h"
 
@@ -351,34 +350,12 @@ IsInnoSetupNumber (LPCTSTR pszChars, int nLength)
   return true;
 }
 
-#define DEFINE_BLOCK(pos, colorindex)   \
-ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != nullptr)\
-  {\
-    if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
-        if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
-        pBuf[nActualItems].m_nCharPos = (pos);\
-        pBuf[nActualItems].m_nColorIndex = (colorindex);\
-        pBuf[nActualItems].m_nBgColorIndex = COLORINDEX_BKGND;\
-        nActualItems ++;}\
-  }
-
-#define COOKIE_COMMENT          0x0001
-#define COOKIE_PREPROCESSOR     0x0002
-#define COOKIE_EXT_COMMENT      0x0004
-#define COOKIE_STRING           0x0008
-#define COOKIE_CHAR             0x0010
-#define COOKIE_EXT_COMMENT2     0x0020
-#define COOKIE_SECTION          0x0040
-
-DWORD CCrystalTextView::
-ParseLineInnoSetup (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems)
+DWORD
+CrystalLineParser::ParseLineInnoSetup (DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems)
 {
-  int nLength = GetLineLength (nLineIndex);
   if (nLength == 0)
     return dwCookie & (COOKIE_EXT_COMMENT | COOKIE_EXT_COMMENT2);
 
-  LPCTSTR pszChars = GetLineChars (nLineIndex);
   bool bFirstChar = (dwCookie & ~COOKIE_EXT_COMMENT) == 0;
   bool bRedefineBlock = true;
   bool bDecIndex = false;
@@ -652,7 +629,7 @@ out:
         }
     }
 
-  if (pszChars[nLength - 1] != '\\' || m_pTextBuffer->IsMBSTrail(nLineIndex, nLength - 1))
+  if (pszChars[nLength - 1] != '\\' || IsMBSTrail(pszChars, nLength - 1))
     dwCookie &= (COOKIE_EXT_COMMENT | COOKIE_EXT_COMMENT2);
   return dwCookie;
 }
index c141e53..0105081 100644 (file)
@@ -26,8 +26,7 @@
 ////////////////////////////////////////////////////////////////////////////
 
 #include "StdAfx.h"
-#include "ccrystaltextview.h"
-#include "ccrystaltextbuffer.h"
+#include "crystallineparser.h"
 #include "SyntaxColors.h"
 #include "string_util.h"
 
@@ -456,32 +455,12 @@ IsISNumber (LPCTSTR pszChars, int nLength)
   return true;
 }
 
-#define DEFINE_BLOCK(pos, colorindex)   \
-ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != nullptr)\
-  {\
-    if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
-        if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
-        pBuf[nActualItems].m_nCharPos = (pos);\
-        pBuf[nActualItems].m_nColorIndex = (colorindex);\
-        pBuf[nActualItems].m_nBgColorIndex = COLORINDEX_BKGND;\
-        nActualItems ++;}\
-  }
-
-#define COOKIE_COMMENT          0x0001
-#define COOKIE_PREPROCESSOR     0x0002
-#define COOKIE_EXT_COMMENT      0x0004
-#define COOKIE_STRING           0x0008
-#define COOKIE_CHAR             0x0010
-
-DWORD CCrystalTextView::
-ParseLineIS (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems)
+DWORD
+CrystalLineParser::ParseLineIS (DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems)
 {
-  int nLength = GetLineLength (nLineIndex);
   if (nLength == 0)
     return dwCookie & COOKIE_EXT_COMMENT;
 
-  LPCTSTR pszChars = GetLineChars (nLineIndex);
   bool bFirstChar = (dwCookie & ~COOKIE_EXT_COMMENT) == 0;
   bool bRedefineBlock = true;
   bool bWasCommentStart = false;
@@ -734,7 +713,7 @@ out:
         }
     }
 
-  if (pszChars[nLength - 1] != '\\' || m_pTextBuffer->IsMBSTrail(nLineIndex, nLength - 1))
+  if (pszChars[nLength - 1] != '\\' || IsMBSTrail(pszChars, nLength - 1))
     dwCookie &= COOKIE_EXT_COMMENT;
   return dwCookie;
 }
index a22e569..8048be1 100644 (file)
@@ -15,8 +15,7 @@
 ////////////////////////////////////////////////////////////////////////////
 
 #include "StdAfx.h"
-#include "ccrystaltextview.h"
-#include "ccrystaltextbuffer.h"
+#include "crystallineparser.h"
 #include "SyntaxColors.h"
 #include "string_util.h"
 
@@ -111,32 +110,12 @@ IsJavaNumber (LPCTSTR pszChars, int nLength)
   return true;
 }
 
-#define DEFINE_BLOCK(pos, colorindex)   \
-ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != nullptr)\
-  {\
-    if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
-        if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
-        pBuf[nActualItems].m_nCharPos = (pos);\
-        pBuf[nActualItems].m_nColorIndex = (colorindex);\
-        pBuf[nActualItems].m_nBgColorIndex = COLORINDEX_BKGND;\
-        nActualItems ++;}\
-  }
-
-#define COOKIE_COMMENT          0x0001
-#define COOKIE_PREPROCESSOR     0x0002
-#define COOKIE_EXT_COMMENT      0x0004
-#define COOKIE_STRING           0x0008
-#define COOKIE_CHAR             0x0010
-
-DWORD CCrystalTextView::
-ParseLineJava (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems)
+DWORD
+CrystalLineParser::ParseLineJava (DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems)
 {
-  int nLength = GetLineLength (nLineIndex);
   if (nLength == 0)
     return dwCookie & COOKIE_EXT_COMMENT;
 
-  LPCTSTR pszChars = GetLineChars (nLineIndex);
   bool bFirstChar = (dwCookie & ~COOKIE_EXT_COMMENT) == 0;
   bool bRedefineBlock = true;
   bool bWasCommentStart = false;
@@ -373,7 +352,7 @@ out:
         }
     }
 
-  if (pszChars[nLength - 1] != '\\' || m_pTextBuffer->IsMBSTrail(nLineIndex, nLength - 1))
+  if (pszChars[nLength - 1] != '\\' || IsMBSTrail(pszChars, nLength - 1))
     dwCookie &= COOKIE_EXT_COMMENT;
   return dwCookie;
 }
index 92a08be..6892e9b 100644 (file)
@@ -15,7 +15,7 @@
 ////////////////////////////////////////////////////////////////////////////
 
 #include "StdAfx.h"
-#include "ccrystaltextview.h"
+#include "crystallineparser.h"
 #include "SyntaxColors.h"
 #include "string_util.h"
 
@@ -286,32 +286,12 @@ IsLispNumber (LPCTSTR pszChars, int nLength)
   return true;
 }
 
-#define DEFINE_BLOCK(pos, colorindex)   \
-ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != nullptr)\
-  {\
-    if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
-        if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
-        pBuf[nActualItems].m_nCharPos = (pos);\
-        pBuf[nActualItems].m_nColorIndex = (colorindex);\
-        pBuf[nActualItems].m_nBgColorIndex = COLORINDEX_BKGND;\
-        nActualItems ++;}\
-  }
-
-#define COOKIE_COMMENT          0x0001
-#define COOKIE_PREPROCESSOR     0x0002
-#define COOKIE_EXT_COMMENT      0x0004
-#define COOKIE_STRING           0x0008
-#define COOKIE_CHAR             0x0010
-
-DWORD CCrystalTextView::
-ParseLineLisp (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems)
+DWORD
+CrystalLineParser::ParseLineLisp (DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems)
 {
-  int nLength = GetLineLength (nLineIndex);
   if (nLength == 0)
     return dwCookie & COOKIE_EXT_COMMENT;
 
-  LPCTSTR pszChars = GetLineChars (nLineIndex);
   bool bFirstChar = (dwCookie & ~COOKIE_EXT_COMMENT) == 0;
   bool bRedefineBlock = true;
   bool bWasCommentStart = false;
index 61cddce..ecd642b 100644 (file)
@@ -26,8 +26,7 @@
 ////////////////////////////////////////////////////////////////////////////
 
 #include "StdAfx.h"
-#include "ccrystaltextview.h"
-#include "ccrystaltextbuffer.h"
+#include "crystallineparser.h"
 #include "SyntaxColors.h"
 #include "string_util.h"
 
@@ -461,32 +460,12 @@ IsNsisNumber (LPCTSTR pszChars, int nLength)
   return true;
 }
 
-#define DEFINE_BLOCK(pos, colorindex)   \
-ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != nullptr)\
-  {\
-    if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
-        if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
-        pBuf[nActualItems].m_nCharPos = (pos);\
-        pBuf[nActualItems].m_nColorIndex = (colorindex);\
-        pBuf[nActualItems].m_nBgColorIndex = COLORINDEX_BKGND;\
-        nActualItems ++;}\
-  }
-
-#define COOKIE_COMMENT          0x0001
-#define COOKIE_PREPROCESSOR     0x0002
-#define COOKIE_EXT_COMMENT      0x0004
-#define COOKIE_STRING           0x0008
-#define COOKIE_CHAR             0x0010
-
-DWORD CCrystalTextView::
-ParseLineNsis (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems)
+DWORD
+CrystalLineParser::ParseLineNsis (DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems)
 {
-  int nLength = GetLineLength (nLineIndex);
   if (nLength == 0)
     return dwCookie & COOKIE_EXT_COMMENT;
 
-  LPCTSTR pszChars = GetLineChars (nLineIndex);
   bool bFirstChar = (dwCookie & ~COOKIE_EXT_COMMENT) == 0;
   bool bRedefineBlock = true;
   bool bWasCommentStart = false;
@@ -732,7 +711,7 @@ out:
         }
     }
 
-  if (pszChars[nLength - 1] != '\\' || m_pTextBuffer->IsMBSTrail(nLineIndex, nLength - 1))
+  if (pszChars[nLength - 1] != '\\' || IsMBSTrail(pszChars, nLength - 1))
     dwCookie &= COOKIE_EXT_COMMENT;
   return dwCookie;
 }
index 966a133..e4b32db 100644 (file)
@@ -15,8 +15,7 @@
 ////////////////////////////////////////////////////////////////////////////
 
 #include "StdAfx.h"
-#include "ccrystaltextview.h"
-#include "ccrystaltextbuffer.h"
+#include "crystallineparser.h"
 #include "SyntaxColors.h"
 #include "string_util.h"
 
@@ -139,33 +138,12 @@ IsPascalNumber (LPCTSTR pszChars, int nLength)
   return true;
 }
 
-#define DEFINE_BLOCK(pos, colorindex)   \
-ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != nullptr)\
-  {\
-    if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
-        if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
-        pBuf[nActualItems].m_nCharPos = (pos);\
-        pBuf[nActualItems].m_nColorIndex = (colorindex);\
-        pBuf[nActualItems].m_nBgColorIndex = COLORINDEX_BKGND;\
-        nActualItems ++;}\
-  }
-
-#define COOKIE_COMMENT          0x0001
-#define COOKIE_PREPROCESSOR     0x0002
-#define COOKIE_EXT_COMMENT      0x0004
-#define COOKIE_STRING           0x0008
-#define COOKIE_CHAR             0x0010
-#define COOKIE_EXT_COMMENT2     0x0020
-
-DWORD CCrystalTextView::
-ParseLinePascal (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems)
+DWORD
+CrystalLineParser::ParseLinePascal (DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems)
 {
-  int nLength = GetLineLength (nLineIndex);
   if (nLength == 0)
     return dwCookie & (COOKIE_EXT_COMMENT | COOKIE_EXT_COMMENT2);
 
-  LPCTSTR pszChars = GetLineChars (nLineIndex);
   bool bFirstChar = (dwCookie & ~COOKIE_EXT_COMMENT) == 0;
   bool bRedefineBlock = true;
   bool bDecIndex = false;
@@ -394,7 +372,7 @@ out:
         }
     }
 
-  if (pszChars[nLength - 1] != '\\' || m_pTextBuffer->IsMBSTrail(nLineIndex, nLength - 1))
+  if (pszChars[nLength - 1] != '\\' || IsMBSTrail(pszChars, nLength - 1))
     dwCookie &= (COOKIE_EXT_COMMENT | COOKIE_EXT_COMMENT2);
   return dwCookie;
 }
index dbc5533..4fe4c6d 100644 (file)
@@ -15,8 +15,7 @@
 ////////////////////////////////////////////////////////////////////////////
 
 #include "StdAfx.h"
-#include "ccrystaltextview.h"
-#include "ccrystaltextbuffer.h"
+#include "crystallineparser.h"
 #include "SyntaxColors.h"
 #include "string_util.h"
 
@@ -283,32 +282,12 @@ IsPerlNumber (LPCTSTR pszChars, int nLength)
   return true;
 }
 
-#define DEFINE_BLOCK(pos, colorindex)   \
-ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != nullptr)\
-  {\
-    if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
-        if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
-        pBuf[nActualItems].m_nCharPos = (pos);\
-        pBuf[nActualItems].m_nColorIndex = (colorindex);\
-        pBuf[nActualItems].m_nBgColorIndex = COLORINDEX_BKGND;\
-        nActualItems ++;}\
-  }
-
-#define COOKIE_COMMENT          0x0001
-#define COOKIE_PREPROCESSOR     0x0002
-#define COOKIE_EXT_COMMENT      0x0004
-#define COOKIE_STRING           0x0008
-#define COOKIE_CHAR             0x0010
-
-DWORD CCrystalTextView::
-ParseLinePerl (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems)
+DWORD
+CrystalLineParser::ParseLinePerl (DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems)
 {
-  int nLength = GetLineLength (nLineIndex);
   if (nLength == 0)
     return dwCookie & COOKIE_EXT_COMMENT;
 
-  LPCTSTR pszChars = GetLineChars (nLineIndex);
   bool bFirstChar = (dwCookie & ~COOKIE_EXT_COMMENT) == 0;
   bool bRedefineBlock = true;
   bool bDecIndex = false;
@@ -501,7 +480,7 @@ out:
         }
     }
 
-  if (pszChars[nLength - 1] != '\\' || m_pTextBuffer->IsMBSTrail(nLineIndex, nLength - 1))
+  if (pszChars[nLength - 1] != '\\' || IsMBSTrail(pszChars, nLength - 1))
     dwCookie &= COOKIE_EXT_COMMENT;
   return dwCookie;
 }
index db33dc2..ef753e8 100644 (file)
@@ -15,7 +15,7 @@
 ////////////////////////////////////////////////////////////////////////////
 
 #include "StdAfx.h"
-#include "ccrystaltextview.h"
+#include "crystallineparser.h"
 #include "SyntaxColors.h"
 #include "string_util.h"
 
@@ -481,35 +481,12 @@ IsPhpNumber (LPCTSTR pszChars, int nLength)
   return true;
 }
 
-#define DEFINE_BLOCK(pos, colorindex)   \
-ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != nullptr)\
-  {\
-    if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
-        if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
-        pBuf[nActualItems].m_nCharPos = (pos);\
-        pBuf[nActualItems].m_nColorIndex = (colorindex);\
-        pBuf[nActualItems].m_nBgColorIndex = COLORINDEX_BKGND;\
-        nActualItems ++;}\
-  }
-
-#define COOKIE_COMMENT          0x0001
-#define COOKIE_PREPROCESSOR     0x0002
-#define COOKIE_EXT_COMMENT      0x0004
-#define COOKIE_STRING           0x0008
-#define COOKIE_CHAR             0x0010
-#define COOKIE_USER1            0x0020
-#define COOKIE_USER2            0x0040
-#define COOKIE_EXT_USER1        0x0080
-
-DWORD CCrystalTextView::
-ParseLinePhp (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems)
+DWORD
+CrystalLineParser::ParseLinePhp (DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems)
 {
-  int nLength = GetLineLength (nLineIndex);
   if (nLength == 0)
     return dwCookie & (COOKIE_EXT_COMMENT|COOKIE_EXT_USER1);
 
-  LPCTSTR pszChars = GetLineChars (nLineIndex);
   bool bFirstChar = (dwCookie & ~(COOKIE_EXT_COMMENT|COOKIE_EXT_USER1)) == 0;
   bool bRedefineBlock = true;
   bool bWasCommentStart = false;
diff --git a/Externals/crystaledit/editlib/plain.cpp b/Externals/crystaledit/editlib/plain.cpp
new file mode 100644 (file)
index 0000000..56cf19b
--- /dev/null
@@ -0,0 +1,8 @@
+#include "StdAfx.h"\r
+#include "crystallineparser.h"\r
+\r
+DWORD\r
+CrystalLineParser::ParseLinePlain (DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems)\r
+{\r
+  return 0;\r
+}\r
index 14dada1..c53402a 100644 (file)
@@ -16,8 +16,7 @@
 ////////////////////////////////////////////////////////////////////////////
 
 #include "StdAfx.h"
-#include "ccrystaltextview.h"
-#include "ccrystaltextbuffer.h"
+#include "crystallineparser.h"
 #include "SyntaxColors.h"
 #include "string_util.h"
 
@@ -61,32 +60,12 @@ IsPoNumber (LPCTSTR pszChars, int nLength)
   return true;
 }
 
-#define DEFINE_BLOCK(pos, colorindex)   \
-ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != nullptr)\
-  {\
-    if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
-        if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
-        pBuf[nActualItems].m_nCharPos = (pos);\
-        pBuf[nActualItems].m_nColorIndex = (colorindex);\
-        pBuf[nActualItems].m_nBgColorIndex = COLORINDEX_BKGND;\
-        nActualItems ++;}\
-  }
-
-#define COOKIE_COMMENT          0x0001
-#define COOKIE_PREPROCESSOR     0x0002
-#define COOKIE_EXT_COMMENT      0x0004
-#define COOKIE_STRING           0x0008
-#define COOKIE_CHAR             0x0010
-
-DWORD CCrystalTextView::
-ParseLinePo (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems)
+DWORD
+CrystalLineParser::ParseLinePo (DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems)
 {
-  int nLength = GetLineLength (nLineIndex);
   if (nLength == 0)
     return dwCookie & COOKIE_EXT_COMMENT;
 
-  LPCTSTR pszChars = GetLineChars (nLineIndex);
   bool bFirstChar = (dwCookie & ~COOKIE_EXT_COMMENT) == 0;
   bool bRedefineBlock = true;
   bool bDecIndex = false;
@@ -279,7 +258,7 @@ out:
         }
     }
 
-  if (pszChars[nLength - 1] != '\\' || m_pTextBuffer->IsMBSTrail(nLineIndex, nLength - 1))
+  if (pszChars[nLength - 1] != '\\' || IsMBSTrail(pszChars, nLength - 1))
     dwCookie &= COOKIE_EXT_COMMENT;
   return dwCookie;
 }
index 4b1fe27..310ec3e 100644 (file)
@@ -15,8 +15,7 @@
 ////////////////////////////////////////////////////////////////////////////
 
 #include "StdAfx.h"
-#include "ccrystaltextview.h"
-#include "ccrystaltextbuffer.h"
+#include "crystallineparser.h"
 #include "SyntaxColors.h"
 #include "string_util.h"
 
@@ -368,33 +367,12 @@ IsPowerShellNumber (LPCTSTR pszChars, int nLength)
   return true;
 }
 
-#define DEFINE_BLOCK(pos, colorindex)   \
-ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != nullptr)\
-  {\
-    if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
-        if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
-        pBuf[nActualItems].m_nCharPos = (pos);\
-        pBuf[nActualItems].m_nColorIndex = (colorindex);\
-        pBuf[nActualItems].m_nBgColorIndex = COLORINDEX_BKGND;\
-        nActualItems ++;}\
-  }
-
-#define COOKIE_COMMENT          0x0001
-#define COOKIE_PREPROCESSOR     0x0002
-#define COOKIE_EXT_COMMENT      0x0004
-#define COOKIE_STRING           0x0008
-#define COOKIE_CHAR             0x0010
-#define COOKIE_VARIABLE         0x0020
-
-DWORD CCrystalTextView::
-ParseLinePowerShell (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems)
+DWORD
+CrystalLineParser::ParseLinePowerShell (DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems)
 {
-  int nLength = GetLineLength (nLineIndex);
   if (nLength == 0)
     return dwCookie & COOKIE_EXT_COMMENT;
 
-  LPCTSTR pszChars = GetLineChars (nLineIndex);
   bool bFirstChar = (dwCookie & ~COOKIE_EXT_COMMENT) == 0;
   bool bRedefineBlock = true;
   bool bDecIndex = false;
index b19b5f2..f83fc6d 100644 (file)
@@ -15,8 +15,7 @@
 ////////////////////////////////////////////////////////////////////////////
 
 #include "StdAfx.h"
-#include "ccrystaltextview.h"
-#include "ccrystaltextbuffer.h"
+#include "crystallineparser.h"
 #include "SyntaxColors.h"
 #include "string_util.h"
 
@@ -208,32 +207,12 @@ IsPythonNumber (LPCTSTR pszChars, int nLength)
   return true;
 }
 
-#define DEFINE_BLOCK(pos, colorindex)   \
-ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != nullptr)\
-  {\
-    if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
-        if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
-        pBuf[nActualItems].m_nCharPos = (pos);\
-        pBuf[nActualItems].m_nColorIndex = (colorindex);\
-        pBuf[nActualItems].m_nBgColorIndex = COLORINDEX_BKGND;\
-        nActualItems ++;}\
-  }
-
-#define COOKIE_COMMENT          0x0001
-#define COOKIE_PREPROCESSOR     0x0002
-#define COOKIE_EXT_COMMENT      0x0004
-#define COOKIE_STRING           0x0008
-#define COOKIE_CHAR             0x0010
-
-DWORD CCrystalTextView::
-ParseLinePython (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems)
+DWORD
+CrystalLineParser::ParseLinePython (DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems)
 {
-  int nLength = GetLineLength (nLineIndex);
   if (nLength == 0)
     return dwCookie & COOKIE_EXT_COMMENT;
 
-  LPCTSTR pszChars = GetLineChars (nLineIndex);
   bool bFirstChar = (dwCookie & ~COOKIE_EXT_COMMENT) == 0;
   bool bRedefineBlock = true;
   bool bDecIndex = false;
@@ -442,7 +421,7 @@ out:
         }
     }
 
-  if (pszChars[nLength - 1] != '\\' || m_pTextBuffer->IsMBSTrail(nLineIndex, nLength - 1))
+  if (pszChars[nLength - 1] != '\\' || IsMBSTrail(pszChars, nLength - 1))
     dwCookie &= COOKIE_EXT_COMMENT;
   return dwCookie;
 }
index 4056886..1f31f59 100644 (file)
@@ -15,8 +15,7 @@
 ////////////////////////////////////////////////////////////////////////////
 
 #include "StdAfx.h"
-#include "ccrystaltextview.h"
-#include "ccrystaltextbuffer.h"
+#include "crystallineparser.h"
 #include "SyntaxColors.h"
 #include "string_util.h"
 
@@ -138,32 +137,12 @@ IsRexxNumber (LPCTSTR pszChars, int nLength)
   return true;
 }
 
-#define DEFINE_BLOCK(pos, colorindex)   \
-ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != nullptr)\
-  {\
-    if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
-        if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
-        pBuf[nActualItems].m_nCharPos = (pos);\
-        pBuf[nActualItems].m_nColorIndex = (colorindex);\
-        pBuf[nActualItems].m_nBgColorIndex = COLORINDEX_BKGND;\
-        nActualItems ++;}\
-  }
-
-#define COOKIE_COMMENT          0x0001
-#define COOKIE_PREPROCESSOR     0x0002
-#define COOKIE_EXT_COMMENT      0x0004
-#define COOKIE_STRING           0x0008
-#define COOKIE_CHAR             0x0010
-
-DWORD CCrystalTextView::
-ParseLineRexx (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems)
+DWORD
+CrystalLineParser::ParseLineRexx (DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems)
 {
-  int nLength = GetLineLength (nLineIndex);
   if (nLength == 0)
     return dwCookie & COOKIE_EXT_COMMENT;
 
-  LPCTSTR pszChars = GetLineChars (nLineIndex);
   bool bFirstChar = (dwCookie & ~COOKIE_EXT_COMMENT) == 0;
   bool bRedefineBlock = true;
   bool bWasCommentStart = false;
@@ -387,7 +366,7 @@ out:
         }
     }
 
-  if (pszChars[nLength - 1] != '\\' || m_pTextBuffer->IsMBSTrail(nLineIndex, nLength - 1))
+  if (pszChars[nLength - 1] != '\\' || IsMBSTrail(pszChars, nLength - 1))
     dwCookie &= COOKIE_EXT_COMMENT;
   return dwCookie;
 }
index 1bf7fa4..bbebdda 100644 (file)
@@ -15,8 +15,7 @@
 ////////////////////////////////////////////////////////////////////////////
 
 #include "StdAfx.h"
-#include "ccrystaltextview.h"
-#include "ccrystaltextbuffer.h"
+#include "crystallineparser.h"
 #include "SyntaxColors.h"
 #include "string_util.h"
 
@@ -202,32 +201,12 @@ IsRsrcNumber (LPCTSTR pszChars, int nLength)
   return true;
 }
 
-#define DEFINE_BLOCK(pos, colorindex)   \
-ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != nullptr)\
-  {\
-    if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
-        if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
-        pBuf[nActualItems].m_nCharPos = (pos);\
-        pBuf[nActualItems].m_nColorIndex = (colorindex);\
-        pBuf[nActualItems].m_nBgColorIndex = COLORINDEX_BKGND;\
-        nActualItems ++;}\
-  }
-
-#define COOKIE_COMMENT          0x0001
-#define COOKIE_PREPROCESSOR     0x0002
-#define COOKIE_EXT_COMMENT      0x0004
-#define COOKIE_STRING           0x0008
-#define COOKIE_CHAR             0x0010
-
-DWORD CCrystalTextView::
-ParseLineRsrc (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems)
+DWORD
+CrystalLineParser::ParseLineRsrc (DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems)
 {
-  int nLength = GetLineLength (nLineIndex);
   if (nLength == 0)
     return dwCookie & COOKIE_EXT_COMMENT;
 
-  LPCTSTR pszChars = GetLineChars (nLineIndex);
   bool bFirstChar = (dwCookie & ~COOKIE_EXT_COMMENT) == 0;
   bool bRedefineBlock = true;
   bool bWasCommentStart = false;
@@ -472,7 +451,7 @@ out:
         }
     }
 
-  if (pszChars[nLength - 1] != '\\' || m_pTextBuffer->IsMBSTrail(nLineIndex, nLength - 1))
+  if (pszChars[nLength - 1] != '\\' || IsMBSTrail(pszChars, nLength - 1))
     dwCookie &= COOKIE_EXT_COMMENT;
   return dwCookie;
 }
index ab4ad0b..085a8d1 100644 (file)
@@ -15,8 +15,7 @@
 ////////////////////////////////////////////////////////////////////////////
 
 #include "StdAfx.h"
-#include "ccrystaltextview.h"
-#include "ccrystaltextbuffer.h"
+#include "crystallineparser.h"
 #include "SyntaxColors.h"
 #include "string_util.h"
 
@@ -169,33 +168,12 @@ IsRubyNumber (LPCTSTR pszChars, int nLength)
   return true;
 }
 
-#define DEFINE_BLOCK(pos, colorindex)   \
-ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != nullptr)\
-  {\
-    if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
-        if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
-        pBuf[nActualItems].m_nCharPos = (pos);\
-        pBuf[nActualItems].m_nColorIndex = (colorindex);\
-        pBuf[nActualItems].m_nBgColorIndex = COLORINDEX_BKGND;\
-        nActualItems ++;}\
-  }
-
-#define COOKIE_COMMENT          0x0001
-#define COOKIE_PREPROCESSOR     0x0002
-#define COOKIE_EXT_COMMENT      0x0004
-#define COOKIE_STRING           0x0008
-#define COOKIE_CHAR             0x0010
-#define COOKIE_VARIABLE                        0X0020
-
-DWORD CCrystalTextView::
-ParseLineRuby(DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems)
+DWORD
+CrystalLineParser::ParseLineRuby(DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems)
 {
-  int nLength = GetLineLength (nLineIndex);
   if (nLength == 0)
     return dwCookie & COOKIE_EXT_COMMENT;
 
-  LPCTSTR pszChars = GetLineChars (nLineIndex);
   bool bFirstChar = (dwCookie & ~COOKIE_EXT_COMMENT) == 0;
   bool bRedefineBlock = true;
   bool bDecIndex = false;
@@ -420,7 +398,7 @@ out:
         }
     }
 
-  if (pszChars[nLength - 1] != '\\' || m_pTextBuffer->IsMBSTrail(nLineIndex, nLength - 1))
+  if (pszChars[nLength - 1] != '\\' || IsMBSTrail(pszChars, nLength - 1))
     dwCookie &= COOKIE_EXT_COMMENT;
   
   return dwCookie;
index afa45ef..fb01a17 100644 (file)
@@ -15,8 +15,7 @@
 ////////////////////////////////////////////////////////////////////////////\r
 \r
 #include "StdAfx.h"\r
-#include "ccrystaltextview.h"\r
-#include "ccrystaltextbuffer.h"\r
+#include "crystallineparser.h"\r
 #include "SyntaxColors.h"\r
 #include "string_util.h"\r
 #include <algorithm>\r
@@ -165,35 +164,12 @@ IsRustNumber (LPCTSTR pszChars, int nLength)
   return true;\r
 }\r
 \r
-#define DEFINE_BLOCK(pos, colorindex)   \\r
-ASSERT((pos) >= 0 && (pos) <= nLength);\\r
-if (pBuf != nullptr)\\r
-  {\\r
-    if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\\r
-        if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\\r
-        pBuf[nActualItems].m_nCharPos = (pos);\\r
-        pBuf[nActualItems].m_nColorIndex = (colorindex);\\r
-        pBuf[nActualItems].m_nBgColorIndex = COLORINDEX_BKGND;\\r
-        nActualItems ++;}\\r
-  }\r
-\r
-#define COOKIE_COMMENT          0x0001\r
-#define COOKIE_EXT_COMMENT      0x0004\r
-#define COOKIE_STRING           0x0008\r
-#define COOKIE_RAWSTRING        0x0020\r
-#define COOKIE_GET_EXT_COMMENT_DEPTH(cookie) (((cookie) & 0x0F00) >> 8)\r
-#define COOKIE_SET_EXT_COMMENT_DEPTH(cookie, depth) (cookie) = (((cookie) & 0xF0FF) | ((depth) << 8))\r
-#define COOKIE_GET_RAWSTRING_NUMBER_COUNT(cookie) (((cookie) & 0xF000) >> 12)\r
-#define COOKIE_SET_RAWSTRING_NUMBER_COUNT(cookie, count) (cookie) = (((cookie) & 0x0FFF) | ((count) << 12))\r
-\r
-DWORD CCrystalTextView::\r
-ParseLineRust (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems)\r
+DWORD\r
+CrystalLineParser::ParseLineRust (DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems)\r
 {\r
-  int nLength = GetLineLength (nLineIndex);\r
   if (nLength == 0)\r
-    return dwCookie & (COOKIE_EXT_COMMENT | COOKIE_RAWSTRING | COOKIE_STRING | 0xFF00);\r
+    return dwCookie & (COOKIE_EXT_COMMENT | COOKIE_RAWSTRING | COOKIE_STRING | 0xFF000000);\r
 \r
-  LPCTSTR pszChars = GetLineChars (nLineIndex);\r
   LPCTSTR pszRawStringBegin = nullptr;\r
   LPCTSTR pszCommentBegin = nullptr;\r
   LPCTSTR pszCommentEnd = nullptr;\r
@@ -436,6 +412,6 @@ out:
         }\r
     }\r
 \r
-  dwCookie &= COOKIE_EXT_COMMENT | COOKIE_RAWSTRING | COOKIE_STRING | 0xFF00;\r
+  dwCookie &= COOKIE_EXT_COMMENT | COOKIE_RAWSTRING | COOKIE_STRING | 0xFF000000;\r
   return dwCookie;\r
 }\r
index b2c8cb5..b41defd 100644 (file)
@@ -15,7 +15,7 @@
 ////////////////////////////////////////////////////////////////////////////
 
 #include "StdAfx.h"
-#include "ccrystaltextview.h"
+#include "crystallineparser.h"
 #include "SyntaxColors.h"
 #include "string_util.h"
 
@@ -239,34 +239,12 @@ IsSgmlNumber (LPCTSTR pszChars, int nLength)
   return true;
 }
 
-#define DEFINE_BLOCK(pos, colorindex)   \
-ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != nullptr)\
-  {\
-    if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
-        if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
-        pBuf[nActualItems].m_nCharPos = (pos);\
-        pBuf[nActualItems].m_nColorIndex = (colorindex);\
-        pBuf[nActualItems].m_nBgColorIndex = COLORINDEX_BKGND;\
-        nActualItems ++;}\
-  }
-
-#define COOKIE_COMMENT          0x0001
-#define COOKIE_PREPROCESSOR     0x0002
-#define COOKIE_EXT_COMMENT      0x0004
-#define COOKIE_STRING           0x0008
-#define COOKIE_CHAR             0x0010
-#define COOKIE_USER1            0x0020
-#define COOKIE_EXT_USER1        0x0040
-
-DWORD CCrystalTextView::
-ParseLineSgml (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems)
+DWORD
+CrystalLineParser::ParseLineSgml (DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems)
 {
-  int nLength = GetLineLength (nLineIndex);
   if (nLength == 0)
     return dwCookie & COOKIE_EXT_COMMENT;
 
-  LPCTSTR pszChars = GetLineChars (nLineIndex);
   bool bFirstChar = (dwCookie & ~COOKIE_EXT_COMMENT) == 0;
   bool bRedefineBlock = true;
   bool bDecIndex = false;
index acfe81f..d75e9b5 100644 (file)
@@ -15,8 +15,7 @@
 ////////////////////////////////////////////////////////////////////////////
 
 #include "StdAfx.h"
-#include "ccrystaltextview.h"
-#include "ccrystaltextbuffer.h"
+#include "crystallineparser.h"
 #include "SyntaxColors.h"
 #include "string_util.h"
 
@@ -107,32 +106,12 @@ IsShNumber (LPCTSTR pszChars, int nLength)
   return true;
 }
 
-#define DEFINE_BLOCK(pos, colorindex)   \
-ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != nullptr)\
-  {\
-    if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
-        if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
-        pBuf[nActualItems].m_nCharPos = (pos);\
-        pBuf[nActualItems].m_nColorIndex = (colorindex);\
-        pBuf[nActualItems].m_nBgColorIndex = COLORINDEX_BKGND;\
-        nActualItems ++;}\
-  }
-
-#define COOKIE_COMMENT          0x0001
-#define COOKIE_PREPROCESSOR     0x0002
-#define COOKIE_EXT_COMMENT      0x0004
-#define COOKIE_STRING           0x0008
-#define COOKIE_CHAR             0x0010
-
-DWORD CCrystalTextView::
-ParseLineSh (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems)
+DWORD
+CrystalLineParser::ParseLineSh (DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems)
 {
-  int nLength = GetLineLength (nLineIndex);
   if (nLength == 0)
     return dwCookie & COOKIE_EXT_COMMENT;
 
-  LPCTSTR pszChars = GetLineChars (nLineIndex);
   bool bFirstChar = (dwCookie & ~COOKIE_EXT_COMMENT) == 0;
   bool bRedefineBlock = true;
   bool bDecIndex = false;
@@ -333,7 +312,7 @@ out:
         }
     }
 
-  if (pszChars[nLength - 1] != '\\' || m_pTextBuffer->IsMBSTrail(nLineIndex, nLength - 1))
+  if (pszChars[nLength - 1] != '\\' || IsMBSTrail(pszChars, nLength - 1))
     dwCookie &= COOKIE_EXT_COMMENT;
   return dwCookie;
 }
index 62bd1c2..f8f86af 100644 (file)
@@ -15,7 +15,7 @@
 ////////////////////////////////////////////////////////////////////////////
 
 #include "StdAfx.h"
-#include "ccrystaltextview.h"
+#include "crystallineparser.h"
 #include "SyntaxColors.h"
 #include "string_util.h"
 
@@ -362,32 +362,12 @@ IsSiodNumber (LPCTSTR pszChars, int nLength)
   return true;
 }
 
-#define DEFINE_BLOCK(pos, colorindex)   \
-ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != nullptr)\
-  {\
-    if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
-        if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
-        pBuf[nActualItems].m_nCharPos = (pos);\
-        pBuf[nActualItems].m_nColorIndex = (colorindex);\
-        pBuf[nActualItems].m_nBgColorIndex = COLORINDEX_BKGND;\
-        nActualItems ++;}\
-  }
-
-#define COOKIE_COMMENT          0x0001
-#define COOKIE_PREPROCESSOR     0x0002
-#define COOKIE_EXT_COMMENT      0x0004
-#define COOKIE_STRING           0x0008
-#define COOKIE_CHAR             0x0010
-
-DWORD CCrystalTextView::
-ParseLineSiod (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems)
+DWORD
+CrystalLineParser::ParseLineSiod (DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems)
 {
-  int nLength = GetLineLength (nLineIndex);
   if (nLength == 0)
     return dwCookie & COOKIE_EXT_COMMENT;
 
-  LPCTSTR pszChars = GetLineChars (nLineIndex);
   bool bFirstChar = (dwCookie & ~COOKIE_EXT_COMMENT) == 0;
   bool bRedefineBlock = true;
   bool bWasCommentStart = false;
index b8b2897..80a9d76 100644 (file)
@@ -15,8 +15,7 @@
 ////////////////////////////////////////////////////////////////////////////
 
 #include "StdAfx.h"
-#include "ccrystaltextview.h"
-#include "ccrystaltextbuffer.h"
+#include "crystallineparser.h"
 #include "SyntaxColors.h"
 #include "string_util.h"
 
@@ -98,32 +97,12 @@ IsSqlNumber (LPCTSTR pszChars, int nLength)
   return true;
 }
 
-#define DEFINE_BLOCK(pos, colorindex)   \
-ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != nullptr)\
-  {\
-    if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
-        if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
-        pBuf[nActualItems].m_nCharPos = (pos);\
-        pBuf[nActualItems].m_nColorIndex = (colorindex);\
-        pBuf[nActualItems].m_nBgColorIndex = COLORINDEX_BKGND;\
-        nActualItems ++;}\
-  }
-
-#define COOKIE_COMMENT          0x0001
-#define COOKIE_PREPROCESSOR     0x0002
-#define COOKIE_EXT_COMMENT      0x0004
-#define COOKIE_STRING           0x0008
-#define COOKIE_CHAR             0x0010
-
-DWORD CCrystalTextView::
-ParseLineSql (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems)
+DWORD
+CrystalLineParser::ParseLineSql (DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems)
 {
-  int nLength = GetLineLength (nLineIndex);
   if (nLength == 0)
     return dwCookie & COOKIE_EXT_COMMENT;
 
-  LPCTSTR pszChars = GetLineChars (nLineIndex);
   bool bFirstChar = (dwCookie & ~COOKIE_EXT_COMMENT) == 0;
   bool bRedefineBlock = true;
   bool bWasCommentStart = false;
@@ -347,7 +326,7 @@ out:
         }
     }
 
-  if (pszChars[nLength - 1] != '\\' || m_pTextBuffer->IsMBSTrail(nLineIndex, nLength - 1))
+  if (pszChars[nLength - 1] != '\\' || IsMBSTrail(pszChars, nLength - 1))
     dwCookie &= COOKIE_EXT_COMMENT;
   return dwCookie;
 }
index b829240..5dce1f5 100644 (file)
@@ -79,3 +79,19 @@ bool IsXKeyword(LPCTSTR pszKey, size_t nKeyLen, LPCTSTR pszKeywordList[], size_t
        }
        return false;
 }
+
+bool IsMBSTrail (const TCHAR *pszChars, int nCol)
+{
+#ifdef _UNICODE
+  const wchar_t *current = pszChars + nCol;
+  if (*current >= 0xDC00 && *current <= 0xDFFF) // surrogate pair 
+    return true;
+  return false;
+#else // _UNICODE
+  const unsigned char *string = (const unsigned char *) pszChars;
+  const unsigned char *current = string + nCol;
+  if (_ismbstrail (string, current) < 0)
+    return true;
+  return false;
+#endif // _UNICODE
+}
index 54b6eb7..4994eba 100644 (file)
@@ -17,3 +17,5 @@ int xisalpha(wint_t c);
 int xisalnum(wint_t c);
 int xisspace(wint_t c);
 bool IsXKeyword(LPCTSTR pszKey, size_t nKeyLen, LPCTSTR pszKeywordList[], size_t nKeywordListCount, int (*compare)(LPCTSTR, LPCTSTR, size_t));
+
+bool IsMBSTrail(const TCHAR *pszChars, int nCol);
index 09a0b89..2f1f556 100644 (file)
@@ -15,8 +15,7 @@
 ////////////////////////////////////////////////////////////////////////////
 
 #include "StdAfx.h"
-#include "ccrystaltextview.h"
-#include "ccrystaltextbuffer.h"
+#include "crystallineparser.h"
 #include "SyntaxColors.h"
 #include "string_util.h"
 
@@ -75,32 +74,12 @@ IsTclNumber (LPCTSTR pszChars, int nLength)
   return true;
 }
 
-#define DEFINE_BLOCK(pos, colorindex)   \
-ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != nullptr)\
-  {\
-    if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
-        if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
-        pBuf[nActualItems].m_nCharPos = (pos);\
-        pBuf[nActualItems].m_nColorIndex = (colorindex);\
-        pBuf[nActualItems].m_nBgColorIndex = COLORINDEX_BKGND;\
-        nActualItems ++;}\
-  }
-
-#define COOKIE_COMMENT          0x0001
-#define COOKIE_PREPROCESSOR     0x0002
-#define COOKIE_EXT_COMMENT      0x0004
-#define COOKIE_STRING           0x0008
-#define COOKIE_CHAR             0x0010
-
-DWORD CCrystalTextView::
-ParseLineTcl (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems)
+DWORD
+CrystalLineParser::ParseLineTcl (DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems)
 {
-  int nLength = GetLineLength (nLineIndex);
   if (nLength == 0)
     return dwCookie & COOKIE_EXT_COMMENT;
 
-  LPCTSTR pszChars = GetLineChars (nLineIndex);
   bool bFirstChar = (dwCookie & ~COOKIE_EXT_COMMENT) == 0;
   bool bRedefineBlock = true;
   bool bDecIndex = false;
@@ -293,7 +272,7 @@ out:
         }
     }
 
-  if (pszChars[nLength - 1] != '\\' || m_pTextBuffer->IsMBSTrail(nLineIndex, nLength - 1))
+  if (pszChars[nLength - 1] != '\\' || IsMBSTrail(pszChars, nLength - 1))
     dwCookie &= COOKIE_EXT_COMMENT;
   return dwCookie;
 }
index 79e9e4a..a8c0336 100644 (file)
@@ -15,7 +15,7 @@
 ////////////////////////////////////////////////////////////////////////////
 
 #include "StdAfx.h"
-#include "ccrystaltextview.h"
+#include "crystallineparser.h"
 #include "SyntaxColors.h"
 #include "string_util.h"
 
@@ -882,32 +882,12 @@ IsTexNumber (LPCTSTR pszChars, int nLength)
   return true;
 }
 
-#define DEFINE_BLOCK(pos, colorindex)   \
-ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != nullptr)\
-  {\
-    if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
-        if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
-        pBuf[nActualItems].m_nCharPos = (pos);\
-        pBuf[nActualItems].m_nColorIndex = (colorindex);\
-        pBuf[nActualItems].m_nBgColorIndex = COLORINDEX_BKGND;\
-        nActualItems ++;}\
-  }
-
-#define COOKIE_COMMENT          0x0001
-#define COOKIE_PREPROCESSOR     0x0002
-#define COOKIE_EXT_COMMENT      0x0004
-#define COOKIE_STRING           0x0008
-#define COOKIE_CHAR             0x0010
-
-DWORD CCrystalTextView::
-ParseLineTex (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems)
+DWORD
+CrystalLineParser::ParseLineTex (DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems)
 {
-  int nLength = GetLineLength (nLineIndex);
   if (nLength == 0)
     return dwCookie & COOKIE_EXT_COMMENT;
 
-  LPCTSTR pszChars = GetLineChars (nLineIndex);
   bool bFirstChar = (dwCookie & ~COOKIE_EXT_COMMENT) == 0;
   bool bRedefineBlock = true;
   bool bDecIndex = false;
index 72e7c92..1c9d5e6 100644 (file)
@@ -331,32 +331,12 @@ IsVerilogNumber (LPCTSTR pszChars, int nLength)
   return true;
 }
 
-#define DEFINE_BLOCK(pos, colorindex)   \
-ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != nullptr)\
-  {\
-    if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
-        if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
-        pBuf[nActualItems].m_nCharPos = (pos);\
-        pBuf[nActualItems].m_nColorIndex = (colorindex);\
-        pBuf[nActualItems].m_nBgColorIndex = COLORINDEX_BKGND;\
-        nActualItems ++;}\
-  }
-
-#define COOKIE_COMMENT          0x0001
-#define COOKIE_PREPROCESSOR     0x0002
-#define COOKIE_EXT_COMMENT      0x0004
-#define COOKIE_STRING           0x0008
-#define COOKIE_CHAR             0x0010
-
-DWORD CCrystalTextView::
-ParseLineVerilog (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems)
+DWORD
+CrystalLineParser::ParseLineVerilog (DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems)
 {
-  int nLength = GetLineLength (nLineIndex);
   if (nLength == 0)
     return dwCookie & COOKIE_EXT_COMMENT;
 
-  LPCTSTR pszChars = GetLineChars (nLineIndex);
   bool bFirstChar = (dwCookie & ~COOKIE_EXT_COMMENT) == 0;
   bool bRedefineBlock = true;
   bool bWasCommentStart = false;
index 8ec28e2..83dbef4 100644 (file)
@@ -15,7 +15,7 @@
 ////////////////////////////////////////////////////////////////////////////
 
 #include "StdAfx.h"
-#include "ccrystaltextview.h"
+#include "crystallineparser.h"
 #include "SyntaxColors.h"
 #include "string_util.h"
 
@@ -336,32 +336,12 @@ IsVhdlChar (LPCTSTR pszChars, int nLength)
   return false;
 }
 
-#define DEFINE_BLOCK(pos, colorindex)   \
-ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != nullptr)\
-  {\
-    if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
-        if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
-        pBuf[nActualItems].m_nCharPos = (pos);\
-        pBuf[nActualItems].m_nColorIndex = (colorindex);\
-        pBuf[nActualItems].m_nBgColorIndex = COLORINDEX_BKGND;\
-        nActualItems ++;}\
-  }
-
-#define COOKIE_COMMENT          0x0001
-#define COOKIE_PREPROCESSOR     0x0002
-#define COOKIE_EXT_COMMENT      0x0004
-#define COOKIE_STRING           0x0008
-#define COOKIE_CHAR             0x0010
-
-DWORD CCrystalTextView::
-ParseLineVhdl (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems)
+DWORD
+CrystalLineParser::ParseLineVhdl (DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems)
 {
-  int nLength = GetLineLength (nLineIndex);
   if (nLength == 0)
     return dwCookie & COOKIE_EXT_COMMENT;
 
-  LPCTSTR pszChars = GetLineChars (nLineIndex);
   bool bRedefineBlock = true;
   bool bDecIndex = false;
   bool bNum = false;
index dae9aa4..8367fbf 100644 (file)
@@ -15,7 +15,7 @@
 ////////////////////////////////////////////////////////////////////////////
 
 #include "StdAfx.h"
-#include "ccrystaltextview.h"
+#include "crystallineparser.h"
 #include "SyntaxColors.h"
 #include "string_util.h"
 
@@ -208,34 +208,12 @@ IsXmlNumber (LPCTSTR pszChars, int nLength)
   return true;
 }
 
-#define DEFINE_BLOCK(pos, colorindex)   \
-ASSERT((pos) >= 0 && (pos) <= nLength);\
-if (pBuf != nullptr)\
-  {\
-    if (nActualItems == 0 || pBuf[nActualItems - 1].m_nCharPos <= (pos)){\
-        if (nActualItems > 0 && pBuf[nActualItems - 1].m_nCharPos == (pos)) nActualItems--;\
-        pBuf[nActualItems].m_nCharPos = (pos);\
-        pBuf[nActualItems].m_nColorIndex = (colorindex);\
-        pBuf[nActualItems].m_nBgColorIndex = COLORINDEX_BKGND;\
-        nActualItems ++;}\
-  }
-
-#define COOKIE_COMMENT          0x0001
-#define COOKIE_PREPROCESSOR     0x0002
-#define COOKIE_EXT_COMMENT      0x0004
-#define COOKIE_STRING           0x0008
-#define COOKIE_CHAR             0x0010
-#define COOKIE_USER1            0x0020
-#define COOKIE_EXT_USER1        0x0040
-
-DWORD CCrystalTextView::
-ParseLineXml (DWORD dwCookie, int nLineIndex, TEXTBLOCK * pBuf, int &nActualItems)
+DWORD
+CrystalLineParser::ParseLineXml (DWORD dwCookie, const TCHAR *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems)
 {
-  int nLength = GetLineLength (nLineIndex);
   if (nLength == 0)
     return dwCookie & COOKIE_EXT_COMMENT;
 
-  LPCTSTR pszChars = GetLineChars (nLineIndex);
   bool bFirstChar = (dwCookie & ~COOKIE_EXT_COMMENT) == 0;
   bool bRedefineBlock = true;
   bool bDecIndex = false;
index 85f55a9..ffff1e1 100644 (file)
@@ -145,12 +145,11 @@ int DirScan_GetItems(const PathContext &paths, const String subdir[],
        String sDir[3];
        String subprefix[3];
 
-       int nIndex;
        std::copy(paths.begin(), paths.end(), sDir);
 
        if (!subdir[0].empty())
        {
-               for (nIndex = 0; nIndex < paths.GetSize(); nIndex++)
+               for (int nIndex = 0; nIndex < paths.GetSize(); nIndex++)
                {
                        sDir[nIndex] = paths::ConcatPath(sDir[nIndex], subdir[nIndex]);
                        subprefix[nIndex] = subdir[nIndex] + backslash;
@@ -158,7 +157,7 @@ int DirScan_GetItems(const PathContext &paths, const String subdir[],
        }
 
        DirItemArray dirs[3], aFiles[3];
-       for (nIndex = 0; nIndex < nDirs; nIndex++)
+       for (int nIndex = 0; nIndex < nDirs; nIndex++)
                LoadAndSortFiles(sDir[nIndex], &dirs[nIndex], &aFiles[nIndex], casesensitive);
 
        // Allow user to abort scanning
@@ -169,10 +168,13 @@ int DirScan_GetItems(const PathContext &paths, const String subdir[],
        // i points to current directory in left list (leftDirs)
        // j points to current directory in right list (rightDirs)
 
-       for (nIndex = 0; nIndex < nDirs; nIndex++)
-               if (dirs[nIndex].size() != 0 || aFiles[nIndex].size() != 0) break;
-       if (nIndex == nDirs)
-               return 0;
+       {
+               int nIndex;
+               for (nIndex = 0; nIndex < nDirs; nIndex++)
+                       if (dirs[nIndex].size() != 0 || aFiles[nIndex].size() != 0) break;
+               if (nIndex == nDirs)
+                       return 0;
+       }
 
        DirItemArray::size_type i=0, j=0, k=0;
        while (true)
@@ -441,6 +443,25 @@ int DirScan_GetItems(const PathContext &paths, const String subdir[],
                }
                break;
        }
+
+       if (parent != nullptr)
+       {
+               for (int nIndex = 0; nIndex < nDirs; ++nIndex)
+                       if (parent->diffcode.exists(nIndex) && parent->diffFileInfo[nIndex].size == DirItem::FILE_SIZE_NONE)
+                               parent->diffFileInfo[nIndex].size = 0;
+       
+               DIFFITEM *dic = parent->GetFirstChild();
+               while (dic)
+               {
+                       for (int nIndex = 0; nIndex < nDirs; ++nIndex)
+                       {
+                               if (dic->diffFileInfo[nIndex].size != DirItem::FILE_SIZE_NONE)
+                                       parent->diffFileInfo[nIndex].size += dic->diffFileInfo[nIndex].size;
+                       }
+                       dic = dic->GetFwdSiblingLink();
+               }
+       }
+
        return 1;
 }
 
@@ -682,7 +703,7 @@ int DirScan_UpdateMarkedItems(DiffFuncStruct *myStruct, DIFFITEM *parentdiffpos)
        CDiffContext *pCtxt = myStruct->context;
        DIFFITEM *pos = pCtxt->GetFirstChildDiffPosition(parentdiffpos);
        int ncount = 0;
-       
+
        while (pos != nullptr)
        {
                if (pCtxt->ShouldAbort())
@@ -704,6 +725,9 @@ int DirScan_UpdateMarkedItems(DiffFuncStruct *myStruct, DIFFITEM *parentdiffpos)
                }
                if (di.diffcode.isDirectory() && pCtxt->m_bRecursive)
                {
+                       for (int i = 0; i < pCtxt->GetCompareDirs(); ++i)
+                               if (di.diffcode.exists(i))
+                                       di.diffFileInfo[i].size = 0;
                        if (di.diffcode.isScanNeeded() && !di.diffcode.isResultFiltered())
                        {
                                di.RemoveChildren();
@@ -724,6 +748,12 @@ int DirScan_UpdateMarkedItems(DiffFuncStruct *myStruct, DIFFITEM *parentdiffpos)
                                ncount += DirScan_UpdateMarkedItems(myStruct, curpos);
                        }
                }
+               if (parentdiffpos != nullptr && pCtxt->m_bRecursive)
+               {
+                       for (int nIndex = 0; nIndex < pCtxt->GetCompareDirs(); ++nIndex)
+                               if (curpos->diffFileInfo[nIndex].size != DirItem::FILE_SIZE_NONE)
+                                       parentdiffpos->diffFileInfo[nIndex].size += curpos->diffFileInfo[nIndex].size;
+               }
        }
        return ncount;
 }
index 01d71c7..afece4d 100644 (file)
     <ClCompile Include="..\Externals\crystaledit\editlib\pascal.cpp" />\r
     <ClCompile Include="..\Externals\crystaledit\editlib\perl.cpp" />\r
     <ClCompile Include="..\Externals\crystaledit\editlib\php.cpp" />\r
+    <ClCompile Include="..\Externals\crystaledit\editlib\plain.cpp" />\r
     <ClCompile Include="..\Externals\crystaledit\editlib\po.cpp" />\r
     <ClCompile Include="..\Externals\crystaledit\editlib\powershell.cpp" />\r
     <ClCompile Include="..\Externals\crystaledit\editlib\python.cpp" />\r
     <ClInclude Include="..\Externals\crystaledit\editlib\fpattern.h" />\r
     <ClInclude Include="..\Externals\crystaledit\editlib\gotodlg.h" />\r
     <ClInclude Include="..\Externals\crystaledit\editlib\LineInfo.h" />\r
+    <ClInclude Include="..\Externals\crystaledit\editlib\crystallineparser.h" />\r
     <ClInclude Include="..\Externals\crystaledit\editlib\memcombo.h" />\r
     <ClInclude Include="..\Externals\crystaledit\editlib\registry.h" />\r
     <ClInclude Include="..\Externals\crystaledit\editlib\statbar.h" />\r
index e8aa02d..36496d8 100644 (file)
     <ClCompile Include="OptionsPanel.cpp">\r
       <Filter>MFCGui\Source Files</Filter>\r
     </ClCompile>\r
+    <ClCompile Include="..\Externals\crystaledit\editlib\plain.cpp">\r
+      <Filter>EditLib\parsers</Filter>\r
+    </ClCompile>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <ClInclude Include="charsets.h">\r
     <ClInclude Include="pch.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
+    <ClInclude Include="..\Externals\crystaledit\editlib\crystallineparser.h">\r
+      <Filter>EditLib\parsers</Filter>\r
+    </ClInclude>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <None Include="res\binarydiff.ico">\r
index 717fbfa..811dd91 100644 (file)
     <ClCompile Include="..\Externals\crystaledit\editlib\pascal.cpp" />\r
     <ClCompile Include="..\Externals\crystaledit\editlib\perl.cpp" />\r
     <ClCompile Include="..\Externals\crystaledit\editlib\php.cpp" />\r
+    <ClCompile Include="..\Externals\crystaledit\editlib\plain.cpp" />\r
     <ClCompile Include="..\Externals\crystaledit\editlib\po.cpp" />\r
     <ClCompile Include="..\Externals\crystaledit\editlib\powershell.cpp" />\r
     <ClCompile Include="..\Externals\crystaledit\editlib\python.cpp" />\r
     <ClInclude Include="..\Externals\crystaledit\editlib\fpattern.h" />\r
     <ClInclude Include="..\Externals\crystaledit\editlib\gotodlg.h" />\r
     <ClInclude Include="..\Externals\crystaledit\editlib\LineInfo.h" />\r
+    <ClInclude Include="..\Externals\crystaledit\editlib\crystallineparser.h" />\r
     <ClInclude Include="..\Externals\crystaledit\editlib\memcombo.h" />\r
     <ClInclude Include="..\Externals\crystaledit\editlib\registry.h" />\r
     <ClInclude Include="..\Externals\crystaledit\editlib\statbar.h" />\r
index e8aa02d..36496d8 100644 (file)
     <ClCompile Include="OptionsPanel.cpp">\r
       <Filter>MFCGui\Source Files</Filter>\r
     </ClCompile>\r
+    <ClCompile Include="..\Externals\crystaledit\editlib\plain.cpp">\r
+      <Filter>EditLib\parsers</Filter>\r
+    </ClCompile>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <ClInclude Include="charsets.h">\r
     <ClInclude Include="pch.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
+    <ClInclude Include="..\Externals\crystaledit\editlib\crystallineparser.h">\r
+      <Filter>EditLib\parsers</Filter>\r
+    </ClInclude>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <None Include="res\binarydiff.ico">\r
index 4abf5bb..fbdb6ae 100644 (file)
     <ClCompile Include="..\Externals\crystaledit\editlib\pascal.cpp" />\r
     <ClCompile Include="..\Externals\crystaledit\editlib\perl.cpp" />\r
     <ClCompile Include="..\Externals\crystaledit\editlib\php.cpp" />\r
+    <ClCompile Include="..\Externals\crystaledit\editlib\plain.cpp" />\r
     <ClCompile Include="..\Externals\crystaledit\editlib\po.cpp" />\r
     <ClCompile Include="..\Externals\crystaledit\editlib\powershell.cpp" />\r
     <ClCompile Include="..\Externals\crystaledit\editlib\python.cpp" />\r
     <ClInclude Include="..\Externals\crystaledit\editlib\fpattern.h" />\r
     <ClInclude Include="..\Externals\crystaledit\editlib\gotodlg.h" />\r
     <ClInclude Include="..\Externals\crystaledit\editlib\LineInfo.h" />\r
+    <ClInclude Include="..\Externals\crystaledit\editlib\crystallineparser.h" />\r
     <ClInclude Include="..\Externals\crystaledit\editlib\memcombo.h" />\r
     <ClInclude Include="..\Externals\crystaledit\editlib\registry.h" />\r
     <ClInclude Include="..\Externals\crystaledit\editlib\statbar.h" />\r
index e8aa02d..36496d8 100644 (file)
     <ClCompile Include="OptionsPanel.cpp">\r
       <Filter>MFCGui\Source Files</Filter>\r
     </ClCompile>\r
+    <ClCompile Include="..\Externals\crystaledit\editlib\plain.cpp">\r
+      <Filter>EditLib\parsers</Filter>\r
+    </ClCompile>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <ClInclude Include="charsets.h">\r
     <ClInclude Include="pch.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
+    <ClInclude Include="..\Externals\crystaledit\editlib\crystallineparser.h">\r
+      <Filter>EditLib\parsers</Filter>\r
+    </ClInclude>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <None Include="res\binarydiff.ico">\r
index c653705..d1b8124 100644 (file)
@@ -50,6 +50,7 @@
 #endif
 
 using std::vector;
+using CrystalLineParser::TEXTBLOCK;
 
 /** @brief Timer ID for delayed rescan. */
 const UINT IDT_RESCAN = 2;
@@ -471,7 +472,7 @@ void CMergeEditView::OnActivateView(BOOL bActivate, CView* pActivateView, CView*
        pDoc->UpdateHeaderActivity(m_nThisPane, !!bActivate);
 }
 
-std::vector<CCrystalTextView::TEXTBLOCK> CMergeEditView::GetAdditionalTextBlocks (int nLineIndex)
+std::vector<TEXTBLOCK> CMergeEditView::GetAdditionalTextBlocks (int nLineIndex)
 {
        static const std::vector<TEXTBLOCK> emptyBlocks;
        if (m_bDetailView)
index ea3bf03..1d6f7f6 100644 (file)
@@ -136,7 +136,7 @@ public:
        void SelectArea(const CPoint & ptStart, const CPoint & ptEnd) { SetSelection(ptStart, ptEnd); } // make public
        using CGhostTextView::GetSelection;
        virtual void UpdateSiblingScrollPos (bool bHorz) override;
-       virtual std::vector<TEXTBLOCK> GetAdditionalTextBlocks (int nLineIndex) override;
+       virtual std::vector<CrystalLineParser::TEXTBLOCK> GetAdditionalTextBlocks (int nLineIndex) override;
        virtual COLORREF GetColor(int nColorIndex) override;
        virtual void GetLineColors (int nLineIndex, COLORREF & crBkgnd,
                        COLORREF & crText, bool & bDrawWhitespace) override;