Merge branch 'master' of git@scm.dev.nokia.troll.no:creator/mainline

This commit is contained in:
hjk
2009-02-05 17:07:18 +01:00
26 changed files with 737 additions and 466 deletions

View File

@@ -109,6 +109,7 @@ Document::Document(const QString &fileName)
localFileName.size()); localFileName.size());
_translationUnit = new TranslationUnit(_control, fileId); _translationUnit = new TranslationUnit(_control, fileId);
_translationUnit->setQtMocRunEnabled(true); _translationUnit->setQtMocRunEnabled(true);
_translationUnit->setObjCEnabled(true);
(void) _control->switchTranslationUnit(_translationUnit); (void) _control->switchTranslationUnit(_translationUnit);
} }

View File

@@ -59,7 +59,9 @@ SimpleLexer::SimpleLexer()
_skipComments(false), _skipComments(false),
_qtMocRunEnabled(true), _qtMocRunEnabled(true),
_objCEnabled(false) _objCEnabled(false)
{ } {
setObjCEnabled(true);
}
SimpleLexer::~SimpleLexer() SimpleLexer::~SimpleLexer()
{ } { }

View File

@@ -727,6 +727,7 @@ void Preprocessor::processDirective(TokenIterator firstToken, TokenIterator last
case PP_INCLUDE: case PP_INCLUDE:
case PP_INCLUDE_NEXT: case PP_INCLUDE_NEXT:
case PP_IMPORT:
if (! skipping()) if (! skipping())
processInclude(d == PP_INCLUDE_NEXT, firstToken, lastToken); processInclude(d == PP_INCLUDE_NEXT, firstToken, lastToken);
break; break;
@@ -1069,6 +1070,8 @@ Preprocessor::PP_DIRECTIVE_TYPE Preprocessor::classifyDirective (const QByteArra
case 6: case 6:
if (__directive[0] == 'i' && __directive == "ifndef") if (__directive[0] == 'i' && __directive == "ifndef")
return PP_IFNDEF; return PP_IFNDEF;
else if (__directive[0] == 'i' && __directive == "import")
return PP_IMPORT;
else if (__directive[0] == 'd' && __directive == "define") else if (__directive[0] == 'd' && __directive == "define")
return PP_DEFINE; return PP_DEFINE;
break; break;

View File

@@ -150,6 +150,7 @@ namespace CPlusPlus {
{ {
PP_UNKNOWN_DIRECTIVE, PP_UNKNOWN_DIRECTIVE,
PP_DEFINE, PP_DEFINE,
PP_IMPORT,
PP_INCLUDE, PP_INCLUDE,
PP_INCLUDE_NEXT, PP_INCLUDE_NEXT,
PP_ELIF, PP_ELIF,

View File

@@ -2,38 +2,5 @@
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'> <mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
<mime-type type="application/octet-stream"> <mime-type type="application/octet-stream">
<comment>unknown</comment> <comment>unknown</comment>
<comment xml:lang="bg">Неизвестен тип</comment>
<comment xml:lang="ca">desconegut</comment>
<comment xml:lang="cs">Neznámý</comment>
<comment xml:lang="cy">Anhysbys</comment>
<comment xml:lang="da">ukendt</comment>
<comment xml:lang="de">unbekannt</comment>
<comment xml:lang="el">αγνωστο</comment>
<comment xml:lang="eo">nekonata</comment>
<comment xml:lang="es">desconocido</comment>
<comment xml:lang="eu">ezezaguna</comment>
<comment xml:lang="fi">tuntematon</comment>
<comment xml:lang="fr">inconnu</comment>
<comment xml:lang="hu">ismeretlen</comment>
<comment xml:lang="it">Sconosciuto</comment>
<comment xml:lang="ja">不明</comment>
<comment xml:lang="ko">알 수 없음</comment>
<comment xml:lang="lt">nežinoma</comment>
<comment xml:lang="ms">Entah</comment>
<comment xml:lang="nb">ukjent</comment>
<comment xml:lang="nl">onbekend</comment>
<comment xml:lang="nn">ukjend</comment>
<comment xml:lang="pl">nieznany typ</comment>
<comment xml:lang="pt">desconhecido</comment>
<comment xml:lang="pt_BR">Desconhecido</comment>
<comment xml:lang="ru">неизвестный</comment>
<comment xml:lang="rw">itazwi</comment>
<comment xml:lang="sq">nuk njihet</comment>
<comment xml:lang="sr">непознато</comment>
<comment xml:lang="sv">okänd</comment>
<comment xml:lang="uk">невідомо</comment>
<comment xml:lang="vi">không rõ</comment>
<comment xml:lang="zh_CN">未知</comment>
<comment xml:lang="zh_TW">不明</comment>
</mime-type> </mime-type>
</mime-info> </mime-info>

View File

@@ -3,37 +3,6 @@
<mime-type type="text/x-csrc"> <mime-type type="text/x-csrc">
<sub-class-of type="text/plain"/> <sub-class-of type="text/plain"/>
<comment>C Source file</comment> <comment>C Source file</comment>
<comment xml:lang="bg">Изходен код на C</comment>
<comment xml:lang="ca">codi font en C</comment>
<comment xml:lang="cs">Zdrojový kód v C</comment>
<comment xml:lang="cy">Ffynhonnell Rhaglen C</comment>
<comment xml:lang="da">C-kildekode</comment>
<comment xml:lang="de">C-Quelltext</comment>
<comment xml:lang="el">πηγαίος κώδικας C</comment>
<comment xml:lang="eo">C-fontkodo</comment>
<comment xml:lang="es">código fuente en C</comment>
<comment xml:lang="eu">C iturburu-kodea</comment>
<comment xml:lang="fi">C-lähdekoodi</comment>
<comment xml:lang="fr">code source C</comment>
<comment xml:lang="hu">C-forráskód</comment>
<comment xml:lang="it">Codice sorgente C</comment>
<comment xml:lang="ja">C ソースコード</comment>
<comment xml:lang="ko">C 소스 코드</comment>
<comment xml:lang="lt">C pradinis kodas</comment>
<comment xml:lang="ms">Kod sumber C</comment>
<comment xml:lang="nb">C-kildekode</comment>
<comment xml:lang="nl">C-broncode</comment>
<comment xml:lang="nn">C-kjeldekode</comment>
<comment xml:lang="pl">Kod źródłowy w C</comment>
<comment xml:lang="pt">código fonte C</comment>
<comment xml:lang="pt_BR">Código fonte C</comment>
<comment xml:lang="ru">программа на языке C</comment>
<comment xml:lang="sq">Kod burues C</comment>
<comment xml:lang="sr">C изворни ко̂д</comment>
<comment xml:lang="sv">C-källkod</comment>
<comment xml:lang="uk">Вихідний код на мові C</comment>
<comment xml:lang="zh_CN">C 源代码</comment>
<comment xml:lang="zh_TW">C 源代碼</comment>
<glob pattern="*.c"/> <glob pattern="*.c"/>
</mime-type> </mime-type>
@@ -41,21 +10,6 @@
<mime-type type="text/x-chdr"> <mime-type type="text/x-chdr">
<sub-class-of type="text/x-csrc"/> <sub-class-of type="text/x-csrc"/>
<comment>C Header file</comment> <comment>C Header file</comment>
<comment xml:lang="bg">Заглавен файл на C</comment>
<comment xml:lang="cs">Hlavička v C</comment>
<comment xml:lang="de">C-Header</comment>
<comment xml:lang="es">cabecera de código fuente en C</comment>
<comment xml:lang="eu">C goiburua</comment>
<comment xml:lang="fi">C-otsake</comment>
<comment xml:lang="fr">en-tête C</comment>
<comment xml:lang="hu">C fejléc</comment>
<comment xml:lang="it">Header C</comment>
<comment xml:lang="ko">C 헤더</comment>
<comment xml:lang="nb">C-kildekodeheader</comment>
<comment xml:lang="nn">C-hovud</comment>
<comment xml:lang="pl">Plik nagłówkowy w C</comment>
<comment xml:lang="sv">C-huvud</comment>
<comment xml:lang="uk">Файл заголовків на C</comment>
<glob pattern="*.h"/> <glob pattern="*.h"/>
</mime-type> </mime-type>
@@ -65,20 +19,6 @@
<sub-class-of type="text/x-chdr"/> <sub-class-of type="text/x-chdr"/>
<comment>C++ Header file</comment> <comment>C++ Header file</comment>
<comment>C++ header</comment> <comment>C++ header</comment>
<comment xml:lang="bg">Заглавен файл на C++</comment>
<comment xml:lang="cs">Hlavička v C++</comment>
<comment xml:lang="de">C++-Header</comment>
<comment xml:lang="es">cabecera de código fuente en C++</comment>
<comment xml:lang="eu">C++ goiburua</comment>
<comment xml:lang="fi">C++-otsake</comment>
<comment xml:lang="fr">en-tête C++</comment>
<comment xml:lang="hu">C++ fejléc</comment>
<comment xml:lang="it">Header C++</comment>
<comment xml:lang="nb">C++-kildekodeheader</comment>
<comment xml:lang="nn">C++-hovud</comment>
<comment xml:lang="pl">Plik nagłówkowy w C++</comment>
<comment xml:lang="sv">C++-huvud</comment>
<comment xml:lang="uk">Файл заголовків на C++</comment>
<glob pattern="*.h"/> <glob pattern="*.h"/>
<glob pattern="*.hh"/> <glob pattern="*.hh"/>
<glob pattern="*.hxx"/> <glob pattern="*.hxx"/>
@@ -97,37 +37,6 @@
<comment>C++ Source file</comment> <comment>C++ Source file</comment>
<sub-class-of type="text/x-csrc"/> <sub-class-of type="text/x-csrc"/>
<comment>C++ source code</comment> <comment>C++ source code</comment>
<comment xml:lang="bg">Изходен код на C++</comment>
<comment xml:lang="ca">codi font en C++</comment>
<comment xml:lang="cs">Zdrojový kód v C++</comment>
<comment xml:lang="cy">Ffynhonnell Rhaglen C++</comment>
<comment xml:lang="da">C++-kildekode</comment>
<comment xml:lang="de">C++-Quelltext</comment>
<comment xml:lang="el">πηγαίος κώδικας C++</comment>
<comment xml:lang="eo">C++-fontkodo</comment>
<comment xml:lang="es">código fuente en C++</comment>
<comment xml:lang="eu">C++ iturburu-kodea</comment>
<comment xml:lang="fi">C++-lähdekoodi</comment>
<comment xml:lang="fr">code source C++</comment>
<comment xml:lang="hu">C++-forráskód</comment>
<comment xml:lang="it">Codice sorgente C++</comment>
<comment xml:lang="ja">C++ ソースコード</comment>
<comment xml:lang="ko">C++ 소스 코드</comment>
<comment xml:lang="lt">C++ pradinis kodas</comment>
<comment xml:lang="ms">Kod sumber C++</comment>
<comment xml:lang="nb">C++-kildekode</comment>
<comment xml:lang="nl">C++-broncode</comment>
<comment xml:lang="nn">C++-kjeldekode</comment>
<comment xml:lang="pl">Kod źródłowy w C++</comment>
<comment xml:lang="pt">código fonte C++</comment>
<comment xml:lang="pt_BR">Código fonte C++</comment>
<comment xml:lang="ru">программа на языке C++</comment>
<comment xml:lang="sq">Kod burues C++</comment>
<comment xml:lang="sr">C++ изворни ко̂д</comment>
<comment xml:lang="sv">C++-källkod</comment>
<comment xml:lang="uk">Вихідний код на мові C++</comment>
<comment xml:lang="zh_CN">C++ 源代码</comment>
<comment xml:lang="zh_TW">C++ 源代碼</comment>
<glob pattern="*.cpp"/> <glob pattern="*.cpp"/>
<glob pattern="*.cc"/> <glob pattern="*.cc"/>
<glob pattern="*.cxx"/> <glob pattern="*.cxx"/>
@@ -135,4 +44,15 @@
<glob pattern="*.C"/> <glob pattern="*.C"/>
<glob pattern="*.inl"/> <glob pattern="*.inl"/>
</mime-type> </mime-type>
<mime-type type="text/x-objcsrc">
<comment>Objective-C source code</comment>
<sub-class-of type="text/x-csrc"/>
<magic priority="30">
<match value="#import" type="string" offset="0"/>
</magic>
<glob pattern="*.m"/>
<glob pattern="*.mm"/>
</mime-type>
</mime-info> </mime-info>

View File

@@ -230,6 +230,8 @@ bool CppHighlighter::isPPKeyword(const QStringRef &text) const
case 6: case 6:
if (text.at(0) == 'i' && text == QLatin1String("ifndef")) if (text.at(0) == 'i' && text == QLatin1String("ifndef"))
return true; return true;
if (text.at(0) == 'i' && text == QLatin1String("import"))
return true;
else if (text.at(0) == 'd' && text == QLatin1String("define")) else if (text.at(0) == 'd' && text == QLatin1String("define"))
return true; return true;
else if (text.at(0) == 'p' && text == QLatin1String("pragma")) else if (text.at(0) == 'p' && text == QLatin1String("pragma"))

View File

@@ -17,11 +17,14 @@
<item> <item>
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
<property name="title"> <property name="title">
<string>Completion Settings</string> <string>Code Completion</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<item> <item>
<widget class="QCheckBox" name="caseSensitive"> <widget class="QCheckBox" name="caseSensitive">
<property name="toolTip">
<string>Do a case-sensitive match for completion items.</string>
</property>
<property name="text"> <property name="text">
<string>&amp;Case-sensitive completion</string> <string>&amp;Case-sensitive completion</string>
</property> </property>
@@ -32,6 +35,9 @@
</item> </item>
<item> <item>
<widget class="QCheckBox" name="autoInsertBraces"> <widget class="QCheckBox" name="autoInsertBraces">
<property name="toolTip">
<string>Automatically insert (, ) and ; when appropriate.</string>
</property>
<property name="text"> <property name="text">
<string>&amp;Automatically insert braces</string> <string>&amp;Automatically insert braces</string>
</property> </property>
@@ -42,6 +48,9 @@
</item> </item>
<item> <item>
<widget class="QCheckBox" name="partiallyComplete"> <widget class="QCheckBox" name="partiallyComplete">
<property name="toolTip">
<string>Insert the common prefix of available completion items.</string>
</property>
<property name="text"> <property name="text">
<string>Autocomplete common &amp;prefix</string> <string>Autocomplete common &amp;prefix</string>
</property> </property>

View File

@@ -4,34 +4,5 @@
<sub-class-of type="application/xml"/> <sub-class-of type="application/xml"/>
<comment>Qt Designer file</comment> <comment>Qt Designer file</comment>
<glob pattern="*.ui"/> <glob pattern="*.ui"/>
<comment xml:lang="bg">Файл, формат Qt Designer</comment>
<comment xml:lang="ca">fitxer de Qt Designer</comment>
<comment xml:lang="cs">Soubor Qt Designeru</comment>
<comment xml:lang="cy">Ffeil Qt Designer</comment>
<comment xml:lang="da">Qt Designer-fil</comment>
<comment xml:lang="de">QT Designer-Datei</comment>
<comment xml:lang="el">αρχείο Qt Designer</comment>
<comment xml:lang="eo">dosiero de Qt Designer</comment>
<comment xml:lang="es">fichero de Qt Designer</comment>
<comment xml:lang="eu">Qt Designer Fitxategia</comment>
<comment xml:lang="fi">Qt Designer -tiedosto</comment>
<comment xml:lang="fr">fichier Qt Designer</comment>
<comment xml:lang="hu">Qt Designer-fájl</comment>
<comment xml:lang="it">File Qt Designer</comment>
<comment xml:lang="ja">Qt Designer ファイル</comment>
<comment xml:lang="ko">Qt 디자이너 파일</comment>
<comment xml:lang="lt">Qt Designer rinkmena</comment>
<comment xml:lang="ms">Fail Qt Designer</comment>
<comment xml:lang="nb">Qt Designer-fil</comment>
<comment xml:lang="nl">Qt Designer-bestand</comment>
<comment xml:lang="nn">Qt Designer-fil</comment>
<comment xml:lang="pl">Plik Qt Designera</comment>
<comment xml:lang="pt">ficheiro do Qt Designer</comment>
<comment xml:lang="pt_BR">Arquivo do Qt Designer</comment>
<comment xml:lang="ru">файл Qt Designer</comment>
<comment xml:lang="sq">File Qt Designer</comment>
<comment xml:lang="sr">Qt Designer датотека</comment>
<comment xml:lang="sv">Qt Designer-fil</comment>
<comment xml:lang="uk">Файл програми Qt-дизайнер</comment>
</mime-type> </mime-type>
</mime-info> </mime-info>

View File

@@ -5,37 +5,6 @@
<alias type="text/javascript"/> <alias type="text/javascript"/>
<sub-class-of type="text/plain"/> <sub-class-of type="text/plain"/>
<comment>Qt Script file</comment> <comment>Qt Script file</comment>
<comment xml:lang="bg">Програма на JavaScript</comment>
<comment xml:lang="ca">programa JavaScript</comment>
<comment xml:lang="cs">Program v JavaScriptu</comment>
<comment xml:lang="da">JavaScript-program</comment>
<comment xml:lang="de">JavaScript-Programm</comment>
<comment xml:lang="el">πρόγραμμα JavaScript</comment>
<comment xml:lang="eo">JavaScript-programo</comment>
<comment xml:lang="es">programa en JavaScript</comment>
<comment xml:lang="eu">JavaScript programa</comment>
<comment xml:lang="fi">JavaScript-ohjelma</comment>
<comment xml:lang="fr">programme JavaScript</comment>
<comment xml:lang="hu">JavaScript-program</comment>
<comment xml:lang="it">Programma JavaScript</comment>
<comment xml:lang="ja">JavaScript プログラム</comment>
<comment xml:lang="ko">자바스크립트 프로그램</comment>
<comment xml:lang="lt">JavaScript programa</comment>
<comment xml:lang="ms">Program JavaScript</comment>
<comment xml:lang="nb">JavaScript-program</comment>
<comment xml:lang="nl">JavaScript-programma</comment>
<comment xml:lang="nn">JavaScript-program</comment>
<comment xml:lang="pl">Pogram JavaScript</comment>
<comment xml:lang="pt">programa JavaScript</comment>
<comment xml:lang="pt_BR">Programa JavaScript</comment>
<comment xml:lang="ru">программа JavaScript</comment>
<comment xml:lang="sq">program JavaScript</comment>
<comment xml:lang="sr">Јаваскрипт програм</comment>
<comment xml:lang="sv">JavaScript-program</comment>
<comment xml:lang="uk">Програма на мові JavaScript</comment>
<comment xml:lang="vi">Chương trình JavaScript</comment>
<comment xml:lang="zh_CN">JavaScript 程序</comment>
<comment xml:lang="zh_TW">JavaScript 程式</comment>
<glob pattern="*.js"/> <glob pattern="*.js"/>
</mime-type> </mime-type>
</mime-info> </mime-info>

View File

@@ -3,36 +3,6 @@
<mime-type type="text/plain"> <mime-type type="text/plain">
<comment>Plain text document</comment> <comment>Plain text document</comment>
<sub-class-of type="application/octet-stream"/> <sub-class-of type="application/octet-stream"/>
<comment xml:lang="bg">Документ с неформатиран текст</comment>
<comment xml:lang="ca">document de text pla</comment>
<comment xml:lang="cs">Prostý textový dokument</comment>
<comment xml:lang="da">ren tekst-dokument</comment>
<comment xml:lang="de">einfaches Textdokument</comment>
<comment xml:lang="el">έγγραφο απλού κειμένου</comment>
<comment xml:lang="eo">plata teksta dokumento</comment>
<comment xml:lang="es">documento de texto sencillo</comment>
<comment xml:lang="eu">testu soileko dokumentua</comment>
<comment xml:lang="fi">perustekstiasiakirja</comment>
<comment xml:lang="fr">document plein texte</comment>
<comment xml:lang="hu">egyszerű szöveg</comment>
<comment xml:lang="it">Documento in testo semplice</comment>
<comment xml:lang="ja">平文テキストドキュメント</comment>
<comment xml:lang="ko">보통 text 문서</comment>
<comment xml:lang="lt">paprastas tekstinis dokumentas</comment>
<comment xml:lang="ms">Dokumen teks jernih</comment>
<comment xml:lang="nb">vanlig tekstdokument</comment>
<comment xml:lang="nl">platte tekst document</comment>
<comment xml:lang="nn">vanleg tekstdokument</comment>
<comment xml:lang="pl">zwykły dokument tekstowy</comment>
<comment xml:lang="pt">documento em texto simples</comment>
<comment xml:lang="pt_BR">Documento somente texto</comment>
<comment xml:lang="sq">dokument teksti i thjeshtë</comment>
<comment xml:lang="sr">обичан текстуални документ</comment>
<comment xml:lang="sv">vanligt textdokument</comment>
<comment xml:lang="uk">звичайний текстовий документ</comment>
<comment xml:lang="vi">thư nhập thô (văn bản không có kiểu dáng)</comment>
<comment xml:lang="zh_CN">纯文本文档</comment>
<comment xml:lang="zh_TW">普通文本檔</comment>
<glob pattern="*.txt"/> <glob pattern="*.txt"/>
</mime-type> </mime-type>
<mime-type type="application/xml"> <mime-type type="application/xml">

View File

@@ -6,27 +6,144 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>484</width> <width>428</width>
<height>398</height> <height>384</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout_3"> <layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0"> <item row="1" column="0">
<widget class="QGroupBox" name="groupBoxTabAndIndentSettings"> <widget class="QGroupBox" name="groupBoxStorageSettings">
<property name="title"> <property name="title">
<string>Tab/Indent Settings</string> <string>Storage</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QCheckBox" name="cleanWhitespace">
<property name="toolTip">
<string>Removes trailing whitespace on saving.</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QCheckBox" name="autoIndent">
<property name="text"> <property name="text">
<string>Enable automatic &amp;indentation</string> <string>&amp;Clean whitespace</string>
</property> </property>
</widget> </widget>
</item> </item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>30</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="inEntireDocument">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Clean whitespace in entire document instead of only for changed parts.</string>
</property>
<property name="text">
<string>In entire &amp;document</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="cleanIndentationLayout">
<item>
<spacer name="cleanIndentationSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>30</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="cleanIndentation">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Correct leading whitespace according to tab settings.</string>
</property>
<property name="text">
<string>Clean indentation</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="addFinalNewLine">
<property name="text">
<string>&amp;Ensure newline at end of file</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="2" column="0">
<widget class="QGroupBox" name="groupBoxInteractionSettings">
<property name="title">
<string>Interaction</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QCheckBox" name="useVim">
<property name="toolTip">
<string/>
</property>
<property name="text">
<string>Use &quot;vi&quot; style editing</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="3" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>8</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
<widget class="QGroupBox" name="groupBoxTabAndIndentSettings">
<property name="title">
<string>Tabs and Indentation</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="2"> <item row="0" column="2">
<layout class="QHBoxLayout" name="horizontalLayout_3"> <layout class="QHBoxLayout" name="horizontalLayout_3">
<item> <item>
@@ -89,13 +206,6 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="1" column="0">
<widget class="QCheckBox" name="insertSpaces">
<property name="text">
<string>Insert &amp;spaces instead of tabs</string>
</property>
</widget>
</item>
<item row="1" column="2"> <item row="1" column="2">
<layout class="QHBoxLayout" name="horizontalLayout_4"> <layout class="QHBoxLayout" name="horizontalLayout_4">
<item> <item>
@@ -145,8 +255,11 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="2" column="0"> <item row="3" column="0">
<widget class="QCheckBox" name="smartBackspace"> <widget class="QCheckBox" name="smartBackspace">
<property name="toolTip">
<string>Backspace will go back one indentation level instead of one space.</string>
</property>
<property name="text"> <property name="text">
<string>&amp;Backspace follows indentation</string> <string>&amp;Backspace follows indentation</string>
</property> </property>
@@ -168,121 +281,23 @@
</property> </property>
</spacer> </spacer>
</item> </item>
</layout> <item row="0" column="0">
<widget class="QCheckBox" name="insertSpaces">
<property name="text">
<string>Insert &amp;spaces instead of tabs</string>
</property>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QGroupBox" name="groupBoxStorageSettings"> <widget class="QCheckBox" name="autoIndent">
<property name="title">
<string>Storage Settings</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QCheckBox" name="cleanWhitespace">
<property name="text"> <property name="text">
<string>&amp;Clean whitespace</string> <string>Enable automatic &amp;indentation</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>30</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="inEntireDocument">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>In entire &amp;document</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="cleanIndentationLayout">
<item>
<spacer name="cleanIndentationSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>30</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="cleanIndentation">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Clean indentation</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="addFinalNewLine">
<property name="text">
<string>&amp;Ensure newline at end of file</string>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="2" column="0">
<widget class="QGroupBox" name="groupBoxInteractionSettings">
<property name="title">
<string>Interaction Settings</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QCheckBox" name="useVim">
<property name="text">
<string>Use &quot;vi&quot; style editing</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="3" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>8</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget> </widget>
<resources/> <resources/>

View File

@@ -6,26 +6,86 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>514</width> <width>381</width>
<height>194</height> <height>279</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout_3"> <layout class="QGridLayout" name="gridLayout_3">
<item row="2" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>8</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Display</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QCheckBox" name="displayLineNumbers">
<property name="text">
<string>Display line &amp;numbers</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="displayFoldingMarkers">
<property name="text">
<string>Display &amp;folding markers</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="visualizeWhitespace">
<property name="toolTip">
<string>Show tabs and spaces.</string>
</property>
<property name="text">
<string>&amp;Visualize whitespace</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="highlightCurrentLine">
<property name="text">
<string>Highlight current &amp;line</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QGroupBox" name="groupBoxDisplaySettings"> <widget class="QGroupBox" name="groupBoxDisplaySettings">
<property name="title"> <property name="title">
<string>Display Settings</string> <string>Text Wrapping</string>
</property> </property>
<layout class="QGridLayout"> <layout class="QGridLayout" name="gridLayout">
<item row="0" column="1"> <item row="0" column="0">
<widget class="QCheckBox" name="enableTextWrapping">
<property name="text">
<string>Enable text &amp;wrapping</string>
</property>
</widget>
</item>
<item row="1" column="0">
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<item> <item>
<widget class="QCheckBox" name="showWrapColumn"> <widget class="QCheckBox" name="showWrapColumn">
<property name="text"> <property name="text">
<string>Display right &amp;margin at column</string> <string>Display right &amp;margin at column:</string>
</property> </property>
</widget> </widget>
</item> </item>
@@ -39,60 +99,25 @@
</property> </property>
</widget> </widget>
</item> </item>
</layout> <item>
</item> <spacer name="horizontalSpacer">
<item row="0" column="0">
<widget class="QCheckBox" name="enableTextWrapping">
<property name="text">
<string>Enable text &amp;wrapping</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="displayLineNumbers">
<property name="text">
<string>Display line &amp;numbers</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="visualizeWhitespace">
<property name="text">
<string>&amp;Visualize whitespace</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="displayFoldingMarkers">
<property name="text">
<string>Display &amp;folding markers</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QCheckBox" name="highlightCurrentLine">
<property name="text">
<string>Highlight current &amp;line</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<spacer name="verticalSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>20</width> <width>40</width>
<height>8</height> <height>20</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
</layout> </layout>
</item>
</layout>
</widget>
</item>
</layout>
</widget> </widget>
<resources/> <resources/>
<connections> <connections>

View File

@@ -23,7 +23,7 @@
<item> <item>
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
<property name="title"> <property name="title">
<string>General Font Settings</string> <string>Font</string>
</property> </property>
<layout class="QHBoxLayout"> <layout class="QHBoxLayout">
<property name="spacing"> <property name="spacing">
@@ -119,7 +119,7 @@
</sizepolicy> </sizepolicy>
</property> </property>
<property name="title"> <property name="title">
<string>Item Specific Settings</string> <string>Color Scheme</string>
</property> </property>
<layout class="QHBoxLayout"> <layout class="QHBoxLayout">
<property name="spacing"> <property name="spacing">

View File

@@ -3,37 +3,6 @@
<mime-type type="text/x-patch"> <mime-type type="text/x-patch">
<sub-class-of type="text/plain"/> <sub-class-of type="text/plain"/>
<comment>Differences between files</comment> <comment>Differences between files</comment>
<glob pattern="*.diff"/> <comment xml:lang="bg">Разлики между файлове</comment>
<comment xml:lang="ca">diferències entre fitxers</comment>
<comment xml:lang="cs">Rozdíly mezi soubory</comment>
<comment xml:lang="da">forskel mellem filer</comment>
<comment xml:lang="de">Unterschied zwischen Dateien</comment>
<comment xml:lang="el">διαφορές μεταξύ αρχείων</comment>
<comment xml:lang="eo">diferencoj inter dosieroj</comment>
<comment xml:lang="es">diferencias entre ficheros</comment>
<comment xml:lang="eu">fitxategien arteko ezberdintasunak</comment>
<comment xml:lang="fi">tiedostojen väliset erot</comment>
<comment xml:lang="fr">différences entre fichiers</comment>
<comment xml:lang="hu">diff-különbségfájl</comment>
<comment xml:lang="it">Differenze tra file</comment>
<comment xml:lang="ja">ファイル間差分</comment>
<comment xml:lang="ko">파일사이의 바뀐점</comment>
<comment xml:lang="lt">skirtumai tarp rinkmenų</comment>
<comment xml:lang="ms">Perbezaan antara fail</comment>
<comment xml:lang="nb">forskjeller mellom filer</comment>
<comment xml:lang="nl">verschillen tussen bestanden</comment>
<comment xml:lang="nn">skilnader mellom filer</comment>
<comment xml:lang="pl">różnica pomiędzy plikami</comment>
<comment xml:lang="pt">diferenças entre ficheiros</comment>
<comment xml:lang="pt_BR">Diferenças entre arquivos</comment>
<comment xml:lang="ru">различия между файлами</comment>
<comment xml:lang="sq">diferenca midis files</comment>
<comment xml:lang="sr">разлике међу датотекама</comment>
<comment xml:lang="sv">skillnader mellan filer</comment>
<comment xml:lang="uk">різниця між файлами</comment>
<comment xml:lang="vi">khác biệt giữa nhiều tập tin</comment>
<comment xml:lang="zh_CN">文件的区别</comment>
<comment xml:lang="zh_TW">檔案內容差異</comment>
<glob pattern="*.patch"/> <glob pattern="*.patch"/>
</mime-type> </mime-type>
</mime-info> </mime-info>

View File

@@ -611,8 +611,7 @@ AsmDefinitionAST *AsmDefinitionAST::clone(MemoryPool *pool) const
{ {
AsmDefinitionAST *ast = new (pool) AsmDefinitionAST; AsmDefinitionAST *ast = new (pool) AsmDefinitionAST;
ast->asm_token = asm_token; ast->asm_token = asm_token;
if (cv_qualifier_seq) ast->volatile_token = volatile_token;
ast->cv_qualifier_seq = cv_qualifier_seq->clone(pool);
ast->lparen_token = lparen_token; ast->lparen_token = lparen_token;
ast->rparen_token = rparen_token; ast->rparen_token = rparen_token;
ast->semicolon_token = semicolon_token; ast->semicolon_token = semicolon_token;
@@ -622,9 +621,7 @@ AsmDefinitionAST *AsmDefinitionAST::clone(MemoryPool *pool) const
void AsmDefinitionAST::accept0(ASTVisitor *visitor) void AsmDefinitionAST::accept0(ASTVisitor *visitor)
{ {
if (visitor->visit(this)) { if (visitor->visit(this)) {
for (SpecifierAST *spec = cv_qualifier_seq; spec; // ### accept the asm operand list.
spec = spec->next)
accept(spec, visitor);
} }
} }
@@ -641,11 +638,8 @@ unsigned AsmDefinitionAST::lastToken() const
return rparen_token + 1; return rparen_token + 1;
else if (lparen_token) else if (lparen_token)
return lparen_token + 1; return lparen_token + 1;
for (SpecifierAST *it = cv_qualifier_seq; it; it = it->next) { else if (volatile_token)
if (! it->next) return volatile_token + 1;
return it->lastToken();
}
return asm_token + 1; return asm_token + 1;
} }

View File

@@ -397,8 +397,10 @@ class CPLUSPLUS_EXPORT AsmDefinitionAST: public DeclarationAST
{ {
public: public:
unsigned asm_token; unsigned asm_token;
SpecifierAST *cv_qualifier_seq; unsigned volatile_token;
unsigned lparen_token; unsigned lparen_token;
// ### string literals
// ### asm operand list
unsigned rparen_token; unsigned rparen_token;
unsigned semicolon_token; unsigned semicolon_token;

View File

@@ -0,0 +1,124 @@
/***************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Qt Software Information (qt-info@nokia.com)
**
**
** Non-Open Source Usage
**
** Licensees may use this file in accordance with the Qt Beta Version
** License Agreement, Agreement version 2.2 provided with the Software or,
** alternatively, in accordance with the terms contained in a written
** agreement between you and Nokia.
**
** GNU General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU General
** Public License versions 2.0 or 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the packaging
** of this file. Please review the following information to ensure GNU
** General Public Licensing requirements will be met:
**
** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
** http://www.gnu.org/copyleft/gpl.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt GPL Exception
** version 1.3, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#include "ObjectiveCTypeQualifiers.h"
CPLUSPLUS_BEGIN_NAMESPACE
static inline int classify2(const char *s) {
if (s[0] == 'i') {
if (s[1] == 'n') {
return Token_in;
}
}
return Token_identifier;
}
static inline int classify3(const char *s) {
if (s[0] == 'o') {
if (s[1] == 'u') {
if (s[2] == 't') {
return Token_out;
}
}
}
return Token_identifier;
}
static inline int classify5(const char *s) {
if (s[0] == 'b') {
if (s[1] == 'y') {
if (s[2] == 'r') {
if (s[3] == 'e') {
if (s[4] == 'f') {
return Token_byref;
}
}
}
}
}
else if (s[0] == 'i') {
if (s[1] == 'n') {
if (s[2] == 'o') {
if (s[3] == 'u') {
if (s[4] == 't') {
return Token_inout;
}
}
}
}
}
return Token_identifier;
}
static inline int classify6(const char *s) {
if (s[0] == 'b') {
if (s[1] == 'y') {
if (s[2] == 'c') {
if (s[3] == 'o') {
if (s[4] == 'p') {
if (s[5] == 'y') {
return Token_bycopy;
}
}
}
}
}
}
else if (s[0] == 'o') {
if (s[1] == 'n') {
if (s[2] == 'e') {
if (s[3] == 'w') {
if (s[4] == 'a') {
if (s[5] == 'y') {
return Token_oneway;
}
}
}
}
}
}
return Token_identifier;
}
int classifyObjectiveCTypeQualifiers(const char *s, int n) {
switch (n) {
case 2: return classify2(s);
case 3: return classify3(s);
case 5: return classify5(s);
case 6: return classify6(s);
default: return Token_identifier;
} // switch
}
CPLUSPLUS_END_NAMESPACE

View File

@@ -0,0 +1,56 @@
/***************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Qt Software Information (qt-info@nokia.com)
**
**
** Non-Open Source Usage
**
** Licensees may use this file in accordance with the Qt Beta Version
** License Agreement, Agreement version 2.2 provided with the Software or,
** alternatively, in accordance with the terms contained in a written
** agreement between you and Nokia.
**
** GNU General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU General
** Public License versions 2.0 or 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the packaging
** of this file. Please review the following information to ensure GNU
** General Public Licensing requirements will be met:
**
** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
** http://www.gnu.org/copyleft/gpl.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt GPL Exception
** version 1.3, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#ifndef CPLUSPLUS_OBJC_TYPEQUALIFIERS_H
#define CPLUSPLUS_OBJC_TYPEQUALIFIERS_H
#include "CPlusPlusForwardDeclarations.h"
CPLUSPLUS_BEGIN_HEADER
CPLUSPLUS_BEGIN_NAMESPACE
enum {
Token_in,
Token_out,
Token_byref,
Token_inout,
Token_bycopy,
Token_oneway,
Token_identifier
};
CPLUSPLUS_EXPORT int classifyObjectiveCTypeQualifiers(const char *s, int n);
CPLUSPLUS_END_NAMESPACE
CPLUSPLUS_END_HEADER
#endif // CPLUSPLUS_OBJC_TYPEQUALIFIERS_H

View File

@@ -56,6 +56,7 @@
#include "Control.h" #include "Control.h"
#include "AST.h" #include "AST.h"
#include "Literals.h" #include "Literals.h"
#include "ObjectiveCTypeQualifiers.h"
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
#include <cassert> #include <cassert>
@@ -627,22 +628,92 @@ bool Parser::parseTemplateArgumentList(TemplateArgumentListAST *&node)
bool Parser::parseAsmDefinition(DeclarationAST *&node) bool Parser::parseAsmDefinition(DeclarationAST *&node)
{ {
if (LA() == T_ASM) { if (LA() != T_ASM)
return false;
AsmDefinitionAST *ast = new (_pool) AsmDefinitionAST; AsmDefinitionAST *ast = new (_pool) AsmDefinitionAST;
ast->asm_token = consumeToken(); ast->asm_token = consumeToken();
parseCvQualifiers(ast->cv_qualifier_seq);
if (LA() == T_LPAREN) { if (LA() == T_VOLATILE)
ast->lparen_token = cursor(); ast->volatile_token = consumeToken();
if (skip(T_LPAREN, T_RPAREN))
ast->rparen_token = consumeToken(); match(T_LPAREN, &ast->lparen_token);
unsigned string_literal_token = 0;
match(T_STRING_LITERAL, &string_literal_token);
while (LA() == T_STRING_LITERAL) {
consumeToken();
} }
if (LA() == T_COLON) {
consumeToken(); // skip T_COLON
parseAsmOperandList();
if (LA() == T_COLON) {
consumeToken();
parseAsmOperandList();
if (LA() == T_COLON) {
consumeToken();
parseAsmClobberList();
}
} else if (LA() == T_COLON_COLON) {
consumeToken();
parseAsmClobberList();
}
} else if (LA() == T_COLON_COLON) {
consumeToken();
parseAsmClobberList();
}
match(T_RPAREN, &ast->rparen_token);
match(T_SEMICOLON, &ast->semicolon_token); match(T_SEMICOLON, &ast->semicolon_token);
node = ast; node = ast;
return true; return true;
}
bool Parser::parseAsmOperandList()
{
if (parseAsmOperand()) {
while (LA() == T_COMMA) {
consumeToken();
parseAsmOperand();
}
return true;
} }
return false; return false;
} }
bool Parser::parseAsmOperand()
{
unsigned string_literal_token = 0;
match(T_STRING_LITERAL, &string_literal_token);
if (LA() == T_LBRACKET) {
/*unsigned lbracket_token = */ consumeToken();
match(T_STRING_LITERAL, &string_literal_token);
unsigned rbracket_token = 0;
match(T_RBRACKET, &rbracket_token);
}
unsigned lparen_token = 0, rparen_token = 0;
match(T_LPAREN, &lparen_token);
ExpressionAST *expression = 0;
parseExpression(expression);
match(T_RPAREN, &rparen_token);
return true;
}
bool Parser::parseAsmClobberList()
{
if (LA() != T_STRING_LITERAL)
return false;
unsigned string_literal_token = consumeToken();
while (LA() == T_COMMA) {
consumeToken();
match(T_STRING_LITERAL, &string_literal_token);
}
return true;
}
bool Parser::parseTemplateDeclaration(DeclarationAST *&node) bool Parser::parseTemplateDeclaration(DeclarationAST *&node)
{ {
if (! (LA(1) == T_TEMPLATE || ((LA(1) == T_EXPORT || LA(1) == T_EXTERN) if (! (LA(1) == T_TEMPLATE || ((LA(1) == T_EXPORT || LA(1) == T_EXTERN)
@@ -2556,6 +2627,13 @@ bool Parser::parsePrimaryExpression(ExpressionAST *&node)
case T_SLOT: case T_SLOT:
return parseQtMethod(node); return parseQtMethod(node);
case T_LBRACKET:
case T_AT_STRING_LITERAL:
case T_AT_ENCODE:
case T_AT_PROTOCOL:
case T_AT_SELECTOR:
return parseObjCExpression(node);
default: { default: {
NameAST *name = 0; NameAST *name = 0;
if (parseNameId(name)) { if (parseNameId(name)) {
@@ -2570,6 +2648,151 @@ bool Parser::parsePrimaryExpression(ExpressionAST *&node)
return false; return false;
} }
bool Parser::parseObjCExpression(ExpressionAST *&node)
{
switch (LA()) {
case T_AT_ENCODE:
return parseObjCEncodeExpression(node);
case T_AT_PROTOCOL:
return parseObjCProtocolExpression(node);
case T_AT_SELECTOR:
return parseObjCSelectorExpression(node);
case T_LBRACKET:
return parseObjCMessageExpression(node);
case T_AT_STRING_LITERAL:
return parseObjCStringLiteral(node);
default:
break;
} // switch
return false;
}
bool Parser::parseObjCStringLiteral(ExpressionAST *&node)
{
if (LA() != T_AT_STRING_LITERAL)
return false;
StringLiteralAST **ast = reinterpret_cast<StringLiteralAST **> (&node);
while (LA() == T_AT_STRING_LITERAL) {
*ast = new (_pool) StringLiteralAST;
(*ast)->token = consumeToken();
ast = &(*ast)->next;
}
return true;
}
bool Parser::parseObjCEncodeExpression(ExpressionAST *&)
{
if (LA() != T_AT_ENCODE)
return false;
/*unsigned encode_token = */ consumeToken();
parseObjCTypeName();
return true;
}
bool Parser::parseObjCProtocolExpression(ExpressionAST *&)
{
if (LA() != T_AT_PROTOCOL)
return false;
/*unsigned protocol_token = */ consumeToken();
unsigned lparen_token = 0, identifier_token = 0, rparen_token = 0;
match(T_LPAREN, &lparen_token);
match(T_IDENTIFIER, &identifier_token);
match(T_RPAREN, &rparen_token);
return true;
}
bool Parser::parseObjCSelectorExpression(ExpressionAST *&)
{
if (LA() != T_AT_SELECTOR)
return false;
/*unsigned selector_token = */consumeToken();
unsigned lparen_token = 0, rparen_token = 0;
match(T_LPAREN, &lparen_token);
parseObjCMethodSignature();
match(T_RPAREN, &rparen_token);
return true;
}
bool Parser::parseObjCMessageExpression(ExpressionAST *&)
{
if (LA() != T_LBRACKET)
return false;
/*unsigned lbracket_token = */ consumeToken();
parseObjCMessageReceiver();
parseObjCMessageArguments();
unsigned rbracket_token = 0;
match(T_RBRACKET, &rbracket_token);
return true;
}
bool Parser::parseObjCMessageReceiver()
{
ExpressionAST *expression = 0;
return parseExpression(expression);
}
bool Parser::parseObjCMessageArguments()
{
if (LA() == T_RBRACKET)
return false; // nothing to do.
unsigned start = cursor();
if (parseObjCSelectorArgs()) {
while (parseObjCSelectorArgs()) {
// accept the selector args.
}
} else {
rewind(start);
parseObjCSelector();
}
while (LA() == T_COMMA) {
consumeToken(); // skip T_COMMA
ExpressionAST *expression = 0;
parseAssignmentExpression(expression);
}
return true;
}
bool Parser::parseObjCSelectorArgs()
{
parseObjCSelector();
if (LA() != T_COLON)
return false;
/*unsigned colon_token = */consumeToken();
ExpressionAST *expression = 0;
parseAssignmentExpression(expression);
return true;
}
bool Parser::parseObjCMethodSignature()
{
if (parseObjCSelector()) {
while (LA() == T_COMMA) {
consumeToken(); // skip T_COMMA
parseObjCSelector();
}
return true;
}
return false;
}
bool Parser::parseNameId(NameAST *&name) bool Parser::parseNameId(NameAST *&name)
{ {
unsigned start = cursor(); unsigned start = cursor();
@@ -3522,6 +3745,42 @@ bool Parser::parseObjCImplementation(DeclarationAST *&)
} }
parseObjClassInstanceVariables(); parseObjClassInstanceVariables();
parseObjCMethodDefinitionList();
return true;
}
bool Parser::parseObjCMethodDefinitionList()
{
while (LA() && LA() != T_AT_END) {
unsigned start = cursor();
switch (LA()) {
case T_PLUS:
case T_MINUS:
parseObjCMethodDefinition();
if (start == cursor())
consumeToken();
break;
default:
// ### warning message
consumeToken();
break;
} // switch
}
return true;
}
bool Parser::parseObjCMethodDefinition()
{
if (LA() != T_MINUS && LA() != T_PLUS)
return false;
parseObjCMethodSignature();
StatementAST *function_body = 0;
parseFunctionBody(function_body);
return true; return true;
} }
@@ -3785,16 +4044,11 @@ bool Parser::parseObjCTypeQualifiers()
return false; return false;
Identifier *id = tok().identifier; Identifier *id = tok().identifier;
if (! strcmp("in", id->chars()) || const int k = classifyObjectiveCTypeQualifiers(id->chars(), id->size());
! strcmp("out", id->chars()) || if (k == Token_identifier)
! strcmp("inout", id->chars()) || return false;
! strcmp("bycopy", id->chars()) ||
! strcmp("byref", id->chars()) ||
! strcmp("oneway", id->chars())) {
consumeToken(); consumeToken();
return true; return true;
}
return false;
} }
// objc-end: T_AT_END // objc-end: T_AT_END

View File

@@ -85,6 +85,9 @@ public:
bool parseAdditiveExpression(ExpressionAST *&node); bool parseAdditiveExpression(ExpressionAST *&node);
bool parseAndExpression(ExpressionAST *&node); bool parseAndExpression(ExpressionAST *&node);
bool parseAsmDefinition(DeclarationAST *&node); bool parseAsmDefinition(DeclarationAST *&node);
bool parseAsmOperandList();
bool parseAsmOperand();
bool parseAsmClobberList();
bool parseAssignmentExpression(ExpressionAST *&node); bool parseAssignmentExpression(ExpressionAST *&node);
bool parseBaseClause(BaseSpecifierAST *&node); bool parseBaseClause(BaseSpecifierAST *&node);
bool parseBaseSpecifier(BaseSpecifierAST *&node); bool parseBaseSpecifier(BaseSpecifierAST *&node);
@@ -211,12 +214,25 @@ public:
bool parseQtMethod(ExpressionAST *&node); bool parseQtMethod(ExpressionAST *&node);
// ObjC++ // ObjC++
bool parseObjCExpression(ExpressionAST *&node);
bool parseObjCClassDeclaration(DeclarationAST *&node); bool parseObjCClassDeclaration(DeclarationAST *&node);
bool parseObjCInterface(DeclarationAST *&node, bool parseObjCInterface(DeclarationAST *&node,
SpecifierAST *attributes = 0); SpecifierAST *attributes = 0);
bool parseObjCProtocol(DeclarationAST *&node, bool parseObjCProtocol(DeclarationAST *&node,
SpecifierAST *attributes = 0); SpecifierAST *attributes = 0);
bool parseObjCEncodeExpression(ExpressionAST *&node);
bool parseObjCProtocolExpression(ExpressionAST *&node);
bool parseObjCSelectorExpression(ExpressionAST *&node);
bool parseObjCStringLiteral(ExpressionAST *&node);
bool parseObjCMethodSignature();
bool parseObjCMessageExpression(ExpressionAST *&node);
bool parseObjCMessageReceiver();
bool parseObjCMessageArguments();
bool parseObjCSelectorArgs();
bool parseObjCMethodDefinitionList();
bool parseObjCMethodDefinition();
bool parseObjCProtocolRefs(); bool parseObjCProtocolRefs();
bool parseObjClassInstanceVariables(); bool parseObjClassInstanceVariables();
bool parseObjCInterfaceMemberDeclaration(); bool parseObjCInterfaceMemberDeclaration();

View File

@@ -101,10 +101,8 @@ bool PrettyPrinter::visit(ArrayInitializerAST *ast)
bool PrettyPrinter::visit(AsmDefinitionAST *ast) bool PrettyPrinter::visit(AsmDefinitionAST *ast)
{ {
out << spell(ast->asm_token); out << spell(ast->asm_token);
for (SpecifierAST *it = ast->cv_qualifier_seq; it; it = it->next) { if (ast->volatile_token)
out << ' '; out << ' ' << spell(ast->volatile_token) << ' ';
accept(it);
}
out << '('; out << '(';
out << "/* ### implement me */"; out << "/* ### implement me */";
out << ");"; out << ");";

View File

@@ -36,8 +36,8 @@ HEADERS += \
$$PWD/TranslationUnit.h \ $$PWD/TranslationUnit.h \
$$PWD/Type.h \ $$PWD/Type.h \
$$PWD/TypeVisitor.h \ $$PWD/TypeVisitor.h \
$$PWD/PrettyPrinter.h $$PWD/PrettyPrinter.h \
$$PWD/ObjectiveCTypeQualifiers.h
SOURCES += \ SOURCES += \
$$PWD/AST.cpp \ $$PWD/AST.cpp \
@@ -55,6 +55,7 @@ SOURCES += \
$$PWD/FullySpecifiedType.cpp \ $$PWD/FullySpecifiedType.cpp \
$$PWD/Keywords.cpp \ $$PWD/Keywords.cpp \
$$PWD/ObjectiveCAtKeywords.cpp \ $$PWD/ObjectiveCAtKeywords.cpp \
$$PWD/ObjectiveCTypeQualifiers.cpp \
$$PWD/Lexer.cpp \ $$PWD/Lexer.cpp \
$$PWD/LiteralTable.cpp \ $$PWD/LiteralTable.cpp \
$$PWD/Literals.cpp \ $$PWD/Literals.cpp \

View File

@@ -719,6 +719,7 @@ bool ProFileEvaluator::Private::visitProValue(ProValue *value)
// The following two blocks fix bug 180128 by making all "interesting" // The following two blocks fix bug 180128 by making all "interesting"
// file name absolute in each .pro file, not just the top most one // file name absolute in each .pro file, not just the top most one
if (varName == QLatin1String("SOURCES") if (varName == QLatin1String("SOURCES")
|| varName == QLatin1String("OBJECTIVE_SOURCES")
|| varName == QLatin1String("HEADERS") || varName == QLatin1String("HEADERS")
|| varName == QLatin1String("INTERFACES") || varName == QLatin1String("INTERFACES")
|| varName == QLatin1String("FORMS") || varName == QLatin1String("FORMS")

View File

@@ -1,5 +1,5 @@
DEFINES += HAVE_QT CPLUSPLUS_WITH_NAMESPACE DEFINES += CPLUSPLUS_WITH_NAMESPACE
INCLUDEPATH += $$PWD/../../../../src/shared/cplusplus INCLUDEPATH += $$PWD/../../../../src/shared/cplusplus
DEPENDPATH += $$INCLUDEPATH . DEPENDPATH += $$INCLUDEPATH .
LIBS += -L$$PWD -lCPlusPlusTestSupport LIBS += -L$$PWD -lCPlusPlusTestSupport

View File

@@ -3,6 +3,7 @@ TEMPLATE = lib
TARGET = CPlusPlusTestSupport TARGET = CPlusPlusTestSupport
CONFIG += static CONFIG += static
QT = core QT = core
DESTDIR = $$PWD
DEFINES += HAVE_QT CPLUSPLUS_WITH_NAMESPACE DEFINES += CPLUSPLUS_WITH_NAMESPACE
include($$PWD/../../../../src/shared/cplusplus/cplusplus.pri) include($$PWD/../../../../src/shared/cplusplus/cplusplus.pri)