Commit ed88512d authored by Victor Yacovlev's avatar Victor Yacovlev

Cleanup of legacy files + merge common changes from pascal branch

parent f584785c

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.
......@@ -7,6 +7,9 @@ if(APPLE)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath,'../Plugins'")
endif(APPLE)
find_package(PythonLibs 3.2)
find_package(Llvm)
if(EXISTS "${CMAKE_SOURCE_DIR}/version_info.cmake")
message(STATUS "Found explicit version info")
include(${CMAKE_SOURCE_DIR}/version_info.cmake)
......@@ -73,22 +76,36 @@ if(MSVC_IDE)
endif (MSVC_IDE)
if(NOT APPLE)
# Various GUI configurations
add_subdirectory(kumir2-classic)
add_subdirectory(kumir2-highgrade)
add_subdirectory(kumir2-ide)
add_subdirectory(kumir2-teacher)
#add_subdirectory(kumir2-python)
# Check if Python present in this git branch and Python3 libraries found
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/kumir2-python")
if(PYTHONLIBS_FOUND)
add_subdirectory(kumir2-python)
else()
message(WARNING "No Python 3.x libs found, building of Python language support disabled")
endif()
endif() # kumir2-python exists
# Check if Pascal present in this git branch
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/kumir2-pascal")
add_subdirectory(kumir2-pascal)
endif() # kumir2-pascal exists
endif(NOT APPLE)
if(APPLE)
# Apple platform has exact one GUI configuration
add_subdirectory(kumir2-macx)
endif(APPLE)
#add_subdirectory(kumir2-cc)
add_subdirectory(kumir2-bc)
add_subdirectory(kumir2-xrun)
find_package(Llvm)
# kumir2-llvmc is optional in case if LLVM libraries present
if(Llvm_FOUND)
add_subdirectory(kumir2-llvmc)
else()
......
find_package(Llvm)
find_package(PythonLibs 3.2)
# Mainstream plugins to be always build
add_subdirectory(kumiranalizer)
add_subdirectory(kumircodegenerator)
#add_subdirectory(kumirnativegenerator)
add_subdirectory(kumircoderun)
add_subdirectory(kumircompilertool)
add_subdirectory(browser)
add_subdirectory(editor)
add_subdirectory(coregui)
add_subdirectory(coursemanager)
# add_subdirectory(pascalanalizer)
find_package(PythonLibs 3.2)
if(PYTHONLIBS_FOUND)
#add_subdirectory(python3language)
else()
message(WARNING "No Python 3.x libs found, building of Python language support disabled")
endif()
find_package(Llvm)
if(Llvm_FOUND)
add_subdirectory(llvmcodegenerator)
else()
message(WARNING "LLVM developer libraries not found, building of LLVM support disabled")
endif(Llvm_FOUND)
# Experimental plugins from various git branches
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/python3language")
if(PYTHONLIBS_FOUND)
add_subdirectory(python3language)
else()
message(WARNING "No Python 3.x libs found, building of Python language support disabled")
endif()
endif() # python3language exists
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/fpcanalizer")
add_subdirectory(fpcanalizer)
endif() # fpcanalizer exists
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/gdbrun")
add_subdirectory(gdbrun)
endif() # gdbrun exists
......@@ -286,16 +286,18 @@ void KumirProgram::prepareKumirRunner(Shared::GeneratorInterface::DebugLevel deb
{
bool ok = false;
QString sourceProgramPath;
sourceProgramPath = editor_->documentContents().sourceUrl.toLocalFile();
Shared::RunInterface::SourceInfo sourceInfo;
sourceInfo.sourceFileName = sourceProgramPath;
if (editor_->analizer()->compiler()) {
editor_->ensureAnalized();
const AST::DataPtr ast = editor_->analizer()->compiler()->abstractSyntaxTree();
sourceProgramPath = editor_->documentContents().sourceUrl.toLocalFile();
QByteArray bufArray;
kumirCodeGenerator()->setOutputToText(false);
kumirCodeGenerator()->setDebugLevel(debugLevel);
QString fileNameSuffix, mimeType;
kumirCodeGenerator()->generateExecuable(ast, bufArray, mimeType, fileNameSuffix);
runner()->loadProgram(sourceProgramPath, bufArray);
runner()->loadProgram(sourceProgramPath, bufArray, sourceInfo);
}
else {
const KumFile::Data source = editor_->documentContents();
......@@ -304,7 +306,7 @@ void KumirProgram::prepareKumirRunner(Shared::GeneratorInterface::DebugLevel deb
? source.visibleText + "\n" + source.hiddenText
: source.visibleText;
const QByteArray sourceData = sourceText.toUtf8();
ok = runner()->loadProgram(sourceProgramPath, sourceData);
ok = runner()->loadProgram(sourceProgramPath, sourceData, sourceInfo);
}
const QString newCwd = QFileInfo(sourceProgramPath).absoluteDir().absolutePath();
QDir::setCurrent(newCwd);
......
......@@ -30,6 +30,8 @@ uint EditorPlane::MarginWidthDefault = 15u /*px*/;
EditorPlane::EditorPlane(EditorInstance * editor)
: QWidget(editor)
, editor_(editor)
, analizerHelper_(0)
, caseInsensitive_(false)
, highlightedTextLineNumber_(-1)
, highlightedTextColumnStartNumber_(0u)
, highlightedTextColumnEndNumber_(0u)
......@@ -43,6 +45,11 @@ EditorPlane::EditorPlane(EditorInstance * editor)
, selectionInProgressFlag_(false)
, marginHintBox_(new QLabel(this, Qt::ToolTip))
{
if (editor->analizer()) {
caseInsensitive_ = editor->analizer()->plugin()->caseInsensitiveGrammatic();
analizerHelper_ = editor->analizer()->helper();
}