Browse Source

Another minor extra cleanup to parsing.

merge-requests/365/head
eidheim 10 years ago
parent
commit
01ae71eb81
  1. 6
      src/source_clang.cc

6
src/source_clang.cc

@ -110,8 +110,8 @@ void Source::ClangViewParse::parse_initialize() {
parsed=false; parsed=false;
if(parse_thread.joinable()) if(parse_thread.joinable())
parse_thread.join(); parse_thread.join();
parse_process_state=ParseProcessState::STARTING;
parse_state=ParseState::PROCESSING; parse_state=ParseState::PROCESSING;
parse_process_state=ParseProcessState::STARTING;
auto buffer=get_buffer()->get_text(); auto buffer=get_buffer()->get_text();
//Remove includes for first parse for initial syntax highlighting //Remove includes for first parse for initial syntax highlighting
@ -141,7 +141,6 @@ void Source::ClangViewParse::parse_initialize() {
if(parse_process_state.compare_exchange_strong(expected, ParseProcessState::PREPROCESSING)) if(parse_process_state.compare_exchange_strong(expected, ParseProcessState::PREPROCESSING))
parse_preprocess(); parse_preprocess();
else if (parse_process_state==ParseProcessState::PROCESSING && parse_mutex.try_lock()) { else if (parse_process_state==ParseProcessState::PROCESSING && parse_mutex.try_lock()) {
if(parse_process_state==ParseProcessState::PROCESSING) {
auto status=clang_tu->ReparseTranslationUnit(parse_thread_buffer.raw()); auto status=clang_tu->ReparseTranslationUnit(parse_thread_buffer.raw());
parsing_in_progress->done("done"); parsing_in_progress->done("done");
if(status==0) { if(status==0) {
@ -160,9 +159,6 @@ void Source::ClangViewParse::parse_initialize() {
parse_error(); parse_error();
} }
} }
else
parse_mutex.unlock();
}
} }
}); });
} }

Loading…
Cancel
Save