summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2011-11-27 22:37:19 -0600
committerSlávek Banko <[email protected]>2012-07-29 19:24:38 +0200
commit2016ba9b1ccbef2178c87f7694ccbcd00b492a67 (patch)
treecda37d25ad87fa0a6280cca1d28b3cd534a31633 /src
parentd145ebef561899ba37d855517e23e0f25932b384 (diff)
downloadabakus-2016ba9b1ccbef2178c87f7694ccbcd00b492a67.tar.gz
abakus-2016ba9b1ccbef2178c87f7694ccbcd00b492a67.zip
Add bison support
(cherry picked from commit a805660cba37d573bd07615cbdb36d3bba11ecc1)
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt3
-rw-r--r--src/editor.cpp5
2 files changed, 8 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 40f79e4..4420ffb 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -21,6 +21,7 @@ link_directories(
${TQT_LIBRARY_DIRS}
)
+include( ${CMAKE_SOURCE_DIR}/BisonMacros.cmake )
##### other data ################################
@@ -29,6 +30,8 @@ install( FILES abakusui.rc DESTINATION ${DATA_INSTALL_DIR} )
##### abakus (executable) #######################
+GENERATE_BISON_FLEX_SOURCES("lexer.ll", "", "parser.yy", "-d")
+
if( HAVE_MPFR )
set( MPFR_SOURCES "hmath.cpp number.c" )
set( MPFR_LIBRARIES "mpfr gmp" )
diff --git a/src/editor.cpp b/src/editor.cpp
index f4a4276..470198b 100644
--- a/src/editor.cpp
+++ b/src/editor.cpp
@@ -184,7 +184,12 @@ int EditorHighlighter::highlightParagraph ( const TQString & text, int )
case Token::Identifier:
{
color = editor->highlightColor( Editor::Variable );
+#ifndef QT_NO_STL
if( binary_search( fnames.constBegin(), fnames.constEnd(), text) ) {
+#else // QT_NO_STL
+ #warning "Not using STL libraries; performance may be degraded..."
+ if( fnames.find( text) != fnames.end()) {
+#endif // QT_NO_STL
color = editor->highlightColor( Editor::FunctionName );
}
}