Permalink
Browse files

Fix for Pascal, TCL and Fortran lexers

  • Loading branch information...
1 parent 7d0c4b8 commit 1f30102ecae786ef8fc4aca48c419dc3e491bcac mezomish committed Mar 24, 2011
Showing with 33 additions and 137 deletions.
  1. +5 −4 cmake/SomeLexers.cmake
  2. +7 −0 pack.bat
  3. +0 −123 src/app/qsci/settings/FileTypeSettings.cpp
  4. +21 −10 src/lib/FileTypeSettings.cpp
View
9 cmake/SomeLexers.cmake
@@ -1,29 +1,30 @@
# find TCL lexer
-find_path ( QSCI_TCL_LEXER qscilexertcl.h ${LIBQSCINTILLA2_INCLUDE_DIR} )
+
+find_path ( QSCI_TCL_LEXER qscilexertcl.h ${QSCINTILLA_INCLUDE_DIR} )
if ( QSCI_TCL_LEXER )
ADD_DEFINITIONS (
-DJUFF_TCL_LEXER
)
endif ( QSCI_TCL_LEXER )
# find Pascal lexer
-find_path ( QSCI_PASCAL_LEXER qscilexerpascal.h ${LIBQSCINTILLA2_INCLUDE_DIR} )
+find_path ( QSCI_PASCAL_LEXER qscilexerpascal.h ${QSCINTILLA_INCLUDE_DIR} )
if ( QSCI_PASCAL_LEXER )
ADD_DEFINITIONS (
-DJUFF_PASCAL_LEXER
)
endif ( QSCI_PASCAL_LEXER )
# find Fortran lexer
-find_path ( QSCI_FORTRAN_LEXER qscilexerfortran.h ${LIBQSCINTILLA2_INCLUDE_DIR} )
+find_path ( QSCI_FORTRAN_LEXER qscilexerfortran.h ${QSCINTILLA_INCLUDE_DIR} )
if ( QSCI_FORTRAN_LEXER )
ADD_DEFINITIONS (
-DJUFF_FORTRAN_LEXER
)
endif ( QSCI_FORTRAN_LEXER )
# find CSS3Property
-find_path ( QSCI_CSS_LEXER qscilexercss.h ${LIBQSCINTILLA2_INCLUDE_DIR} )
+find_path ( QSCI_CSS_LEXER qscilexercss.h ${QSCINTILLA_INCLUDE_DIR} )
if ( QSCI_CSS_LEXER )
EXECUTE_PROCESS (
COMMAND grep CSS3Property ${QSCI_CSS_LEXER}/qscilexercss.h
View
7 pack.bat
@@ -20,6 +20,7 @@ if "%1" == "" GOTO No_Version
echo Copying program binaries...
copy "build\juffed.exe" "%1"
copy "build\libjuff.dll" "%1"
+ copy "build\libjuffed-engine-*.dll" "%1"
REM localizations, apis, hlschemes
echo.
@@ -29,6 +30,12 @@ if "%1" == "" GOTO No_Version
copy "apis\*.api" "%1\apis"
copy "hlschemes\*.xml" "%1\hlschemes"
+ REM plugins
+ echo.
+ echo ----------------------------------
+ echo Copying Plugins...
+ copy "build\plugins\*.dll" "%1\plugins\"
+
REM Misc files
echo.
echo ----------------------------------
View
123 src/app/qsci/settings/FileTypeSettings.cpp
@@ -1,123 +0,0 @@
-/*
-JuffEd - An advanced text editor
-Copyright 2007-2010 Mikhail Murzin
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-version 2 as published by the Free Software Foundation.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#include "FileTypeSettings.h"
-
-
-QStringList FileTypeSettings::getTypeList() {
- if ( Settings::valueExists("filetypes", "types") )
- return Settings::value("filetypes", "types").toStringList();
- else
- return QStringList();
-}
-
-QStringList FileTypeSettings::getFileNamePatterns(const QString& type) {
- if ( Settings::valueExists("filetypes-filenames", type) ) {
- return Settings::value("filetypes-filenames", type).toStringList();
- }
- else {
- QStringList list;
- if ( type == "Bash")
- list << "*.sh" << "*.run";
- else if ( type == "Batch")
- list << "*.bat";
- else if ( type == "C++")
- list << "*.h" << "*.hpp" << "*.hxx" << "*.h++" << "*.c" << "*.cc" << "*.cpp" << "*.cxx" << "*.c++";
- else if ( type == "C#")
- list << "*.cs";
- else if ( type == "CMake")
- list << "CMakeLists.txt" << "*.cmake";
- else if ( type == "CSS")
- list << "*.css";
- else if ( type == "D")
- list << "*.d" << "*.di";
- else if ( type == "Diff")
- list << "*.diff" << "*.patch";
- else if ( type == "HTML")
- list << "*.htm*" << "*.[xd]htm*";
- else if ( type == "IDL")
- list << "*.idl";
- else if ( type == "Java")
- list << "*.java";
- else if ( type == "JavaScript")
- list << "*.js";
- else if ( type == "Lua")
- list << "*.lua" << "*.tasklua";
- else if ( type == "Makefile")
- list << "*Makefile*";
- else if ( type == "Perl")
- list << "*.p[lm]";
- else if ( type == "Python")
- list << "*.py";
- else if ( type == "PHP")
- list << "*.php*";
- else if ( type == "Ruby")
- list << "*.rb";
- else if ( type == "SQL")
- list << "*.sql";
- else if ( type == "TeX")
- list << "*.tex";
- else if ( type == "XML")
- list << "*.xml";
- else if ( type == "Fortran")
- list << "*.f" << "*.f77" << "*.f90";
-
- return list;
- }
-}
-
-QStringList FileTypeSettings::getFirstLinePatterns(const QString& type) {
- if ( Settings::valueExists("filetypes-firstlines", type) ) {
- return Settings::value("filetypes-firstlines", type).toStringList();
- }
- else {
- QStringList list;
-
- if ( type == "Bash")
- list << "*bash*" << "*/sh*";
- else if ( type == "Diff")
- list << "Index: *";
- else if ( type == "HTML")
- list << "<!doctype html*" << "<html*";
- else if ( type == "Perl")
- list << "*perl*";
- else if ( type == "Python")
- list << "*python*";
- else if ( type == "PHP")
- list << "<?php*" << "<? *" << "<?";
- else if ( type == "TeX")
- list << "\\documentclass";
- else if ( type == "XML")
- list << "<!doctype*" << "<?xml*";
-
- return list;
- }
-}
-
-void FileTypeSettings::setTypeList(const QStringList& list) {
- Settings::setValue("filetypes", "types", list);
-}
-
-void FileTypeSettings::setFileNamePatterns(const QString& type, const QStringList& list) {
- Settings::setValue("filetypes-filenames", type, list);
-}
-
-void FileTypeSettings::setFirstLinePatterns(const QString& type, const QStringList& list) {
- Settings::setValue("filetypes-firstlines", type, list);
-}
-
View
31 src/lib/FileTypeSettings.cpp
@@ -20,7 +20,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
QStringList FileTypeSettings::getTypeList() {
- return Settings::instance()->value("filetypes", "types").toStringList();
+ if ( Settings::instance()->valueExists("filetypes", "types") )
+ return Settings::instance()->value("filetypes", "types").toStringList();
+ else
+ return QStringList();
}
QStringList FileTypeSettings::getFileNamePatterns(const QString& type) {
@@ -59,6 +62,9 @@ QStringList FileTypeSettings::getFileNamePatterns(const QString& type) {
else if ( type == "Diff") {
list << "*.diff" << "*.patch";
}
+ else if ( type == "Fortran") {
+ list << "*.f" << "*.f77" << "*.f90";
+ }
else if ( type == "Haskell") {
list << "*.hs" << "*.lhs";
}
@@ -95,6 +101,9 @@ QStringList FileTypeSettings::getFileNamePatterns(const QString& type) {
else if ( type == "NXC") {
list << "*.nxc";
}
+ else if ( type == "Pascal") {
+ list << "*.p{1,2}" << "*.pa[s345]";
+ }
else if ( type == "Perl") {
list << "*.p[lm]";
}
@@ -104,6 +113,12 @@ QStringList FileTypeSettings::getFileNamePatterns(const QString& type) {
else if ( type == "PHP") {
list << "*.php*";
}
+ else if ( type == "Qore") {
+ list << "*.q" << "*.qc" << "*.ql";
+ }
+ else if ( type == "Qorus") {
+ list << "*.qfd" << "*.qwf" << "*.qsd" << "*.qclass";
+ }
else if ( type == "Ruby") {
list << "*.rb";
}
@@ -113,18 +128,12 @@ QStringList FileTypeSettings::getFileNamePatterns(const QString& type) {
else if ( type == "TeX") {
list << "*.tex";
}
+ else if ( type == "TCL") {
+ list << "*.tcl";
+ }
else if ( type == "XML") {
list << "*.xml";
}
- else if ( type == "Fortran") {
- list << "*.f" << "*.f77" << "*.f90";
- }
- else if ( type == "Qore") {
- list << "*.q" << "*.qc" << "*.ql";
- }
- else if ( type == "Qorus") {
- list << "*.qfd" << "*.qwf" << "*.qsd" << "*.qclass";
- }
return list;
}
@@ -143,6 +152,8 @@ QStringList FileTypeSettings::getFirstLinePatterns(const QString& type) {
list << "Index: *";
else if ( type == "HTML")
list << "<!doctype html*" << "<html*";
+ else if ( type == "Pascal")
+ list << "program *" << "unit *";
else if ( type == "Perl")
list << "*perl*";
else if ( type == "Python")

0 comments on commit 1f30102

Please sign in to comment.