Wx-Scintilla-0.38000755001750001750 011727344243 14262 5ustar00azawawiazawawi000000000000Wx-Scintilla-0.38/META.yml000444001750001750 230611727344243 15671 0ustar00azawawiazawawi000000000000--- abstract: 'Scintilla source code editing for wxWidgets' author: - 'Ahmad M. Zawawi ' build_requires: Alien::wxWidgets: 0 ExtUtils::XSpp: 0.1602 Test::More: 0 Wx: 0 configure_requires: Module::Build: 0.36 perl: 5.006 dynamic_config: 1 generated_by: 'Module::Build version 0.38, CPAN::Meta::Converter version 2.112150' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: Wx-Scintilla no_index: directory: - tools - wx-scintilla - cpp - inc provides: Wx::Scintilla: file: lib/Wx/Scintilla.pm version: 0.38 Wx::Scintilla::Constant: file: lib/Wx/Scintilla/Constant.pm version: 0.38 Wx::Scintilla::TextCtrl: file: lib/Wx/Scintilla/TextCtrl.pm version: 0.38 Wx::Scintilla::TextEvent: file: lib/Wx/Scintilla/TextEvent.pm version: 0.38 Wx::ScintillaTextCtrl: file: lib/Wx/Scintilla.pm version: 0.38 Wx::ScintillaTextEvent: file: lib/Wx/Scintilla.pm version: 0.38 requires: perl: 5.008 resources: homepage: http://padre.perlide.org/ license: http://dev.perl.org/licenses/ repository: http://svn.perlide.org/padre/trunk/Wx-Scintilla/ version: 0.38 Wx-Scintilla-0.38/wx_typemap.xsp000444001750001750 1223311727344243 17371 0ustar00azawawiazawawi000000000000############################################################################# ## Name: typemap.xsp ## Purpose: Main typemap file for xsubppp.pl ## Author: Mattia Barbon ## Modified by: ## Created: 01/03/2003 ## RCS-ID: $Id: typemap.xsp 2927 2010-06-06 08:06:10Z mbarbon $ ## Copyright: (c) 2003-2010 Mattia Barbon ## Licence: This program is free software; you can redistribute it and/or ## modify it under the same terms as Perl itself ############################################################################# %typemap{void}{simple}; %typemap{bool}{simple}; %typemap{char}{simple}; %typemap{short}{simple}; %typemap{int}{simple}; %typemap{long}{simple}; %typemap{unsigned short}{simple}; %typemap{unsigned}{simple}; %typemap{unsigned int}{simple}; %typemap{unsigned long}{simple}; %typemap{float}{simple}; %typemap{double}{simple}; %typemap{wxChar}{simple}; %typemap{SV*}{simple}; %typemap{wxDouble}{simple}; %typemap{size_t}{simple}; %typemap{time_t}{simple}; %typemap{wxUint32}{simple}; %typemap{wxByte}{simple}; %typemap{wxArrayString}{simple}; %typemap{wxArrayInt}{parsed}{ %output_list{% PUTBACK; wxPli_intarray_push( aTHX_ RETVAL ); SPAGAIN; %}; }; %typemap{const wxArrayString&}{parsed}{ %cpp_type{%wxArrayString%}; %output_list{% PUTBACK; wxPli_stringarray_push( aTHX_ RETVAL ); SPAGAIN; %}; }; %typemap{const wxArrayInt&}{parsed}{ %cpp_type{%wxArrayInt%}; %output_list{% PUTBACK; wxPli_intarray_push( aTHX_ RETVAL ); SPAGAIN; %}; }; %typemap{wxArrayInt&}{parsed}{%wxArrayInt%}; %typemap{wxWindowID}{simple}; %typemap{wxCoord}{simple}; %typemap{wxEventType}{simple}; %typemap{const wxChar*}{simple}; %typemap{PlClassName}{simple}; %typemap{wxPliUserDataCD*}{simple}; %typemap{wxPliUserDataCD**}{simple}; %typemap{wxString}{simple}; %typemap{wxString&}{parsed}{ %cpp_type{%wxString%}; }; %typemap{const wxString&}{parsed}{ %cpp_type{%wxString%}; }; %typemap{const wxRect&}{reference}; %typemap{const wxSize&}{parsed}{ %cpp_type{%wxSize%}; }; %typemap{const wxPoint&}{parsed}{ %cpp_type{%wxPoint%}; }; %typemap{const wxPosition&}{parsed}{ %cpp_type{%wxPosition%}; }; %typemap{wxSize}{parsed}{ %cpp_type{%wxSize%}; }; %typemap{wxPoint}{parsed}{ %cpp_type{%wxPoint%}; }; %typemap{wxPoint*}{simple}; %typemap{wxPosition}{parsed}{ %cpp_type{%wxPosition%}; }; %typemap{wxPosition*}{simple}; %typemap{const wxArtID&}{parsed}{ %cpp_type{%wxString%}; }; %typemap{const wxArtClient&}{parsed}{ %cpp_type{%wxString%}; }; %typemap{wxArtProvider*}{simple}; %typemap{wxArtProvider&}{reference}; %typemap{wxBitmap}{reference}; %typemap{const wxBitmap&}{reference}; %typemap{wxCursor}{reference}; %typemap{const wxCursor&}{reference}; %typemap{wxIcon}{reference}; %typemap{wxFont}{reference}; %typemap{wxFont*}{simple}; %typemap{wxAnimation*}{simple}; %typemap{wxAnimation&}{reference}; %typemap{const wxAnimation&}{reference}; %typemap{wxAnimationType}{simple}; %typemap{wxDC*}{simple}; %typemap{wxDC&}{reference}; %typemap{const wxDC&}{reference}; %typemap{wxWindowDC*}{simple}; %typemap{wxWindowDC&}{reference}; %typemap{const wxWindowDC&}{reference}; %typemap{wxMemoryDC*}{simple}; %typemap{wxMemoryDC&}{reference}; %typemap{const wxMemoryDC&}{reference}; %typemap{wxPrinterDC*}{simple}; %typemap{wxPrinterDC&}{reference}; %typemap{const wxPrinterDC&}{reference}; %typemap{const wxValidator&}{reference}; %typemap{const wxPen&}{reference}; %typemap{const wxBrush&}{reference}; %typemap{const wxFont&}{reference}; %typemap{wxDateTime*}{simple}; %typemap{wxDateTime&}{reference}; %typemap{const wxDateTime&}{reference}; %typemap{wxDateSpan*}{simple}; %typemap{wxDateSpan&}{reference}; %typemap{const wxDateSpan&}{reference}; %typemap{wxTimeSpan*}{simple}; %typemap{wxTimeSpan&}{reference}; %typemap{const wxTimeSpan&}{reference}; %typemap{wxObject*}{simple}; %typemap{wxEvtHandler*}{simple}; %typemap{wxSplitterWindow*}{simple}; %typemap{wxSplitterEvent*}{simple}; %typemap{wxWindow*}{simple}; %typemap{wxListView*}{simple}; %typemap{wxSizer*}{simple}; %typemap{wxIconBundle*}{simple}; %typemap{wxFrame*}{simple}; %typemap{wxDialog*}{simple}; %typemap{wxChoice*}{simple}; %typemap{wxTreeCtrl*}{simple}; %typemap{wxToolBarBase*}{simple}; %typemap{wxToolBar*}{simple}; %typemap{wxTextCtrl*}{simple}; %typemap{wxControl*}{simple}; %typemap{wxMenu*}{simple}; %typemap{wxKeyEvent&}{reference}; %typemap{wxColour}{reference}; %typemap{const wxColour&}{reference}; %typemap{const wxIcon&}{reference}; %typemap{const wxIconBundle&}{reference}; %typemap{const wxFont&}{reference}; %typemap{const wxRegion&}{reference}; %typemap{wxImageList*}{simple}; %typemap{wxImage*}{simple}; %typemap{wxImage&}{reference}; %typemap{wxPliInputStream}{simple}; %typemap{wxPliOutputStream}{simple}; %typemap{wxGraphicsContext*}{simple}; %typemap{wxGraphicsContext&}{reference}; %typemap{const wxGraphicsContext&}{reference}; %typemap{const wxGraphicsPath&}{reference}; %typemap{const wxGraphicsMatrix&}{reference}; %typemap{const wxGraphicsPen&}{reference}; %typemap{const wxGraphicsBrush&}{reference}; %typemap{const wxGraphicsFont&}{reference}; %typemap{wxVariant*}{simple}; %typemap{wxVariant&}{reference}; %typemap{const wxVariant&}{reference}; Wx-Scintilla-0.38/README000444001750001750 302511727344243 15277 0ustar00azawawiazawawi000000000000Wx-Scintilla The README is used to introduce the module and provide instructions on how to install the module, any machine dependencies it may have (for example C compilers and installed libraries) and any other information that should be provided before the module is installed. A README file is required for CPAN modules since CPAN extracts the README file from a module distribution so that people browsing the archive can use it to get an idea of the module's uses. It is usually a good idea to provide version information here so that people can decide whether fixes for the module are worth downloading. INSTALLATION To install this module, run the following commands: perl Build.PL ./Build ./Build test ./Build install SUPPORT AND DOCUMENTATION After installing, you can find documentation for this module with the perldoc command. perldoc Wx::Scintilla You can also look for information at: RT, CPAN's request tracker http://rt.cpan.org/NoAuth/Bugs.html?Dist=Wx-Scintilla AnnoCPAN, Annotated CPAN documentation http://annocpan.org/dist/Wx-Scintilla CPAN Ratings http://cpanratings.perl.org/d/Wx-Scintilla Search CPAN http://search.cpan.org/dist/Wx-Scintilla/ LICENSE AND COPYRIGHT Copyright (C) 2011 Ahmad M. Zawawi This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License. See http://dev.perl.org/licenses/ for more information. Wx-Scintilla-0.38/Scintilla.xs000444001750001750 100311727344243 16707 0ustar00azawawiazawawi000000000000/** XS bindings for Wx::Scintilla */ #define PERL_NO_GET_CONTEXT #include "cpp/wxapi.h" #undef THIS MODULE=Wx__Scintilla BOOT: INIT_PLI_HELPERS( wx_pli_helpers ); INCLUDE_COMMAND: $^X -MExtUtils::XSpp::Cmd -e xspp -- -t wx_typemap.xsp XS/ScintillaTextCtrl.xsp INCLUDE_COMMAND: $^X -MExtUtils::XSpp::Cmd -e xspp -- -t wx_typemap.xsp XS/ScintillaTextEvent.xsp #include "cpp/st_constants.cpp" # //FIXME//tricky #if defined(__WXMSW__) #undef XS #define XS( name ) WXXS( name ) #endif MODULE=Wx__Scintilla Wx-Scintilla-0.38/META.json000444001750001750 374011727344243 16044 0ustar00azawawiazawawi000000000000{ "abstract" : "Scintilla source code editing for wxWidgets", "author" : [ "Ahmad M. Zawawi " ], "dynamic_config" : 1, "generated_by" : "Module::Build version 0.38, CPAN::Meta::Converter version 2.112150", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "Wx-Scintilla", "no_index" : { "directory" : [ "tools", "wx-scintilla", "cpp", "inc" ] }, "prereqs" : { "build" : { "requires" : { "Alien::wxWidgets" : 0, "ExtUtils::XSpp" : "0.1602", "Test::More" : 0, "Wx" : 0 } }, "configure" : { "requires" : { "Module::Build" : "0.36", "perl" : "5.006" } }, "runtime" : { "requires" : { "perl" : "5.008" } } }, "provides" : { "Wx::Scintilla" : { "file" : "lib/Wx/Scintilla.pm", "version" : "0.38" }, "Wx::Scintilla::Constant" : { "file" : "lib/Wx/Scintilla/Constant.pm", "version" : "0.38" }, "Wx::Scintilla::TextCtrl" : { "file" : "lib/Wx/Scintilla/TextCtrl.pm", "version" : "0.38" }, "Wx::Scintilla::TextEvent" : { "file" : "lib/Wx/Scintilla/TextEvent.pm", "version" : "0.38" }, "Wx::ScintillaTextCtrl" : { "file" : "lib/Wx/Scintilla.pm", "version" : "0.38" }, "Wx::ScintillaTextEvent" : { "file" : "lib/Wx/Scintilla.pm", "version" : "0.38" } }, "release_status" : "stable", "resources" : { "homepage" : "http://padre.perlide.org/", "license" : [ "http://dev.perl.org/licenses/" ], "repository" : { "url" : "http://svn.perlide.org/padre/trunk/Wx-Scintilla/" } }, "version" : "0.38" } Wx-Scintilla-0.38/wx_typemap000444001750001750 5546511727344243 16576 0ustar00azawawiazawawi000000000000############################################################################# ## Name: typemap ## Purpose: typemap template ## Author: Mattia Barbon ## Modified by: ## Created: 29/10/2000 ## RCS-ID: $Id: typemap 2952 2010-08-15 10:38:47Z mbarbon $ ## Copyright: (c) 2000-2010 Mattia Barbon ## Licence: This program is free software; you can redistribute it and/or ## modify it under the same terms as Perl itself ############################################################################# TYPEMAP wxFlexSizerGrowMode T_ENUM wxEdge T_ENUM wxRelationship T_ENUM wxWindowID T_WINDOWID wxStockCursor T_ENUM wxEventType T_ENUM wxCheckBoxState T_ENUM wxBitmapType T_ENUM const char * T_PV wxCoord T_IV float T_NV wxFontEncoding T_ENUM wxFontFamily T_ENUM wxFontStyle T_ENUM wxFontWeight T_ENUM wxRegionContain T_ENUM wxSashEdgePosition T_ENUM wxSashDragStatus T_ENUM wxListColumnFormat T_ENUM wxRasterOperationMode T_ENUM wxPolygonFillMode T_ENUM wxFloodFillStyle T_ENUM wxMappingMode T_ENUM off_t T_IV ResourceCat T_ENUM wxSeekMode T_ENUM WXCOLORREF T_IV EntryType T_ENUM wxKillError T_ENUM wxSignal T_ENUM wxItemKind T_ENUM wxLayoutDirection T_ENUM PlClassName T_CLASSNAME wxUint32 T_IV wxByte T_U_CHAR wxTextCtrlHitTestResult T_ENUM wxArrayString T_ARRAYSTRING wxPliUserDataCD ** T_ARRAYUSERDATA wxArrayInt T_ARRAYINT wxTextPos T_IV wxTextAttrAlignment T_ENUM wxIdleMode T_ENUM wxDouble T_DOUBLE wxAnimationType T_ENUM wxUpdateUIMode T_ENUM wxWindowVariant T_ENUM wxImageResizeQuality T_ENUM wxAlignment T_ENUM wxFindReplaceDialogStyles T_ENUM wxFindReplaceFlags T_ENUM wxBackgroundStyle T_ENUM wxSystemColour T_ENUM wxSystemFont T_ENUM wxSystemMetric T_ENUM wxSystemScreenType T_ENUM wxOrientation T_ENUM wxBatteryState T_ENUM wxPowerType T_ENUM wxDirection T_ENUM wxPenStyle T_ENUM wxPenCap T_ENUM wxPenJoin T_ENUM wxBrushStyle T_ENUM wxShowEffect T_ENUM wxDialogLayoutAdaptationMode T_ENUM wxLogTraceMask T_UV wxLogLevel T_UV wxTraceMask T_UV wxTreeItemIdValue T_UV wxTreeItemIcon T_UV wxKeyCode T_KEYCODE wxChar T_IV wxStockHelpStringClient T_ENUM wxDateTime * O_NON_WXOBJECT Wx_UserDataCD * O_USERDATACD wxPliUserDataCD * O_USERDATACD Wx_UserDataO * O_USERDATAO wxPliUserDataO * O_USERDATAO SV_null * T_SV_NULL wxClassInfo * O_NON_WXOBJECT wxPropertyInfo * O_NON_WXOBJECT const wxClassInfo * O_NON_WXOBJECT const wxPropertyInfo * O_NON_WXOBJECT const wxTypeInfo * O_NON_WXOBJECT wxTypeInfo * O_NON_WXOBJECT wxPropertyAccessor * O_NON_WXOBJECT wxTypeKind T_ENUM wxPropertyInfoFlags T_ENUM wxObject * O_WXOBJECT wxApp * O_WXOBJECT wxStandardPaths * O_NON_WXOBJECT wxWindow * O_WXOBJECT wxPlWindow * O_WXOBJECT wxPlControl * O_WXOBJECT wxFrame * O_WXOBJECT wxTopLevelWindow * O_WXOBJECT wxEvtHandler * O_WXOBJECT wxMiniFrame * O_WXOBJECT wxPopupWindow * O_WXOBJECT wxPopupTransientWindow * O_WXOBJECT wxPlPopupTransientWindow * O_WXOBJECT wxDisplay * O_NON_WXOBJECT_THR wxVideoMode * O_NON_WXOBJECT_THR wxEventBlocker * O_NON_WXOBJECT_THR wxWindowUpdateLocker * O_NON_WXOBJECT_THR wxMenuBar * O_WXOBJECT wxMenu * O_WXOBJECT wxMenuItem * O_WXOBJECT wxDirFilterListCtrl * O_WXEVTHANDLER wxDirCtrl * O_WXEVTHANDLER wxFileCtrl * O_WXEVTHANDLER wxGenericDirCtrl * O_WXEVTHANDLER wxAnimationCtrl * O_WXEVTHANDLER wxStatusBar * O_WXEVTHANDLER wxToolBar * O_WXEVTHANDLER wxToolBarBase * O_WXEVTHANDLER wxToolBarSimple * O_WXEVTHANDLER wxPanel * O_WXOBJECT wxDialog * O_WXOBJECT wxControl * O_WXOBJECT wxButton * O_WXEVTHANDLER wxStaticText * O_WXEVTHANDLER wxStaticLine * O_WXEVTHANDLER wxTextCtrl * O_WXOBJECT wxTextCtrlBase * O_WXOBJECT wxPropertySheetDialog * O_WXEVTHANDLER wxPlValidator * O_WXOBJECT wxValidator * O_WXOBJECT wxCheckBox * O_WXEVTHANDLER wxChoice * O_WXEVTHANDLER wxComboBox * O_WXEVTHANDLER wxComboCtrl * O_WXEVTHANDLER wxComboCtrlBase * O_WXEVTHANDLER wxComboPopup * O_NON_WXOBJECT wxPlComboPopup * O_NON_WXOBJECT wxOwnerDrawnComboBox * O_WXEVTHANDLER wxPlOwnerDrawnComboBox * O_WXEVTHANDLER wxControlWithItems * O_WXOBJECT wxEditableListBox * O_WXOBJECT wxListBox * O_WXEVTHANDLER wxStaticBox * O_WXEVTHANDLER wxRadioButton * O_WXEVTHANDLER wxRadioBox * O_WXEVTHANDLER wxScrollBar * O_WXEVTHANDLER wxNotebook * O_WXEVTHANDLER wxBookCtrl * O_WXEVTHANDLER wxBookCtrlBase * O_WXEVTHANDLER wxCheckListBox * O_WXEVTHANDLER wxGauge * O_WXEVTHANDLER wxBitmapButton * O_WXEVTHANDLER wxTreeCtrl * O_WXOBJECT wxListCtrl * O_WXOBJECT wxListView * O_WXEVTHANDLER wxStaticBitmap * O_WXEVTHANDLER wxSpinButton * O_WXEVTHANDLER wxSpinCtrl * O_WXEVTHANDLER wxSpinCtrlDouble * O_WXEVTHANDLER wxSlider * O_WXEVTHANDLER wxScrolledWindow * O_WXOBJECT wxVScrolledWindow * O_WXEVTHANDLER wxHScrolledWindow * O_WXEVTHANDLER wxHVScrolledWindow * O_WXEVTHANDLER wxPlVScrolledWindow * O_WXEVTHANDLER wxPlHScrolledWindow * O_WXEVTHANDLER wxPlHVScrolledWindow * O_WXEVTHANDLER wxVListBox * O_WXEVTHANDLER wxPlVListBox * O_WXEVTHANDLER wxSplitterWindow * O_WXEVTHANDLER wxSearchCtrl * O_WXEVTHANDLER wxSashWindow * O_WXEVTHANDLER wxToggleButton * O_WXEVTHANDLER wxBitmapToggleButton * O_WXEVTHANDLER wxSplashScreen * O_WXOBJECT wxSplashScreenWindow * O_WXOBJECT wxListbook * O_WXEVTHANDLER wxChoicebook * O_WXEVTHANDLER wxToolbook * O_WXEVTHANDLER wxTreebook * O_WXEVTHANDLER wxHyperlinkCtrl * O_WXEVTHANDLER wxPickerBase * O_WXEVTHANDLER wxColourPickerCtrl * O_WXEVTHANDLER wxFilePickerCtrl * O_WXEVTHANDLER wxDirPickerCtrl * O_WXEVTHANDLER wxFontPickerCtrl * O_WXEVTHANDLER wxCollapsiblePane * O_WXEVTHANDLER wxBitmapComboBox * O_WXEVTHANDLER wxInfoBar * O_WXEVTHANDLER wxHeaderCtrl * O_WXEVTHANDLER wxPlHeaderCtrl * O_WXEVTHANDLER wxHeaderCtrlSimple * O_WXEVTHANDLER wxHeaderColumn * O_NON_WXOBJECT_THR wxSettableHeaderColumn * O_NON_WXOBJECT_THR wxHeaderColumnSimple * O_NON_WXOBJECT_THR wxPlHeaderColumn * O_NON_WXOBJECT_SELF wxPlSettableHeaderColumn * O_NON_WXOBJECT_SELF wxWizard * O_WXOBJECT wxWizardPage * O_WXOBJECT wxWizardPageSimple * O_WXOBJECT wxColourDialog * O_WXOBJECT wxFileDialog * O_WXOBJECT wxDirDialog * O_NON_WXOBJECT wxNumberEntryDialog * O_WXOBJECT wxMultiChoiceDialog * O_WXOBJECT wxSingleChoiceDialog * O_WXOBJECT wxMultipleChoiceDialog* O_WXOBJECT wxTextEntryDialog * O_WXOBJECT wxPasswordEntryDialog * O_WXOBJECT wxFontDialog * O_WXOBJECT wxPageSetupDialog * O_WXOBJECT wxPrintDialog * O_WXOBJECT wxMessageDialog * O_WXOBJECT wxProgressDialog * O_WXOBJECT wxFindReplaceDialog * O_WXOBJECT wxPropertySheetDialog * O_WXOBJECT wxFindReplaceData * O_NON_WXOBJECT wxColourData * O_WXOBJECT_THR wxFontData * O_WXOBJECT_THR wxSizer * O_WXOBJECT wxPlSizer * O_WXOBJECT wxBoxSizer * O_WXOBJECT wxStaticBoxSizer * O_WXOBJECT wxNotebookSizer * O_WXOBJECT wxGridSizer * O_WXOBJECT wxFlexGridSizer * O_WXOBJECT wxSizerItem * O_WXOBJECT wxGridBagSizer * O_WXOBJECT wxGBPosition * O_NON_WXOBJECT wxGBSpan * O_NON_WXOBJECT wxGBPosition O_GBPOSITION wxGBSpan O_GBSPAN wxGBPosition & O_GBPOSITION wxGBSpan & O_GBSPAN wxGBSizerItem * O_WXOBJECT wxStdDialogButtonSizer * O_WXOBJECT wxWrapSizer * O_WXOBJECT wxDC * O_WXOBJECT_THR wxMemoryDC * O_WXOBJECT_THR wxPrinterDC * O_WXOBJECT_THR wxWindowDC * O_WXOBJECT_THR wxClientDC * O_WXOBJECT_THR wxPaintDC * O_WXOBJECT_THR wxScreenDC * O_WXOBJECT_THR wxBufferedDC * O_WXOBJECT_THR wxBufferedPaintDC * O_WXOBJECT_THR wxAutoBufferedPaintDC * O_WXOBJECT_THR wxMirrorDC * O_WXOBJECT_THR wxSVGFileDC * O_WXOBJECT_THR wxGCDC * O_WXOBJECT_THR wxOverlay * O_NON_WXOBJECT_THR wxDCOverlay * O_NON_WXOBJECT_THR wxDCClipper * O_NON_WXOBJECT_THR wxTaskBarIcon * O_WXOBJECT wxNotificationMessage * O_NON_WXOBJECT_THR wxTextAttr * O_NON_WXOBJECT_THR wxLog * O_NON_WXOBJECT wxLogTextCtrl * O_NON_WXOBJECT wxLogNull * O_NON_WXOBJECT_THR wxLogGui * O_NON_WXOBJECT wxLogWindow * O_NON_WXOBJECT wxLogChain * O_NON_WXOBJECT wxLogPassThrough * O_NON_WXOBJECT wxLogStderr * O_NON_WXOBJECT wxPlLog * O_NON_WXOBJECT wxPlLogPassThrough * O_NON_WXOBJECT wxLocale * O_NON_WXOBJECT_THR wxLanguageInfo * O_NON_WXOBJECT_THR const wxLanguageInfo * O_NON_WXOBJECT_THR wxStopWatch * O_NON_WXOBJECT_THR wxAboutDialogInfo * O_NON_WXOBJECT wxPoint O_POINT wxSize O_SIZE wxPosition O_POSITION wxColour O_NON_WXOBJECT_VAL wxPoint & O_POINT wxSize & O_SIZE wxPosition & O_POSITION wxColour & O_NON_WXOBJECT_VAL wxVariant* O_NON_WXOBJECT_THR wxVariant O_VARIANT wxProcess * O_WXOBJECT wxSound * O_NON_WXOBJECT_THR wxTipProvider * O_NON_WXOBJECT wxDrawObject * O_NON_WXOBJECT wxSize * O_NON_WXOBJECT_THR wxPoint * O_NON_WXOBJECT_THR wxRect * O_NON_WXOBJECT_THR wxPosition * O_NON_WXOBJECT_THR wxColour * O_NON_WXOBJECT_THR wxCaret * O_NON_WXOBJECT wxCaretSuspend * O_NON_WXOBJECT_THR wxWindowDisabler * O_NON_WXOBJECT_THR wxBusyCursor * O_NON_WXOBJECT_THR wxBusyInfo * O_NON_WXOBJECT_THR wxLayoutConstraints * O_WXOBJECT wxIndividualLayoutConstraint * O_WXOBJECT wxDropTarget * O_NON_WXOBJECT wxListItem * O_NON_WXOBJECT_THR wxListItemAttr * O_NON_WXOBJECT_THR wxPliTreeItemData * O_NON_WXOBJECT wxTreeItemData * O_NON_WXOBJECT wxTreeItemId * O_NON_WXOBJECT_THR wxAnimation * O_WXOBJECT_THR wxFontMapper * O_NON_WXOBJECT wxFontEnumerator * O_NON_WXOBJECT_THR wxNativeFontInfo * O_NON_WXOBJECT_THR wxFont * O_WXOBJECT_THR wxRegion * O_WXOBJECT_THR wxIcon * O_WXOBJECT_THR wxIconBundle * O_NON_WXOBJECT wxIconLocation * O_NON_WXOBJECT wxBitmap * O_WXOBJECT_THR wxCursor * O_WXOBJECT_THR const wxCursor * O_WXOBJECT_THR wxToolTip * O_WXOBJECT wxPen * O_WXOBJECT_THR wxMask * O_WXOBJECT wxBrush * O_WXOBJECT_THR wxBitmapHandler * O_WXOBJECT wxPalette * O_WXOBJECT_THR wxMimeTypesManager * O_NON_WXOBJECT_THR wxFileType * O_NON_WXOBJECT wxFileTypeInfo * O_NON_WXOBJECT wxImage * O_WXOBJECT_THR wxImageHandler * O_WXOBJECT wxBMPHandler * O_WXOBJECT wxGIFHandler * O_WXOBJECT wxPCXHandler * O_WXOBJECT wxPNMHandler * O_WXOBJECT wxTIFFHandler * O_WXOBJECT wxJPEGHandler * O_WXOBJECT wxPNGHandler * O_WXOBJECT wxXPMHandler * O_WXOBJECT wxIFFHandler * O_WXOBJECT wxICOHandler * O_WXOBJECT wxCURHandler * O_WXOBJECT wxANIHandler * O_WXOBJECT wxTGAHandler * O_WXOBJECT wxImageList * O_WXOBJECT_THR wxToolBarToolBase * O_NON_WXOBJECT wxAcceleratorEntry * O_NON_WXOBJECT_THR wxAcceleratorTable * O_WXOBJECT_THR wxTimer * O_WXOBJECT wxSingleInstanceChecker * O_NON_WXOBJECT_THR wxWave * O_NON_WXOBJECT wxGraphicsRenderer * O_WXOBJECT wxGraphicsBrush * O_WXOBJECT_THR wxGraphicsContext * O_WXOBJECT_THR wxGraphicsFont * O_WXOBJECT_THR wxGraphicsMatrix * O_WXOBJECT_THR wxGraphicsObject * O_WXOBJECT_THR wxGraphicsPath * O_WXOBJECT_THR wxGraphicsPen * O_WXOBJECT_THR wxGraphicsGradientStop * O_NON_WXOBJECT_THR wxGraphicsGradientStops * O_NON_WXOBJECT_THR # events wxEvent * O_WXOBJECT_THR wxActivateEvent * O_WXOBJECT_THR wxBookCtrlEvent * O_WXOBJECT_THR wxClipboardTextEvent * O_WXOBJECT_THR wxCloseEvent * O_WXOBJECT_THR wxCommandEvent * O_WXOBJECT_THR wxContextMenuEvent * O_WXOBJECT_THR wxEraseEvent * O_WXOBJECT_THR wxFindDialogEvent * O_WXOBJECT_THR wxFocusEvent * O_WXOBJECT_THR wxFileCtrlEvent * O_WXOBJECT_THR wxKeyEvent * O_WXOBJECT_THR wxHelpEvent * O_WXOBJECT_THR wxIconizeEvent * O_WXOBJECT_THR wxIdleEvent * O_WXOBJECT_THR wxInitDialogEvent * O_WXOBJECT_THR wxJoystickEvent * O_WXOBJECT_THR wxListbookEvent * O_WXOBJECT_THR wxListEvent * O_WXOBJECT_THR wxMaximizeEvent * O_WXOBJECT_THR wxMenuEvent * O_WXOBJECT_THR wxMouseCaptureChangedEvent * O_WXOBJECT_THR wxMouseCaptureLostEvent * O_WXOBJECT_THR wxMouseEvent * O_WXOBJECT_THR wxMoveEvent * O_WXOBJECT_THR wxNotebookEvent * O_WXOBJECT_THR wxNotifyEvent * O_WXOBJECT_THR wxPaintEvent * O_WXOBJECT_THR wxQueryLayoutInfo * O_WXOBJECT_THR wxSashEvent * O_WXOBJECT_THR wxSizeEvent * O_WXOBJECT_THR wxScrollEvent * O_WXOBJECT_THR wxScrollWinEvent * O_WXOBJECT_THR wxSpinEvent * O_WXOBJECT_THR wxSplitterEvent * O_WXOBJECT_THR wxSetCursorEvent * O_WXOBJECT_THR wxSysColourChangedEvent * O_WXOBJECT_THR wxTaskBarIconEvent * O_WXOBJECT_THR wxTimerEvent * O_WXOBJECT_THR wxTreeEvent * O_WXOBJECT_THR wxUpdateUIEvent * O_WXOBJECT_THR wxTextUrlEvent * O_WXOBJECT_THR wxProcessEvent * O_WXOBJECT_THR wxWizardEvent * O_WXOBJECT_THR wxTreebookEvent * O_WXOBJECT_THR wxNavigationKeyEvent * O_WXOBJECT_THR wxChildFocusEvent * O_WXOBJECT_THR wxHyperlinkEvent * O_WXOBJECT_THR wxPowerEvent * O_WXOBJECT_THR wxColourPickerEvent * O_WXOBJECT_THR wxFileDirPickerEvent * O_WXOBJECT_THR wxFontPickerEvent * O_WXOBJECT_THR wxWindowCreateEvent * O_WXOBJECT_THR wxWindowDestroyEvent * O_WXOBJECT_THR wxCollapsiblePaneEvent * O_WXOBJECT_THR wxHeaderCtrlEvent * O_WXOBJECT_THR wxPlEvent * O_WXOBJECT_THR wxPlCommandEvent * O_WXOBJECT_THR wxPlThreadEvent * O_WXOBJECT_THR wxConfigBase * O_NON_WXOBJECT wxConfig * O_NON_WXOBJECT wxFileConfig * O_NON_WXOBJECT wxArtProvider * O_WXOBJECT wxPlArtProvider * O_WXOBJECT OUTPUT O_WXOBJECT wxPli_object_2_sv( aTHX_ $arg, $var ); O_WXOBJECT_THR wxPli_object_2_sv( aTHX_ $arg, $var ); wxPli_thread_sv_register( aTHX_ ${(my $ntt=$ntype)=~s/^(?:const\s+)?(?:Wx_|wx)(.*?)(?:Ptr)?$/$1/g;$ntt=qq{\"Wx::$ntt\"};\$ntt}, $var, $arg ); O_WXEVTHANDLER wxPli_evthandler_2_sv( aTHX_ $arg, $var ); O_WXCLIENTDATACONTAINER wxPli_clientdatacontainer_2_sv( aTHX_ $arg, $var, ${(my $ntt=$ntype)=~s/^(?:const\s+)?(?:Wx_|wx)(.*?)(?:Ptr)?$/$1/g;$ntt=qq{\"Wx::$ntt\"};\$ntt} ); O_WXCLIENTDATACONTAINER_THR_SV wxPli_clientdatacontainer_2_sv( aTHX_ $arg, $var, ${(my $ntt=$ntype)=~s/^(?:const\s+)?(?:Wx_|wx)(.*?)(?:Ptr)?$/$1/g;$ntt=qq{\"Wx::$ntt\"};\$ntt} ); wxPli_thread_sv_register( aTHX_ ${(my $ntt=$ntype)=~s/^(?:const\s+)?(?:Wx_|wx)(.*?)(?:Ptr)?$/$1/g;$ntt=qq{\"Wx::$ntt\"};\$ntt}, SvRV( $arg ), $arg ); O_NON_WXOBJECT wxPli_non_object_2_sv( aTHX_ $arg, $var, ${(my $ntt=$ntype)=~s/^(?:const\s+)?(?:Wx_|wx)(.*?)(?:Ptr)?$/$1/g;$ntt=qq{\"Wx::$ntt\"};\$ntt} ); O_NON_WXOBJECT_THR wxPli_non_object_2_sv( aTHX_ $arg, $var, ${(my $ntt=$ntype)=~s/^(?:const\s+)?(?:Wx_|wx)(.*?)(?:Ptr)?$/$1/g;$ntt=qq{\"Wx::$ntt\"};\$ntt} ); wxPli_thread_sv_register( aTHX_ ${(my $ntt=$ntype)=~s/^(?:const\s+)?(?:Wx_|wx)(.*?)(?:Ptr)?$/$1/g;$ntt=qq{\"Wx::$ntt\"};\$ntt}, $var, $arg ); O_NON_WXOBJECT_THR_SV wxPli_non_object_2_sv( aTHX_ $arg, $var, ${(my $ntt=$ntype)=~s/^(?:const\s+)?(?:Wx_|wx)(.*?)(?:Ptr)?$/$1/g;$ntt=qq{\"Wx::$ntt\"};\$ntt} ); wxPli_thread_sv_register( aTHX_ ${(my $ntt=$ntype)=~s/^(?:const\s+)?(?:Wx_|wx)(.*?)(?:Ptr)?$/$1/g;$ntt=qq{\"Wx::$ntt\"};\$ntt}, SvRV( $arg ), $arg ); O_SIZE wxPli_non_object_2_sv( aTHX_ $arg, new $type($var), ${(my $ntt=$ntype)=~s/^(?:const\s+)?(?:Wx_|wx)(.*?)(?:Ptr)?$/$1/g;$ntt=qq{\"Wx::$ntt\"};\$ntt} ); O_GBPOSITION wxPli_non_object_2_sv( aTHX_ $arg, new $type($var), ${(my $ntt=$ntype)=~s/^(?:const\s+)?(?:Wx_|wx)(.*?)(?:Ptr)?$/$1/g;$ntt=qq{\"Wx::$ntt\"};\$ntt} ); O_GBSPAN wxPli_non_object_2_sv( aTHX_ $arg, new $type($var), ${(my $ntt=$ntype)=~s/^(?:const\s+)?(?:Wx_|wx)(.*?)(?:Ptr)?$/$1/g;$ntt=qq{\"Wx::$ntt\"};\$ntt} ); O_POINT wxPli_non_object_2_sv( aTHX_ $arg, new $type($var), ${(my $ntt=$ntype)=~s/^(?:const\s+)?(?:Wx_|wx)(.*?)(?:Ptr)?$/$1/g;$ntt=qq{\"Wx::$ntt\"};\$ntt} ); O_POSITION wxPli_non_object_2_sv( aTHX_ $arg, new $type($var), ${(my $ntt=$ntype)=~s/^(?:const\s+)?(?:Wx_|wx)(.*?)(?:Ptr)?$/$1/g;$ntt=qq{\"Wx::$ntt\"};\$ntt} ); T_KEYCODE sv_setiv( $arg, $var ); T_UV sv_setuv( $arg, (UV)$var ); INPUT O_WXOBJECT $var = (${(my $t=$type)=~s/^Wx_/wx/;\$t}) wxPli_sv_2_object( aTHX_ $arg, ${(my $ntt=$ntype)=~s/^(?:const\s+)?(?:Wx_|wx)(.*?)(?:Ptr)?$/$1/g;$ntt=qq{\"Wx::$ntt\"};\$ntt} ); O_WXOBJECT_THR $var = (${(my $t=$type)=~s/^Wx_/wx/;\$t}) wxPli_sv_2_object( aTHX_ $arg, ${(my $ntt=$ntype)=~s/^(?:const\s+)?(?:Wx_|wx)(.*?)(?:Ptr)?$/$1/g;$ntt=qq{\"Wx::$ntt\"};\$ntt} ); O_WXEVTHANDLER $var = (${(my $t=$type)=~s/^Wx_/wx/;\$t}) wxPli_sv_2_object( aTHX_ $arg, ${(my $ntt=$ntype)=~s/^(?:const\s+)?(?:Wx_|wx)(.*?)(?:Ptr)?$/$1/g;$ntt=qq{\"Wx::$ntt\"};\$ntt} ); O_WXCLIENTDATACONTAINER $var = (${(my $t=$type)=~s/^Wx_/wx/;\$t}) wxPli_sv_2_object( aTHX_ $arg, ${(my $ntt=$ntype)=~s/^(?:const\s+)?(?:Wx_|wx)(.*?)(?:Ptr)?$/$1/g;$ntt=qq{\"Wx::$ntt\"};\$ntt} ); O_WXCLIENTDATACONTAINER_THR_SV $var = (${(my $t=$type)=~s/^Wx_/wx/;\$t}) wxPli_sv_2_object( aTHX_ $arg, ${(my $ntt=$ntype)=~s/^(?:const\s+)?(?:Wx_|wx)(.*?)(?:Ptr)?$/$1/g;$ntt=qq{\"Wx::$ntt\"};\$ntt} ); O_NON_WXOBJECT $var = (${(my $t=$type)=~s/^Wx_/wx/;\$t}) wxPli_sv_2_object( aTHX_ $arg, ${(my $ntt=$ntype)=~s/^(?:const\s+)?(?:Wx_|wx)(.*?)(?:Ptr)?$/$1/g;$ntt=qq{\"Wx::$ntt\"};\$ntt} ); O_NON_WXOBJECT_VAL $var = *($type *) wxPli_sv_2_object( aTHX_ $arg, ${(my $ntt=$ntype)=~s/^(?:const\s+)?(?:Wx_|wx)(.*?)(?:Ptr)?$/$1/g;$ntt=qq{\"Wx::$ntt\"};\$ntt} ); O_NON_WXOBJECT_THR $var = (${(my $t=$type)=~s/^Wx_/wx/;\$t}) wxPli_sv_2_object( aTHX_ $arg, ${(my $ntt=$ntype)=~s/^(?:const\s+)?(?:Wx_|wx)(.*?)(?:Ptr)?$/$1/g;$ntt=qq{\"Wx::$ntt\"};\$ntt} ); O_NON_WXOBJECT_THR_SV $var = (${(my $t=$type)=~s/^Wx_/wx/;\$t}) wxPli_sv_2_object( aTHX_ $arg, ${(my $ntt=$ntype)=~s/^(?:const\s+)?(?:Wx_|wx)(.*?)(?:Ptr)?$/$1/g;$ntt=qq{\"Wx::$ntt\"};\$ntt} ); O_POINT $var = wxPli_sv_2_wxpoint( aTHX_ $arg ); O_SIZE $var = wxPli_sv_2_wxsize( aTHX_ $arg ); O_POSITION $var = wxPli_sv_2_wxposition( aTHX_ $arg ); O_GBPOSITION $var = wxPli_sv_2_wxgbposition( aTHX_ $arg ); O_GBSPAN $var = wxPli_sv_2_wxgbspan( aTHX_ $arg ); T_KEYCODE $var = wxPli_sv_2_keycode( aTHX_ $arg ); T_UV $var = ($type)SvUV( $arg ); T_CLASSNAME $var = wxPli_get_class( aTHX_ $arg ); O_VARIANT $var = wxPli_sv_2_wxvariant( aTHX_ $arg ); # # Wx_UserData* # INPUT O_USERDATACD if( SvOK( $arg ) ) { $var = new wxPliUserDataCD( $arg ); } else $var = 0; O_USERDATAO if( SvOK( $arg ) ) { $var = new wxPliUserDataO( $arg ); } else $var = 0; OUTPUT O_USERDATACD $arg = ( $var == 0 ) ? &PL_sv_undef : $var->GetData(); SvREFCNT_inc( $arg ); // xsubpp mortalizes it... O_USERDATAO $arg = ( $var == 0 ) ? &PL_sv_undef : $var->GetData(); SvREFCNT_inc( $arg ); // xsubpp mortalizes it... # # Objects with a self reference # INPUT O_NON_WXOBJECT_SELF $var = (${(my $t=$type)=~s/^Wx_/wx/;\$t}) wxPli_sv_2_object( aTHX_ $arg, ${(my $ntt=$ntype)=~s/^(?:const\s+)?(?:Wx_|wx)(.*?)(?:Ptr)?$/$1/g;$ntt=qq{\"Wx::$ntt\"};\$ntt} ); OUTPUT O_NON_WXOBJECT_SELF $arg = ( $var == 0 ) ? &PL_sv_undef : $var->GetSelf(); SvREFCNT_inc( $arg ); // xsubpp mortalizes it... # # SV_null # INPUT T_SV_NULL $var = SvOK( $arg ) ? $arg : 0; OUTPUT T_SV_NULL $arg = ( $var == 0 ) ? &PL_sv_undef : $var; SvREFCNT_inc( $arg ); // xsubpp mortalizes it... # # streams # TYPEMAP wxPliInputStream S_PL_ISTREAM wxPliOutputStream S_PL_OSTREAM wxInputStream * S_WX_ISTREAM wxOutputStream * S_WX_OSTREAM Wx_InputStream * O_NON_WXOBJECT Wx_OutputStream * O_NON_WXOBJECT INPUT S_PL_ISTREAM wxPli_sv_2_istream( aTHX_ $arg, $var ); S_PL_OSTREAM wxPli_sv_2_ostream( aTHX_ $arg, $var ); OUTPUT S_WX_ISTREAM wxPli_stream_2_sv( aTHX_ $arg, $var, "Wx::InputStream" ); S_WX_OSTREAM wxPli_stream_2_sv( aTHX_ $arg, $var, "Wx::OutputStream" ); # Unicode support TYPEMAP wxChar * T_WXCHAR const wxChar* T_CONST_WXCHAR wxString T_WXSTRING INPUT T_WXCHAR WXCHAR_INPUT( $var, wxChar*, $arg ); T_CONST_WXCHAR WXCHAR_INPUT( $var, wxChar*, $arg ); T_WXSTRING WXSTRING_INPUT( $var, $type, $arg ); OUTPUT T_WXCHAR WXCHAR_OUTPUT( $var, $arg ); T_CONST_WXCHAR WXCHAR_OUTPUT( $var, $arg ); T_WXSTRING WXSTRING_OUTPUT( $var, $arg ); # typemap for window ID INPUT T_WINDOWID $var = wxPli_get_wxwindowid( aTHX_ $arg ); OUTPUT T_WINDOWID sv_setiv($arg, (IV)$var); INPUT T_ARRAYSTRING wxPli_av_2_arraystring( aTHX_ $arg, & $var ); INPUT T_ARRAYINT wxPli_av_2_arrayint( aTHX_ $arg, & $var ); INPUT T_ARRAYUSERDATA wxPli_av_2_userdatacdarray( aTHX_ $arg, & $var ); wxPliArrayGuard guard_$var = $var;Wx-Scintilla-0.38/typemap000444001750001750 21311727344243 15775 0ustar00azawawiazawawi000000000000## Scintilla typemap TYPEMAP wxDragResult T_ENUM wxScintillaTextCtrl * O_WXOBJECT wxScintillaTextEvent * O_WXOBJECT Wx-Scintilla-0.38/ticket_1341.patch000444001750001750 202111727344243 17366 0ustar00azawawiazawawi000000000000Index: LexAda.cxx =================================================================== --- LexAda.cxx (revision 16781) +++ LexAda.cxx (working copy) @@ -11,6 +11,10 @@ #include #include +#include +#ifdef _MSC_VER +#pragma warning(disable: 4786) +#endif #include #include "ILexer.h" Index: LexMPT.cxx =================================================================== --- LexMPT.cxx (revision 16781) +++ LexMPT.cxx (working copy) @@ -13,6 +13,10 @@ #include #include +#include +#ifdef _MSC_VER +#pragma warning(disable: 4786) +#endif #include #include "ILexer.h" Index: LexSpice.cxx =================================================================== --- LexSpice.cxx (revision 16781) +++ LexSpice.cxx (working copy) @@ -11,6 +11,10 @@ #include #include +#include +#ifdef _MSC_VER +#pragma warning(disable: 4786) +#endif #include #include "ILexer.h" Wx-Scintilla-0.38/Changes000444001750001750 3457311727344243 15746 0ustar00azawawiazawawi000000000000Revision history for Wx-Scintilla 0.38 2012.3.12 - Released 0.37_06 as stable 0.38 (AZAWAWI) 0.37_06 2012.3.9 - Updated Wx::Scintilla::Constant (AZAWAWI) - In MacOSX, include CoreFoundation when doing a cocoa build (MARKD) - Better determination of wxWidgets architectures (MARKD) - Fix for Lion users who recently upgraded to Xcode 4.3 (MARKD) 0.37_05 2012.3.8 - Wrap STC specific implementations of LineUp / LineDown. This should move the caret one line up or down (MARKD). - Updated to Scintilla 3.0.4 (AZAWAWI): - ECL lexer added. - CPP lexer fixes styling after document comment keywords. - Pascal folder improves handling of some constructs. - XML lexer avoids entering a bad mode due to complex preprocessor instructions. - Duplicate command is always remembered as a distinct command for undo. - Fix bug where setting an indicator for the whole document would fail. - Crash fixed for SCI_MOVESELECTEDLINESDOWN with empty vertical selection. - Fractional widths used for line numbers, character markers and other situations. - RGBA markers are drawn centred when taller than line. - Image marker drawing problem fixed for markers taller than line. - Markers are drawn horizontally off-centre based on margin type instead of dimensions. - Fold tail markers drawn vertically centred. - Fixed problems with multiple clicks in margin and with mouse actions combined with virtual space. - Fixed bug with using page up and down and not returning to original line. - Down arrow with wrapped text no longer skips lines. - Fix problem with dwell ending immediately due to word wrap. - Wrapped lines are rewrapped more consistently while resizing window. - Selected line ends are highlighted more consistently. - Redrawing reduced for some marker calls. - No more CPAN indexing of inc directory (AZAWAWI) 0.37_04 2012.2.6 - Fixed linking issue with 0.37_03 (AZAWAWI) 0.37_03 2012.2.6 - Minor update to Wx::Scintilla::Constant (AZAWAWI) 0.37_02 2012.2.6 - Updated to Scintilla 3.0.3 (AZAWAWI): - Scintilla 3.0.3 is a minor bug fix release. - Fractional character positioning was extended to more areas. - Lexers were added for the AviSynth and Take Command languages and the CSS lexer was extended to support SCSS. 0.37_01 2011.12.22 - Updated wx-scintilla\src\scintilla\README.txt to fix packaging issues (AZAWAWI) 0.36 2011.12.21 - Released 0.33_05 as stable 0.36 (AZAWAWI) 0.35_05 2011.12.11 - Upgraded to Scintilla 3.0.2 (AZAWAWI) 0.35_04 2011.11.14 - Fix SurfaceImpl::Polygon drawing bug that caused some markers to not be drawn at all. This was introduced in 0.35_01 (AZAWAWI) 0.35_03 2011.11.13 - Updated Scintilla to 3.0.1 pre-release (AZAWAWI). Relevant changes are: - Highlight "else" as a keyword for TCL in the same way as other languages. - Ensure pixmaps allocated before painting as there was a crash when Scintilla drew without common initialisation calls. 0.35_02 2011.11.3 - Fixed bold font bug reported by Kevin Dawson [BOWTIE] (AZAWAWI) 0.35_01 2011.11.2 - Wx::ScintillaTextCtrl -> Wx::Scintilla::TextCtrl in tools/ (AZAWAWI) - Upgrade to Scintilla 3.0 (AZAWAWI). The following are the related changes: - Paletted display support removed. - New API to see if all lines are visible which can be used to optimize processing fold structure notifications. - Scrolling optimized by avoiding invalidation of fold margin when redrawing whole window. - Optimized SCI_MARKERNEXT. - C++ lexer supports Pike hash quoted strings when turned on with lexer.cpp.hashquoted.strings. - Fixed incorrect line height with annotations in wrapped mode when there are multiple views. Bug #3388159. - Calltips may be displayed above the text as well as below. Bug #3410830. 0.34 2011.11.2 - Released 0.33_03 as stable 0.34 (AZAWAWI) 0.33_03 2011.11.2 Fixed 0.33_02 regressions regarding Wx constants support (AZAWAWI) 0.33_02 2011.11.2 ** BAD RELEASE ** - Removed wxSTC_CMD_ internal constants and CmdKeyExecute method (AZAWAWI) - Removed unused st_constants.cpp (AZAWAWI) - Fixed tests, tools and SYNOPSIS to fully use Wx::Scintilla constants (AZAWAWI) 0.33_01 2011.11.2 - Moved Wx::ScintillaTextCtrl to Wx::Scintilla::TextCtrl (ADAMK) - Moved Wx::ScintillaTextEvent to Wx::Scintilla::TextEvent (ADAMK) - Moved Wx::Event::EVT_STC_XXXXXX to Wx::Scintilla::EVT_XXXXXX (ADAMK) - Generate Wx::Scintilla::Constant that contains the same Scintilla constant names along with their POD documentation from Scintilla.iface (AZAWAWI) - Add $VERSION to all modules (ADAMK) - Add use 5.008 to all modules (ADAMK) - Added 'Meta: no_index' for 'tools', 'cpp' and 'wx-scintilla' directories (DOLMEN) 0.32 2011.10.11 - Released 0.31_02 as stable 0.32 (AZAWAWI) 0.31_02 2011.10.11 - Wx::Scintilla contains now Wx::wxSTC_XYZ as Wx::Scintilla::XYZ constants (AZAWAWI) 0.31_01 2011.10.9 - Croak about deprecated EVT_STC_POSCHANGED (SUBMERSIBLE_TOASTER, AZAWAWI) - Fix ticket:1341 'Wx-Scintilla build fails on wxWidgets 2.8.10' (MARKD) 0.30 2011.9.18 - Released 0.29_03 as stable 0.30 (AZAWAWI) 0.29_03 2011.9.17 - Updated to Scintilla 2.29 released on 16th September 2011 (AZAWAWI): - LaTeX lexer improved with more states and fixes to most outstanding bugs. Bug #1493111. Bug #1856356. Bug #3081692. - Lua lexer updates for Lua 5.2 beta with goto labels and "\z" string escape. - Perl string styling highlights interpolated variables. - Perl lexer updated for Perl 5.14.0 with 0X and 0B numeric literal prefixes, break keyword and "+" supported in subroutine prototypes. - Perl bug fixed with CRLF line endings. - Markdown lexer fixed to not change state with "_" in middle of word. - Mouse pointer changes over selection to an arrow near start when scrolled horizontally. - Indicators that finish at the end of the document no longer expand when text is appended. - On Windows, autocompletion lists will scroll instead of document when mouse wheel spun. 0.29_02 2011.9.14 - More missing wxSTC indicator constants: wxSTC_INDIC_DASH, wxSTC_INDIC_DOTS, wxSTC_INDIC_DOTBOX, wxSTC_INDIC_STRAIGHTBOX (AZAWAWI) - Add missing SetEmptySelection to remove any selection and sets the caret at position without scrolling into view (AZAWAWI) 0.29_01 2011.9.11 - Updated to Scintilla 2.29 prerelease (AZAWAWI) 0.28 2011.9.10 - Released 0.27_01 as stable 0.28 (AZAWAWI) 0.27_01 2011.9.8 - Fixed ExtUtils::Parse 3.03_02+ warnings about missing 'OUTPUT: RETVAL' sections (AZAWAWI) 0.26 2011.9.8 - Released 0.23_01 as stable 0.24 (AZAWAWI) - Fix RT #70662: cpanm Wx::Scintilla fails on Ubuntu Lucid by requiring ExtUtils::XSpp 0.1602 (KAARE, AZAWAWI) - Drop Makefile.PL generation in Build.PL (AZAWAWI) 0.25_03 2011.9.7 - Removed stale yellowbrain.com parsed POD documentation (AZAWAWI) - wxSTC_ANNOTATION_BOXED border was not being drawn (AZAWAWI) 0.25_02 2011.9.6 - Exposed annotations API (AZAWAWI) 0.25_01 2011.8.29 - Exposed wxEVT_STC_INDICATOR_CLICK, wxEVT_STC_INDICATOR_RELEASE, wxEVT_STC_AUTOCOMP_CANCELLED and wxEVT_STC_AUTOCOMP_CHAR_DELETED events (AZAWAWI) - Cleaned up the source code from unused SWIG defines (AZAWAWI) - Expose Scintilla's modern indicator API (AZAWAWI) 0.24 2011.8.29 - Released 0.23_01 as stable 0.24 (AZAWAWI) 0.23_01 2011.8.21 - Updated the string variable interpolation Perl lexer to the latest (KHMAN, AZAWAWI) 0.22 2011.8.17 - 0.21_08 is now released as stable 0.22 to the *unsuspecting* world (AZAWAWI) 0.21_08 2011.8.17 - The following variable interpolation patterns are now highlighted correctly (KHMAN, AZAWAWI): ${word} @{word} and things like $${word} $#{word} @#{word} and things like $#${word} ${digit} @{digit} $$ and most special variables with operator characters $0 to $9 and things like $123 $^A and other control character special variables 0.21_07 2011.8.16 - Added variable interpolation for here-docs (KHMAN, AZAWAWI) 0.21_06 2011.8.15 - Added variable interpolation for: "" qq{} `` qx{} // m{} qr{} s{}{} (KHMAN, AZAWAWI) - Fix build failure on wxWidgets 2.8.10 (MARKD, AZAWAWI) 0.21_05 2011.8.12 - Integrated Perl variable interpolation patch by Kein-Hong Man from Scintilla interest group (KHMAN, AZAWAWI) 0.21_04 2011.8.9 - The rebirth of the experimental Perl 6 lexer (AZAWAWI) - Expose IndicatorSetAlpha, IndicatorGetAlpha, IndicatorSetUnder and IndicatorGetUnder (AZAWAWI) - Fixed a drawing bug for transparent boxed indicators (AZAWAWI,Reported by ADAMK) 0.21_03 2011.8.3 - Test and install Module::Build actions invoke build first (AZAWAWI) - Build or link like make *only* when one of the output files is not up to date (AZAWAWI) 0.21_02 2011.8.2 - Fix OSX compilation error (TOME++) - Updated editor.pl to include the perl 5.10 // scintilla test (AZAWAWI) 0.21_01 2011.8.2 - Upgraded to Scintilla 2.28 which was released on 1st August 2011 (AZAWAWI) - Switched to building Scintilla 2.x by default (AZAWAWI) - Removed Scintilla 1.79 support (AZAWAWI) 0.20 2011.8.1 - The editor doesn't need to be visible to pass tests (ADAMK) - Added 'perl Build.PL --stc2' to build experimental Scintilla 2.03 (AZAWAWI). This is a back port from wxWidgets 2.9.2 development branch for wxWidgets 2.8.10+. Please test and let me know if it works for you or not. 0.19 2011.7.4 - Handle MinGW link to MS style perl5xx.lib (MARKD) 0.18 2011.6.29 - Reformatted Changes file (AZAWAWI) - Fix RT #69176 Unrecognized command line option "-Wno-strict-overflow" (AZAWAWI) 0.17 2011.6.28 - Wx::Scintilla cannot exist with Wx::STC (MARKD) - More simplified user-friendly build logs (AZAWAWI) - Less warnings noise while compiling Scintilla on GTK, MSWgcc and OSX (AZAWAWI) 0.16 2011.6.28 - Show a simplified version of commands and show the actual command when it fails or interrupted with Ctrl-C unless perl Build.PL verbose=1 is used (AZAWAWI) - Fix RT #69115: Building Wx::Scintilla fails in relocatable perl (AZAWAWI) 0.15 2011.6.21 - Minor POD fix (AZAWAWI) 0.14 2011.6.21 - Ubuntu 11.04+ scrolling redraw fix http://trac.wxwidgets.org/ticket/13229 (MARKD) - Added initial version of Wx::Scintilla::Manual (AZAWAWI) - Removed File::ShareDir lookup as scintilla DLL is now side by side with the XS DLL (MARKD) - Fixed the bad soname in Linux GTK build (MARKD) - Stop linking libperl on non-MSWin32 platforms. Relative -rpath for GTK ensures the current scintilla dll is always loaded (MARKD) - Removed File::ShareDir dependency (AZAWAWI) 0.13 2011.6.20 - EVT_SCINTILLA* is now EVT_STC* for backward compatibility with Wx::STC (AZAWAWI) - POD updates (AZAWAWI) - Added Perl 6 lexer to linked lexers (AZAWAWI) 0.12 2011.6.17 - Updated POD (AZAWAWI) - Don't set global Wx::Event version (MARKD) - Pre-build check for GTK development library (MARKD) - Static Perl linking fix (MARKD) - Totally experimental Perl 6 syntax higlighting that is made only for the brave of heart (AZAWAWI) 0.11 2011.6.16 - OS compatibility patch (Big thanks to Mark Dootson++) (MARKD) CentOS 3 32 bit - custom built Perl CentOS 5 32/64 bit - custom built Perl Fedora 14 32 Bit - system Perl & Wx Ubuntu 10/11 32 Bit - system Perl & Wx Mac OS X Snow Leopard - 32 bit custom Perl Windows XP 32 bit custom Perl & Wx Windows Vista 32/64 bit custom Perl & Wx Windows 7 64 bit custom Perl & Wx 0.10 2011.6.15 - Added Makefile.PL support through Module::Build::Compat (AZAWAWI) 0.09 2011.6.13 - Experimental support 64-bit Ubuntu 10.10 (SZABGAB, AZAWAWI) - Defeat the indexer by splitting the package declaration on two lines for Wx::Event (MARKD, AZAWAWI) 0.08 2011.6.10 - Proper ActivePerl + MS VC Compiler support in Wx::Scintilla (AZAWAWI) - Updated POD documentation about supported platforms (AZAWAWI) 0.07 2011.6.10 - Removed the 'OS unsupported' test in Build.PL; i want it to fail on other platforms so i can learn more from failures (AZAWAWI) 0.06 2011.6.9 - Added t/03_editor.t to begin testing Scintilla editor functionality (AZAWAWI) - More POD updates (AZAWAWI) - Removed Makefile.PL because of weird compilation failures while using it (AZAWAWI) - Handled compilation failures and the user's control-c (AZAWAWI) - Removed a few Alien::wxWidgets dependencies in Build.PL which causes a lot of false UNKNOWNs in CPAN testers reports (AZAWAWI) - Reuse Module::Build API to use Config (AZAWAWI) - Fixed shared library loading problems on Linux by setting runtime link paths (AZAWAWI) 0.05 2011.6.8 - Updated POD documentation (AZAWAWI) - Experimental linux gtk support (AZAWAWI) 0.042 2011.6.6 - Quick version to handle packages with undefined versions 0.04 2011.6.6 - Better handling of File::ShareDir death (AZAWAWI) - Fixed XS loader version mismatch bug in Wx::boot by replacing it by XSLoader::load (AZAWAWI) - File::Sharedir is not used to locate shared libs when the test harness is active (AZAWAWI) - Updated POD documentation (AZAWAWI) - Added a minimal demo Perl editor application in the SYNOPSIS section (AZAWAWI) 0.03 2011.6.6 - The package version is extracted correctly to prevent test failures (AZAWAWI) - Wx::Event is no longer subclassed to prevent the permission error for now (AZAWAWI) - Include the important and missing Scintilla.xs (AZAWAWI) - More POD documentation (AZAWAWI) - Fixed missing dist_abstract warning in Build.PL (AZAWAWI, Reported by SZABGAB) 0.02 2011.6.5 - Attempt to fix the Wx::Event-subclass-upload-permission error (AZAWAWI) 0.01 2011.6.5 - First version, released on an unsuspecting world (AZAWAWI)Wx-Scintilla-0.38/Build.PL000444001750001750 272011727344243 15714 0ustar00azawawiazawawi000000000000use 5.006; use strict; use lib 'inc'; require Module::Build::Scintilla; # Create build script Module::Build::Scintilla::stc_builderclass()->new( module_name => 'Wx::Scintilla', license => 'perl', dist_author => q{Ahmad M. Zawawi }, dist_version_from => 'lib/Wx/Scintilla.pm', configure_requires => { 'perl' => '5.006', 'Module::Build' => '0.36', }, build_requires => { 'Test::More' => 0, 'Alien::wxWidgets' => 0, 'Wx' => 0, 'ExtUtils::XSpp' => '0.1602', }, requires => { 'perl' => '5.008', }, needs_compiler => 0, # We will be doing our own XS compilation add_to_cleanup => [ 'Wx-Scintilla-*', 'wx-scintilla/src/*.o.d', 'wx-scintilla/src/*.o', 'wx-scintilla/src/*.obj', 'wx-scintilla/src/scintilla/src/*.o.d', 'wx-scintilla/src/scintilla/src/*.o', 'wx-scintilla/src/scintilla/src/*.obj', 'Scintilla.c', 'Scintilla.o', 'Scintilla.obj', 'Scintilla.bs', 'Scintilla.def', 'Scintilla_def.old', 'blib', '*.dll', '*.pdb', '*.obj', '*.a', '*.so', 'stc_checkdepends.out', ], meta_merge => { resources => { homepage => 'http://padre.perlide.org/', repository => 'http://svn.perlide.org/padre/trunk/Wx-Scintilla/', }, no_index => { directory => [qw], }, }, dist_abstract => 'Scintilla source code editing for wxWidgets', extra_linker_flags => '-lwxmsw28u_scintilla', )->create_build_script(); Wx-Scintilla-0.38/MANIFEST000444001750001750 2040711727344243 15573 0ustar00azawawiazawawi000000000000Build.PL Changes cpp/st_constants.cpp inc/Module/Build/Scintilla.pm inc/Module/Build/Scintilla/GTK.pm inc/Module/Build/Scintilla/MSW.pm inc/Module/Build/Scintilla/MSWgcc.pm inc/Module/Build/Scintilla/OSX.pm lib/Wx/Scintilla.pm lib/Wx/Scintilla/Constant.pm lib/Wx/Scintilla/Manual.pod lib/Wx/Scintilla/TextCtrl.pm lib/Wx/Scintilla/TextEvent.pm MANIFEST This list of files README Scintilla.xs Scintilla_README t/01_load.t t/02_inheritance.t t/03_editor.t t/03_editor_child.t t/lib/Tests_Helper.pm ticket_1341.patch tools/gen_scintilla_constants.pl tools/perl-test-interpolation.pl.txt tools/perl6_editor.pl tools/perl_editor.pl tools/perltidyrc typemap wx-scintilla/include/private.h wx-scintilla/include/WxScintilla.h wx-scintilla/src/PlatWX.cpp wx-scintilla/src/PlatWX.h wx-scintilla/src/scintilla.cpp wx-scintilla/src/scintilla/include/ILexer.h wx-scintilla/src/scintilla/include/Platform.h wx-scintilla/src/scintilla/include/SciLexer.h wx-scintilla/src/scintilla/include/Scintilla.h wx-scintilla/src/scintilla/include/Scintilla.iface wx-scintilla/src/scintilla/include/ScintillaWidget.h wx-scintilla/src/scintilla/License.txt wx-scintilla/src/scintilla/README.txt wx-scintilla/src/scintilla/src/Accessor.cxx wx-scintilla/src/scintilla/src/Accessor.h wx-scintilla/src/scintilla/src/AutoComplete.cxx wx-scintilla/src/scintilla/src/AutoComplete.h wx-scintilla/src/scintilla/src/CallTip.cxx wx-scintilla/src/scintilla/src/CallTip.h wx-scintilla/src/scintilla/src/Catalogue.cxx wx-scintilla/src/scintilla/src/Catalogue.h wx-scintilla/src/scintilla/src/CellBuffer.cxx wx-scintilla/src/scintilla/src/CellBuffer.h wx-scintilla/src/scintilla/src/CharacterSet.cxx wx-scintilla/src/scintilla/src/CharacterSet.h wx-scintilla/src/scintilla/src/CharClassify.cxx wx-scintilla/src/scintilla/src/CharClassify.h wx-scintilla/src/scintilla/src/ContractionState.cxx wx-scintilla/src/scintilla/src/ContractionState.h wx-scintilla/src/scintilla/src/Decoration.cxx wx-scintilla/src/scintilla/src/Decoration.h wx-scintilla/src/scintilla/src/Document.cxx wx-scintilla/src/scintilla/src/Document.h wx-scintilla/src/scintilla/src/Editor.cxx wx-scintilla/src/scintilla/src/Editor.h wx-scintilla/src/scintilla/src/ExternalLexer.cxx wx-scintilla/src/scintilla/src/ExternalLexer.h wx-scintilla/src/scintilla/src/FontQuality.h wx-scintilla/src/scintilla/src/Indicator.cxx wx-scintilla/src/scintilla/src/Indicator.h wx-scintilla/src/scintilla/src/KeyMap.cxx wx-scintilla/src/scintilla/src/KeyMap.h wx-scintilla/src/scintilla/src/LexA68k.cxx wx-scintilla/src/scintilla/src/LexAbaqus.cxx wx-scintilla/src/scintilla/src/LexAccessor.h wx-scintilla/src/scintilla/src/LexAda.cxx wx-scintilla/src/scintilla/src/LexAPDL.cxx wx-scintilla/src/scintilla/src/LexAsm.cxx wx-scintilla/src/scintilla/src/LexAsn1.cxx wx-scintilla/src/scintilla/src/LexASY.cxx wx-scintilla/src/scintilla/src/LexAU3.cxx wx-scintilla/src/scintilla/src/LexAVE.cxx wx-scintilla/src/scintilla/src/LexAVS.cxx wx-scintilla/src/scintilla/src/LexBaan.cxx wx-scintilla/src/scintilla/src/LexBash.cxx wx-scintilla/src/scintilla/src/LexBasic.cxx wx-scintilla/src/scintilla/src/LexBullant.cxx wx-scintilla/src/scintilla/src/LexCaml.cxx wx-scintilla/src/scintilla/src/LexCLW.cxx wx-scintilla/src/scintilla/src/LexCmake.cxx wx-scintilla/src/scintilla/src/LexCOBOL.cxx wx-scintilla/src/scintilla/src/LexCoffeeScript.cxx wx-scintilla/src/scintilla/src/LexConf.cxx wx-scintilla/src/scintilla/src/LexCPP.cxx wx-scintilla/src/scintilla/src/LexCrontab.cxx wx-scintilla/src/scintilla/src/LexCsound.cxx wx-scintilla/src/scintilla/src/LexCSS.cxx wx-scintilla/src/scintilla/src/LexD.cxx wx-scintilla/src/scintilla/src/LexECL.cxx wx-scintilla/src/scintilla/src/LexEiffel.cxx wx-scintilla/src/scintilla/src/LexerBase.cxx wx-scintilla/src/scintilla/src/LexerBase.h wx-scintilla/src/scintilla/src/LexErlang.cxx wx-scintilla/src/scintilla/src/LexerModule.cxx wx-scintilla/src/scintilla/src/LexerModule.h wx-scintilla/src/scintilla/src/LexerNoExceptions.cxx wx-scintilla/src/scintilla/src/LexerNoExceptions.h wx-scintilla/src/scintilla/src/LexerSimple.cxx wx-scintilla/src/scintilla/src/LexerSimple.h wx-scintilla/src/scintilla/src/LexEScript.cxx wx-scintilla/src/scintilla/src/LexFlagship.cxx wx-scintilla/src/scintilla/src/LexForth.cxx wx-scintilla/src/scintilla/src/LexFortran.cxx wx-scintilla/src/scintilla/src/LexGAP.cxx wx-scintilla/src/scintilla/src/LexGui4Cli.cxx wx-scintilla/src/scintilla/src/LexHaskell.cxx wx-scintilla/src/scintilla/src/LexHTML.cxx wx-scintilla/src/scintilla/src/LexInno.cxx wx-scintilla/src/scintilla/src/LexKix.cxx wx-scintilla/src/scintilla/src/LexLisp.cxx wx-scintilla/src/scintilla/src/LexLout.cxx wx-scintilla/src/scintilla/src/LexLua.cxx wx-scintilla/src/scintilla/src/LexMagik.cxx wx-scintilla/src/scintilla/src/LexMarkdown.cxx wx-scintilla/src/scintilla/src/LexMatlab.cxx wx-scintilla/src/scintilla/src/LexMetapost.cxx wx-scintilla/src/scintilla/src/LexMMIXAL.cxx wx-scintilla/src/scintilla/src/LexModula.cxx wx-scintilla/src/scintilla/src/LexMPT.cxx wx-scintilla/src/scintilla/src/LexMSSQL.cxx wx-scintilla/src/scintilla/src/LexMySQL.cxx wx-scintilla/src/scintilla/src/LexNimrod.cxx wx-scintilla/src/scintilla/src/LexNsis.cxx wx-scintilla/src/scintilla/src/LexOpal.cxx wx-scintilla/src/scintilla/src/LexOthers.cxx wx-scintilla/src/scintilla/src/LexPascal.cxx wx-scintilla/src/scintilla/src/LexPB.cxx wx-scintilla/src/scintilla/src/LexPerl.cxx wx-scintilla/src/scintilla/src/LexPerl6.cxx wx-scintilla/src/scintilla/src/LexPLM.cxx wx-scintilla/src/scintilla/src/LexPOV.cxx wx-scintilla/src/scintilla/src/LexPowerPro.cxx wx-scintilla/src/scintilla/src/LexPowerShell.cxx wx-scintilla/src/scintilla/src/LexProgress.cxx wx-scintilla/src/scintilla/src/LexPS.cxx wx-scintilla/src/scintilla/src/LexPython.cxx wx-scintilla/src/scintilla/src/LexR.cxx wx-scintilla/src/scintilla/src/LexRebol.cxx wx-scintilla/src/scintilla/src/LexRuby.cxx wx-scintilla/src/scintilla/src/LexScriptol.cxx wx-scintilla/src/scintilla/src/LexSmalltalk.cxx wx-scintilla/src/scintilla/src/LexSML.cxx wx-scintilla/src/scintilla/src/LexSorcus.cxx wx-scintilla/src/scintilla/src/LexSpecman.cxx wx-scintilla/src/scintilla/src/LexSpice.cxx wx-scintilla/src/scintilla/src/LexSQL.cxx wx-scintilla/src/scintilla/src/LexTACL.cxx wx-scintilla/src/scintilla/src/LexTADS3.cxx wx-scintilla/src/scintilla/src/LexTAL.cxx wx-scintilla/src/scintilla/src/LexTCL.cxx wx-scintilla/src/scintilla/src/LexTCMD.cxx wx-scintilla/src/scintilla/src/LexTeX.cxx wx-scintilla/src/scintilla/src/LexTxt2tags.cxx wx-scintilla/src/scintilla/src/LexVB.cxx wx-scintilla/src/scintilla/src/LexVerilog.cxx wx-scintilla/src/scintilla/src/LexVHDL.cxx wx-scintilla/src/scintilla/src/LexYAML.cxx wx-scintilla/src/scintilla/src/LineMarker.cxx wx-scintilla/src/scintilla/src/LineMarker.h wx-scintilla/src/scintilla/src/OptionSet.h wx-scintilla/src/scintilla/src/Partitioning.h wx-scintilla/src/scintilla/src/PerLine.cxx wx-scintilla/src/scintilla/src/PerLine.h wx-scintilla/src/scintilla/src/PositionCache.cxx wx-scintilla/src/scintilla/src/PositionCache.h wx-scintilla/src/scintilla/src/PropSetSimple.cxx wx-scintilla/src/scintilla/src/PropSetSimple.h wx-scintilla/src/scintilla/src/RESearch.cxx wx-scintilla/src/scintilla/src/RESearch.h wx-scintilla/src/scintilla/src/RunStyles.cxx wx-scintilla/src/scintilla/src/RunStyles.h wx-scintilla/src/scintilla/src/ScintillaBase.cxx wx-scintilla/src/scintilla/src/ScintillaBase.h wx-scintilla/src/scintilla/src/Selection.cxx wx-scintilla/src/scintilla/src/Selection.h wx-scintilla/src/scintilla/src/SparseState.h wx-scintilla/src/scintilla/src/SplitVector.h wx-scintilla/src/scintilla/src/Style.cxx wx-scintilla/src/scintilla/src/Style.h wx-scintilla/src/scintilla/src/StyleContext.cxx wx-scintilla/src/scintilla/src/StyleContext.h wx-scintilla/src/scintilla/src/SVector.h wx-scintilla/src/scintilla/src/UniConversion.cxx wx-scintilla/src/scintilla/src/UniConversion.h wx-scintilla/src/scintilla/src/ViewStyle.cxx wx-scintilla/src/scintilla/src/ViewStyle.h wx-scintilla/src/scintilla/src/WordList.cxx wx-scintilla/src/scintilla/src/WordList.h wx-scintilla/src/scintilla/src/XPM.cxx wx-scintilla/src/scintilla/src/XPM.h wx-scintilla/src/scintilla_cw.h wx-scintilla/src/scintilla_cw_d.h wx-scintilla/src/scintilla_cwc.h wx-scintilla/src/scintilla_cwc_d.h wx-scintilla/src/scintilla_i18n.cpp wx-scintilla/src/ScintillaWX.cpp wx-scintilla/src/ScintillaWX.h wx_typemap wx_typemap.xsp XS/ScintillaTextCtrl.xsp XS/ScintillaTextEvent.xsp META.yml META.json Wx-Scintilla-0.38/Scintilla_README000444001750001750 470011727344243 17302 0ustar00azawawiazawawi000000000000This contrib is the wxStyledTextCtrl, which is a wrapper around the Scintilla edit control. (See www.scintilla.org) There is still VERY MUCH to be done, most notable of which is a more advanced sample that exercises more of the code. (I havn't tested AutoComplete or CallTips, or most of the event types at all yet.) And also documentation, adding wrappers for some new scintilla functionality, building and testing on wxGTK, etc. Be patient, it all will get there soon. Let me describe a bit about the architecture I am implementing... Obviously there is the Platform layer which implements the varioius platform classes by using wxWindows classes and filling in where needed. Then there is a ScintillaWX class that is derived from ScintillaBase and implements the necessary virtual methods that Scintilla needs to fully funciton. This class however is not meant to ever be used directly by wx programmers. I call it one end of the bridge between the wx and Scintilla worlds. The other end of the bridge is a class called wxStyledTextCtrl that looks, feels and acts like other classes in wxWindows. Here is a diagram: +------------------+ +-------------------+ | wxStyledTextCtrl |--bridge--| ScintillaWX | +------------------+ +-------------------+ | ScintillaBase | +-------------------+ | Editor | +-------------------+ | PlatWX | +-------------------+ wxStyledTextCtrl derives from wxControl so it has a window that can be drawn upon. When a wxStyledTextCtrl is constructed it constructs a ScintillaWX for itself and passes itself to the scintilla object to be set as the wMain and wDraw attributes. All method calls on the STC are sent over the bridge in the form of calls to ScintiallWX::WndProc. All notifications are sent back over the bridge and turned into wxEvents. Robin [SOLARIS NOTE - ellers@iinet.net.au - June 2002] On sunos5 (sparc) the stc code breaks if optimisation is turned on (the default). If your release build breaks but the debug build is fine, try reconfiguring with --disable-optimise and rebuilding. If you are using wxPython you will also need to disable optimised compiling. To do this I had to hand modify the python makefile in (prefix)/lib/python2.2/config/Makefile to remove optimisation flags. Wx-Scintilla-0.38/tools000755001750001750 011727344243 15422 5ustar00azawawiazawawi000000000000Wx-Scintilla-0.38/tools/perltidyrc000444001750001750 377611727344243 17700 0ustar00azawawiazawawi000000000000# Final parameter set for this run: --add-semicolons --add-whitespace --blanks-before-blocks --blanks-before-comments --blanks-before-subs --block-brace-tightness=1 --block-brace-vertical-tightness=0 --nobrace-left-and-indent --brace-tightness=1 --brace-vertical-tightness=2 --brace-vertical-tightness-closing=0 --break-at-old-comma-breakpoints --break-at-old-keyword-breakpoints --break-at-old-ternary-breakpoints --nocheck-syntax --closing-brace-indentation=0 --closing-paren-indentation=0 --noclosing-side-comments --closing-side-comment-else-flag=0 --closing-side-comment-interval=25 --closing-side-comment-maximum-text=20 --closing-square-bracket-indentation=0 --comma-arrow-breakpoints=3 --continuation-indentation=4 --cuddled-else --delete-closing-side-comments --delete-old-newlines --delete-old-whitespace --delete-semicolons --entab-leading-whitespace=4 --format="tidy" --format-skipping --fuzzy-line-length --hanging-side-comments --indent-block-comments --indent-columns=4 --keep-interior-semicolons --no-line-up-parentheses --nologfile --long-block-line-count=8 --look-for-autoloader --look-for-selfloader --maximum-consecutive-blank-lines=2 --maximum-fields-per-table=0 --maximum-line-length=120 --minimum-space-to-comment=1 --nooutdent-labels --nooutdent-long-comments --nooutdent-long-lines --nooutdent-long-quotes --output-line-ending="unix" --paren-tightness=1 --paren-vertical-tightness=2 --paren-vertical-tightness-closing=0 --pass-version-line --perl-syntax-check-flags="-c -T" --pod2html --recombine --short-concatenation-item-length=8 --nospace-for-semicolon --nospace-terminal-semicolon --square-bracket-tightness=1 --square-bracket-vertical-tightness=2 --square-bracket-vertical-tightness-closing=0 --starting-indentation-level=0 --static-block-comments --nostatic-side-comments --noswallow-optional-blank-lines --notabs --trim-qw --valign --vertical-tightness=2 --vertical-tightness-closing=0 --want-break-before="% + - * / x != == >= <= =~ !~ < > | & **= += *= &= <<= &&= -= /= |= >>= ||= .= %= ^=x=" --nowarning-outputWx-Scintilla-0.38/tools/perl6_editor.pl000444001750001750 322411727344243 20513 0ustar00azawawiazawawi000000000000#----> Experimental Perl 6 editor package Editor::Perl6; use strict; use warnings; # Load Wx::Scintilla use Wx::Scintilla 0.34 (); use base 'Wx::Scintilla::TextCtrl'; use Wx qw(:everything); use Wx::Event; # Override the constructor to Enable Perl 6 support in the editor sub new { my ( $class, $parent ) = @_; my $self = $class->SUPER::new( $parent, -1, [ -1, -1 ], [ 750, 700 ] ); # Set the font my $font = Wx::Font->new( 10, wxTELETYPE, wxNORMAL, wxNORMAL ); $self->SetFont($font); $self->StyleSetFont( Wx::Scintilla::STYLE_DEFAULT, $font ); $self->StyleClearAll(); # Set the various Perl 6 lexer colors $self->StyleSetForeground( Wx::Scintilla::wxSCINTILLA_P6_DEFAULT, Wx::Colour->new( 0x00, 0x00, 0x00 ) ); $self->StyleSetForeground( Wx::Scintilla::wxSCINTILLA_P6_COMMENT, Wx::Colour->new( 0x00, 0x7f, 0x00 ) ); $self->StyleSetForeground( Wx::Scintilla::wxSCINTILLA_P6_STRING, Wx::Colour->new( 0xff, 0x7f, 0x00 ) ); $self->StyleSetBold( Wx::Scintilla::wxSCINTILLA_P6_COMMENT, 1); # set the lexer to Perl 6 $self->SetLexer(Wx::Scintilla::wxSCINTILLA_LEX_PERL6); my $keywords = ["use say"]; $self->SetKeyWords(0, $keywords); $self->SetText(<<"EXAMPLE"); =pod begin This is pod =pod end # Perl 6 example use v6; say "Hello world from Perl 6!"; EXAMPLE $self->SetFocus; return $self; } package Perl6EditorApp; use strict; use warnings; use Wx; use base 'Wx::App'; sub OnInit { my $self = shift; my $frame = Wx::Frame->new(undef, -1, 'Perl 6 Editor!'); my $editor = Editor::Perl6->new($frame); $frame->Show(1); return 1; } # Create the application object, and pass control to it. package main; my $app = Perl6EditorApp->new; $app->MainLoop; Wx-Scintilla-0.38/tools/gen_scintilla_constants.pl000555001750001750 671411727344243 23036 0ustar00azawawiazawawi000000000000#!/usr/bin/perl use strict; use warnings; use Module::Metadata (); use Perl::Tidy (); use File::Spec (); use FindBin qw{ $Bin }; # check if perltidyrc file exists my $perltidyrc = File::Spec->catfile( $Bin, 'perltidyrc' ); die "cannot find perltidy configuration file: $perltidyrc\n" unless -e $perltidyrc; my $filename = "$Bin/../wx-scintilla/src/scintilla/include/Scintilla.iface"; my $constants_pm = "$Bin/../lib/Wx/Scintilla/Constant.pm"; my $scintilla_pm = "$Bin/../lib/Wx/Scintilla.pm"; # Find the version from Scintilla.pm my $scintilla = Module::Metadata->new_from_file($scintilla_pm); my $version = $scintilla->version('Wx::Scintilla'); unless ($version) { die "Failed to find Wx::Scintilla \$VERSION"; } # Parse the iface file print "Parsing $filename\n"; open my $fh, $filename or die "Cannot open $filename\n"; my $source = ''; my $doc_comment = undef; my $pod = ''; my @constants = (); while ( my $line = <$fh> ) { if ( $line =~ /^\s*$/ ) { # Empty line separator $doc_comment = undef; $source .= "\n"; } elsif ( $line =~ /^##/ ) { # ignore pure comments } elsif ( $line =~ /^(get|fun)/ ) { # Ignore documentation comment for functions $doc_comment = undef; } elsif ( $line =~ /^(#.+?)$/ ) { # Store documentation comments $doc_comment .= "$1\n"; } elsif ( $line =~ /^\s*enu\s+(\w+)\s*=\s*(\w+)\s*$/ ) { # Enumeration $doc_comment = "# $1 enumeration\n"; } elsif ( $line =~ /^\s*val\s+(\w+)\s*=(.+?)\s*$/ ) { if ( defined $doc_comment ) { if ( $doc_comment =~ /#\s+(Lexical state(s)? for (?:.+))$/ ) { $pod .= "\n=head2 $1\n\n"; } elsif ( $doc_comment =~ /#\s(\S+\s(?:enumeration))/ ) { $pod .= "\n=head2 $1\n\n"; } else { my $pod_comment = $doc_comment; $pod_comment =~ s/\s*#\s+//g; $pod .= "\n$pod_comment\n"; } $source .= $doc_comment if defined $doc_comment; $doc_comment = undef; } $source .= "\t$1 => $2,\n"; push @constants, $1; $pod .= sprintf( "\t%-30s (%s)\n", $1, $2 ); } } close $fh; my $exported_constants = join "\n", map { " $_" } @constants; $source = <<"CODE" . $source; package Wx::Scintilla::Constant; ## ## Warning: This file is autogenerated from Scintilla.iface ## PLEASE DO NOT EDIT ## use 5.008; use strict; use warnings; require Exporter; our \$VERSION = '$version'; our \@ISA = 'Exporter'; our \@EXPORT = qw( $exported_constants ); use constant { CODE $source .= <<"POD"; }; 1; __END__ =pod =head1 NAME Wx::Scintilla::Constant - A list of Wx::Scintilla constants =head1 DESCRIPTION This is a list of auto-generated constants from Scintilla.iface. =head1 CONSTANTS $pod =head1 AUTHOR Ahmad M. Zawawi =head1 COPYRIGHT Copyright 2011 Ahmad M. Zawawi. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut POD print "Perl tidy output in memory\n"; my $output = ''; Perl::Tidy::perltidy( source => \$source, destination => \$output, argv => "--profile=$perltidyrc", ); print "Writing to $constants_pm\n"; open my $constants_fh, '>', $constants_pm or die "Cannot open $constants_pm\n"; binmode $constants_fh; print $constants_fh $output; close $constants_fh; Wx-Scintilla-0.38/tools/perl_editor.pl000444001750001750 2225711727344243 20454 0ustar00azawawiazawawi000000000000#----> Perl Wx::Scintilla editor :) package My::Scintilla::Editor; use strict; use warnings; use FindBin qw{ $Bin }; # Load Wx::Scintilla use Wx::Scintilla 0.34 (); # replaces use Wx::STC use base 'Wx::Scintilla::TextCtrl'; # replaces Wx::StyledTextCtrl use Wx qw(:everything); use Wx::Event; # Override the constructor to Enable Perl support in the editor sub new { my ( $class, $parent ) = @_; my $self = $class->SUPER::new( $parent, -1, [ -1, -1 ], [ 750, 700 ] ); # Set the font my $font = Wx::Font->new( 10, wxTELETYPE, wxNORMAL, wxNORMAL ); $self->SetFont($font); $self->StyleSetFont( Wx::Scintilla::STYLE_DEFAULT, $font ); $self->StyleClearAll(); # Set the various Perl lexer colors $self->StyleSetForeground( Wx::Scintilla::SCE_PL_DEFAULT, Wx::Colour->new( 0x00, 0x00, 0x7f ) ); $self->StyleSetForeground( Wx::Scintilla::SCE_PL_ERROR, Wx::Colour->new( 0xff, 0x00, 0x00 ) ); $self->StyleSetForeground( Wx::Scintilla::SCE_PL_COMMENTLINE, Wx::Colour->new( 0x00, 0x7f, 0x00 ) ); $self->StyleSetForeground( Wx::Scintilla::SCE_PL_POD, Wx::Colour->new( 0x7f, 0x7f, 0x7f ) ); $self->StyleSetForeground( Wx::Scintilla::SCE_PL_NUMBER, Wx::Colour->new( 0x00, 0x7f, 0x7f ) ); $self->StyleSetForeground( Wx::Scintilla::SCE_PL_WORD, Wx::Colour->new( 0x00, 0x00, 0x7f ) ); $self->StyleSetForeground( Wx::Scintilla::SCE_PL_STRING, Wx::Colour->new( 0xff, 0x7f, 0x00 ) ); $self->StyleSetForeground( Wx::Scintilla::SCE_PL_CHARACTER, Wx::Colour->new( 0x7f, 0x00, 0x7f ) ); $self->StyleSetForeground( Wx::Scintilla::SCE_PL_PUNCTUATION, Wx::Colour->new( 0x00, 0x00, 0x00 ) ); $self->StyleSetForeground( Wx::Scintilla::SCE_PL_PREPROCESSOR, Wx::Colour->new( 0x7f, 0x7f, 0x7f ) ); $self->StyleSetForeground( Wx::Scintilla::SCE_PL_OPERATOR, Wx::Colour->new( 0x00, 0x00, 0x7f ) ); $self->StyleSetForeground( Wx::Scintilla::SCE_PL_IDENTIFIER, Wx::Colour->new( 0x00, 0x00, 0xff ) ); $self->StyleSetForeground( Wx::Scintilla::SCE_PL_SCALAR, Wx::Colour->new( 0x7f, 0x00, 0x7f ) ); $self->StyleSetForeground( Wx::Scintilla::SCE_PL_ARRAY, Wx::Colour->new( 0x40, 0x80, 0xff ) ); $self->StyleSetForeground( Wx::Scintilla::SCE_PL_HASH, Wx::Colour->new( 0xff, 0x00, 0x7f ) ); $self->StyleSetForeground( Wx::Scintilla::SCE_PL_SYMBOLTABLE, Wx::Colour->new( 0x7f, 0x7f, 0x00 ) ); my $color1 = Wx::Colour->new( 0xff, 0x7f, 0x00 ); my $color2 = Wx::Colour->new( 0x00, 0x00, 0xff ); my %styles = ( Wx::Scintilla::SCE_PL_REGEX => $color1, Wx::Scintilla::SCE_PL_REGSUBST => $color1, Wx::Scintilla::SCE_PL_LONGQUOTE => $color1, Wx::Scintilla::SCE_PL_BACKTICKS => $color1, Wx::Scintilla::SCE_PL_DATASECTION => $color1, Wx::Scintilla::SCE_PL_HERE_DELIM => $color1, Wx::Scintilla::SCE_PL_HERE_Q => $color1, Wx::Scintilla::SCE_PL_HERE_QQ => $color1, Wx::Scintilla::SCE_PL_HERE_QX => $color1, Wx::Scintilla::SCE_PL_STRING_Q => $color1, Wx::Scintilla::SCE_PL_STRING_QQ => $color1, Wx::Scintilla::SCE_PL_STRING_QX => $color1, Wx::Scintilla::SCE_PL_STRING_QR => $color1, Wx::Scintilla::SCE_PL_STRING_QW => $color1, Wx::Scintilla::SCE_PL_POD_VERB => $color1, Wx::Scintilla::SCE_PL_SUB_PROTOTYPE => $color1, Wx::Scintilla::SCE_PL_FORMAT_IDENT => $color1, Wx::Scintilla::SCE_PL_FORMAT => $color1, Wx::Scintilla::SCE_PL_STRING_QQ => $color1, Wx::Scintilla::SCE_PL_STRING_QX => $color1, Wx::Scintilla::SCE_PL_STRING_QR => $color1, Wx::Scintilla::SCE_PL_STRING_QW => $color1, Wx::Scintilla::SCE_PL_POD_VERB => $color1, Wx::Scintilla::SCE_PL_SUB_PROTOTYPE => $color1, Wx::Scintilla::SCE_PL_FORMAT_IDENT => $color1, Wx::Scintilla::SCE_PL_FORMAT => $color1, Wx::Scintilla::SCE_PL_STRING_VAR => $color2, Wx::Scintilla::SCE_PL_REGEX_VAR => $color2, Wx::Scintilla::SCE_PL_REGSUBST_VAR => $color2, Wx::Scintilla::SCE_PL_BACKTICKS_VAR => $color2, Wx::Scintilla::SCE_PL_HERE_QQ_VAR => $color2, Wx::Scintilla::SCE_PL_HERE_QX_VAR => $color2, Wx::Scintilla::SCE_PL_STRING_QQ_VAR => $color2, Wx::Scintilla::SCE_PL_STRING_QX_VAR => $color2, Wx::Scintilla::SCE_PL_STRING_QR_VAR => $color2, ); for my $style ( keys %styles ) { $self->StyleSetForeground( $style, $styles{$style} ); } $self->StyleSetBold( Wx::Scintilla::SCE_PL_WORD, 1 ); $self->StyleSetSpec( Wx::Scintilla::SCE_H_TAG, "fore:#0000ff" ); # set the lexer to Perl 5 $self->SetLexer(Wx::Scintilla::SCLEX_PERL); $self->SetStyleBits( $self->GetStyleBitsNeeded ); my @keywords = qw( NULL __FILE__ __LINE__ __PACKAGE__ __DATA__ __END__ AUTOLOAD BEGIN CORE DESTROY END EQ GE GT INIT LE LT NE CHECK abs accept alarm and atan2 bind binmode bless caller chdir chmod chomp chop chown chr chroot close closedir cmp connect continue cos crypt dbmclose dbmopen defined delete die do dump each else elsif endgrent endhostent endnetent endprotoent endpwent endservent eof eq eval exec exists exit exp fcntl fileno flock for foreach fork format formline ge getc getgrent getgrgid getgrnam gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr getnetbyname getnetent getpeername getpgrp getppid getpriority getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid getservbyname getservbyport getservent getsockname getsockopt glob gmtime goto grep gt hex if index int ioctl join keys kill last lc lcfirst le length link listen local localtime lock log lstat lt map mkdir msgctl msgget msgrcv msgsnd my ne next no not oct open opendir or ord our pack package pipe pop pos print printf prototype push quotemeta qu rand read readdir readline readlink readpipe recv redo ref rename require reset return reverse rewinddir rindex rmdir scalar seek seekdir select semctl semget semop send setgrent sethostent setnetent setpgrp setpriority setprotoent setpwent setservent setsockopt shift shmctl shmget shmread shmwrite shutdown sin sleep socket socketpair sort splice split sprintf sqrt srand stat study sub substr symlink syscall sysopen sysread sysseek system syswrite tell telldir tie tied time times truncate uc ucfirst umask undef unless unlink unpack unshift untie until use utime values vec wait waitpid wantarray warn while write xor given when default say state UNITCHECK ); $self->SetKeyWords( 0, join( ' ', @keywords ) ); my $filename = "$Bin/perl-test-interpolation.pl.txt"; if ( open my $fh, "<", $filename ) { local $/ = undef; my $content = <$fh>; $self->SetText($content); } else { die "Cannot open $filename for reading\n"; } $self->SetFocus; Wx::Event::EVT_STC_INDICATOR_CLICK( $self, $self, sub { print "EVT_STC_INDICATOR_CLICK triggered\n"; } ); Wx::Event::EVT_STC_INDICATOR_RELEASE( $self, $self, sub { print "EVT_STC_INDICATOR_RELEASE triggered\n"; } ); my $WARNING_STYLE = 126; my $ERROR_STYLE = $WARNING_STYLE + 1; $self->StyleSetForeground( $WARNING_STYLE, Wx::Colour->new( 0xAF, 0x80, 0x00 ) ); $self->StyleSetBackground( $WARNING_STYLE, Wx::Colour->new( 0xFF, 0xFF, 0xF0 ) ); $self->StyleSetItalic( $WARNING_STYLE, 1 ); $self->StyleSetForeground( $ERROR_STYLE, Wx::Colour->new( 0xAF, 0x00, 0x00 ) ); $self->StyleSetBackground( $ERROR_STYLE, Wx::Colour->new( 0xFF, 0xF0, 0xF0 ) ); $self->StyleSetItalic( $ERROR_STYLE, 1 ); $self->AnnotationClearAll; my $annoText1 = "Warning\n"; my $annoText2 = "Error!"; $self->AnnotationSetText( 2, $annoText1 . $annoText2 ); $self->AnnotationSetStyles( 2, sprintf( "%c", $WARNING_STYLE ) x length($annoText1) . sprintf( "%c", $ERROR_STYLE ) x length($annoText2) ); $self->AnnotationSetVisible(Wx::Scintilla::ANNOTATION_BOXED); $self->IndicatorSetForeground( 0, Wx::Colour->new("red") ); $self->SetIndicatorCurrent(0); $self->IndicatorFillRange( 0, 20 ); $self->SetEmptySelection(0); return $self; } #----> DEMO EDITOR APPLICATION # First, define an application object class to encapsulate the application itself package DemoEditorApp; use strict; use warnings; use Wx; use base 'Wx::App'; # We must override OnInit to build the window sub OnInit { my $self = shift; my $frame = Wx::Frame->new( undef, # no parent window -1, # no window id 'Perl Wx::Scintilla editor!', # Window title [ -1, -1 ], [ 750, 700 ], ); my $editor = My::Scintilla::Editor->new( $frame, # Parent window ); $frame->Show(1); return 1; } # Create the application object, and pass control to it. package main; my $app = DemoEditorApp->new; $app->MainLoop; Wx-Scintilla-0.38/tools/perl-test-interpolation.pl.txt000444001750001750 25112211727344243 23601 0ustar00azawawiazawawi000000000000#-------------------------------------------------------------------------- # perl-test-interpolation.pl #-------------------------------------------------------------------------- # This is mainly interpolation-related notes and tests. # # Primary documentation (version 5.14.1, 20110809): # http://perldoc.perl.org/perlop.html # # Tests done on Perl 5.10.1 (Cygwin) # # NOTE: * If highlighting does not work or work partially, it means that # the implementation has not covered those cases yet. # * {bareword} patterns and special vars have undergone limited # testing but the codepaths are mostly identical # #-------------------------------------------------------------------------- # Kein-Hong Man Public Domain 20110810 #-------------------------------------------------------------------------- # 20110810 initial document # 20110819 released with variable interpolation patch #-------------------------------------------------------------------------- #-------------------------------------------------------------------------- # Overview notes for variable interpolation (digested from perlop, untested) #-------------------------------------------------------------------------- # types of 'blocks' needing variable interpolation: # ------------------------------------------------- ""; # literal SCE_PL_STRING SCE_PL_STRING_VAR qq{}; # SCE_PL_STRING_QQ SCE_PL_STRING_QQ_VAR ``; # command SCE_PL_BACKTICKS SCE_PL_BACKTICKS_VAR qx{}; # [1] SCE_PL_STRING_QX SCE_PL_STRING_QX_VAR //; # pattern match [2] SCE_PL_REGEX SCE_PL_REGEX_VAR m{}; # [1][2] SCE_PL_REGEX SCE_PL_REGEX_VAR qr{}; # pattern [1][2] SCE_PL_STRING_QR SCE_PL_STRING_QR_VAR s{}{}; # substitution [1][2] SCE_PL_REGSUBST SCE_PL_REGSUBST_VAR < SCE_PL_HERE_QQ SCE_PL_HERE_QQ_VAR # `EOF` -> SCE_PL_HERE_QX SCE_PL_HERE_QX_VAR # [1] no interpolation if '' delimiter pair used # a $$ delimiter pair has priority over $var usage # a @@ delimiter pair has priority over @var usage # [2] issues with $ in pattern, documentation specifically mentions # that $( $) $| are not interpolated # @+ and @- are also not interpolated # [3] "EOF", `EOF` or EOF interpolates, 'EOF' or \EOF doesn't # therefore, SCE_PL_HERE_Q is not interpolated # these are NOT interpolated, for reference: # ------------------------------------------ ''; # literal SCE_PL_CHARACTER q{}; # SCE_PL_STRING_Q qw{}; # word list SCE_PL_STRING_QW tr{}{}; # transliteration [4] SCE_PL_REGSUBST y{}{}; # transliteration [4] SCE_PL_REGSUBST # [4] interpolated only if wrapped in an eval() e.g. eval("tr{}{}") # i.e. using "string" interpolation, so no special treatment necessary #-------------------------------------------------------------------------- # Limitations of preliminary variable interpolation implementation: # * Under consideration for future implementation. # # (1) whitespace not allowed (but in reality, perl allows whitespace # in various places, especially within [] {} subscripts) # VT does not work, FF work, rest of whitespace chars work # multiple lines also work, but users unlikely to code this way # (but there seems to be various exceptions...) # # (2) subscription elements not detected # {} [] -> (or a combination) # heuristics likely to be greedy matching # it may in fact be desirable NOT to highlight any further, because # for example, $foo[$bar] look just fine with simple highlighting # # (3) 'e'/'ee' modifiers for s{}{} causes evaluation of the REPLACEMENT # this is related to eval() which evaluates a string as a Perl expr # won't touch this with a ten-yard stick... # # * VT/FF behaviour not precisely checked, but VT seems to be usually # legal whitespace within {} and maybe [] too... won't touch this # * extended regexes also allows comments and stuff like that, but # highlighting all kinds of regex stuff seems like overkill... #-------------------------------------------------------------------------- $foo = "baz"; # FOR REFERENCE: example variables to be interpolated $boo = 'boo'; # in the tests that follows @boo = ("one", "two", "three"); #-------------------------------------------------------------------------- # "" double-quoted literal (mostly tested samples) #-------------------------------------------------------------------------- "basic"; # FOR REFERENCE: basic "multiline string second line"; # multiline "\$"; # escaped $ "text\$text"; "$text\$text"; "$"; # ERROR, perl says $name expected or escape with \$ "$$"; # pid "text$$text"; # perl recognizes $$text "$foo"; # simple var "text$foo;;"; "$foo\n"; # var terminated by \ "$$foo"; # reference $foo = \"baz"; "text$$foo;;"; "$$$foo"; # reference $foo = \\"baz"; and so on... "text$$$foo;;"; "$$$$$$$$$$$$$$$$$$$foo"; # still legal... "$ foo"; # still works with additional spaces and tabs # also with multiple newlines (and CR too) # VT failed, FF worked (consider this unreliable) "${foo}"; # bareword style "${_}"; "${_abc}"; "${_123}"; "${0} ${1}${9}text"; # match results "${12} ${1a}"; # don't highlight! ERROR for second example "$$${foo}"; # reference $foo = \\"baz"; "${}"; # ERROR "${foo "; # ERROR "text${foo}text"; "$ { foo }"; # whitespace behaviour same as above # within {}, all whitespace work, including VT "-$\-"; # outputs "--" where $\ == $OUTPUT_RECORD_SEPARATOR # but "$\" fails to parse! perl needs a trailing char "${"; # ERROR, no closing brace "$}"; # not a special variable, works, probably undef var "$""; "# ERROR, string's delimiter char has priority # special variables (mostly untested, except for $" and $\, see above) "$$ $< $; $< $> $& $` $' $+ $, $. $/ $% $: $= $~ $! $? $@ $[ $] $$"; "$<1$;()$+2 $=$~$!_abc $[123$]"; # test 'em close together "$( $) $| @+ @-"; # only for non-patterns (works here) "$# $#; $* @* "; # some non-special variable samples "$0 $1 $2 $3 $4 $5 $6 $7 $8 $9"; # match variables "$0$1$2 $3; ($4)"; # close-up test "$123 $1e5 $1_ $1_ab"; # Perl lexes $123, and $1 for the rest # special variables (control character type) "$^A $^C $^D $^E $^F $^H $^I $^L $^M"; "$^N $^O $^P $^R $^S $^T $^V $^W $^X"; "$^N$^O $^N;$^OHNO $^N01 $^O_ $^N^O"; # adjacent char tests "$^B$^O$^O"; # $^B is not a special variable "$#"; # ERROR, special var $# was removed in Perl 5.10 "$#boo"; # prints 2, last index of @boo array "$#$boo"; # valid if $boo='boo'; "$#{boo}"; # bareword style "$#{_}"; "$#{_abc}"; "$#{_123}"; "$#{0} $#{1}$#{9}text"; # dunno what this means, legal but not lexed "$#${boo}"; # valid if $boo='boo'; "text$#boo;;"; "$# boo"; # warning, then 'boo' (no space allowed in between) # basic variables, these follow identifier rules "$foo"; "$abc123"; "$_"; "$_abc"; "$_123"; "$a_1"; "$foo $foo $foo-$foo+$foo;"; # non-word char terminates "$foo $foo $foo $foo+$foo;"; # multiline # subscripted variable samples (untested) # highlighting of subscript portion not implemented yet "$foo[0]$foo{key}$foo->{k}$foo{k}[i]$foo->{k}[i]"; "\@"; # escaped @ "text\@text"; "@text\@text"; "@"; # no error! prints as '@' "@@"; # prints as '@@' "text@@text"; # perl recognizes @text "@boo"; # simple array "text@boo;;"; "@boo\n"; # var terminated by \ "@bo"; # empty string, probably undef array "@@boo"; # the @boo is valid, prints '@one two three' "@$boo"; # valid, prints 'one two three' if $boo='boo'; "@$$$boo"; # valid, same output "text@$$$boo;;;"; "@$$$$$$$$$$$$$$$$$$$boo"; # still legal... "@$"; # empty string, probably undef array "$@boo"; # nope, prints 'boo' where $@ is a special variable "@ boo"; # nope, prints '@ boo'! whitespace not allowed! "@{boo}"; # bareword style "@{_}"; "@{_abc}"; "@{_123}"; "@{0} @{1}@{9}text"; # dunno what this means, but legal "@$${boo}"; # valid if $boo='boo'; "@{boo "; # ERROR "@{ boo }"; # whitespace within {} works, including newlines "@ {boo}"; # nope, prints '@ {boo}' "-@\-"; # nope, prints '-@-', not a special var "@{"; # ERROR, no closing brace "@}"; # all other bracket chars print as literal chars # basic variables, these follow identifier rules "@boo"; "@abc123"; "@_"; "@_abc"; "@_123"; "@a_1"; "@boo @boo @boo-@boo+@boo;"; # non-word char terminates "@boo @boo @boo @boo+@boo;"; # multiline # subscripted variable samples (untested) # highlighting of subscript portion not implemented yet "@boo[0]@boo{key}@boo->{k}@boo{k}[i]@boo->{k}[i]"; # mixture of adjacent interpolated vars (untested) "$foo$foo"; "$foo$$$foo"; "$foo$#boo"; "$foo@boo"; "$foo@$$boo"; "@boo$foo"; "@boo$$$foo"; "@boo$#boo"; "@boo@boo"; "@boo@$$boo"; "$foo$"; "$foo$#"; "$foo@"; # adjacent non-vars "$foo$$$"; "$foo@$$"; # $$$ and @$$ interpolated to empty #-------------------------------------------------------------------------- # qq{} literal (mostly tested samples) #-------------------------------------------------------------------------- # FOR REFERENCE: qq!stuff!; qq mstuffm; qq 1stuff1; # various delimiters qq(foo); qq[foo]; qq{foo}; qq; # 4 kinds of opposite pairs qq\stuff\; qq\\; # backslash delimiter qq|\$|; # escaped $ qq.text\$text.; qq.$text\$text.; qq*$*; # ERROR, perl says $name expected or escape with \$ qq~$$~; # pid qq~text$$text~; # perl recognizes $$text qq+$foo+; # simple var qq _text$foo;;_; qq@$foo\n@; # var terminated by \ qq($$foo); # reference $foo = \"baz"; qq; qq[$$$foo]; # reference $foo = \\"baz"; and so on... qq{text$$$foo;;}; qq%$$$$$$$$$$$$$$$$$$$foo%; # still legal... qq:$ foo:; # still works with additional spaces and tabs # also with multiple newlines (and CR too) # VT failed, FF worked (consider this unreliable) qq#${foo}#; # bareword style qq#${_}#; qq#${_abc}#; qq#${_123}#; qq#${0} ${1}${9}text#; # match results qq#${12} ${1a}#; # don't highlight! ERROR for second example qq#$$${foo}#; # reference $foo = \\"baz"; qq#${}#; # ERROR qq#${foo #; # ERROR qq&text${foo}text&; qq/$ { foo }/; # this sample legal (not fully checked) qq;-$\-;; # outputs "--" where $\ == $OUTPUT_RECORD_SEPARATOR # but "$\" fails to parse! perl needs a trailing char qq(${); # ERROR, no closing brace qq($}); # not a special variable, works, probably undef var # special variables (mostly untested, except for $" and $\, see above) qq($$ $< $; $< $> $& $` $' $+ $, $. $/ $% $: $= $~ $! $? $@ $[ $] $$); qq($<1$;()$+2 $=$~$!_abc $[123$]); # test 'em close together qq($( $) $| @+ @-); # only for non-patterns (works here) qq($# $#; $* @* ); # some non-special variable samples qq($0 $1 $2 $3 $4 $5 $6 $7 $8 $9); # match variables qq($0$1$2 $3; ($4)); # close-up test qq($123 $1e5 $1_ $1_ab); # Perl lexes $123, and $1 for the rest # special variables (control character type) qq($^A $^C $^D $^E $^F $^H $^I $^L $^M); qq($^N $^O $^P $^R $^S $^T $^V $^W $^X); qq($^N$^O $^N;$^OHNO $^N01 $^O_ $^N^O); # adjacent char tests qq($^B$^O$^O); # $^B is not a special variable qq($#); # ERROR, special var $# was removed in Perl 5.10 qq($#boo); # prints 2, last index of @boo array qq($#$boo); # valid if $boo='boo'; qq($#{boo}); # bareword style qq($#{_}); qq($#{_abc}); qq($#{_123}); qq($#{0} $#{1}$#{9}text); # dunno what this means, legal but not lexed qq($#${boo}); # valid if $boo='boo'; qq(text$#boo;;); qq($# boo); # warning, then 'boo' (no space allowed in between) # basic variables, these follow identifier rules qq($foo); qq($abc123); qq($_); qq($_abc); qq($_123); qq($a_1); qq($foo $foo $foo-$foo+$foo;); # non-word char terminates qq($foo $foo $foo $foo+$foo;); # multiline # subscripted variable samples (untested) # highlighting of subscript portion not implemented yet qq($foo[0]$foo{key}$foo->{k}$foo{k}[i]$foo->{k}[i]); qq|\@|; # escaped @ qq.text\@text.; qq.$text\$text.; qq*@*; # no error! prints as '@' qq~@@~; # prints as '@@' qq~text@@text~; # perl recognizes @text qq+@boo+; # simple array qq _text@boo;;_; qq^@boo\n^; # var terminated by \ qq,@bo,; # empty string, probably undef array qq?@@boo?; # the @boo is valid, prints '@one two three' qq(@$boo); # valid, prints 'one two three' if $boo='boo'; qq<@$$$boo>; # valid, same output qq{text@$$$boo;;;}; qq%@$$$$$$$$$$$$$$$$$$$boo%; # still legal... qq:@$:; # empty string, probably undef array qq:$@boo:; # nope, prints 'boo' where $@ is a special variable qq:@ boo:; # nope, prints '@ boo'! whitespace not allowed! qq#@{boo}#; # bareword style qq#@{_}#; qq#@{_abc}#; qq#@{_123}#; qq#@{0} @{1}@{9}text#; # dunno what this means, but legal qq#@$${boo}#; # valid if $boo='boo'; qq#@{boo #; # ERROR qq&@{ boo }&; # this sample legal (not fully checked) qq/@ {boo}/; # nope, prints '@ {boo}' qq;-@\-;; # nope, prints '-@-', not a special var qq(@{); # ERROR, no closing brace qq(@}); # all other bracket chars print as literal chars # basic variables, these follow identifier rules qq(@boo); qq(@abc123); qq(@_); qq(@_abc); qq(@_123); qq(@a_1); qq(@boo @boo @boo-@boo+@boo;); # non-word char terminates qq(@boo @boo @boo @boo+@boo;); # multiline # subscripted variable samples (untested) # highlighting of subscript portion not implemented yet qq(@boo[0]@boo{key}@boo->{k}@boo{k}[i]@boo->{k}[i]); # mixture of adjacent interpolated vars (untested) qq($foo$foo); qq($foo$$$foo); qq($foo$#boo); qq($foo@boo); qq($foo@$$boo); qq(@boo$foo); qq(@boo$$$foo); qq(@boo$#boo); qq(@boo@boo); qq(@boo@$$boo); qq($foo$); qq($foo$#); qq($foo@); # adjacent non-vars qq($foo$$$); qq($foo@$$); # $$$ and @$$ interpolated to empty # nested delimiters qq((text)$foo(text)); # var terminated by paired delimiter qq<<>$foo<>>; qq{${foo{bar}}}; # legal syntax, dunno meaning # wordchar delimiters qq _$foo_; # space separator after 'qq' mandatory qq 1$foo1; # delimiter is not consumed by interpolated var qq m$foom; # single quote delimiter for qq{} still enables interpolation # (for the others, using '' disables interpolation, see details at top) qq'$foo'; qq'@boo'; qq'$#boo'; #-------------------------------------------------------------------------- # `` command (mostly tested samples) # NOTE: `` uses the same codepath as "" so its behaviour should be # identical, the following is more about testing valid syntax #-------------------------------------------------------------------------- `echo basic`; # FOR REFERENCE: basic `echo multiline string second line`; # multiline `echo \$`; # escaped $ `echo text\$text`; `echo $text\$text`; `echo $`; # ERROR, perl says $name expected or escape with \$ `echo $$`; # pid `echo text$$text`; # perl recognizes $$text `echo $foo`; # simple var `echo text$foo;`; `echo $foo\n`; # var terminated by \ `echo $$foo`; # reference $foo = \"baz"; `echo text$$foo;`; `echo $$$foo`; # reference $foo = \\"baz"; and so on... `echo text$$$foo;`; `echo $$$$$$$$$$$$$$$$$$$foo`; # still legal... `echo $ foo`; # still works with additional spaces and tabs # also with multiple newlines (and CR too) # VT failed, FF worked (consider this unreliable) `echo ${foo}`; # bareword style `echo ${_}`; `echo ${_abc}`; `echo ${_123}`; `echo ${0} ${1}${9}text`; # match results `echo ${12} ${1a}`; # don't highlight! ERROR for second example `echo $$${foo}`; # reference $foo = \\"baz"; `echo ${}`; # ERROR `echo ${foo `; # ERROR `echo text${foo}text`; `echo $ { foo }`; # whitespace behaviour same as above `echo -$\-`; # outputs "--" where $\ == $OUTPUT_RECORD_SEPARATOR # but "$\" fails to parse! perl needs a trailing char `echo ${`; # ERROR, no closing brace `echo $}`; # not a special variable, works, probably undef var `echo $``; `# ERROR, string's delimiter char has priority # special variables (mostly untested, except for $" and $\, see above) `$$ $< $; $< $> $& $' $+ $, $. $/ $% $: $= $~ $! $? $@ $[ $] $$`; # $` removed `$<1$;()$+2 $=$~$!_abc $[123$]`; # test 'em close together `$( $) $| @+ @-`; # only for non-patterns (works here) `$# $#; $* @* `; # some non-special variable samples `$0 $1 $2 $3 $4 $5 $6 $7 $8 $9`; # match variables `$0$1$2 $3; ($4)`; # close-up test `$123 $1e5 $1_ $1_ab`; # Perl lexes $123, and $1 for the rest # special variables (control character type) `$^A $^C $^D $^E $^F $^H $^I $^L $^M`; `$^N $^O $^P $^R $^S $^T $^V $^W $^X`; `$^N$^O $^N;$^OHNO $^N01 $^O_ $^N^O`; # adjacent char tests `$^B$^O$^O`; # $^B is not a special variable `echo $#`; # ERROR, special var $# was removed in Perl 5.10 `echo $#boo`; # prints 2, last index of @boo array `echo $#$boo`; # valid if $boo='boo'; `echo $#{_}`; `echo $#{_abc}`; `echo $#{_123}`; `echo $#{0} $#{1}$#{9}text`; # dunno what this means, legal but not lexed `echo $#{boo}`; # bareword style `echo $#${boo}`; # valid if $boo='boo'; `echo text$#boo;`; `echo $# boo`; # warning, then 'boo' (no space allowed in between) # basic variables, these follow identifier rules `$foo`; `$abc123`; `$_`; `$_abc`; `$_123`; `$a_1`; `$foo $foo $foo-$foo+$foo;`; # non-word char terminates `$foo $foo $foo $foo+$foo;`; # multiline # subscripted variable samples (untested) # highlighting of subscript portion not implemented yet `$foo[0]$foo{key}$foo->{k}$foo{k}[i]$foo->{k}[i]`; `echo \@`; # escaped @ `echo text\@text`; `echo $text\$text`; `echo @`; # no error! prints as '@' `echo @@`; # prints as '@@' `echo text@@text`; # perl recognizes @text `echo @boo`; # simple array `echo text@boo;`; `echo @boo\n`; # var terminated by \ `echo @bo`; # empty string, probably undef array `echo @@boo`; # the @boo is valid, prints '@one two three' `echo @$boo`; # valid, prints 'one two three' if $boo='boo'; `echo @$$$boo`; # valid, same output `echo text@$$$boo;`; `echo @$$$$$$$$$$$$$$$$$$$boo`; # still legal... `echo @$`; # empty string, probably undef array `echo $@boo`; # nope, prints 'boo' where $@ is a special variable `echo @ boo`; # nope, prints '@ boo'! whitespace not allowed! `echo @{boo}`; # bareword style `echo @{_}`; `echo @{_abc}`; `echo @{_123}`; `echo @{0} @{1}@{9}text`; # dunno what this means, but legal `echo @$${boo}`; # valid if $boo='boo'; `echo @{boo `; # ERROR `echo @{ boo }`; # whitespace within {} works, including newlines `echo @ {boo}`; # nope, prints '@ {boo}' `echo -@\-`; # nope, prints '-@-', not a special var `echo @{`; # ERROR, no closing brace `echo @}`; # all other bracket chars print as literal chars # basic variables, these follow identifier rules `@boo`; `@abc123`; `@_`; `@_abc`; `@_123`; `@a_1`; `@boo @boo @boo-@boo+@boo;`; # non-word char terminates `@boo @boo @boo @boo+@boo;`; # multiline # subscripted variable samples (untested) # highlighting of subscript portion not implemented yet `@boo[0]@boo{key}@boo->{k}@boo{k}[i]@boo->{k}[i]`; # mixture of adjacent interpolated vars (untested) `$foo$foo`; `$foo$$$foo`; `$foo$#boo`; `$foo@boo`; `$foo@$$boo`; `@boo$foo`; `@boo$$$foo`; `@boo$#boo`; `@boo@boo`; `@boo@$$boo`; `$foo$`; `$foo$#`; `$foo@`; # adjacent non-vars `$foo$$$`; `$foo@$$`; # $$$ and @$$ interpolated to empty #-------------------------------------------------------------------------- # qx{} command (mostly tested samples) # NOTE: qx{} uses the same codepath as qq{}, the difference is that qx{} # does not interpolate when a '' delimiter pair is used #-------------------------------------------------------------------------- # FOR REFERENCE: qx!stuff!; qx mstuffm; qx 1stuff1; # various delimiters qx(foo); qx[foo]; qx{foo}; qx; # 4 kinds of opposite pairs qx\stuff\; qx\\; # backslash delimiter qx|echo \$|; # escaped $ qx.echo text\$text.; # prints 'text', that's funny... qx.echo $text\$text.; qx*echo $*; # ERROR, perl says $name expected or escape with \$ qx~echo $$~; # pid qx~echo text$$text~; # perl recognizes $$text qx+echo $foo+; # simple var qx _echo text$foo;_; qx@echo $foo\n@; # var terminated by \ qx(echo $$foo); # reference $foo = \"baz"; qx; qx[echo $$$foo]; # reference $foo = \\"baz"; and so on... qx{echo text$$$foo;}; qx%echo $$$$$$$$$$$$$$$$$$$foo%; # still legal... qx:echo $ foo:; # still works with additional spaces and tabs # also with multiple newlines (and CR too) # VT failed, FF worked (consider this unreliable) qx#echo ${foo}#; # bareword style qx#echo ${_}#; qx#echo ${_abc}#; qx#echo ${_123}#; qx#echo ${0} ${1}${9}text#; # match results qx#echo ${12} ${1a}#; # don't highlight! ERROR for second example qx#echo $$${foo}#; # reference $foo = \\"baz"; qx#echo ${}#; # ERROR qx#echo ${foo #; # ERROR qx&echo text${foo}text&; qx/echo $ { foo }/; # this sample legal (not fully checked) qx;echo -$\-;; # outputs "--" where $\ == $OUTPUT_RECORD_SEPARATOR # but "$\" fails to parse! perl needs a trailing char qx(echo ${); # ERROR, no closing brace qx(echo $}); # not a special variable, works, probably undef var qx(echo $#); # ERROR, special var $# was removed in Perl 5.10 qx(echo $#boo); # prints 2, last index of @boo array qx(echo $#$boo); # valid if $boo='boo'; qx(echo $#{boo}); # bareword style qx(echo $#{_}); qx(echo $#{_abc}); qx(echo $#{_123}); qx($#{0} $#{1}$#{9}text); # dunno what this means, legal but not lexed qx(echo $#${boo}); # valid if $boo='boo'; qx(echo text$#boo;); qx(echo $# boo); # warning, then 'boo' (no space allowed in between) # basic variables, these follow identifier rules qx($foo); qx($abc123); qx($_); qx($_abc); qx($_123); qx($a_1); qx($foo $foo $foo-$foo+$foo;); # non-word char terminates qx($foo $foo $foo $foo+$foo;); # multiline # subscripted variable samples (untested) # highlighting of subscript portion not implemented yet qx($foo[0]$foo{key}$foo->{k}$foo{k}[i]$foo->{k}[i]); qx|echo \@|; # escaped @ qx.echo text\@text.; qx.echo @text\@text.; qx*echo @*; # no error! prints as '@' qx~echo @@~; # prints as '@@' qx~echo text@@text~; # perl recognizes @text qx+echo @boo+; # simple array qx _echo text@boo;_; qx^echo @boo\n^; # var terminated by \ qx,echo @bo,; # empty string, probably undef array qx?echo @@boo?; # the @boo is valid, prints '@one two three' qx(echo @$boo); # valid, prints 'one two three' if $boo='boo'; qx; # valid, same output qx{echo text@$$$boo;}; qx%echo @$$$$$$$$$$$$$$$$$$$boo%; # still legal... qx:echo @$:; # empty string, probably undef array qx:echo $@boo:; # nope, prints 'boo' where $@ is a special variable qx:echo @ boo:; # nope, prints '@ boo'! whitespace not allowed! qx#echo @{boo}#; # bareword style qx#echo @{_}#; qx#echo @{_abc}#; qx#echo @{_123}#; qx#echo @{0} @{1}@{9}text#; # dunno what this means, but legal qx#echo @$${boo}#; # valid if $boo='boo'; qx#echo @{boo #; # ERROR qx&echo @{ boo }&; # this sample legal (not fully checked) qx/echo @ {boo}/; # nope, prints '@ {boo}' qx;-echo @\-;; # nope, prints nothing, unclear what echo is doing qx(echo @{); # ERROR, no closing brace qx(echo @}); # all other bracket chars print as literal chars # special variables (mostly untested, except for $" and $\, see above) qx($$ $< $; $< $> $& $` $' $+ $, $. $/ $% $: $= $~ $! $? $@ $[ $] $$); qx($<1$;()$+2 $=$~$!_abc $[123$]); # test 'em close together qx($( $) $| @+ @-); # only for non-patterns (works here) qx($# $#; $* @* ); # some non-special variable samples qx($0 $1 $2 $3 $4 $5 $6 $7 $8 $9); # match variables qx($0$1$2 $3; ($4)); # close-up test qx($123 $1e5 $1_ $1_ab); # Perl lexes $123, and $1 for the rest # special variables (control character type) qx($^A $^C $^D $^E $^F $^H $^I $^L $^M); qx($^N $^O $^P $^R $^S $^T $^V $^W $^X); qx($^N$^O $^N;$^OHNO $^N01 $^O_ $^N^O); # adjacent char tests qx($^B$^O$^O); # $^B is not a special variable # basic variables, these follow identifier rules qx(@boo); qx(@abc123); qx(@_); qx(@_abc); qx(@_123); qx(@a_1); qx(@boo @boo @boo-@boo+@boo;); # non-word char terminates qx(@boo @boo @boo @boo+@boo;); # multiline # subscripted variable samples (untested) # highlighting of subscript portion not implemented yet qx(@boo[0]@boo{key}@boo->{k}@boo{k}[i]@boo->{k}[i]); # mixture of adjacent interpolated vars (untested) qx($foo$foo); qx($foo$$$foo); qx($foo$#boo); qx($foo@boo); qx($foo@$$boo); qx(@boo$foo); qx(@boo$$$foo); qx(@boo$#boo); qx(@boo@boo); qx(@boo@$$boo); qx($foo$); qx($foo$#); qx($foo@); # adjacent non-vars qx($foo$$$); qx($foo@$$); # $$$ and @$$ interpolated to empty # nested delimiters qx((text)$foo(text)); # var terminated by paired delimiter qx<<>$foo<>>; qx{${foo{bar}}}; # legal syntax, dunno meaning # wordchar delimiters qx _echo $foo_; # space separator after 'qx' mandatory qx 1echo $foo1; # delimiter is not consumed by interpolated var qx mecho $foom; # qx{} does not interpolate when a '' delimiter pair is used qx'echo $foo'; # prints nothing, $foo used by echo qx'echo @boo'; # prints '@boo' as expected qx'echo $#boo'; # prints '0boo', $# used by echo #-------------------------------------------------------------------------- # // pattern match (mostly tested samples) #-------------------------------------------------------------------------- # Example test: print ($foo =~ /$foo/); # scalar 1 for the match # - if something 'matches' in the following, it means that the regex # matched something in a given string and returned scalar 1 # Better way to verify, print a normalized string: print qr/$foo/; /stuff/c; # FOR REFERENCE: basic /multiline string second line/; # multiline /\$/; # escaped $, matches '$' /text\$text/; # matches 'text$text' /$text\$text/; /$/; # regex end of line /$$/; # matches $$ (pid) /text$$text/; # minimum match 'text', $$text interpolated /$foo/; # simple var, matches 'baz' /text$foo;;/; # matches 'textbaz;;' /$foo\n/; # var terminated by \, matches "baz\n" /$$foo/; # reference $foo = \"baz";, minimum match 'baz' /text$$foo;;/; # minimum match 'textbaz;;' /$$$foo/; # reference $foo = \\"baz";, minimum match 'baz' /text$$$foo;;/; # minimum match 'textbaz;;' /$$$$$$$$$$$$$$$$$$$foo/; # still legal... # won't generate an error if $foo = "baz";, but # the resulting regex seems to match '' /$ foo/; # legal, but does not match 'baz' # probably not interpolated /${foo}/; # bareword style, matches 'baz' /${_}/; /${_abc}/; /${_123}/; /${0} ${1}${9}text/; # match results /${12} ${1a}/; # don't highlight! ERROR for second example /$$${foo}/; # reference $foo = \\"baz"; /${}/; # ERROR /${foo /; # ERROR /text${foo}text/; # matches 'textbaztext' /$ { foo }/; # no match, probably not interpolated /${ foo }/; # but whitespace within {} works # spaces, tabs, multiple lines, VT, FF all work! /${/; # ERROR, no closing brace # special variables (mostly untested, except for $" and $\, see above) /$$ $< $; $< $> $& $` $' $+ $, $. $% $: $= $~ $! $? $@ $[ $] $$/; # $/ removed /$<1$;()$+2 $=$~$!_abc $[123$]/; # test 'em close together /$( $) $| @+ @-/; # only for non-patterns (not highlighted here) /$# $#; $* @* /; # some non-special variable samples /$0 $1 $2 $3 $4 $5 $6 $7 $8 $9/; # match variables /$0$1$2 $3; ($4)/; # close-up test /$123 $1e5 $1_ $1_ab/; # Perl lexes $123, and $1 for the rest # special variables (control character type) /$^A $^C $^D $^E $^F $^H $^I $^L $^M/; /$^N $^O $^P $^R $^S $^T $^V $^W $^X/; /$^N$^O $^N;$^OHNO $^N01 $^O_ $^N^O/; # adjacent char tests /$^B$^O$^O/; # $^B is not a special variable /$#/; # ERROR, syntax error, no mention of special var $# /$#boo/; # matches '2', last index of @boo array /$#$boo/; # valid if $boo='boo'; /$#{boo}/; # bareword style /$#{_}/; /$#{_abc}/; /$#{_123}/; /$#{0} $#{1}$#{9}text/; # dunno what this means, legal but not lexed /$#${boo}/; # valid if $boo='boo'; /text$#boo;;/; # matches 'text2;;' /$# boo/; # $# unsupported warning, unlike the syntax error for /$#/ # matches ' boo' # basic variables, these follow identifier rules /$foo/; /$abc123/; /$_/; /$_abc/; /$_123/; /$a_1/; /$foo $foo $foo-$foo+$foo;/; # non-word char terminates /$foo $foo $foo $foo+$foo;/; # multiline # subscripted variable samples (untested) # highlighting of subscript portion not implemented yet /$foo[0]$foo{key}$foo->{k}$foo{k}[i]$foo->{k}[i]/; /\@/; # escaped @, matches '@' /text\@text/; # matches 'text@text' /@text\@text/; /@/; # matches '@' /@@/; # matches '@@' /text@@text/; # minimum match 'text@', @text interpolated /@boo/; # simple array, matches 'one two three' /text@boo;;/; # matches 'textone two three;;' /@boo\n/; # var terminated by \, matches "one two three\n" /@bo/; # matches anything, probably undef array /@@boo/; # the @boo is valid, matches '@one two three' /@$boo/; # valid, matches 'one two three' if $boo='boo'; /@$$$boo/; # valid, same result /text@$$$boo;;;/; /@$$$$$$$$$$$$$$$$$$$boo/; # still legal... /@$/; # matches empty string, probably undef array /$@boo/; # nope, minimum match 'boo' where $@ is a special variable /@ boo/; # matches '@ boo', not interpolated /@{boo}/; # bareword style, matches 'one two three' /@{_}/; /@{_abc}/; /@{_123}/; /@{0} @{1}@{9}text/; # dunno what this means, but legal /@$${boo}/; # valid if $boo='boo'; /@{boo /; # ERROR /@{ boo }/; # whitespace within {} works (barely tested) /@ {boo}/; # matches '@ {boo}', not interpolated /@{/; # ERROR, no closing brace # basic variables, these follow identifier rules /@boo/; /@abc123/; /@_/; /@_abc/; /@_123/; /@a_1/; /@boo @boo @boo-@boo+@boo;/; # non-word char terminates /@boo @boo @boo @boo+@boo;/; # multiline # subscripted variable samples (untested) # highlighting of subscript portion not implemented yet /@boo[0]@boo{key}@boo->{k}@boo{k}[i]@boo->{k}[i]/; # mixture of adjacent interpolated vars (untested) /$foo$foo/; /$foo$$$foo/; /$foo$#boo/; /$foo@boo/; /$foo@$$boo/; /@boo$foo/; /@boo$$$foo/; /@boo$#boo/; /@boo@boo/; /@boo@$$boo/; /$foo$/; /$foo$#/; /$foo@/; # adjacent non-vars ??? /$foo$$$/; # $$$ interpolated to empty, min match 'baz' /$foo$$/; # $$ is pid, min match ('baz'.$$) /$foo@$$/; # @$$ interpolated to empty, min match 'baz' /$foo@$/; # @$ interpolated to empty, min match 'baz' # tests for modifier handling in interpolation code /$foo/c; /@boo/c; #-------------------------------------------------------------------------- # m{} command (mostly tested samples) #-------------------------------------------------------------------------- # FOR REFERENCE: m!stuff!; m mstuffm; m 1stuff1; # various delimiters m(foo); m[foo]; m{foo}; m; # 4 kinds of opposite pairs m\stuff\; m\\; # backslash delimiter # Better way to verify, print a normalized string: print qr/$foo/; m|\$|; # escaped $, matches '$' m.text\$text.; # matches 'text$text' m.$text\$text.; m*$*; # regex end of line m~$$~; # matches $$ (pid) m~text$$text~; # minimum match 'text', $$text interpolated m+$foo+; # simple var, matches 'baz' m _text$foo;;_; # matches 'textbaz;;' m@$foo\n@; # var terminated by \, matches "baz\n" m($$foo); # reference $foo = \"baz";, minimum match 'baz' m; # minimum match 'textbaz;;' m[$$$foo]; # reference $foo = \\"baz";, minimum match 'baz' m{text$$$foo;;}; # minimum match 'textbaz;;' m%$$$$$$$$$$$$$$$$$$$foo%; # still legal... # won't generate an error if $foo = "baz";, but # the resulting regex seems to match '' m:$ foo:; # legal, but does not match 'baz' # probably not interpolated m#${foo}#; # bareword style, matches 'baz' m#${_}#; m#${_abc}#; m#${_123}#; m#${0} ${1}${9}text#; # match results m#${12} ${1a}#; # don't highlight! ERROR for second example m#$$${foo}#; # reference $foo = \\"baz"; m#${}#; # ERROR m#${foo #; # ERROR m&text${foo}text&; # matches 'textbaztext' m/$ { foo }/; # no match, probably not interpolated m;${ foo };; # but whitespace within {} works # spaces, tabs, multiple lines, VT, FF all work! m(/${); # ERROR, no closing brace # special variables (mostly untested, except for $" and $\, see above) m($$ $< $; $< $> $& $` $' $+ $, $. $/ $% $: $= $~ $! $? $@ $[ $] $$); m($<1$;()$+2 $=$~$!_abc $[123$]); # test 'em close together m($( $) $| @+ @-); # only for non-patterns (not highlighted here) m($# $#; $* @* ); # some non-special variable samples m($0 $1 $2 $3 $4 $5 $6 $7 $8 $9); # match variables m($0$1$2 $3; ($4)); # close-up test m($123 $1e5 $1_ $1_ab); # Perl lexes $123, and $1 for the rest # special variables (control character type) m($^A $^C $^D $^E $^F $^H $^I $^L $^M); m($^N $^O $^P $^R $^S $^T $^V $^W $^X); m($^N$^O $^N;$^OHNO $^N01 $^O_ $^N^O); # adjacent char tests m($^B$^O$^O); # $^B is not a special variable m($#); # ERROR, syntax error, no mention of special var $# m($#boo); # matches '2', last index of @boo array m($#$boo); # valid if $boo='boo'; m($#{boo}); # bareword style m($#{_}); m($#{_abc}); m($#{_123}); m($#{0} $#{1}$#{9}text); # dunno what this means, legal but not lexed m($#${boo}); # valid if $boo='boo'; m(text$#boo;;); # matches 'text2;;' m($# boo); # $# unsupported warning, unlike the syntax error for /$#/ # matches ' boo' # basic variables, these follow identifier rules m($foo); m($abc123); m($_); m($_abc); m($_123); m($a_1); m($foo $foo $foo-$foo+$foo;); # non-word char terminates m($foo $foo $foo $foo+$foo;); # multiline # subscripted variable samples (untested) # highlighting of subscript portion not implemented yet m($foo[0]$foo{key}$foo->{k}$foo{k}[i]$foo->{k}[i]); m|\@|; # escaped @, matches '@' m.text\@text.; # matches 'text@text' m.@text\@text.; m*@*; # matches '@' m~@@~; # matches '@@' m~text@@text~; # minimum match 'text@', @text interpolated m+@boo+; # simple array, matches 'one two three' m _text@boo;;_; # matches 'textone two three;;' m^@boo\n^; # var terminated by \, matches "one two three\n" m,@bo,; # matches anything, probably undef array m?@@boo?; # the @boo is valid, matches '@one two three' m(@$boo); # valid, matches 'one two three' if $boo='boo'; m<@$$$boo>; # valid, same result m{text@$$$boo;;;}; m%@$$$$$$$$$$$$$$$$$$$boo%; # still legal... m:@$:; # matches empty string, probably undef array m:$@boo:; # nope, minimum match 'boo' where $@ is a special variable m:@ boo:; # matches '@ boo', not interpolated m#@{boo}#; # bareword style, matches 'one two three' m#@{_}#; m#@{_abc}#; m#@{_123}#; m#@{0} @{1}@{9}text#; # dunno what this means, but legal m#@$${boo}#; # valid if $boo='boo'; m#@{boo #; # ERROR m&@{ boo }&; # whitespace within {} works (barely tested) m/@ {boo}/; # matches '@ {boo}', not interpolated m!@{!; # ERROR, no closing brace # basic variables, these follow identifier rules m(@boo); m(@abc123); m(@_); m(@_abc); m(@_123); m(@a_1); m(@boo @boo @boo-@boo+@boo;); # non-word char terminates m(@boo @boo @boo @boo+@boo;); # multiline # subscripted variable samples (untested) # highlighting of subscript portion not implemented yet m(@boo[0]@boo{key}@boo->{k}@boo{k}[i]@boo->{k}[i]); # mixture of adjacent interpolated vars (untested) m($foo$foo); m($foo$$$foo); m($foo$#boo); m($foo@boo); m($foo@$$boo); m(@boo$foo); m(@boo$$$foo); m(@boo$#boo); m(@boo@boo); m(@boo@$$boo); m($foo$); m($foo$#); m($foo@); # adjacent non-vars m($foo$$$); m($foo$$); m($foo@$$); m($foo@$); # see // samples # nested delimiters m((text)$foo(text)); # var terminated by paired delimiter m<<>$foo<>>; m{${foo{bar}}}; # legal syntax, dunno meaning # wordchar delimiters m _$foo_; # space separator after 'm' mandatory m 1$foo1; # delimiter is not consumed by interpolated var m m$foom; # m{} does not interpolate when a '' delimiter pair is used m'$foo'; # dunno what can match this m'@boo'; # '@boo' m'$#boo'; # dunno what can match this # tests for modifier handling in interpolation code m!$foo!c; m!@boo!c; m($foo)c; m(@boo)c; #-------------------------------------------------------------------------- # qr{} command (UNTESTED, BEHAVIOUR IS ASSUMED TO BE IDENTICAL TO m{}) #-------------------------------------------------------------------------- # FOR REFERENCE: qr!stuff!; qr mstuffm; qr 1stuff1; # various delimiters qr(foo); qr[foo]; qr{foo}; qr; # 4 kinds of opposite pairs qr\stuff\; qr\\; # backslash delimiter # Better way to verify, print a normalized string: print qr/$foo/; qr|\$|; # escaped $, matches '$' qr.text\$text.; # matches 'text$text' qr.$text\$text.; qr*$*; # regex end of line qr~$$~; # matches $$ (pid) qr~text$$text~; # minimum match 'text', $$text interpolated qr+$foo+; # simple var, matches 'baz' qr _text$foo;;_; # matches 'textbaz;;' qr@$foo\n@; # var terminated by \, matches "baz\n" qr($$foo); # reference $foo = \"baz";, minimum match 'baz' qr; # minimum match 'textbaz;;' qr[$$$foo]; # reference $foo = \\"baz";, minimum match 'baz' qr{text$$$foo;;}; # minimum match 'textbaz;;' qr%$$$$$$$$$$$$$$$$$$$foo%; # still legal... # won't generate an error if $foo = "baz";, but # the resulting regex seems to match '' qr:$ foo:; # legal, but does not match 'baz' # probably not interpolated qr#${foo}#; # bareword style, matches 'baz' qr#${_}#; qr#${_abc}#; qr#${_123}#; qr#${0} ${1}${9}text#; # match results qr#${12} ${1a}#; # don't highlight! ERROR for second example qr#$$${foo}#; # reference $foo = \\"baz"; qr#${}#; # ERROR qr#${foo #; # ERROR qr&text${foo}text&; # matches 'textbaztext' qr/$ { foo }/; # no match, probably not interpolated qr;${ foo };; # but whitespace within {} works # spaces, tabs, multiple lines, VT, FF all work! qr(/${); # ERROR, no closing brace # special variables (mostly untested, except for $" and $\, see above) qr($$ $< $; $< $> $& $` $' $+ $, $. $/ $% $: $= $~ $! $? $@ $[ $] $$); qr($<1$;()$+2 $=$~$!_abc $[123$]); # test 'em close together qr($( $) $| @+ @-); # only for non-patterns (not highlighted here) qr($# $#; $* @* ); # some non-special variable samples qr($0 $1 $2 $3 $4 $5 $6 $7 $8 $9); # match variables qr($0$1$2 $3; ($4)); # close-up test qr($123 $1e5 $1_ $1_ab); # Perl lexes $123, and $1 for the rest # special variables (control character type) qr($^A $^C $^D $^E $^F $^H $^I $^L $^M); qr($^N $^O $^P $^R $^S $^T $^V $^W $^X); qr($^N$^O $^N;$^OHNO $^N01 $^O_ $^N^O); # adjacent char tests qr($^B$^O$^O); # $^B is not a special variable qr($#); # ERROR, syntax error, no mention of special var $# qr($#boo); # matches '2', last index of @boo array qr($#$boo); # valid if $boo='boo'; qr($#{boo}); # bareword style qr($#{_}); qr($#{_abc}); qr($#{_123}); qr($#{0} $#{1}$#{9}text); # dunno what this means, legal but not lexed qr($#${boo}); # valid if $boo='boo'; qr(text$#boo;;); # matches 'text2;;' qr($# boo); # $# unsupported warning, unlike the syntax error for /$#/ # matches ' boo' # basic variables, these follow identifier rules qr($foo); qr($abc123); qr($_); qr($_abc); qr($_123); qr($a_1); qr($foo $foo $foo-$foo+$foo;); # non-word char terminates qr($foo $foo $foo $foo+$foo;); # multiline # subscripted variable samples (untested) # highlighting of subscript portion not implemented yet qr($foo[0]$foo{key}$foo->{k}$foo{k}[i]$foo->{k}[i]); qr|\@|; # escaped @, matches '@' qr.text\@text.; # matches 'text@text' qr.@text\@text.; qr*@*; # matches '@' qr~@@~; # matches '@@' qr~text@@text~; # minimum match 'text@', @text interpolated qr+@boo+; # simple array, matches 'one two three' qr _text@boo;;_; # matches 'textone two three;;' qr^@boo\n^; # var terminated by \, matches "one two three\n" qr,@bo,; # matches anything, probably undef array qr?@@boo?; # the @boo is valid, matches '@one two three' qr(@$boo); # valid, matches 'one two three' if $boo='boo'; qr<@$$$boo>; # valid, same result qr{text@$$$boo;;;}; qr%@$$$$$$$$$$$$$$$$$$$boo%; # still legal... qr:@$:; # matches empty string, probably undef array qr:$@boo:; # nope, minimum match 'boo' where $@ is a special variable qr:@ boo:; # matches '@ boo', not interpolated qr#@{boo}#; # bareword style, matches 'one two three' qr#@{_}#; qr#@{_abc}#; qr#@{_123}#; qr#@{0} @{1}@{9}text#; # dunno what this means, but legal qr#@$${boo}#; # valid if $boo='boo'; qr#@{boo #; # ERROR qr&@{ boo }&; # whitespace within {} works (barely tested) qr/@ {boo}/; # matches '@ {boo}', not interpolated qr!@{!; # ERROR, no closing brace # basic variables, these follow identifier rules qr(@boo); qr(@abc123); qr(@_); qr(@_abc); qr(@_123); qr(@a_1); qr(@boo @boo @boo-@boo+@boo;); # non-word char terminates qr(@boo @boo @boo @boo+@boo;); # multiline # subscripted variable samples (untested) # highlighting of subscript portion not implemented yet qr(@boo[0]@boo{key}@boo->{k}@boo{k}[i]@boo->{k}[i]); # mixture of adjacent interpolated vars (untested) qr($foo$foo); qr($foo$$$foo); qr($foo$#boo); qr($foo@boo); qr($foo@$$boo); qr(@boo$foo); qr(@boo$$$foo); qr(@boo$#boo); qr(@boo@boo); qr(@boo@$$boo); qr($foo$); qr($foo$#); qr($foo@); # adjacent non-vars qr($foo$$$); qr($foo$$); qr($foo@$$); qr($foo@$); # see // samples # nested delimiters qr((text)$foo(text)); # var terminated by paired delimiter qr<<>$foo<>>; qr{${foo{bar}}}; # legal syntax, dunno meaning # wordchar delimiters qr _$foo_; # space separator after 'qr' mandatory qr 1$foo1; # delimiter is not consumed by interpolated var qr m$foom; # qr{} does not interpolate when a '' delimiter pair is used qr'$foo'; # dunno what can match this qr'@boo'; # '@boo' qr'$#boo'; # dunno what can match this # tests for modifier handling in interpolation code qr!$foo!c; qr!@boo!c; qr($foo)c; qr(@boo)c; #-------------------------------------------------------------------------- # s{}{} substitution PATTERN section (mostly tested samples) #-------------------------------------------------------------------------- # Example test (if matched, entire match is substituted, and prints 'doh'): $_ = '$'; s|\$|doh|; print "$_\n"; # Better way to verify, print a normalized string: print qr/$foo/; # FOR REFERENCE: s!stuff!stuff!g; s sstuffsstuffsg; s 1stuff1stuff1g; # various delimiters s(stuff)(stuff); s[stuff][stuff]; # 4 kinds of opposite pairs s{stuff}{stuff}; s; s(stuff)[stuff]; s{stuff}; s[stuff]!stuff!; # mixed delimiters s\stuff\stuff\; s\\\; # backslash delimiter s|\$|doh|; # escaped $, matches '$' s.text\$text.doh.; # matches 'text$text' s.$text\$text.doh.; s*$*doh*; # regex end of line s~$$~doh~; # matches $$ (pid) s~text$$text~doh~; # minimum match 'text', $$text interpolated s+$foo+doh+; # simple var, matches 'baz' s _text$foo;;_doh_; # matches 'textbaz;;' s@$foo\n@doh@; # var terminated by \, matches "baz\n" s($$foo)(doh); # reference $foo = \"baz";, minimum match 'baz' s; # minimum match 'textbaz;;' s[$$$foo][doh]; # reference $foo = \\"baz";, minimum match 'baz' s{text$$$foo;;}{doh}; # minimum match 'textbaz;;' s%$$$$$$$$$$$$$$$$$$$foo%doh%; # still legal... # won't generate an error if $foo = "baz";, but # the resulting regex seems to match '' s:$ foo:doh:; # legal, but does not match 'baz' # probably not interpolated s#${foo}#doh#; # bareword style, matches 'baz' s#${_}#doh#; s#${_abc}#doh#; s#${_123}#doh#; s#${0} ${1}${9}text#doh#; # match results s#${12} ${1a}#doh#; # don't highlight! ERROR for second example s#$$${foo}#doh#; # reference $foo = \\"baz"; s#${}#doh#; # ERROR s#${foo #doh#; # ERROR s&text${foo}text&doh&; # matches 'textbaztext' s/$ { foo }/doh/; # no match, probably not interpolated s;${ foo };doh;; # but whitespace within {} works # spaces, tabs, multiple lines, VT, FF all work! s(${)(doh); # ERROR, no closing brace # special variables (mostly untested, except for $" and $\, see above) s($$ $< $; $< $> $& $` $' $+ $, $. $/ $% $: $= $~ $! $? $@ $[ $] $$)(doh); s($<1$;()$+2 $=$~$!_abc $[123$])(doh); # test 'em close together s($( $) $| @+ @-)(doh); # only for non-patterns (not highlighted here) s($# $#; $* @* )(doh); # some non-special variable samples s($0 $1 $2 $3 $4 $5 $6 $7 $8 $9)(doh); # match variables s($0$1$2 $3; ($4))(doh); # close-up test s($123 $1e5 $1_ $1_ab)(doh); # Perl lexes $123, and $1 for the rest # special variables (control character type) s($^A $^C $^D $^E $^F $^H $^I $^L $^M)(doh); s($^N $^O $^P $^R $^S $^T $^V $^W $^X)(doh); s($^N$^O $^N;$^OHNO $^N01 $^O_ $^N^O)(doh); # adjacent char tests s($^B$^O$^O)(doh); # $^B is not a special variable s($#)(doh); # ERROR, syntax error, no mention of special var $# s($#boo)(doh); # matches '2', last index of @boo array s($#$boo)(doh); # valid if $boo='boo'; s($#{boo})(doh); # bareword style s($#{_})(doh); s($#{_abc})(doh); s($#{_123})(doh); s($#{0} $#{1}$#{9}text)(doh); # dunno what this means, legal but not lexed s($#${boo})(doh); # valid if $boo='boo'; s(text$#boo;;)(doh); # matches 'text2;;' s($# boo)(doh); # $# unsupported warning, unlike the syntax error for /$#/ # matches ' boo' # basic variables, these follow identifier rules s($foo)(doh); s($abc123)(doh); s($_)(doh); s($_abc)(doh); s($_123)(doh); s($a_1)(doh); s($foo $foo $foo-$foo+$foo;)(doh); # non-word char terminates s($foo $foo $foo $foo+$foo;)(doh); # multiline # subscripted variable samples (untested) # highlighting of subscript portion not implemented yet s($foo[0]$foo{key}$foo->{k}$foo{k}[i]$foo->{k}[i])(doh); s|\@|doh|; # escaped @, matches '@' s.text\@text.doh.; # matches 'text@text' s.@text\@text.doh.; s*@*doh*; # matches '@' s~@@~doh~; # matches '@@' s~text@@text~doh~; # minimum match 'text@', @text interpolated s+@boo+doh+; # simple array, matches 'one two three' s _text@boo;;_doh_; # matches 'textone two three;;' s^@boo\n^doh^; # var terminated by \, matches "one two three\n" s,@bo,doh,; # matches anything, probably undef array s?@@boo?doh?; # the @boo is valid, matches '@one two three' s(@$boo)(doh); # valid, matches 'one two three' if $boo='boo'; s<@$$$boo>; # valid, same result s{text@$$$boo;;;}{doh}; s%@$$$$$$$$$$$$$$$$$$$boo%doh%; # still legal... s:@$:doh:; # matches empty string, probably undef array s:$@boo:doh:; # nope, minimum match 'boo' where $@ is a special variable s:@ boo:doh:; # matches '@ boo', not interpolated s#@{boo}#doh#; # bareword style, matches 'one two three' s#@{_}#doh#; s#@{_abc}#doh#; s#@{_123}#doh#; s#@{0} @{1}@{9}text#doh#; # dunno what this means, but legal s#@$${boo}#doh#; # valid if $boo='boo'; s#@{boo #doh#; # ERROR s&@{ boo }&doh&; # whitespace within {} works (barely tested) s/@ {boo}/doh/; # matches '@ {boo}', not interpolated s!@{!doh!; # ERROR, no closing brace # basic variables, these follow identifier rules s(@boo)(doh); s(@abc123)(doh); s(@_)(doh); s(@_abc)(doh); s(@_123)(doh); s(@a_1)(doh); s(@boo @boo @boo-@boo+@boo;)(doh); # non-word char terminates s(@boo @boo @boo @boo+@boo;)(doh); # multiline # subscripted variable samples (untested) # highlighting of subscript portion not implemented yet s(@boo[0]@boo{key}@boo->{k}@boo{k}[i]@boo->{k}[i])(doh); # mixture of adjacent interpolated vars (untested) s($foo$foo)(doh); s($foo$$$foo)(doh); s($foo$#boo)(doh); s($foo@boo)(doh); s($foo@$$boo)(doh); s(@boo$foo)(doh); s(@boo$$$foo)(doh); s(@boo$#boo)(doh); s(@boo@boo)(doh); s(@boo@$$boo)(doh); s($foo$)(doh); s($foo$#)(doh); s($foo@)(doh); # adjacent non-vars s($foo$$$)(doh); s($foo@$$)(doh); # see // samples # nested delimiters s((text)$foo(text))(doh); # var terminated by paired delimiter s<<>$foo<>>; s{${foo{bar}}}{doh}; # legal syntax, dunno meaning # wordchar delimiters s _$foo_doh_; # space separator after 's' mandatory s 1$foo1doh1; # delimiter is not consumed by interpolated var s m$foomdohm; # s{}{} does not interpolate when a '' delimiter pair is used s'$foo'doh'; # dunno what can match this s'@boo'doh'; # '@boo' s'$#boo'doh'; # dunno what can match this # tests for modifier handling in interpolation code s!$foo!doh!c; s!@boo!doh!c; s($foo)(doh)c; s(@boo)(doh)c; s{$foo} {doh}c; s{@boo} {doh}c; #-------------------------------------------------------------------------- # s{}{} substitution REPLACEMENT section (mostly tested samples) #-------------------------------------------------------------------------- # Example test (we want to study the behaviour of the RHS): $_ = ''; s||doh|; print "$_\n"; s||\$|; # escaped $, outputs '$' s..text\$text.; # outputs 'text$text' s..$text\$text.; s**$*; # ERROR, perl says $name expected or escape with \$ s~~$$~; # outputs $$ (pid) s~~text$$text~; # outputs 'text', $$text interpolated s++$foo+; # simple var, outputs 'baz' s __text$foo;;_; # outputs 'textbaz;;' s@@$foo\n@; # var terminated by \, outputs "baz\n" s()($$foo); # reference $foo = \"baz";, outputs 'baz' s<>; # outputs 'textbaz;;' s[][$$$foo]; # reference $foo = \\"baz";, outputs 'baz' s{}{text$$$foo;;}; # outputs 'textbaz;;' s%%$$$$$$$$$$$$$$$$$$$foo%; # still legal... # won't generate an error if $foo = "baz";, but # output seems to be an empty string s::$ foo:; # outputs 'baz', whitespace probably follows qq{} s##${foo}#; # bareword style, outputs 'baz' s##${_}#; s##${_abc}#; s##${_123}#; s##${0} ${1}${9}text#; # match results s##${12} ${1a}#; # don't highlight! ERROR for second example s##$$${foo}#; # reference $foo = \\"baz"; s##${}#; # ERROR s##${foo #; # ERROR s&&text${foo}text&; # outputs 'textbaztext' s//$ { foo }/; # still outputs 'baz' s;;${ foo };; # still outputs 'baz' # exact whitespace behaviour untested s()(${); # ERROR, no closing brace # special variables (mostly untested, except for $" and $\, see above) s()($$ $< $; $< $> $& $` $' $+ $, $. $/ $% $: $= $~ $! $? $@ $[ $] $$); s()($<1$;()$+2 $=$~$!_abc $[123$]); # test 'em close together s()($( $) $| @+ @-); # only for non-patterns (works here) s()($# $#; $* @* ); # some non-special variable samples s()($0 $1 $2 $3 $4 $5 $6 $7 $8 $9); # match variables s()($0$1$2 $3; ($4)); # close-up test s()($123 $1e5 $1_ $1_ab); # Perl lexes $123, and $1 for the rest # special variables (control character type) s()($^A $^C $^D $^E $^F $^H $^I $^L $^M); s()($^N $^O $^P $^R $^S $^T $^V $^W $^X); s()($^N$^O $^N;$^OHNO $^N01 $^O_ $^N^O); # adjacent char tests s()($^B$^O$^O); # $^B is not a special variable s()($#); # ERROR, syntax error, no mention of special var $# s()($#boo); # outputs '2', last index of @boo array s()($#$boo); # valid if $boo='boo'; s()($#{boo}); # bareword style s()($#{_}); s()($#{_abc}); s()($#{_123}); s()($#{0} $#{1}$#{9}text); # dunno what this means, legal but not lexed s()($#${boo}); # valid if $boo='boo'; s()(text$#boo;;); # outputs 'text2;;' s()($# boo); # $# unsupported warning, unlike the syntax error for /$#/ # outputs ' boo' # basic variables, these follow identifier rules s()($foo); s()($abc123); s()($_); s()($_abc); s()($_123); s()($a_1); s()($foo $foo $foo-$foo+$foo;); # non-word char terminates s()($foo $foo $foo $foo+$foo;); # multiline # subscripted variable samples (untested) # highlighting of subscript portion not implemented yet s()($foo[0]$foo{key}$foo->{k}$foo{k}[i]$foo->{k}[i]); s||\@|; # escaped @, outputs '@' s..text\@text.; # outputs 'text@text' s..@text\@text.; s**@*; # outputs '@' s~~@@~; # outputs '@@' s~~text@@text~; # outputs 'text@', @text interpolated s++@boo+; # simple array, outputs 'one two three' s __text@boo;;_; # outputs 'textone two three;;' s^^@boo\n^; # var terminated by \, outputs "one two three\n" s,,@bo,; # outputs empty string, probably undef array s??@@boo?; # the @boo is valid, outputs '@one two three' s()(@$boo); # valid, outputs 'one two three' if $boo='boo'; s<><@$$$boo>; # valid, same result s(){text@$$$boo;;;}; s%%@$$$$$$$$$$$$$$$$$$$boo%; # still legal... s::@$:; # outputs empty string, probably undef array s::$@boo:; # nope, outputs 'boo' where $@ is a special variable s::@ boo:; # outputs '@ boo', not interpolated s##@{boo}#; # bareword style, outputs 'one two three' s##@{_}#; s##@{_abc}#; s##@{_123}#; s##@{0} @{1}@{9}text#; # dunno what this means, but legal s##@$${boo}#; # valid if $boo='boo'; s##@{boo #; # ERROR s&&@{ boo }&; # whitespace within {} works (barely tested) s//@ {boo}/; # outputs '@ {boo}', not interpolated s!!@{!; # ERROR, no closing brace # basic variables, these follow identifier rules s()(@boo); s()(@abc123); s()(@_); s()(@_abc); s()(@_123); s()(@a_1); s()(@boo @boo @boo-@boo+@boo;); # non-word char terminates s()(@boo @boo @boo @boo+@boo;); # multiline # subscripted variable samples (untested) # highlighting of subscript portion not implemented yet s()(@boo[0]@boo{key}@boo->{k}@boo{k}[i]@boo->{k}[i]); # mixture of adjacent interpolated vars (untested) s()($foo$foo); s()($foo$$$foo); s()($foo$#boo); s()($foo@boo); s()($foo@$$boo); s()(@boo$foo); s()(@boo$$$foo); s()(@boo$#boo); s()(@boo@boo); s()(@boo@$$boo); s()($foo$); s()($foo$#); s()($foo@); # adjacent non-vars s()($foo$$$); s()($foo@$$); # see // samples # nested delimiters s()((text)$foo(text)); # var terminated by paired delimiter s<><<>$foo<>>; s{}{${foo{bar}}}; # legal syntax, dunno meaning # wordchar delimiters s __$foo_; # space separator after 's' mandatory s 11$foo1; # delimiter is not consumed by interpolated var s mm$foom; # s{}{} does not interpolate when a '' delimiter pair is used s''$foo'; # outputs '$foo' s''@boo'; # outputs '@boo' s''$#boo'; # outputs '$#boo' # tests for modifier handling in interpolation code s!!$foo!c; s!!@boo!c; s()($foo)c; s()(@boo)c; s{} {$foo}c; s{} {@boo}c; #-------------------------------------------------------------------------- # < $& $` $' $+ $, $. $/ $% $: $= $~ $! $? $@ $[ $] $$ EOF print <{k}$foo{k}[i]$foo->{k}[i] EOF print <{k}@boo{k}[i]@boo->{k}[i] EOF # mixture of adjacent interpolated vars (untested) print < $1 $2 $3 $4 $5 $6 $7 $8 $9 $& $` $' $+ @+ @- $, $. $/ $\ $| $% $: $= $~ $! $? $@ $# $* # deprecated in Perl 5, removed in Perl 5.10 # EXCLUDE interpolation support for these two # $# is handled in the $# etc forms $[ # deprecated in Perl 5.12 $] # deprecated in Perl 5.6 # INCLUDE interpolation support for these two # both appear in lib/perl5/5.10/* (see below) $( $) $| @+ @- # DO NOT interpolate in /patterns/ # balancing <> () pairs involve special variables too # the following lines work, but not if say $< or $> is deleted print qq food>; print qq} food>; # set of characters that are tested for $: # "$;<>&`'+,./\%:=~!?@[] # additional $ characters for non-patterns: # ()| # set of characters that are tested for @ in non-patterns: # +- $t = 'hi'; # tests for $ behaviour, assume all quoted blocks $t =~ /(hi)/; # behave in the same way for them # seems to be lexed as [0-9]+ print "-$foo$1-\n"; # -bazhi- print "-$foo$2-\n"; # -baz- print "-$foo$12-\n"; # -baz- print "-$foo$123-\n"; # -baz- print "-$foo$1e5-\n"; # -bazhie5- print "-$foo$1_-\n"; # -bazhi_- print "-$foo$1_ab-\n"; # -bazhi_ab- print "-$foo$0-\n"; # -baztest.pl- print "-$foo$00-\n"; # -bazhi- print "-$foo$0_-\n"; # -baztest.pl_- # tests for $ disambiguation in /pattern/ strings, use [@$][$]+ /$foo$/; # adjacent non-var /$foo$$$/; # $$$ interpolated to empty, min match 'baz' /$foo$$/; # $$ is pid, min match ('baz'.$$) /$foo@$$/; # @$$ interpolated to empty, min match 'baz' /$foo@$/; # @$ interpolated to empty, min match 'baz' $$ # conclusion: separately tested as part of [@$][$]+ handling # TODO? won't test the weird $$$ @$$ sequences, odd numbers of $ # will be partially highlighted (below), let's see if there is a # superhero Perl coder out there who writes such things... "$$$" "$$$$" "@$$" "@$$$$" # (b) control character type (to implement): # ------------------------------------------ $^C $^D $^F $^H $^I $^M $^O $^P $^T $^V $^X $^N $^R $^A $^L $^E $^S $^W # set of alphabets tested for control character type: # ACDEFHILMNOPRSTVWX # normal code highlighting allows [A-Z], e.g. $^B, but # we'll just stick to the above for quoted strings # (c) verbose type (SKIP) # ------------------------------------------------------------- # KIV TODO: implement in a later update as normal code needs # highlighting support for it too ${^ENCODING} ${^OPEN} ${^GLOBAL_PHASE} ${^TAINT} ${^UNICODE} ${^UTF8CACHE} ${^UTF8LOCALE} ${^WIN32_SLOPPY_STAT} ${^MATCH} ${^PREMATCH} ${^POSTMATCH} ${^RE_DEBUG_FLAGS} ${^RE_TRIE_MAXBUF} ${^CHILD_ERROR_NATIVE} ${^WARNING_BITS} # (d) other complex variable specs (SKIP) # ------------------------------------------------------------- # implement these for now: ${bareword} @{bareword} ${digit} # SKIP these for now: # * ${op} @{op} single character operators in braces, except for # ${_} @{_} which are covered by the bareword handler # * ${expr} @{expr} $#{expr} ${^C} #-------------------------------------------------------------------------- # Perl 5.10 samples from Cygwin's version 20110815 # - these are snippets aren't of much use outside their files, # - for the nutties, please assume they are under Perl's license :-) #-------------------------------------------------------------------------- # lib/perl5/5.10/* # AutoSplit.pm open(my $in, "<$filename") or die "AutoSplit: Can't open $filename: $!\n"; # assert.pl &panic("ASSERTION BOTCHED: $_[$[]",$@) unless eval $_[$[]; print "\npanic: @_\n"; # bigfloat.pl &norm(($1 ? "$1$2$x" : "+$2$x"), (($x ne '') ? $6-length($x) : $6)); # dumpvar.pl $short = "0..$#{$_[0]} '" . my $end = "0..$#{$v} '" . print "${sp}-> REUSED_ADDRESS\n" ; # Dumpvalue.pm print "0..$#{$v} @a$shortmore\n"; $short = $sp . "0..$#{$v} " . # DBM_Filter.pm if ( ! defined %{ "${class}::"} ) { croak "$caller: Cannot Load DBM Filter '$class': $@" if $@; my $fetch = *{ "${class}::Fetch" }{CODE}; # DB.pm $DB::dbline{$DB::lineno} =~ s/;9($|\0)/$1/; # clear any temp breakpt # CPAN.pm open(STDOUT,">$m$_") or die "open:$_:$!\n"; die "$@" if "$@"; # charnames.pm croak ":alias cannot use existing pragma :$1 (reversed order?)"; # FileHandle.pm my $c = *{"${pkg}::$func"}{CODE} or die "${pkg}::$func missing"; # NEXT.pm my @every = map { my $sub = "${_}::$wanted_method"; # SelfLoader.pm my $fh = \*{"${callpack}::DATA"}; if (defined(&{"${1}::AUTOLOAD"})) { # strict.pm unless ( __FILE__ =~ /(^|[\/\\])\Q${\__PACKAGE__}\E\.pmc?$/ ) { die("Incorrect use of pragma '${\__PACKAGE__}' at $f line $l.\n"); # subs.pm *{"${callpack}::$sym"} = \&{"${callpack}::$sym"}; # Switch.pm *{"${pkg}::$_"} = \&$_; # Test.pm print $TESTOUT "# Running under perl version $] for $^O", # Memoize.pm croak "Unrecognized option to `${context}_CACHE': `$cache_opt' should be one of (@CONTEXT_TAGS); aborting"; "function $info->{NAME}" : "anonymous function $func"; $DEBUG and warn "${name}($fn) => $cref in _make_cref\n"; # Fatal.pm $sub = "${pkg}::$sub" unless $sub =~ /::/; push @out, "${else}if (\@_ == $n) {\n"; # CGI.pm croak("$AUTOLOAD: $@"); @TEMP=("${SL}usr${SL}tmp","${SL}var${SL}tmp", "C:${SL}temp","${SL}tmp","${SL}temp", "${vol}${SL}Temporary Items", "${SL}WWW_ROOT", "${SL}SYS\$SCRATCH", "C:${SL}system${SL}temp"); # perl5db.pl $ENV{PERLDB_PIDS} = "$$"; $pids = "[pid=$$]"; CORE::warn("perldb: couldn't parse $file: $@") if $@; $prefix = $sub =~ /::/ ? "" : "${'package'}::"; ? "(@{ $sub[$i]{args} })" print $fh "$sub[$i]{context}=$sub$args from $file:$sub[$i]{line}\n"; print $fh "$sub[$i]{context} = $s$args" . " called from $file" . " line $sub[$i]{line}\n"; $ENV{"${stem}_$i"} = $val; my $n = delete $ENV{"${stem}_n"}; $version{$file} = "${ $_ . '::VERSION' } from "; # lib/perl5/5.10/App/* # lib/perl5/5.10/Archive/* # lib/perl5/5.10/Attribute/* # Handlers.pm or die "Internal error: $lastattr{pkg} symbol went missing"; *{"$lastattr{pkg}::_ATTR_${_}_${name}"} = $lastattr{ref}; croak "Attribute handler '$2' doesn't handle $1 attributes"; my $handler = "_ATTR_${type}_${attr}"; # lib/perl5/5.10/autodie/* # lib/perl5/5.10/B/* # lib/perl5/5.10/Carp/* # Heavy.pm $mess = "$err at $i{file} line $i{line}$tid_msg\n"; $mess .= "\t$i{sub_name} called at $i{file} line $i{line}$tid_msg\n"; # lib/perl5/5.10/CGi/* # lib/perl5/5.10/Class/* # lib/perl5/5.10/Config/* # lib/perl5/5.10/CPAN/* # yaml_not_installed.pm "'$self->{module}' not installed, cannot $self->{during} '$self->{file}'\n"; # Index.pm Carp::cluck("META-PROTOCOL[$CPAN::META->{PROTOCOL}]"); # InfoObj.pm $self->debug("ID[$self->{ID}]"); push @m, sprintf " %-12s %s\n", $_, "@{$self->{$_}}"; push @svalue, "$y=>$v->{$x}{$y}"; # Author.pm "authors/id/@$chksumfile", # FirstTime.pm $CPAN::Frontend->mywarn("Ignoring excessive arguments '@{$args{args}}'"); ("Warning (maybe harmless): '$CPAN::Config->{yaml_module}' not installed.\n"); # Distribution.pm $CPAN::Frontend->unrecoverable_error(<[0] \[$map{$_->[1]}]\n"} @good_prereq_tuples), # lib/perl5/5.10/CPANPLUS/* # lib/perl5/5.10/DBM_Filter/* # lib/perl5/5.10/Devel/* # lib/perl5/5.10/Digest/* # lib/perl5/5.10/Encode/* # lib/perl5/5.10/encoding/* # lib/perl5/5.10/Exporter/* # Heavy.pm Carp::croak("$_[0]Illegal null symbol in \@${1}::EXPORT") warn qq["$spec" is not defined in %${pkg}::EXPORT_TAGS]; # lib/perl5/5.10/ExtUtils/* # MM_Unix.pm warn "Could not eval '$eval' in $parsefile: $@" if $@; my $attrs = join " ", map { qq[$_="$attrs{$_}"] } keys %attrs; $archname .= "-$Config{PERL_REVISION}.$Config{PERL_VERSION}"; "$self->{BASEEXT}$self->{LIB_EXT}" # MM_VMS.pm $extopt =~ s/$self->{LIB_EXT}$/.opt/; $target = "Perl$Config{'exe_ext'}" unless $target; # lib/perl5/5.10/File/* # lib/perl5/5.10/Filter/* # lib/perl5/5.10/Getopt/* # Long.pm "argv: (@$argv)", # lib/perl5/5.10/I18N/* # lib/perl5/5.10/IO/* # lib/perl5/5.10/IPC/* # Cmd.pm my $pp_cmd = (ref $cmd ? "@$cmd" : $cmd); # lib/perl5/5.10/Locale/* # Simple.pm $str =~ s{ ... # pattern section has no interpolations }{ my $digit = $2 || shift; $digit . ( $1 ? ( ($1 eq 'tense') ? (($3 eq 'present') ? 'ing' : 'ed') : ($1 eq 'quant') ? ' ' . (($digit > 1) ? ($4 || "$3s") : $3) : '' ) : '' ); }egx; # lib/perl5/5.10/Log/* # lib/perl5/5.10/Math/* # lib/perl5/5.10/Memoize/* # lib/perl5/5.10/Module/* # Build.pm $top_class = ${"${top_class}::ISA"}[0]; __PACKAGE__->_interpose_module("Module::Build::Platform::$^O"); __PACKAGE__->_interpose_module("Module::Build::Platform::$OSTYPES{$^O}"); # lib/perl5/5.10/Net/* # Ping.pm my $wrstr = "$$ $err"; # Cmd.pm $cmd->debug_print(1, "${spc}${pkg}${v}\n"); # FTP.pm foreach $file (map { m,/, ? $_ : "$dir/$_" } @filelist) { ... } return grep { /^\Q$feat\E\b/i } @$feature; # lib/perl5/5.10/Object/* # lib/perl5/5.10/overload/* # lib/perl5/5.10/Package/* # lib/perl5/5.10/Params/* # lib/perl5/5.10/Parse/* # lib/perl5/5.10/PerlIO/* # lib/perl5/5.10/Pod/* # Termcap.pm sub cmd_b { my $self = shift; return "$$self{BOLD}$_[1]$$self{NORM}" } my $codes = "(?:\Q$$self{BOLD}\E|\Q$$self{UNDL}\E|\Q$$self{NORM}\E)"; my $char = "(?:$codes*[^\\n])"; my $shortchar = $char . "{0,$width}"; if (s/^($shortchar)\s+// || s/^($longchar)//) {...} # Overstrike.pm if (s/^((?>$char){0,$width})(?:\Z|\s+)//) {...} # HTML.pm return $self->{'podhtml_LOT'}{"$to#$section"}; # quite possibly undef! # BlackBox.pm DEBUG > 1 and print "Starting new ${$paras}[-1][0] para at line ${$self}{'line_count'}\n"; DEBUG > 1 and print "Resuming verbatim para at line ${$self}{'line_count'}\n"; DEBUG > 1 and print "Popping $curr_open->[-1][0] $curr_open->[-1][1]{'target'} because of =end $content\n"; # lib/perl5/5.10/pods/* # lib/perl5/5.10/Search/* # lib/perl5/5.10/TAP/* # Writer.pm my $ESCAPE_KEY = qr{ (?: ^\W ) | $ESCAPE_CHAR }x; $val =~ s/ ( [\x00-\x1f] ) / '\\' . $UNPRINTABLE[ ord($1) ] /gex; # lib/perl5/5.10/Term/* # lib/perl5/5.10/Test/* # Tester.pm $check = "/\Q$1\E#\\s+\Q$2\E.*?\\n?.*?\Qat $3\E line \Q$4\E.*\\n?/"; $check = "\Q$check\E" unless( $check =~ s,^/(.*)/$,$1, or ref $check ); return 0 unless $got =~ s/^$check//; $gotend =~ s/\n/$reset\n$red/g; # lib/perl5/5.10/Text/* # Balanced.pm push @pat, "$del(?:[^$del]*(?:(?:$del$del)[^$del]*)*)$del"; push @pat, "$del(?:[^$esc$del]*(?:$esc.[^$esc$del]*)*)$del"; unless $$textref =~ m/\G($pre)($pat)/gc; unless ($$textref =~ m/ \Q$initial\E [^\\$initial]* (\\.[^\\$initial]*)* \Q$initial\E /gcsx) $$textref =~ /\G$ldel1[^\\$ldel1]*(\\.[^\\$ldel1]*)*$ldel1/gcs # lib/perl5/5.10/Thread/* # lib/perl5/5.10/Tie/* # Hash.pm warnings::warnif("WARNING: calling ${pkg}->new since ${pkg}->TIEHASH is missing"); # SubstrHash.pm croak("Table is full ($tsize->[0] elements)") if $$self[5] > $tsize->[0]; # File.pm my %good_opt = map {$_ => 1, "-$_" => 1} croak "usage: tie \@array, $_[0], filename, [option => value]..."; _ci_warn("rec 0: offset <$self->{offsets}[0]> s/b 0!"); _ci_warn("ad_history has bad length <@{$self->{ad_history}}>"); # lib/perl5/5.10/Time/* # lib/perl5/5.10/Unicode/* # lib/perl5/5.10/unicore/* # Collate.pm return if defined $self->{undefName} && $name =~ /$self->{undefName}/; # lib/perl5/5.10/User/* # lib/perl5/vendor_perl/5.10/Archive/* # MemberRead.pm && $self->{buffer} =~ s/^(.*?)$sep//s # Archive.pm return grep { $_->fileName() =~ /$pattern/ } $self->members(); else { $archiveName =~ s{$pattern}{$dest} } $pred ? sub { m{$pattern} && &$pred } : sub { m{$pattern} && -r }; # lib/perl5/vendor_perl/5.10/auto/* # lib/perl5/vendor_perl/5.10/Bundle/* # lib/perl5/vendor_perl/5.10/common/* # lib/perl5/vendor_perl/5.10/Compress/* # lib/perl5/vendor_perl/5.10/Config/* # Tiny.pm $contents .= "[$section]\n" unless $section eq '_'; $contents .= "$property=$block->{$property}\n"; # V.pm $config{version} = "$rel.$vers.$subvers"; my $pv = qx[$^X -V]; # lib/perl5/vendor_perl/5.10/CPAN/* # Distroprefs.pm my ($ext) = /\.($possible_ext)$/ or redo; exists $match->{$_[1]} || exists $match->{"not_$_[1]"} die "Error in Distroprefs pattern qr{$re}\n$@"; return $data =~ /$qr/; # FirstTime.pm my(@path) = split /$Config{'path_sep'}/, $ENV{'PATH'}; $CPAN::Frontend->myprint(" <$item>\n"); $CPAN::Frontend->myprint(qq{Trying to overwrite $mby\n}); CPAN->debug("picklist('$items','$prompt','$default','$require_nonempty',". "'$empty_warning')") if $CPAN::DEBUG; @u = map ("$_ ($bare_country)", @u) # FTP.pm open $fh, "+>>$file" or $CPAN::Frontend->mydie("Could not open '$file': $!"); or $CPAN::Frontend->mydie("Could not rename '$sfile.$$' to '$sfile': $!\n"); rename $aslocal, "$aslocal.bak$$"; $self->debug("Themethod[$Themethod]reordered[@reordered]") if $CPAN::DEBUG; $self->debug("synth. urllist[@urllist]") if $CPAN::DEBUG; CPAN->debug("ret[$ret]aslocal[$aslocal]") if $CPAN::DEBUG; my($system) = "$chdir$funkyftp$src_switch \"$url\" $devnull$stdout_redir"; my($system) = "$funkyftp$src_switch \"$url.gz\" $devnull > $asl_gz"; # HandleConfig.pm @report = map {"\t$_ \[$v->[$_]]\n"} 0..$#$v; CPAN->debug("INC{'$config'}[$INC{$config}]") if $CPAN::DEBUG; # Reporter.pm $fh->print( map { "$_ $prereqs{$_}\n" } keys %prereqs ); my $prereq_result = qx/$perl $version_finder < $prereq_input/; # Shell.pm CPAN::Shell->expand_by_method('CPAN::Author',['id'],"/$rau/"); push @bbase, "$bbase\::$entry"; # Tarzip.pm $system = qq{$tarcommand x${tar_verb}f "$file"}; # lib/perl5/vendor_perl/5.10/Data/* # Compare.pm (ref($y) && exists($been_there{"$y-$ypos-$yparent"}) && $been_there{"$y-$ypos-$yparent"} > 1) $been_there{\@x."-$xpos-$xparent"}--; # lib/perl5/vendor_perl/5.10/Devel/* # lib/perl5/vendor_perl/5.10/Error/* # lib/perl5/vendor_perl/5.10/File/* # GlobMapper.pm while ($string =~ s/(.*?)$noPreBS(,|$matchMetaRE)//) $out .= "$1)" ; $self->{InputGlob} =~ s/$noPreBS[\(\)]//g; # Rule.pm ? map { [ ( ref $_ ? $_ : qr/$_/ ) => 0 ] } @$_ my $sub = eval "$code" or die "compile error '$code' $@"; "\$subs{'$key'}->(\@args) # $_->{rule}\n"; # Darwin.pm $path =~ s/^\Q$my_home/$users_home/; # lib/perl5/vendor_perl/5.10/HTML/* # lib/perl5/vendor_perl/5.10/HTTP/* # Common.pm qq(Content-Disposition: form-data; name="$k"$CRLF$CRLF$v)); push(@parts, "$CRLF--$boundary--$CRLF"); # Auth.pm $val .= "$sep$k=$v"; # ETag.pm push(@res, qq($weak"$etag")); # Microsoft.pm warn "$cookie_index ['$sig' $size] does not seem to contain cookies"; if ($data =~ /Cookie\:\Q$user_name\E\@([\x21-\xFF]+).*?((?:\Q$user_name\E|\Q$user_name2\E)\@[\x21-\xFF]+\.txt)/) # Negotiate.pm print " $pv = $accept{$type}{$name}{$pv}\n"; print " (q=$q, mbx=$mbx, qe=$qe, qc=$qc, ql=$ql, qs=$qs)\n"; # Cookies.pm $_[0] =~ s/%([0-9a-fA-F][0-9a-fA-F])/ $x = uc($1); $x eq "2F" || $x eq "25" ? "%$x" : pack("C", hex($x)); /eg; $_[0] =~ s/([\0-\x20\x7f-\xff])/sprintf("%%%02X",ord($1))/eg; # lib/perl5/vendor_perl/5.10/IO/* # lib/perl5/vendor_perl/5.10/IPC/* # ProfLogger.pm open PROFILE, ">$self->{Destination}" or die "$!: $self->{Destination}\n"; # lib/perl5/vendor_perl/5.10/JSON/* # PP.pm $arg =~ s/([\x22\x5c\n\r\t\f\b])/$esc{$1}/g; $arg =~ s/([\x00-\x08\x0b\x0e-\x1f])/'\\u00' . unpack('H2', $1)/eg; # lib/perl5/vendor_perl/5.10/LWP/* # UserAgent.pm print STDERR " (${t}s)" if $t; print STDERR "$ANI[$self->{progress_ani}++]\b"; print STDERR "$p\b\b\b\b"; # Digest.pm push(@pairs, "$_=" . qq("$resp{$_}")); # gopher.pm $tmp .= qq{$pretty
\n}; # http10.pm die "Can't connect to $host:$port ($@)"; # lib/perl5/vendor_perl/5.10/Metabase/* # Hash.pm Carp::croak "missing required keys for $class\: @missing\n" if @missing; # metabase.pm my $guid_re = qr(\A$hex{8}-$hex{4}-$hex{4}-$hex{4}-$hex{12}\z)i; my ($subtype) = $self =~ m{\A$scheme:([^:]+)}; # commit.pm my ($string) = $self =~ m{\A$scheme:///$subtype/(.+)\z}; return "http://${host}/perl.git/" . $self->sha1; # lib/perl5/vendor_perl/5.10/Module/* # DataFeed.pm print FH join(',', map("\n\t'$_'", map {s/\\$/\\\\/; $_} @inc)); my $file = "$dir/auto/$modpname/$modfname.$dl_ext"; # Signature.pm return "$scheme://$KeyServer:$KeyServerPort"; my @verify = `gpg --batch --verify $SIGNATURE`; while (`gpg --batch --keyserver=$keyserver --search-keys '$key_name'`) { if (/\Q$key_name\E/) { $plaintext .= "@{$digest->{$file}} $file\n"; require "Digest/$algorithm/PurePerl.pm"; "Digest::$algorithm\::PurePerl"->new $file =~ s!(\.(\w|-)+)!substr ($1,0,4)!ge; $file =~ s!((\w|-)+)!substr ($1,0,8)!ge; # ScanDeps.pm use constant dl_ext => ".$Config{dlext}"; @files = map "$dir/Is/$_->{name}", _glob_in_inc("$dir/Is") push @files, "$dir/$subdir/$_->{name}"; (@_ and $_[0] =~ /^(?:$Keys)$/o) ? @_ : (files => [@_], recurse => 1) next if $file =~ /(?:^|${pathsep})Term${pathsep}ReadLine\.pm$/; next if $file =~ /(?:^|${pathsep})Tcl${pathsep}Tk\W/; unshift(@INC, "$_/$archname") if -d "$_/$archname"; unshift(@INC, "$_/$ver/$archname") if -d "$_/$ver/$archname"; if (/^\s* use \s+ $loader(?!\:) \b \s* (.*)/sx) { $subdir =~ s/\$CurrentPackage/$CurrentPackage/; $line =~ s/^(.*?)((?:[\r\n]+__(?:DATA|END)__[\r\n]+)|$)/ use Module::ScanDeps::DataFeed '$fname.out'; sub { $1 } $2/s; $newkey =~ s"^(?:(?:$inc)/?)""sg if File::Spec->file_name_is_absolute($newkey); $key =~ s"^(?:(?:$inc)/?)""s; return 'shared' if $name =~ /\.$dlext$/i; # lib/perl5/vendor_perl/5.10/Net/* # IP.pm $current =~ s/0{$nbits}$/$add/; $ip =~ s/ (^|:) # Find beginning or ':' -> $1 0+ # 1 or several 0s (?= # Look-ahead [a-fA-F\d]+ # One or several Hexs (?::|$)) # ':' or end /$1/gx; # Telnet.pm @isa = eval "\@${class}::ISA"; # lib/perl5/vendor_perl/5.10/Number/* # lib/perl5/vendor_perl/5.10/PAR/* # Dist.pm $args{dist} =~ s{^cpan://((([a-zA-Z])[a-zA-Z])[-_a-zA-Z]+)/} {http://www.cpan.org/modules/by-authors/id/\U$3/$2/$1\E/}; $file =~ s/([^\w\.])/$escapes{$1}/g; $e =~ /^$version$/o if ($e =~ /^$version|any_version$/) { # lib/perl5/vendor_perl/5.10/Pod/* # Simple.pm DEBUG > 2 and print " Tolerating $$para[2] as =item *\\n\\n$1\n"; DEBUG and print "Applying precooked treelet hack to $_[0][0]\n"; DEBUG > 3 and print " Merging ", $i-1, ":[$treelet->[$i-1]] and $i\:[$treelet->[$i]]\n"; DEBUG > 4 and print " Noting child $i : $treelet->[$i][0]<...>\n"; DEBUG > 4 and print " Renaming $was node to $dynasty[-1]\n"; DEBUG > 1 and print "Nixing Z node @{$treelet->[$i]}\n"; print " Peering at L-content text bit \"$ell_content[$j]\" for a '|'.\n"; # Coverage.pm $sym =~ s/$self->{package}:://; # RTF.pm ( $1, "{\\$2\n", "/$1", "}" ); $scratch =~ s/\#([^\#]+)\#/${$self}{$1}/g; # interpolate DEBUG and print "Indenting back $indent_stack[-1] twips.\n"; s/([F\x00-\x1F\-\\\{\}\x7F-\xFF])/$Escape{$1}/g; # ESCAPER s/([^\x00-\xFF])/'\\uc1\\u'.((ord($1)<32768)?ord($1):(ord($1)-65536)).'?'/eg; # Search.pm $verbose and print "Appending \"$self->{'dir_prefix'}\" to $try, ", "giving $start_in (= @$modname_prefix)\n"; unless ($name =~ s/$prefix$podname/$prefix$podname/i) { $verbose and print "Too deep! [@$modname_bits]\n"; DEBUG and print "Found version line (#$lines): $_"; s<([^\x20\x21\x23\x27-\x3F\x41-\x5B\x5D-\x7E])> <'\\x'.(unpack("H2",$1))>eg; # Text.pm $_[0]{'Thispara'} .= " <$link->{to}>" unless $_[0]{'Thispara'} =~ /\b\E$link->{to}/; # XHTML.pm $str =~ s/([$ents])/'&' . $entities{$1} . ';'/ge; # BlackBox.pm DEBUG > 1 and print "Noting =cut at line ${$self}{'line_count'}\n"; DEBUG > 1 and print "Starting new ${$paras}[-1][0] para at line ${$self}{'line_count'}\n"; DEBUG > 1 and print "Popping $curr_open->[-1][0] $curr_open->[-1][1]{'target'} because of =end $content\n"; s/^([^\t]*)(\t+)/$1.(" " x ((length($2)<<3)-(length($1)&7)))/e DEBUG > 5 and print "Scrutinizing line $i: $$p[$i]\n"; DEBUG > 4 and print "_verbatim_format considers:\n<$p->[$i-1]>\n<$p->[$i]>\n"; DEBUG > 5 and print "_verbatim_format merges {$p->[$i]} and {$p->[$i+1]}\n"; # HTML.pm $Tagmap->{"head$_"} =~ s/$_/$_ + $add/e; $after =~ s{()}{$link\n$1}i; # otherwise nevermind $string =~ s/([^\x00-\xFF])/join '', map sprintf('%%%02X',$_), unpack 'C*', $1/eg; $string =~ s/([^-_\.!~*()abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789])/sprintf('%%%02X',ord($1))/eg; return $self->{'podhtml_LOT'}{"$to#$section"}; # quite possibly undef! # HTMLBatch.pm $self->muse("Done with batch conversion. $$self{'__batch_conv_page_count'} files done."); DEBUG > 3 and print "Noting @$c[-1]\n"; print " $m $$m2p{$m}\n"; DEBUG > 5 and print "Noting $$chunk[0] as a file I'll create.\n"; $this_css =~ s<#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])\b> < join '', '#', ($1,$2,$3)[@swap] >eg if @swap; DEBUG > 5 and print "Noting $$script[0] as a file I'll create.\n"; # lib/perl5/vendor_perl/5.10/Probe/* # Perl.pm $version =~ s/\.(\d+)/sprintf( '%03d', $1 )/eg; return `$perl -MConfig=myconfig -e print -e myconfig` eq Config->myconfig; $thisperl .= $exe unless $thisperl =~ m/$exe(;\d+)?$/i; my @inc = `$perl -l -e print -e for -e \@INC`; # lib/perl5/vendor_perl/5.10/Software/* # LicenseUtils.pm "GPL,? $_v?(\\d)" => sub { "GPL_$_[0]_0" }, 'GPL' => [ map { "GPL_$_\_0" } (1..3) ], # lib/perl5/vendor_perl/5.10/Term/* # readline.pm filler_Pending [_unescape "$+"]; warn "Warning$InputLocMsg: ". "Re-binding char #$key from [$KeyMap[$key]] to meta for [@keys] => $func.\n" if $^W; $map = "$KeyMap{'name'}_$key"; $file =~ s/^~([\\\/])/$ENV{HOME}$1/ if not -f $file and exists $ENV{HOME}; $InputLocMsg = " [$file line $.]"; # lib/perl5/vendor_perl/5.10/Test/* # Reporter.pm $self->errstr(__PACKAGE__ . ": error from '$transport_class:'\n$@\n"); $file = "$grade.$distribution.$self->{_perl_version}->{_archname}.$self->{_perl_version}->{_osvers}.${\(time)}.$$.rpt"; $file = "$grade.$distribution.$self->{_perl_version}->{_archname}"; my $ext = "$self->{_perl_version}->{_osvers}.${\(time)}.$$.rpt"; $buffer =~ s{$CR$LF}{$LF}g; $buffer =~ s{$CR}{$LF}g; my $cmd = "$perl -MConfig -e$q print qq{$magick\n\$Config{archname}\n\$Config{osvers}\n};$q"; $cmd = "$sh $perl $q-MConfig$q -e$q print qq{$magick\\n\$Config{archname}\\n\$Config{osvers}\\n};$q"; $arg =~ s/\$([a-zA-Z])/exists $var{$1} ? $var{$1} : '$'.$1/eg; # lib/perl5/vendor_perl/5.10/Text/* # Glob.pm return qr/^$regex$/; # lib/perl5/vendor_perl/5.10/URI/* # _generic.pm $$self =~ m,^((?:$URI::scheme_re:)?)(?://([^/?\#]*))?(.*)$,os or die; $auth =~ s/([^$ACHAR])/ URI::Escape::escape_char($1)/ego; # Escape.pm eval "\$subst{\$patn} = sub {\$_[0] =~ s/([$tmp])/\$escapes{\$1} || _fail_hi(\$1)/ge; }"; $text =~ s/($Unsafe{RFC3986})/$escapes{$1} || _fail_hi($1)/ge; $text =~ s/([^\0-\x7F])/do {my $o = ord($1); sprintf("%c%c", 0xc0 | ($o >> 6), 0x80 | ($o & 0x3f)) }/ge; $str =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg if defined $str; # Heuristic.pm unshift(@srcs, "${1}_${2}"); $_ = "$1://$_"; # lib/perl5/vendor_perl/5.10/WWW/* # lib/perl5/vendor_perl/5.10/XML/* # PurePerl.pm $self->parser_error("Character reference &#$ref; refers to an illegal XML character ($char)", $reader) $chr =~ /$SingleChar/o or $self->parser_error("Character reference '&$name;' refers to an illegal XML character", $reader); if ($data =~ /^([^$quote]*)$quote/) { $value =~ s/&(#(x[0-9a-fA-F]+)|#([0-9]+)|\w+);/$self->AttReference($1, $reader)/geo; # XMLDecl.pm $data =~ /^(version$S*=$S*(["'])($VersionNum)\2)/o or return 0; $data =~ /^(standalone$S*=$S*(["'])(yes|no)\2)/o or return 0; $data =~ /^(encoding$S*=$S*(["'])($EncNameStart$EncNameEnd*)\2)/o or return 0; # lib/perl5/vendor_perl/5.10/YAML/* # Loader.pm $node =~ s/\\([never\\fart0]|x([0-9a-fA-F]{2}))/ (length($1)>1)?pack("H2",$2):$unescapes{$1}/gex; # Tiny.pm $string =~ s/\\([never\\fartz]|x([0-9a-fA-F]{2}))/(length($1)>1)?pack("H2",$2):$UNESCAPES{$1}/gex; #-------------------------------------------------------------------------- # end of test file #-------------------------------------------------------------------------- Wx-Scintilla-0.38/lib000755001750001750 011727344243 15030 5ustar00azawawiazawawi000000000000Wx-Scintilla-0.38/lib/Wx000755001750001750 011727344243 15426 5ustar00azawawiazawawi000000000000Wx-Scintilla-0.38/lib/Wx/Scintilla.pm000444001750001750 3521511727344243 20071 0ustar00azawawiazawawi000000000000package Wx::Scintilla; use 5.008; use strict; use warnings; use Carp (); use Exporter (); use XSLoader (); use Wx (); our $VERSION = '0.38'; # Check for loaded Wx::STC BEGIN { if ( exists $INC{'Wx/STC.pm'} ) { croak('Wx::Scintilla and Wx::STC and mutually exclusive'); } } # Import all of the constants use Wx::Scintilla::Constant; # Define Perl 6 lexer use constant { wxSCINTILLA_LEX_PERL6 => 102, wxSCINTILLA_P6_DEFAULT => 0, wxSCINTILLA_P6_COMMENT => 1, wxSCINTILLA_P6_STRING => 2, }; # Load the XS backend XSLoader::load 'Wx::Scintilla', $VERSION; # # properly setup inheritance tree # no strict; package Wx::ScintillaTextCtrl; our $VERSION = '0.38'; @ISA = qw(Wx::Control); package Wx::ScintillaTextEvent; our $VERSION = '0.38'; @ISA = qw(Wx::CommandEvent); use strict; # Load the renamespaced versions require Wx::Scintilla::TextCtrl; require Wx::Scintilla::TextEvent; # Set up all of the events SCOPE: { # Disable Wx::EVT_STC_* event warning redefinition no warnings 'redefine'; # SVN_XXXXXX notification messages sub Wx::Event::EVT_STC_STYLENEEDED($$$) { $_[0]->Connect( $_[1], -1, &Wx::wxEVT_STC_STYLENEEDED, $_[2] ); } sub Wx::Event::EVT_STC_CHARADDED($$$) { $_[0]->Connect( $_[1], -1, &Wx::wxEVT_STC_CHARADDED, $_[2] ); } sub Wx::Event::EVT_STC_SAVEPOINTREACHED($$$) { $_[0]->Connect( $_[1], -1, &Wx::wxEVT_STC_SAVEPOINTREACHED, $_[2] ); } sub Wx::Event::EVT_STC_SAVEPOINTLEFT($$$) { $_[0]->Connect( $_[1], -1, &Wx::wxEVT_STC_SAVEPOINTLEFT, $_[2] ); } sub Wx::Event::EVT_STC_ROMODIFYATTEMPT($$$) { $_[0]->Connect( $_[1], -1, &Wx::wxEVT_STC_ROMODIFYATTEMPT, $_[2] ); } sub Wx::Event::EVT_STC_KEY($$$) { $_[0]->Connect( $_[1], -1, &Wx::wxEVT_STC_KEY, $_[2] ); } sub Wx::Event::EVT_STC_DOUBLECLICK($$$) { $_[0]->Connect( $_[1], -1, &Wx::wxEVT_STC_DOUBLECLICK, $_[2] ); } sub Wx::Event::EVT_STC_UPDATEUI($$$) { $_[0]->Connect( $_[1], -1, &Wx::wxEVT_STC_UPDATEUI, $_[2] ); } sub Wx::Event::EVT_STC_MODIFIED($$$) { $_[0]->Connect( $_[1], -1, &Wx::wxEVT_STC_MODIFIED, $_[2] ); } sub Wx::Event::EVT_STC_MACRORECORD($$$) { $_[0]->Connect( $_[1], -1, &Wx::wxEVT_STC_MACRORECORD, $_[2] ); } sub Wx::Event::EVT_STC_MARGINCLICK($$$) { $_[0]->Connect( $_[1], -1, &Wx::wxEVT_STC_MARGINCLICK, $_[2] ); } sub Wx::Event::EVT_STC_NEEDSHOWN($$$) { $_[0]->Connect( $_[1], -1, &Wx::wxEVT_STC_NEEDSHOWN, $_[2] ); } sub Wx::Event::EVT_STC_PAINTED($$$) { $_[0]->Connect( $_[1], -1, &Wx::wxEVT_STC_PAINTED, $_[2] ); } sub Wx::Event::EVT_STC_USERLISTSELECTION($$$) { $_[0]->Connect( $_[1], -1, &Wx::wxEVT_STC_USERLISTSELECTION, $_[2] ); } sub Wx::Event::EVT_STC_URIDROPPED($$$) { $_[0]->Connect( $_[1], -1, &Wx::wxEVT_STC_URIDROPPED, $_[2] ); } sub Wx::Event::EVT_STC_DWELLSTART($$$) { $_[0]->Connect( $_[1], -1, &Wx::wxEVT_STC_DWELLSTART, $_[2] ); } sub Wx::Event::EVT_STC_DWELLEND($$$) { $_[0]->Connect( $_[1], -1, &Wx::wxEVT_STC_DWELLEND, $_[2] ); } sub Wx::Event::EVT_STC_ZOOM($$$) { $_[0]->Connect( $_[1], -1, &Wx::wxEVT_STC_ZOOM, $_[2] ); } sub Wx::Event::EVT_STC_HOTSPOT_CLICK($$$) { $_[0]->Connect( $_[1], -1, &Wx::wxEVT_STC_HOTSPOT_CLICK, $_[2] ); } sub Wx::Event::EVT_STC_HOTSPOT_DCLICK($$$) { $_[0]->Connect( $_[1], -1, &Wx::wxEVT_STC_HOTSPOT_DCLICK, $_[2] ); } sub Wx::Event::EVT_STC_INDICATOR_CLICK($$$) { $_[0]->Connect( $_[1], -1, &Wx::wxEVT_STC_INDICATOR_CLICK, $_[2] ); } sub Wx::Event::EVT_STC_INDICATOR_RELEASE($$$) { $_[0]->Connect( $_[1], -1, &Wx::wxEVT_STC_INDICATOR_RELEASE, $_[2] ); } sub Wx::Event::EVT_STC_CALLTIP_CLICK($$$) { $_[0]->Connect( $_[1], -1, &Wx::wxEVT_STC_CALLTIP_CLICK, $_[2] ); } sub Wx::Event::EVT_STC_AUTOCOMP_CANCELLED($$$) { $_[0]->Connect( $_[1], -1, &Wx::wxEVT_STC_AUTOCOMP_CANCELLED, $_[2] ); } sub Wx::Event::EVT_STC_AUTOCOMP_CHAR_DELETED($$$) { $_[0]->Connect( $_[1], -1, &Wx::wxEVT_STC_AUTOCOMP_CHAR_DELETED, $_[2] ); } # SCEN_XXXXXX notification messages sub Wx::Event::EVT_STC_CHANGE($$$) { $_[0]->Connect( $_[1], -1, &Wx::wxEVT_STC_CHANGE, $_[2] ); } # Events that do not seem to match the documentation sub Wx::Event::EVT_STC_START_DRAG($$$) { $_[0]->Connect( $_[1], -1, &Wx::wxEVT_STC_START_DRAG, $_[2] ); } sub Wx::Event::EVT_STC_DRAG_OVER($$$) { $_[0]->Connect( $_[1], -1, &Wx::wxEVT_STC_DRAG_OVER, $_[2] ); } sub Wx::Event::EVT_STC_DO_DROP($$$) { $_[0]->Connect( $_[1], -1, &Wx::wxEVT_STC_DO_DROP, $_[2] ); } # Deprecated notifications sub Wx::Event::EVT_STC_POSCHANGED($$$) { Carp::croak('EVT_STC_POSCHANGED is deprecated, use EVT_STC_UPDATEUI'); } sub Wx::Event::EVT_STC_CHECKBRACE($$$) { Carp::croak('EVT_STC_CHECKBRACE is deprecated, use EVT_STC_UPDATEUI'); } } # Create the aliases to the native versions. # The order here matches the order in the Scintilla documentation. BEGIN { # SCN_XXXXXX notifications *EVT_STYLENEEDED = *Wx::Event::EVT_STC_STYLENEEDED; *EVT_CHARADDED = *Wx::Event::EVT_STC_CHARADDED; *EVT_SAVEPOINTREACHED = *Wx::Event::EVT_STC_SAVEPOINTREACHED; *EVT_SAVEPOINTLEFT = *Wx::Event::EVT_STC_SAVEPOINTLEFT; *EVT_MODIFYATTEMPTRO = *Wx::Event::EVT_STC_ROMODIFYATTEMPT; *EVT_KEY = *Wx::Event::EVT_STC_KEY; *EVT_DOUBLECLICK = *Wx::Event::EVT_STC_DOUBLECLICK; *EVT_UPDATEUI = *Wx::Event::EVT_STC_UPDATEUI; *EVT_MODIFIED = *Wx::Event::EVT_STC_MODIFIED; *EVT_MACRORECORD = *Wx::Event::EVT_STC_MACRORECORD; *EVT_MARGINCLICK = *Wx::Event::EVT_STC_MARGINCLICK; *EVT_NEEDSHOWN = *Wx::Event::EVT_STC_NEEDSHOWN; *EVT_PAINTED = *Wx::Event::EVT_STC_PAINTED; *EVT_USERLISTSELECTION = *Wx::Event::EVT_STC_USERLISTSELECTION; *EVT_URIDROPPED = *Wx::Event::EVT_STC_URIDROPPED; *EVT_DWELLSTART = *Wx::Event::EVT_STC_DWELLSTART; *EVT_DWELLEND = *Wx::Event::EVT_STC_DWELLEND; *EVT_ZOOM = *Wx::Event::EVT_STC_ZOOM; *EVT_HOTSPOTCLICK = *Wx::Event::EVT_STC_HOTSPOT_CLICK; *EVT_HOTSPOTDOUBLECLICK = *Wx::Event::EVT_STC_HOTSPOT_DCLICK; # *EVT_HOTSPOTRELEASECLICK = *Wx::Event::EVT_STC_HOTSPOTRELEASECLICK; *EVT_INDICATORCLICK = *Wx::Event::EVT_STC_INDICATOR_CLICK; *EVT_INDICATORRELEASE = *Wx::Event::EVT_STC_INDICATOR_RELEASE; *EVT_CALLTIPCLICK = *Wx::Event::EVT_STC_CALLTIP_CLICK; # *EVT_AUTOCSELECTION = *Wx::Event::EVT_STC_AUTOCSELECTION; *EVT_AUTOCCANCELLED = *Wx::Event::EVT_STC_AUTOCOMP_CANCELLED; *EVT_AUTOCCHARDELETED = *Wx::Event::EVT_STC_AUTOCOMP_CHAR_DELETED; # SCEN_XXXXXX notifications *EVT_CHANGE = *Wx::Event::EVT_STC_CHANGE; # Deprecated notifications *EVT_POSCHANGED = *Wx::Event::EVT_STC_POSCHANGED; *EVT_CHECKBRACE = *Wx::Event::EVT_STC_CHECKBRACE; } 1; __END__ =pod =head1 NAME Wx::Scintilla - Scintilla source code editing component for wxWidgets =head1 SYNOPSIS #----> My first scintilla Wx editor :) package My::Scintilla::Editor; use strict; use warnings; # Load Wx::Scintilla use Wx::Scintilla (); # replaces use Wx::STC use base 'Wx::Scintilla::TextCtrl'; # replaces Wx::StyledTextCtrl use Wx qw(:everything); use Wx::Event; # Override the constructor to Enable Perl support in the editor sub new { my ( $class, $parent ) = @_; my $self = $class->SUPER::new( $parent, -1, [ -1, -1 ], [ 750, 700 ] ); # Set the font my $font = Wx::Font->new( 10, wxTELETYPE, wxNORMAL, wxNORMAL ); $self->SetFont($font); $self->StyleSetFont( Wx::Scintilla::STYLE_DEFAULT, $font ); $self->StyleClearAll(); # Set the various Perl lexer colors $self->StyleSetForeground( 0, Wx::Colour->new( 0x00, 0x00, 0x7f ) ); $self->StyleSetForeground( 1, Wx::Colour->new( 0xff, 0x00, 0x00 ) ); $self->StyleSetForeground( 2, Wx::Colour->new( 0x00, 0x7f, 0x00 ) ); $self->StyleSetForeground( 3, Wx::Colour->new( 0x7f, 0x7f, 0x7f ) ); $self->StyleSetForeground( 4, Wx::Colour->new( 0x00, 0x7f, 0x7f ) ); $self->StyleSetForeground( 5, Wx::Colour->new( 0x00, 0x00, 0x7f ) ); $self->StyleSetForeground( 6, Wx::Colour->new( 0xff, 0x7f, 0x00 ) ); $self->StyleSetForeground( 7, Wx::Colour->new( 0x7f, 0x00, 0x7f ) ); $self->StyleSetForeground( 8, Wx::Colour->new( 0x00, 0x00, 0x00 ) ); $self->StyleSetForeground( 9, Wx::Colour->new( 0x7f, 0x7f, 0x7f ) ); $self->StyleSetForeground( 10, Wx::Colour->new( 0x00, 0x00, 0x7f ) ); $self->StyleSetForeground( 11, Wx::Colour->new( 0x00, 0x00, 0xff ) ); $self->StyleSetForeground( 12, Wx::Colour->new( 0x7f, 0x00, 0x7f ) ); $self->StyleSetForeground( 13, Wx::Colour->new( 0x40, 0x80, 0xff ) ); $self->StyleSetForeground( 17, Wx::Colour->new( 0xff, 0x00, 0x7f ) ); $self->StyleSetForeground( 18, Wx::Colour->new( 0x7f, 0x7f, 0x00 ) ); $self->StyleSetBold( 12, 1 ); $self->StyleSetSpec( Wx::Scintilla::SCE_H_TAG, "fore:#0000ff" ); # set the lexer to Perl 5 $self->SetLexer(Wx::Scintilla::SCLEX_PERL); return $self; } #----> DEMO EDITOR APPLICATION # First, define an application object class to encapsulate the application itself package DemoEditorApp; use strict; use warnings; use Wx; use base 'Wx::App'; # We must override OnInit to build the window sub OnInit { my $self = shift; my $frame = Wx::Frame->new( undef, # no parent window -1, # no window id 'My First Scintilla Editor!', # Window title ); my $editor = My::Scintilla::Editor->new( $frame, # Parent window ); $frame->Show(1); return 1; } # Create the application object, and pass control to it. package main; my $app = DemoEditorApp->new; $app->MainLoop; =head1 DESCRIPTION While we already have a good scintilla editor component support via Wx::StyledTextCtrl in Perl, we already suffer from an older scintilla package and thus lagging Perl support in the popular Wx Scintilla component. wxWidgets L has a *very slow* release timeline. Scintilla is a contributed project which means it will not be the latest by the time a new wxWidgets distribution is released. And on the scintilla front, the Perl 5 lexer is not 100% bug free even and we do not have any kind of Perl 6 support in Scintilla. The ambitious goal of this project is to provide fresh Perl 5 and maybe 6 support in L while preserving compatibility with Wx::StyledTextCtrl and continually contribute it back to Scintilla project. Note: You cannot load Wx::STC and Wx::Scintilla in the same application. They are mutually exclusive. The wxSTC_... events are handled by one library or the other. Scintilla 2.28 is now bundled and enabled by default. =head1 MANUAL If you are looking for more API documentation, please consult L =head1 PLATFORMS At the moment, Linux (Debian, Ubuntu, Fedora, CentOS) and Windows (Strawberry and ActivePerl) are supported platforms. My next goal is to support more platforms. Please let me know if you can help out :) On Debian/Ubuntu, you need to install the following via: sudo apt-get install libgtk2.0-dev On MacOS 64-bit by default you need to install a 32-bit Perl in order to install wxWidgets 2.8.x. Please refer to L for more information. =head1 HISTORY wxWidgets 2.9.1 and development have Scintilla 2.03 so far. I searched for Perl lexer changes in scintilla history and here is what we will be getting when we upgrade to 2.26+. =over =item Release 2.26 Perl folding folds "here doc"s and adds options fold.perl.at.else and fold.perl.comment.explicit. Fold structure for Perl fixed. =item Release 2.20 Perl folder works for array blocks, adjacent package statements, nested PODs, and terminates package folding at DATA, D and Z. =item Release 1.79 Perl lexer bug fixed where previous lexical states persisted causing "/" special case styling and subroutine prototype styling to not be correct. =item Release 1.78 Perl lexer fixes problem with string matching caused by line endings. =item Release 1.77 Perl lexer update. =item Release 1.76 Perl lexer handles defined-or operator "". =item Release 1.75 Perl lexer enhanced for handling minus-prefixed barewords, underscores in numeric literals and vector/version strings, D and Z similar to END, subroutine prototypes as a new lexical class, formats and format blocks as new lexical classes, and '/' suffixed keywords and barewords. =item Release 1.71 Perl lexer allows UTF-8 identifiers and has some other small improvements. =back =head1 ACKNOWLEDGEMENTS Neil Hudgson for creating and maintaining the excellent Scintilla project L. Thanks! Robin Dunn L for the excellent scintilla contribution that he made to wxWidgets. This work is based on his codebase. Thanks! Mark dootson L for his big effort to make Wx::Scintilla compilable on various platforms. Big thanks! Heiko Jansen and Gabor Szabo L for the idea to backport Perl lexer for wxWidgets 2.8.10 L and all of #padre members for the continuous support and testing. Thanks! =head1 SUPPORT Bugs should always be submitted via the CPAN bug tracker L For other issues, contact the maintainer. =head1 AUTHOR Ahmad M. Zawawi Mark Dootson =head1 SEE ALSO Wx::Scintilla Manual L wxStyledTextCtrl Documentation L Scintilla edit control for Win32::GUI L =head1 COPYRIGHT AND LICENSE Copyright 2011 Ahmad M. Zawawi. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. License for Scintilla Included Scintilla source is copyrighted 1998-2011 by Neil Hodgson Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. NEIL HODGSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NEIL HODGSON BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. =cut Wx-Scintilla-0.38/lib/Wx/Scintilla000755001750001750 011727344243 17350 5ustar00azawawiazawawi000000000000Wx-Scintilla-0.38/lib/Wx/Scintilla/TextCtrl.pm000444001750001750 21311727344243 21570 0ustar00azawawiazawawi000000000000package Wx::Scintilla::TextCtrl; use 5.008; use strict; use warnings; our $VERSION = '0.38'; our @ISA = 'Wx::ScintillaTextCtrl'; 1; Wx-Scintilla-0.38/lib/Wx/Scintilla/Manual.pod000444001750001750 100511727344243 21422 0ustar00azawawiazawawi000000000000package Wx::Scintilla::Manual; # ABSTRACT: What is Wx::Scintilla, and how do I use it? =pod =head1 NAME Wx::Scintilla::Manual - What is Wx::Scintilla, and how do I use it? =head1 WHAT IS WX::SCINTILLA? =head2 Constants Scintilla constants can be here L =head1 AUTHOR Ahmad M. Zawawi =head1 COPYRIGHT Copyright 2011 Ahmad M. Zawawi. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut __END__Wx-Scintilla-0.38/lib/Wx/Scintilla/TextEvent.pm000444001750001750 21511727344243 21747 0ustar00azawawiazawawi000000000000package Wx::Scintilla::TextEvent; use 5.008; use strict; use warnings; our $VERSION = '0.38'; our @ISA = 'Wx::ScintillaTextEvent'; 1; Wx-Scintilla-0.38/lib/Wx/Scintilla/Constant.pm000444001750001750 51374411727344243 21712 0ustar00azawawiazawawi000000000000package Wx::Scintilla::Constant; ## ## Warning: This file is autogenerated from Scintilla.iface ## PLEASE DO NOT EDIT ## use 5.008; use strict; use warnings; require Exporter; our $VERSION = '0.38'; our @ISA = 'Exporter'; our @EXPORT = qw( INVALID_POSITION SCI_START SCI_OPTIONAL_START SCI_LEXER_START SCWS_INVISIBLE SCWS_VISIBLEALWAYS SCWS_VISIBLEAFTERINDENT SC_EOL_CRLF SC_EOL_CR SC_EOL_LF SC_CP_UTF8 MARKER_MAX SC_MARK_CIRCLE SC_MARK_ROUNDRECT SC_MARK_ARROW SC_MARK_SMALLRECT SC_MARK_SHORTARROW SC_MARK_EMPTY SC_MARK_ARROWDOWN SC_MARK_MINUS SC_MARK_PLUS SC_MARK_VLINE SC_MARK_LCORNER SC_MARK_TCORNER SC_MARK_BOXPLUS SC_MARK_BOXPLUSCONNECTED SC_MARK_BOXMINUS SC_MARK_BOXMINUSCONNECTED SC_MARK_LCORNERCURVE SC_MARK_TCORNERCURVE SC_MARK_CIRCLEPLUS SC_MARK_CIRCLEPLUSCONNECTED SC_MARK_CIRCLEMINUS SC_MARK_CIRCLEMINUSCONNECTED SC_MARK_BACKGROUND SC_MARK_DOTDOTDOT SC_MARK_ARROWS SC_MARK_PIXMAP SC_MARK_FULLRECT SC_MARK_LEFTRECT SC_MARK_AVAILABLE SC_MARK_UNDERLINE SC_MARK_RGBAIMAGE SC_MARK_CHARACTER SC_MARKNUM_FOLDEREND SC_MARKNUM_FOLDEROPENMID SC_MARKNUM_FOLDERMIDTAIL SC_MARKNUM_FOLDERTAIL SC_MARKNUM_FOLDERSUB SC_MARKNUM_FOLDER SC_MARKNUM_FOLDEROPEN SC_MASK_FOLDERS SC_MARGIN_SYMBOL SC_MARGIN_NUMBER SC_MARGIN_BACK SC_MARGIN_FORE SC_MARGIN_TEXT SC_MARGIN_RTEXT STYLE_DEFAULT STYLE_LINENUMBER STYLE_BRACELIGHT STYLE_BRACEBAD STYLE_CONTROLCHAR STYLE_INDENTGUIDE STYLE_CALLTIP STYLE_LASTPREDEFINED STYLE_MAX SC_CHARSET_ANSI SC_CHARSET_DEFAULT SC_CHARSET_BALTIC SC_CHARSET_CHINESEBIG5 SC_CHARSET_EASTEUROPE SC_CHARSET_GB2312 SC_CHARSET_GREEK SC_CHARSET_HANGUL SC_CHARSET_MAC SC_CHARSET_OEM SC_CHARSET_RUSSIAN SC_CHARSET_CYRILLIC SC_CHARSET_SHIFTJIS SC_CHARSET_SYMBOL SC_CHARSET_TURKISH SC_CHARSET_JOHAB SC_CHARSET_HEBREW SC_CHARSET_ARABIC SC_CHARSET_VIETNAMESE SC_CHARSET_THAI SC_CHARSET_8859_15 SC_CASE_MIXED SC_CASE_UPPER SC_CASE_LOWER SC_FONT_SIZE_MULTIPLIER SC_WEIGHT_NORMAL SC_WEIGHT_SEMIBOLD SC_WEIGHT_BOLD INDIC_PLAIN INDIC_SQUIGGLE INDIC_TT INDIC_DIAGONAL INDIC_STRIKE INDIC_HIDDEN INDIC_BOX INDIC_ROUNDBOX INDIC_STRAIGHTBOX INDIC_DASH INDIC_DOTS INDIC_SQUIGGLELOW INDIC_DOTBOX INDIC_MAX INDIC_CONTAINER INDIC0_MASK INDIC1_MASK INDIC2_MASK INDICS_MASK SC_IV_NONE SC_IV_REAL SC_IV_LOOKFORWARD SC_IV_LOOKBOTH SC_PRINT_NORMAL SC_PRINT_INVERTLIGHT SC_PRINT_BLACKONWHITE SC_PRINT_COLOURONWHITE SC_PRINT_COLOURONWHITEDEFAULTBG SCFIND_WHOLEWORD SCFIND_MATCHCASE SCFIND_WORDSTART SCFIND_REGEXP SCFIND_POSIX SC_FOLDLEVELBASE SC_FOLDLEVELWHITEFLAG SC_FOLDLEVELHEADERFLAG SC_FOLDLEVELNUMBERMASK SC_FOLDFLAG_LINEBEFORE_EXPANDED SC_FOLDFLAG_LINEBEFORE_CONTRACTED SC_FOLDFLAG_LINEAFTER_EXPANDED SC_FOLDFLAG_LINEAFTER_CONTRACTED SC_FOLDFLAG_LEVELNUMBERS SC_TIME_FOREVER SC_WRAP_NONE SC_WRAP_WORD SC_WRAP_CHAR SC_WRAPVISUALFLAG_NONE SC_WRAPVISUALFLAG_END SC_WRAPVISUALFLAG_START SC_WRAPVISUALFLAGLOC_DEFAULT SC_WRAPVISUALFLAGLOC_END_BY_TEXT SC_WRAPVISUALFLAGLOC_START_BY_TEXT SC_WRAPINDENT_FIXED SC_WRAPINDENT_SAME SC_WRAPINDENT_INDENT SC_CACHE_NONE SC_CACHE_CARET SC_CACHE_PAGE SC_CACHE_DOCUMENT SC_EFF_QUALITY_MASK SC_EFF_QUALITY_DEFAULT SC_EFF_QUALITY_NON_ANTIALIASED SC_EFF_QUALITY_ANTIALIASED SC_EFF_QUALITY_LCD_OPTIMIZED SC_MULTIPASTE_ONCE SC_MULTIPASTE_EACH EDGE_NONE EDGE_LINE EDGE_BACKGROUND SC_STATUS_OK SC_STATUS_FAILURE SC_STATUS_BADALLOC SC_CURSORNORMAL SC_CURSORARROW SC_CURSORWAIT SC_CURSORREVERSEARROW VISIBLE_SLOP VISIBLE_STRICT CARET_SLOP CARET_STRICT CARET_JUMPS CARET_EVEN SC_SEL_STREAM SC_SEL_RECTANGLE SC_SEL_LINES SC_SEL_THIN SC_CARETSTICKY_OFF SC_CARETSTICKY_ON SC_CARETSTICKY_WHITESPACE SC_ALPHA_TRANSPARENT SC_ALPHA_OPAQUE SC_ALPHA_NOALPHA CARETSTYLE_INVISIBLE CARETSTYLE_LINE CARETSTYLE_BLOCK SC_MARGINOPTION_NONE SC_MARGINOPTION_SUBLINESELECT ANNOTATION_HIDDEN ANNOTATION_STANDARD ANNOTATION_BOXED UNDO_MAY_COALESCE SCVS_NONE SCVS_RECTANGULARSELECTION SCVS_USERACCESSIBLE SC_TECHNOLOGY_DEFAULT SC_TECHNOLOGY_DIRECTWRITE KEYWORDSET_MAX SC_TYPE_BOOLEAN SC_TYPE_INTEGER SC_TYPE_STRING SC_MOD_INSERTTEXT SC_MOD_DELETETEXT SC_MOD_CHANGESTYLE SC_MOD_CHANGEFOLD SC_PERFORMED_USER SC_PERFORMED_UNDO SC_PERFORMED_REDO SC_MULTISTEPUNDOREDO SC_LASTSTEPINUNDOREDO SC_MOD_CHANGEMARKER SC_MOD_BEFOREINSERT SC_MOD_BEFOREDELETE SC_MULTILINEUNDOREDO SC_STARTACTION SC_MOD_CHANGEINDICATOR SC_MOD_CHANGELINESTATE SC_MOD_CHANGEMARGIN SC_MOD_CHANGEANNOTATION SC_MOD_CONTAINER SC_MOD_LEXERSTATE SC_MODEVENTMASKALL SC_UPDATE_CONTENT SC_UPDATE_SELECTION SC_UPDATE_V_SCROLL SC_UPDATE_H_SCROLL SCEN_CHANGE SCEN_SETFOCUS SCEN_KILLFOCUS SCK_DOWN SCK_UP SCK_LEFT SCK_RIGHT SCK_HOME SCK_END SCK_PRIOR SCK_NEXT SCK_DELETE SCK_INSERT SCK_ESCAPE SCK_BACK SCK_TAB SCK_RETURN SCK_ADD SCK_SUBTRACT SCK_DIVIDE SCK_WIN SCK_RWIN SCK_MENU SCMOD_NORM SCMOD_SHIFT SCMOD_CTRL SCMOD_ALT SCMOD_SUPER SCMOD_META SCLEX_CONTAINER SCLEX_NULL SCLEX_PYTHON SCLEX_CPP SCLEX_HTML SCLEX_XML SCLEX_PERL SCLEX_SQL SCLEX_VB SCLEX_PROPERTIES SCLEX_ERRORLIST SCLEX_MAKEFILE SCLEX_BATCH SCLEX_XCODE SCLEX_LATEX SCLEX_LUA SCLEX_DIFF SCLEX_CONF SCLEX_PASCAL SCLEX_AVE SCLEX_ADA SCLEX_LISP SCLEX_RUBY SCLEX_EIFFEL SCLEX_EIFFELKW SCLEX_TCL SCLEX_NNCRONTAB SCLEX_BULLANT SCLEX_VBSCRIPT SCLEX_BAAN SCLEX_MATLAB SCLEX_SCRIPTOL SCLEX_ASM SCLEX_CPPNOCASE SCLEX_FORTRAN SCLEX_F77 SCLEX_CSS SCLEX_POV SCLEX_LOUT SCLEX_ESCRIPT SCLEX_PS SCLEX_NSIS SCLEX_MMIXAL SCLEX_CLW SCLEX_CLWNOCASE SCLEX_LOT SCLEX_YAML SCLEX_TEX SCLEX_METAPOST SCLEX_POWERBASIC SCLEX_FORTH SCLEX_ERLANG SCLEX_OCTAVE SCLEX_MSSQL SCLEX_VERILOG SCLEX_KIX SCLEX_GUI4CLI SCLEX_SPECMAN SCLEX_AU3 SCLEX_APDL SCLEX_BASH SCLEX_ASN1 SCLEX_VHDL SCLEX_CAML SCLEX_BLITZBASIC SCLEX_PUREBASIC SCLEX_HASKELL SCLEX_PHPSCRIPT SCLEX_TADS3 SCLEX_REBOL SCLEX_SMALLTALK SCLEX_FLAGSHIP SCLEX_CSOUND SCLEX_FREEBASIC SCLEX_INNOSETUP SCLEX_OPAL SCLEX_SPICE SCLEX_D SCLEX_CMAKE SCLEX_GAP SCLEX_PLM SCLEX_PROGRESS SCLEX_ABAQUS SCLEX_ASYMPTOTE SCLEX_R SCLEX_MAGIK SCLEX_POWERSHELL SCLEX_MYSQL SCLEX_PO SCLEX_TAL SCLEX_COBOL SCLEX_TACL SCLEX_SORCUS SCLEX_POWERPRO SCLEX_NIMROD SCLEX_SML SCLEX_MARKDOWN SCLEX_TXT2TAGS SCLEX_A68K SCLEX_MODULA SCLEX_COFFEESCRIPT SCLEX_TCMD SCLEX_AVS SCLEX_ECL SCLEX_AUTOMATIC SCE_P_DEFAULT SCE_P_COMMENTLINE SCE_P_NUMBER SCE_P_STRING SCE_P_CHARACTER SCE_P_WORD SCE_P_TRIPLE SCE_P_TRIPLEDOUBLE SCE_P_CLASSNAME SCE_P_DEFNAME SCE_P_OPERATOR SCE_P_IDENTIFIER SCE_P_COMMENTBLOCK SCE_P_STRINGEOL SCE_P_WORD2 SCE_P_DECORATOR SCE_C_DEFAULT SCE_C_COMMENT SCE_C_COMMENTLINE SCE_C_COMMENTDOC SCE_C_NUMBER SCE_C_WORD SCE_C_STRING SCE_C_CHARACTER SCE_C_UUID SCE_C_PREPROCESSOR SCE_C_OPERATOR SCE_C_IDENTIFIER SCE_C_STRINGEOL SCE_C_VERBATIM SCE_C_REGEX SCE_C_COMMENTLINEDOC SCE_C_WORD2 SCE_C_COMMENTDOCKEYWORD SCE_C_COMMENTDOCKEYWORDERROR SCE_C_GLOBALCLASS SCE_C_STRINGRAW SCE_C_TRIPLEVERBATIM SCE_C_HASHQUOTEDSTRING SCE_D_DEFAULT SCE_D_COMMENT SCE_D_COMMENTLINE SCE_D_COMMENTDOC SCE_D_COMMENTNESTED SCE_D_NUMBER SCE_D_WORD SCE_D_WORD2 SCE_D_WORD3 SCE_D_TYPEDEF SCE_D_STRING SCE_D_STRINGEOL SCE_D_CHARACTER SCE_D_OPERATOR SCE_D_IDENTIFIER SCE_D_COMMENTLINEDOC SCE_D_COMMENTDOCKEYWORD SCE_D_COMMENTDOCKEYWORDERROR SCE_D_STRINGB SCE_D_STRINGR SCE_D_WORD5 SCE_D_WORD6 SCE_D_WORD7 SCE_TCL_DEFAULT SCE_TCL_COMMENT SCE_TCL_COMMENTLINE SCE_TCL_NUMBER SCE_TCL_WORD_IN_QUOTE SCE_TCL_IN_QUOTE SCE_TCL_OPERATOR SCE_TCL_IDENTIFIER SCE_TCL_SUBSTITUTION SCE_TCL_SUB_BRACE SCE_TCL_MODIFIER SCE_TCL_EXPAND SCE_TCL_WORD SCE_TCL_WORD2 SCE_TCL_WORD3 SCE_TCL_WORD4 SCE_TCL_WORD5 SCE_TCL_WORD6 SCE_TCL_WORD7 SCE_TCL_WORD8 SCE_TCL_COMMENT_BOX SCE_TCL_BLOCK_COMMENT SCE_H_DEFAULT SCE_H_TAG SCE_H_TAGUNKNOWN SCE_H_ATTRIBUTE SCE_H_ATTRIBUTEUNKNOWN SCE_H_NUMBER SCE_H_DOUBLESTRING SCE_H_SINGLESTRING SCE_H_OTHER SCE_H_COMMENT SCE_H_ENTITY SCE_H_TAGEND SCE_H_XMLSTART SCE_H_XMLEND SCE_H_SCRIPT SCE_H_ASP SCE_H_ASPAT SCE_H_CDATA SCE_H_QUESTION SCE_H_VALUE SCE_H_XCCOMMENT SCE_H_SGML_DEFAULT SCE_H_SGML_COMMAND SCE_H_SGML_1ST_PARAM SCE_H_SGML_DOUBLESTRING SCE_H_SGML_SIMPLESTRING SCE_H_SGML_ERROR SCE_H_SGML_SPECIAL SCE_H_SGML_ENTITY SCE_H_SGML_COMMENT SCE_H_SGML_1ST_PARAM_COMMENT SCE_H_SGML_BLOCK_DEFAULT SCE_HJ_START SCE_HJ_DEFAULT SCE_HJ_COMMENT SCE_HJ_COMMENTLINE SCE_HJ_COMMENTDOC SCE_HJ_NUMBER SCE_HJ_WORD SCE_HJ_KEYWORD SCE_HJ_DOUBLESTRING SCE_HJ_SINGLESTRING SCE_HJ_SYMBOLS SCE_HJ_STRINGEOL SCE_HJ_REGEX SCE_HJA_START SCE_HJA_DEFAULT SCE_HJA_COMMENT SCE_HJA_COMMENTLINE SCE_HJA_COMMENTDOC SCE_HJA_NUMBER SCE_HJA_WORD SCE_HJA_KEYWORD SCE_HJA_DOUBLESTRING SCE_HJA_SINGLESTRING SCE_HJA_SYMBOLS SCE_HJA_STRINGEOL SCE_HJA_REGEX SCE_HB_START SCE_HB_DEFAULT SCE_HB_COMMENTLINE SCE_HB_NUMBER SCE_HB_WORD SCE_HB_STRING SCE_HB_IDENTIFIER SCE_HB_STRINGEOL SCE_HBA_START SCE_HBA_DEFAULT SCE_HBA_COMMENTLINE SCE_HBA_NUMBER SCE_HBA_WORD SCE_HBA_STRING SCE_HBA_IDENTIFIER SCE_HBA_STRINGEOL SCE_HP_START SCE_HP_DEFAULT SCE_HP_COMMENTLINE SCE_HP_NUMBER SCE_HP_STRING SCE_HP_CHARACTER SCE_HP_WORD SCE_HP_TRIPLE SCE_HP_TRIPLEDOUBLE SCE_HP_CLASSNAME SCE_HP_DEFNAME SCE_HP_OPERATOR SCE_HP_IDENTIFIER SCE_HPHP_COMPLEX_VARIABLE SCE_HPA_START SCE_HPA_DEFAULT SCE_HPA_COMMENTLINE SCE_HPA_NUMBER SCE_HPA_STRING SCE_HPA_CHARACTER SCE_HPA_WORD SCE_HPA_TRIPLE SCE_HPA_TRIPLEDOUBLE SCE_HPA_CLASSNAME SCE_HPA_DEFNAME SCE_HPA_OPERATOR SCE_HPA_IDENTIFIER SCE_HPHP_DEFAULT SCE_HPHP_HSTRING SCE_HPHP_SIMPLESTRING SCE_HPHP_WORD SCE_HPHP_NUMBER SCE_HPHP_VARIABLE SCE_HPHP_COMMENT SCE_HPHP_COMMENTLINE SCE_HPHP_HSTRING_VARIABLE SCE_HPHP_OPERATOR SCE_PL_DEFAULT SCE_PL_ERROR SCE_PL_COMMENTLINE SCE_PL_POD SCE_PL_NUMBER SCE_PL_WORD SCE_PL_STRING SCE_PL_CHARACTER SCE_PL_PUNCTUATION SCE_PL_PREPROCESSOR SCE_PL_OPERATOR SCE_PL_IDENTIFIER SCE_PL_SCALAR SCE_PL_ARRAY SCE_PL_HASH SCE_PL_SYMBOLTABLE SCE_PL_VARIABLE_INDEXER SCE_PL_REGEX SCE_PL_REGSUBST SCE_PL_LONGQUOTE SCE_PL_BACKTICKS SCE_PL_DATASECTION SCE_PL_HERE_DELIM SCE_PL_HERE_Q SCE_PL_HERE_QQ SCE_PL_HERE_QX SCE_PL_STRING_Q SCE_PL_STRING_QQ SCE_PL_STRING_QX SCE_PL_STRING_QR SCE_PL_STRING_QW SCE_PL_POD_VERB SCE_PL_SUB_PROTOTYPE SCE_PL_FORMAT_IDENT SCE_PL_FORMAT SCE_PL_STRING_VAR SCE_PL_XLAT SCE_PL_REGEX_VAR SCE_PL_REGSUBST_VAR SCE_PL_BACKTICKS_VAR SCE_PL_HERE_QQ_VAR SCE_PL_HERE_QX_VAR SCE_PL_STRING_QQ_VAR SCE_PL_STRING_QX_VAR SCE_PL_STRING_QR_VAR SCE_RB_DEFAULT SCE_RB_ERROR SCE_RB_COMMENTLINE SCE_RB_POD SCE_RB_NUMBER SCE_RB_WORD SCE_RB_STRING SCE_RB_CHARACTER SCE_RB_CLASSNAME SCE_RB_DEFNAME SCE_RB_OPERATOR SCE_RB_IDENTIFIER SCE_RB_REGEX SCE_RB_GLOBAL SCE_RB_SYMBOL SCE_RB_MODULE_NAME SCE_RB_INSTANCE_VAR SCE_RB_CLASS_VAR SCE_RB_BACKTICKS SCE_RB_DATASECTION SCE_RB_HERE_DELIM SCE_RB_HERE_Q SCE_RB_HERE_QQ SCE_RB_HERE_QX SCE_RB_STRING_Q SCE_RB_STRING_QQ SCE_RB_STRING_QX SCE_RB_STRING_QR SCE_RB_STRING_QW SCE_RB_WORD_DEMOTED SCE_RB_STDIN SCE_RB_STDOUT SCE_RB_STDERR SCE_RB_UPPER_BOUND SCE_B_DEFAULT SCE_B_COMMENT SCE_B_NUMBER SCE_B_KEYWORD SCE_B_STRING SCE_B_PREPROCESSOR SCE_B_OPERATOR SCE_B_IDENTIFIER SCE_B_DATE SCE_B_STRINGEOL SCE_B_KEYWORD2 SCE_B_KEYWORD3 SCE_B_KEYWORD4 SCE_B_CONSTANT SCE_B_ASM SCE_B_LABEL SCE_B_ERROR SCE_B_HEXNUMBER SCE_B_BINNUMBER SCE_PROPS_DEFAULT SCE_PROPS_COMMENT SCE_PROPS_SECTION SCE_PROPS_ASSIGNMENT SCE_PROPS_DEFVAL SCE_PROPS_KEY SCE_L_DEFAULT SCE_L_COMMAND SCE_L_TAG SCE_L_MATH SCE_L_COMMENT SCE_L_TAG2 SCE_L_MATH2 SCE_L_COMMENT2 SCE_L_VERBATIM SCE_L_SHORTCMD SCE_L_SPECIAL SCE_L_CMDOPT SCE_L_ERROR SCE_LUA_DEFAULT SCE_LUA_COMMENT SCE_LUA_COMMENTLINE SCE_LUA_COMMENTDOC SCE_LUA_NUMBER SCE_LUA_WORD SCE_LUA_STRING SCE_LUA_CHARACTER SCE_LUA_LITERALSTRING SCE_LUA_PREPROCESSOR SCE_LUA_OPERATOR SCE_LUA_IDENTIFIER SCE_LUA_STRINGEOL SCE_LUA_WORD2 SCE_LUA_WORD3 SCE_LUA_WORD4 SCE_LUA_WORD5 SCE_LUA_WORD6 SCE_LUA_WORD7 SCE_LUA_WORD8 SCE_LUA_LABEL SCE_ERR_DEFAULT SCE_ERR_PYTHON SCE_ERR_GCC SCE_ERR_MS SCE_ERR_CMD SCE_ERR_BORLAND SCE_ERR_PERL SCE_ERR_NET SCE_ERR_LUA SCE_ERR_CTAG SCE_ERR_DIFF_CHANGED SCE_ERR_DIFF_ADDITION SCE_ERR_DIFF_DELETION SCE_ERR_DIFF_MESSAGE SCE_ERR_PHP SCE_ERR_ELF SCE_ERR_IFC SCE_ERR_IFORT SCE_ERR_ABSF SCE_ERR_TIDY SCE_ERR_JAVA_STACK SCE_ERR_VALUE SCE_BAT_DEFAULT SCE_BAT_COMMENT SCE_BAT_WORD SCE_BAT_LABEL SCE_BAT_HIDE SCE_BAT_COMMAND SCE_BAT_IDENTIFIER SCE_BAT_OPERATOR SCE_TCMD_DEFAULT SCE_TCMD_COMMENT SCE_TCMD_WORD SCE_TCMD_LABEL SCE_TCMD_HIDE SCE_TCMD_COMMAND SCE_TCMD_IDENTIFIER SCE_TCMD_OPERATOR SCE_TCMD_ENVIRONMENT SCE_TCMD_EXPANSION SCE_TCMD_CLABEL SCE_MAKE_DEFAULT SCE_MAKE_COMMENT SCE_MAKE_PREPROCESSOR SCE_MAKE_IDENTIFIER SCE_MAKE_OPERATOR SCE_MAKE_TARGET SCE_MAKE_IDEOL SCE_DIFF_DEFAULT SCE_DIFF_COMMENT SCE_DIFF_COMMAND SCE_DIFF_HEADER SCE_DIFF_POSITION SCE_DIFF_DELETED SCE_DIFF_ADDED SCE_DIFF_CHANGED SCE_CONF_DEFAULT SCE_CONF_COMMENT SCE_CONF_NUMBER SCE_CONF_IDENTIFIER SCE_CONF_EXTENSION SCE_CONF_PARAMETER SCE_CONF_STRING SCE_CONF_OPERATOR SCE_CONF_IP SCE_CONF_DIRECTIVE SCE_AVE_DEFAULT SCE_AVE_COMMENT SCE_AVE_NUMBER SCE_AVE_WORD SCE_AVE_STRING SCE_AVE_ENUM SCE_AVE_STRINGEOL SCE_AVE_IDENTIFIER SCE_AVE_OPERATOR SCE_AVE_WORD1 SCE_AVE_WORD2 SCE_AVE_WORD3 SCE_AVE_WORD4 SCE_AVE_WORD5 SCE_AVE_WORD6 SCE_ADA_DEFAULT SCE_ADA_WORD SCE_ADA_IDENTIFIER SCE_ADA_NUMBER SCE_ADA_DELIMITER SCE_ADA_CHARACTER SCE_ADA_CHARACTEREOL SCE_ADA_STRING SCE_ADA_STRINGEOL SCE_ADA_LABEL SCE_ADA_COMMENTLINE SCE_ADA_ILLEGAL SCE_BAAN_DEFAULT SCE_BAAN_COMMENT SCE_BAAN_COMMENTDOC SCE_BAAN_NUMBER SCE_BAAN_WORD SCE_BAAN_STRING SCE_BAAN_PREPROCESSOR SCE_BAAN_OPERATOR SCE_BAAN_IDENTIFIER SCE_BAAN_STRINGEOL SCE_BAAN_WORD2 SCE_LISP_DEFAULT SCE_LISP_COMMENT SCE_LISP_NUMBER SCE_LISP_KEYWORD SCE_LISP_KEYWORD_KW SCE_LISP_SYMBOL SCE_LISP_STRING SCE_LISP_STRINGEOL SCE_LISP_IDENTIFIER SCE_LISP_OPERATOR SCE_LISP_SPECIAL SCE_LISP_MULTI_COMMENT SCE_EIFFEL_DEFAULT SCE_EIFFEL_COMMENTLINE SCE_EIFFEL_NUMBER SCE_EIFFEL_WORD SCE_EIFFEL_STRING SCE_EIFFEL_CHARACTER SCE_EIFFEL_OPERATOR SCE_EIFFEL_IDENTIFIER SCE_EIFFEL_STRINGEOL SCE_NNCRONTAB_DEFAULT SCE_NNCRONTAB_COMMENT SCE_NNCRONTAB_TASK SCE_NNCRONTAB_SECTION SCE_NNCRONTAB_KEYWORD SCE_NNCRONTAB_MODIFIER SCE_NNCRONTAB_ASTERISK SCE_NNCRONTAB_NUMBER SCE_NNCRONTAB_STRING SCE_NNCRONTAB_ENVIRONMENT SCE_NNCRONTAB_IDENTIFIER SCE_FORTH_DEFAULT SCE_FORTH_COMMENT SCE_FORTH_COMMENT_ML SCE_FORTH_IDENTIFIER SCE_FORTH_CONTROL SCE_FORTH_KEYWORD SCE_FORTH_DEFWORD SCE_FORTH_PREWORD1 SCE_FORTH_PREWORD2 SCE_FORTH_NUMBER SCE_FORTH_STRING SCE_FORTH_LOCALE SCE_MATLAB_DEFAULT SCE_MATLAB_COMMENT SCE_MATLAB_COMMAND SCE_MATLAB_NUMBER SCE_MATLAB_KEYWORD SCE_MATLAB_STRING SCE_MATLAB_OPERATOR SCE_MATLAB_IDENTIFIER SCE_MATLAB_DOUBLEQUOTESTRING SCE_SCRIPTOL_DEFAULT SCE_SCRIPTOL_WHITE SCE_SCRIPTOL_COMMENTLINE SCE_SCRIPTOL_PERSISTENT SCE_SCRIPTOL_CSTYLE SCE_SCRIPTOL_COMMENTBLOCK SCE_SCRIPTOL_NUMBER SCE_SCRIPTOL_STRING SCE_SCRIPTOL_CHARACTER SCE_SCRIPTOL_STRINGEOL SCE_SCRIPTOL_KEYWORD SCE_SCRIPTOL_OPERATOR SCE_SCRIPTOL_IDENTIFIER SCE_SCRIPTOL_TRIPLE SCE_SCRIPTOL_CLASSNAME SCE_SCRIPTOL_PREPROCESSOR SCE_ASM_DEFAULT SCE_ASM_COMMENT SCE_ASM_NUMBER SCE_ASM_STRING SCE_ASM_OPERATOR SCE_ASM_IDENTIFIER SCE_ASM_CPUINSTRUCTION SCE_ASM_MATHINSTRUCTION SCE_ASM_REGISTER SCE_ASM_DIRECTIVE SCE_ASM_DIRECTIVEOPERAND SCE_ASM_COMMENTBLOCK SCE_ASM_CHARACTER SCE_ASM_STRINGEOL SCE_ASM_EXTINSTRUCTION SCE_ASM_COMMENTDIRECTIVE SCE_F_DEFAULT SCE_F_COMMENT SCE_F_NUMBER SCE_F_STRING1 SCE_F_STRING2 SCE_F_STRINGEOL SCE_F_OPERATOR SCE_F_IDENTIFIER SCE_F_WORD SCE_F_WORD2 SCE_F_WORD3 SCE_F_PREPROCESSOR SCE_F_OPERATOR2 SCE_F_LABEL SCE_F_CONTINUATION SCE_CSS_DEFAULT SCE_CSS_TAG SCE_CSS_CLASS SCE_CSS_PSEUDOCLASS SCE_CSS_UNKNOWN_PSEUDOCLASS SCE_CSS_OPERATOR SCE_CSS_IDENTIFIER SCE_CSS_UNKNOWN_IDENTIFIER SCE_CSS_VALUE SCE_CSS_COMMENT SCE_CSS_ID SCE_CSS_IMPORTANT SCE_CSS_DIRECTIVE SCE_CSS_DOUBLESTRING SCE_CSS_SINGLESTRING SCE_CSS_IDENTIFIER2 SCE_CSS_ATTRIBUTE SCE_CSS_IDENTIFIER3 SCE_CSS_PSEUDOELEMENT SCE_CSS_EXTENDED_IDENTIFIER SCE_CSS_EXTENDED_PSEUDOCLASS SCE_CSS_EXTENDED_PSEUDOELEMENT SCE_CSS_MEDIA SCE_CSS_VARIABLE SCE_POV_DEFAULT SCE_POV_COMMENT SCE_POV_COMMENTLINE SCE_POV_NUMBER SCE_POV_OPERATOR SCE_POV_IDENTIFIER SCE_POV_STRING SCE_POV_STRINGEOL SCE_POV_DIRECTIVE SCE_POV_BADDIRECTIVE SCE_POV_WORD2 SCE_POV_WORD3 SCE_POV_WORD4 SCE_POV_WORD5 SCE_POV_WORD6 SCE_POV_WORD7 SCE_POV_WORD8 SCE_LOUT_DEFAULT SCE_LOUT_COMMENT SCE_LOUT_NUMBER SCE_LOUT_WORD SCE_LOUT_WORD2 SCE_LOUT_WORD3 SCE_LOUT_WORD4 SCE_LOUT_STRING SCE_LOUT_OPERATOR SCE_LOUT_IDENTIFIER SCE_LOUT_STRINGEOL SCE_ESCRIPT_DEFAULT SCE_ESCRIPT_COMMENT SCE_ESCRIPT_COMMENTLINE SCE_ESCRIPT_COMMENTDOC SCE_ESCRIPT_NUMBER SCE_ESCRIPT_WORD SCE_ESCRIPT_STRING SCE_ESCRIPT_OPERATOR SCE_ESCRIPT_IDENTIFIER SCE_ESCRIPT_BRACE SCE_ESCRIPT_WORD2 SCE_ESCRIPT_WORD3 SCE_PS_DEFAULT SCE_PS_COMMENT SCE_PS_DSC_COMMENT SCE_PS_DSC_VALUE SCE_PS_NUMBER SCE_PS_NAME SCE_PS_KEYWORD SCE_PS_LITERAL SCE_PS_IMMEVAL SCE_PS_PAREN_ARRAY SCE_PS_PAREN_DICT SCE_PS_PAREN_PROC SCE_PS_TEXT SCE_PS_HEXSTRING SCE_PS_BASE85STRING SCE_PS_BADSTRINGCHAR SCE_NSIS_DEFAULT SCE_NSIS_COMMENT SCE_NSIS_STRINGDQ SCE_NSIS_STRINGLQ SCE_NSIS_STRINGRQ SCE_NSIS_FUNCTION SCE_NSIS_VARIABLE SCE_NSIS_LABEL SCE_NSIS_USERDEFINED SCE_NSIS_SECTIONDEF SCE_NSIS_SUBSECTIONDEF SCE_NSIS_IFDEFINEDEF SCE_NSIS_MACRODEF SCE_NSIS_STRINGVAR SCE_NSIS_NUMBER SCE_NSIS_SECTIONGROUP SCE_NSIS_PAGEEX SCE_NSIS_FUNCTIONDEF SCE_NSIS_COMMENTBOX SCE_MMIXAL_LEADWS SCE_MMIXAL_COMMENT SCE_MMIXAL_LABEL SCE_MMIXAL_OPCODE SCE_MMIXAL_OPCODE_PRE SCE_MMIXAL_OPCODE_VALID SCE_MMIXAL_OPCODE_UNKNOWN SCE_MMIXAL_OPCODE_POST SCE_MMIXAL_OPERANDS SCE_MMIXAL_NUMBER SCE_MMIXAL_REF SCE_MMIXAL_CHAR SCE_MMIXAL_STRING SCE_MMIXAL_REGISTER SCE_MMIXAL_HEX SCE_MMIXAL_OPERATOR SCE_MMIXAL_SYMBOL SCE_MMIXAL_INCLUDE SCE_CLW_DEFAULT SCE_CLW_LABEL SCE_CLW_COMMENT SCE_CLW_STRING SCE_CLW_USER_IDENTIFIER SCE_CLW_INTEGER_CONSTANT SCE_CLW_REAL_CONSTANT SCE_CLW_PICTURE_STRING SCE_CLW_KEYWORD SCE_CLW_COMPILER_DIRECTIVE SCE_CLW_RUNTIME_EXPRESSIONS SCE_CLW_BUILTIN_PROCEDURES_FUNCTION SCE_CLW_STRUCTURE_DATA_TYPE SCE_CLW_ATTRIBUTE SCE_CLW_STANDARD_EQUATE SCE_CLW_ERROR SCE_CLW_DEPRECATED SCE_LOT_DEFAULT SCE_LOT_HEADER SCE_LOT_BREAK SCE_LOT_SET SCE_LOT_PASS SCE_LOT_FAIL SCE_LOT_ABORT SCE_YAML_DEFAULT SCE_YAML_COMMENT SCE_YAML_IDENTIFIER SCE_YAML_KEYWORD SCE_YAML_NUMBER SCE_YAML_REFERENCE SCE_YAML_DOCUMENT SCE_YAML_TEXT SCE_YAML_ERROR SCE_YAML_OPERATOR SCE_TEX_DEFAULT SCE_TEX_SPECIAL SCE_TEX_GROUP SCE_TEX_SYMBOL SCE_TEX_COMMAND SCE_TEX_TEXT SCE_METAPOST_DEFAULT SCE_METAPOST_SPECIAL SCE_METAPOST_GROUP SCE_METAPOST_SYMBOL SCE_METAPOST_COMMAND SCE_METAPOST_TEXT SCE_METAPOST_EXTRA SCE_ERLANG_DEFAULT SCE_ERLANG_COMMENT SCE_ERLANG_VARIABLE SCE_ERLANG_NUMBER SCE_ERLANG_KEYWORD SCE_ERLANG_STRING SCE_ERLANG_OPERATOR SCE_ERLANG_ATOM SCE_ERLANG_FUNCTION_NAME SCE_ERLANG_CHARACTER SCE_ERLANG_MACRO SCE_ERLANG_RECORD SCE_ERLANG_PREPROC SCE_ERLANG_NODE_NAME SCE_ERLANG_COMMENT_FUNCTION SCE_ERLANG_COMMENT_MODULE SCE_ERLANG_COMMENT_DOC SCE_ERLANG_COMMENT_DOC_MACRO SCE_ERLANG_ATOM_QUOTED SCE_ERLANG_MACRO_QUOTED SCE_ERLANG_RECORD_QUOTED SCE_ERLANG_NODE_NAME_QUOTED SCE_ERLANG_BIFS SCE_ERLANG_MODULES SCE_ERLANG_MODULES_ATT SCE_ERLANG_UNKNOWN SCE_MSSQL_DEFAULT SCE_MSSQL_COMMENT SCE_MSSQL_LINE_COMMENT SCE_MSSQL_NUMBER SCE_MSSQL_STRING SCE_MSSQL_OPERATOR SCE_MSSQL_IDENTIFIER SCE_MSSQL_VARIABLE SCE_MSSQL_COLUMN_NAME SCE_MSSQL_STATEMENT SCE_MSSQL_DATATYPE SCE_MSSQL_SYSTABLE SCE_MSSQL_GLOBAL_VARIABLE SCE_MSSQL_FUNCTION SCE_MSSQL_STORED_PROCEDURE SCE_MSSQL_DEFAULT_PREF_DATATYPE SCE_MSSQL_COLUMN_NAME_2 SCE_V_DEFAULT SCE_V_COMMENT SCE_V_COMMENTLINE SCE_V_COMMENTLINEBANG SCE_V_NUMBER SCE_V_WORD SCE_V_STRING SCE_V_WORD2 SCE_V_WORD3 SCE_V_PREPROCESSOR SCE_V_OPERATOR SCE_V_IDENTIFIER SCE_V_STRINGEOL SCE_V_USER SCE_KIX_DEFAULT SCE_KIX_COMMENT SCE_KIX_STRING1 SCE_KIX_STRING2 SCE_KIX_NUMBER SCE_KIX_VAR SCE_KIX_MACRO SCE_KIX_KEYWORD SCE_KIX_FUNCTIONS SCE_KIX_OPERATOR SCE_KIX_IDENTIFIER SCE_GC_DEFAULT SCE_GC_COMMENTLINE SCE_GC_COMMENTBLOCK SCE_GC_GLOBAL SCE_GC_EVENT SCE_GC_ATTRIBUTE SCE_GC_CONTROL SCE_GC_COMMAND SCE_GC_STRING SCE_GC_OPERATOR SCE_SN_DEFAULT SCE_SN_CODE SCE_SN_COMMENTLINE SCE_SN_COMMENTLINEBANG SCE_SN_NUMBER SCE_SN_WORD SCE_SN_STRING SCE_SN_WORD2 SCE_SN_WORD3 SCE_SN_PREPROCESSOR SCE_SN_OPERATOR SCE_SN_IDENTIFIER SCE_SN_STRINGEOL SCE_SN_REGEXTAG SCE_SN_SIGNAL SCE_SN_USER SCE_AU3_DEFAULT SCE_AU3_COMMENT SCE_AU3_COMMENTBLOCK SCE_AU3_NUMBER SCE_AU3_FUNCTION SCE_AU3_KEYWORD SCE_AU3_MACRO SCE_AU3_STRING SCE_AU3_OPERATOR SCE_AU3_VARIABLE SCE_AU3_SENT SCE_AU3_PREPROCESSOR SCE_AU3_SPECIAL SCE_AU3_EXPAND SCE_AU3_COMOBJ SCE_AU3_UDF SCE_APDL_DEFAULT SCE_APDL_COMMENT SCE_APDL_COMMENTBLOCK SCE_APDL_NUMBER SCE_APDL_STRING SCE_APDL_OPERATOR SCE_APDL_WORD SCE_APDL_PROCESSOR SCE_APDL_COMMAND SCE_APDL_SLASHCOMMAND SCE_APDL_STARCOMMAND SCE_APDL_ARGUMENT SCE_APDL_FUNCTION SCE_SH_DEFAULT SCE_SH_ERROR SCE_SH_COMMENTLINE SCE_SH_NUMBER SCE_SH_WORD SCE_SH_STRING SCE_SH_CHARACTER SCE_SH_OPERATOR SCE_SH_IDENTIFIER SCE_SH_SCALAR SCE_SH_PARAM SCE_SH_BACKTICKS SCE_SH_HERE_DELIM SCE_SH_HERE_Q SCE_ASN1_DEFAULT SCE_ASN1_COMMENT SCE_ASN1_IDENTIFIER SCE_ASN1_STRING SCE_ASN1_OID SCE_ASN1_SCALAR SCE_ASN1_KEYWORD SCE_ASN1_ATTRIBUTE SCE_ASN1_DESCRIPTOR SCE_ASN1_TYPE SCE_ASN1_OPERATOR SCE_VHDL_DEFAULT SCE_VHDL_COMMENT SCE_VHDL_COMMENTLINEBANG SCE_VHDL_NUMBER SCE_VHDL_STRING SCE_VHDL_OPERATOR SCE_VHDL_IDENTIFIER SCE_VHDL_STRINGEOL SCE_VHDL_KEYWORD SCE_VHDL_STDOPERATOR SCE_VHDL_ATTRIBUTE SCE_VHDL_STDFUNCTION SCE_VHDL_STDPACKAGE SCE_VHDL_STDTYPE SCE_VHDL_USERWORD SCE_CAML_DEFAULT SCE_CAML_IDENTIFIER SCE_CAML_TAGNAME SCE_CAML_KEYWORD SCE_CAML_KEYWORD2 SCE_CAML_KEYWORD3 SCE_CAML_LINENUM SCE_CAML_OPERATOR SCE_CAML_NUMBER SCE_CAML_CHAR SCE_CAML_WHITE SCE_CAML_STRING SCE_CAML_COMMENT SCE_CAML_COMMENT1 SCE_CAML_COMMENT2 SCE_CAML_COMMENT3 SCE_HA_DEFAULT SCE_HA_IDENTIFIER SCE_HA_KEYWORD SCE_HA_NUMBER SCE_HA_STRING SCE_HA_CHARACTER SCE_HA_CLASS SCE_HA_MODULE SCE_HA_CAPITAL SCE_HA_DATA SCE_HA_IMPORT SCE_HA_OPERATOR SCE_HA_INSTANCE SCE_HA_COMMENTLINE SCE_HA_COMMENTBLOCK SCE_HA_COMMENTBLOCK2 SCE_HA_COMMENTBLOCK3 SCE_T3_DEFAULT SCE_T3_X_DEFAULT SCE_T3_PREPROCESSOR SCE_T3_BLOCK_COMMENT SCE_T3_LINE_COMMENT SCE_T3_OPERATOR SCE_T3_KEYWORD SCE_T3_NUMBER SCE_T3_IDENTIFIER SCE_T3_S_STRING SCE_T3_D_STRING SCE_T3_X_STRING SCE_T3_LIB_DIRECTIVE SCE_T3_MSG_PARAM SCE_T3_HTML_TAG SCE_T3_HTML_DEFAULT SCE_T3_HTML_STRING SCE_T3_USER1 SCE_T3_USER2 SCE_T3_USER3 SCE_T3_BRACE SCE_REBOL_DEFAULT SCE_REBOL_COMMENTLINE SCE_REBOL_COMMENTBLOCK SCE_REBOL_PREFACE SCE_REBOL_OPERATOR SCE_REBOL_CHARACTER SCE_REBOL_QUOTEDSTRING SCE_REBOL_BRACEDSTRING SCE_REBOL_NUMBER SCE_REBOL_PAIR SCE_REBOL_TUPLE SCE_REBOL_BINARY SCE_REBOL_MONEY SCE_REBOL_ISSUE SCE_REBOL_TAG SCE_REBOL_FILE SCE_REBOL_EMAIL SCE_REBOL_URL SCE_REBOL_DATE SCE_REBOL_TIME SCE_REBOL_IDENTIFIER SCE_REBOL_WORD SCE_REBOL_WORD2 SCE_REBOL_WORD3 SCE_REBOL_WORD4 SCE_REBOL_WORD5 SCE_REBOL_WORD6 SCE_REBOL_WORD7 SCE_REBOL_WORD8 SCE_SQL_DEFAULT SCE_SQL_COMMENT SCE_SQL_COMMENTLINE SCE_SQL_COMMENTDOC SCE_SQL_NUMBER SCE_SQL_WORD SCE_SQL_STRING SCE_SQL_CHARACTER SCE_SQL_SQLPLUS SCE_SQL_SQLPLUS_PROMPT SCE_SQL_OPERATOR SCE_SQL_IDENTIFIER SCE_SQL_SQLPLUS_COMMENT SCE_SQL_COMMENTLINEDOC SCE_SQL_WORD2 SCE_SQL_COMMENTDOCKEYWORD SCE_SQL_COMMENTDOCKEYWORDERROR SCE_SQL_USER1 SCE_SQL_USER2 SCE_SQL_USER3 SCE_SQL_USER4 SCE_SQL_QUOTEDIDENTIFIER SCE_ST_DEFAULT SCE_ST_STRING SCE_ST_NUMBER SCE_ST_COMMENT SCE_ST_SYMBOL SCE_ST_BINARY SCE_ST_BOOL SCE_ST_SELF SCE_ST_SUPER SCE_ST_NIL SCE_ST_GLOBAL SCE_ST_RETURN SCE_ST_SPECIAL SCE_ST_KWSEND SCE_ST_ASSIGN SCE_ST_CHARACTER SCE_ST_SPEC_SEL SCE_FS_DEFAULT SCE_FS_COMMENT SCE_FS_COMMENTLINE SCE_FS_COMMENTDOC SCE_FS_COMMENTLINEDOC SCE_FS_COMMENTDOCKEYWORD SCE_FS_COMMENTDOCKEYWORDERROR SCE_FS_KEYWORD SCE_FS_KEYWORD2 SCE_FS_KEYWORD3 SCE_FS_KEYWORD4 SCE_FS_NUMBER SCE_FS_STRING SCE_FS_PREPROCESSOR SCE_FS_OPERATOR SCE_FS_IDENTIFIER SCE_FS_DATE SCE_FS_STRINGEOL SCE_FS_CONSTANT SCE_FS_WORDOPERATOR SCE_FS_DISABLEDCODE SCE_FS_DEFAULT_C SCE_FS_COMMENTDOC_C SCE_FS_COMMENTLINEDOC_C SCE_FS_KEYWORD_C SCE_FS_KEYWORD2_C SCE_FS_NUMBER_C SCE_FS_STRING_C SCE_FS_PREPROCESSOR_C SCE_FS_OPERATOR_C SCE_FS_IDENTIFIER_C SCE_FS_STRINGEOL_C SCE_CSOUND_DEFAULT SCE_CSOUND_COMMENT SCE_CSOUND_NUMBER SCE_CSOUND_OPERATOR SCE_CSOUND_INSTR SCE_CSOUND_IDENTIFIER SCE_CSOUND_OPCODE SCE_CSOUND_HEADERSTMT SCE_CSOUND_USERKEYWORD SCE_CSOUND_COMMENTBLOCK SCE_CSOUND_PARAM SCE_CSOUND_ARATE_VAR SCE_CSOUND_KRATE_VAR SCE_CSOUND_IRATE_VAR SCE_CSOUND_GLOBAL_VAR SCE_CSOUND_STRINGEOL SCE_INNO_DEFAULT SCE_INNO_COMMENT SCE_INNO_KEYWORD SCE_INNO_PARAMETER SCE_INNO_SECTION SCE_INNO_PREPROC SCE_INNO_INLINE_EXPANSION SCE_INNO_COMMENT_PASCAL SCE_INNO_KEYWORD_PASCAL SCE_INNO_KEYWORD_USER SCE_INNO_STRING_DOUBLE SCE_INNO_STRING_SINGLE SCE_INNO_IDENTIFIER SCE_OPAL_SPACE SCE_OPAL_COMMENT_BLOCK SCE_OPAL_COMMENT_LINE SCE_OPAL_INTEGER SCE_OPAL_KEYWORD SCE_OPAL_SORT SCE_OPAL_STRING SCE_OPAL_PAR SCE_OPAL_BOOL_CONST SCE_OPAL_DEFAULT SCE_SPICE_DEFAULT SCE_SPICE_IDENTIFIER SCE_SPICE_KEYWORD SCE_SPICE_KEYWORD2 SCE_SPICE_KEYWORD3 SCE_SPICE_NUMBER SCE_SPICE_DELIMITER SCE_SPICE_VALUE SCE_SPICE_COMMENTLINE SCE_CMAKE_DEFAULT SCE_CMAKE_COMMENT SCE_CMAKE_STRINGDQ SCE_CMAKE_STRINGLQ SCE_CMAKE_STRINGRQ SCE_CMAKE_COMMANDS SCE_CMAKE_PARAMETERS SCE_CMAKE_VARIABLE SCE_CMAKE_USERDEFINED SCE_CMAKE_WHILEDEF SCE_CMAKE_FOREACHDEF SCE_CMAKE_IFDEFINEDEF SCE_CMAKE_MACRODEF SCE_CMAKE_STRINGVAR SCE_CMAKE_NUMBER SCE_GAP_DEFAULT SCE_GAP_IDENTIFIER SCE_GAP_KEYWORD SCE_GAP_KEYWORD2 SCE_GAP_KEYWORD3 SCE_GAP_KEYWORD4 SCE_GAP_STRING SCE_GAP_CHAR SCE_GAP_OPERATOR SCE_GAP_COMMENT SCE_GAP_NUMBER SCE_GAP_STRINGEOL SCE_PLM_DEFAULT SCE_PLM_COMMENT SCE_PLM_STRING SCE_PLM_NUMBER SCE_PLM_IDENTIFIER SCE_PLM_OPERATOR SCE_PLM_CONTROL SCE_PLM_KEYWORD SCE_4GL_DEFAULT SCE_4GL_NUMBER SCE_4GL_WORD SCE_4GL_STRING SCE_4GL_CHARACTER SCE_4GL_PREPROCESSOR SCE_4GL_OPERATOR SCE_4GL_IDENTIFIER SCE_4GL_BLOCK SCE_4GL_END SCE_4GL_COMMENT1 SCE_4GL_COMMENT2 SCE_4GL_COMMENT3 SCE_4GL_COMMENT4 SCE_4GL_COMMENT5 SCE_4GL_COMMENT6 SCE_4GL_DEFAULT_ SCE_4GL_NUMBER_ SCE_4GL_WORD_ SCE_4GL_STRING_ SCE_4GL_CHARACTER_ SCE_4GL_PREPROCESSOR_ SCE_4GL_OPERATOR_ SCE_4GL_IDENTIFIER_ SCE_4GL_BLOCK_ SCE_4GL_END_ SCE_4GL_COMMENT1_ SCE_4GL_COMMENT2_ SCE_4GL_COMMENT3_ SCE_4GL_COMMENT4_ SCE_4GL_COMMENT5_ SCE_4GL_COMMENT6_ SCE_ABAQUS_DEFAULT SCE_ABAQUS_COMMENT SCE_ABAQUS_COMMENTBLOCK SCE_ABAQUS_NUMBER SCE_ABAQUS_STRING SCE_ABAQUS_OPERATOR SCE_ABAQUS_WORD SCE_ABAQUS_PROCESSOR SCE_ABAQUS_COMMAND SCE_ABAQUS_SLASHCOMMAND SCE_ABAQUS_STARCOMMAND SCE_ABAQUS_ARGUMENT SCE_ABAQUS_FUNCTION SCE_ASY_DEFAULT SCE_ASY_COMMENT SCE_ASY_COMMENTLINE SCE_ASY_NUMBER SCE_ASY_WORD SCE_ASY_STRING SCE_ASY_CHARACTER SCE_ASY_OPERATOR SCE_ASY_IDENTIFIER SCE_ASY_STRINGEOL SCE_ASY_COMMENTLINEDOC SCE_ASY_WORD2 SCE_R_DEFAULT SCE_R_COMMENT SCE_R_KWORD SCE_R_BASEKWORD SCE_R_OTHERKWORD SCE_R_NUMBER SCE_R_STRING SCE_R_STRING2 SCE_R_OPERATOR SCE_R_IDENTIFIER SCE_R_INFIX SCE_R_INFIXEOL SCE_MAGIK_DEFAULT SCE_MAGIK_COMMENT SCE_MAGIK_HYPER_COMMENT SCE_MAGIK_STRING SCE_MAGIK_CHARACTER SCE_MAGIK_NUMBER SCE_MAGIK_IDENTIFIER SCE_MAGIK_OPERATOR SCE_MAGIK_FLOW SCE_MAGIK_CONTAINER SCE_MAGIK_BRACKET_BLOCK SCE_MAGIK_BRACE_BLOCK SCE_MAGIK_SQBRACKET_BLOCK SCE_MAGIK_UNKNOWN_KEYWORD SCE_MAGIK_KEYWORD SCE_MAGIK_PRAGMA SCE_MAGIK_SYMBOL SCE_POWERSHELL_DEFAULT SCE_POWERSHELL_COMMENT SCE_POWERSHELL_STRING SCE_POWERSHELL_CHARACTER SCE_POWERSHELL_NUMBER SCE_POWERSHELL_VARIABLE SCE_POWERSHELL_OPERATOR SCE_POWERSHELL_IDENTIFIER SCE_POWERSHELL_KEYWORD SCE_POWERSHELL_CMDLET SCE_POWERSHELL_ALIAS SCE_POWERSHELL_FUNCTION SCE_POWERSHELL_USER1 SCE_POWERSHELL_COMMENTSTREAM SCE_MYSQL_DEFAULT SCE_MYSQL_COMMENT SCE_MYSQL_COMMENTLINE SCE_MYSQL_VARIABLE SCE_MYSQL_SYSTEMVARIABLE SCE_MYSQL_KNOWNSYSTEMVARIABLE SCE_MYSQL_NUMBER SCE_MYSQL_MAJORKEYWORD SCE_MYSQL_KEYWORD SCE_MYSQL_DATABASEOBJECT SCE_MYSQL_PROCEDUREKEYWORD SCE_MYSQL_STRING SCE_MYSQL_SQSTRING SCE_MYSQL_DQSTRING SCE_MYSQL_OPERATOR SCE_MYSQL_FUNCTION SCE_MYSQL_IDENTIFIER SCE_MYSQL_QUOTEDIDENTIFIER SCE_MYSQL_USER1 SCE_MYSQL_USER2 SCE_MYSQL_USER3 SCE_MYSQL_HIDDENCOMMAND SCE_PO_DEFAULT SCE_PO_COMMENT SCE_PO_MSGID SCE_PO_MSGID_TEXT SCE_PO_MSGSTR SCE_PO_MSGSTR_TEXT SCE_PO_MSGCTXT SCE_PO_MSGCTXT_TEXT SCE_PO_FUZZY SCE_PAS_DEFAULT SCE_PAS_IDENTIFIER SCE_PAS_COMMENT SCE_PAS_COMMENT2 SCE_PAS_COMMENTLINE SCE_PAS_PREPROCESSOR SCE_PAS_PREPROCESSOR2 SCE_PAS_NUMBER SCE_PAS_HEXNUMBER SCE_PAS_WORD SCE_PAS_STRING SCE_PAS_STRINGEOL SCE_PAS_CHARACTER SCE_PAS_OPERATOR SCE_PAS_ASM SCE_SORCUS_DEFAULT SCE_SORCUS_COMMAND SCE_SORCUS_PARAMETER SCE_SORCUS_COMMENTLINE SCE_SORCUS_STRING SCE_SORCUS_STRINGEOL SCE_SORCUS_IDENTIFIER SCE_SORCUS_OPERATOR SCE_SORCUS_NUMBER SCE_SORCUS_CONSTANT SCE_POWERPRO_DEFAULT SCE_POWERPRO_COMMENTBLOCK SCE_POWERPRO_COMMENTLINE SCE_POWERPRO_NUMBER SCE_POWERPRO_WORD SCE_POWERPRO_WORD2 SCE_POWERPRO_WORD3 SCE_POWERPRO_WORD4 SCE_POWERPRO_DOUBLEQUOTEDSTRING SCE_POWERPRO_SINGLEQUOTEDSTRING SCE_POWERPRO_LINECONTINUE SCE_POWERPRO_OPERATOR SCE_POWERPRO_IDENTIFIER SCE_POWERPRO_STRINGEOL SCE_POWERPRO_VERBATIM SCE_POWERPRO_ALTQUOTE SCE_POWERPRO_FUNCTION SCE_SML_DEFAULT SCE_SML_IDENTIFIER SCE_SML_TAGNAME SCE_SML_KEYWORD SCE_SML_KEYWORD2 SCE_SML_KEYWORD3 SCE_SML_LINENUM SCE_SML_OPERATOR SCE_SML_NUMBER SCE_SML_CHAR SCE_SML_STRING SCE_SML_COMMENT SCE_SML_COMMENT1 SCE_SML_COMMENT2 SCE_SML_COMMENT3 SCE_MARKDOWN_DEFAULT SCE_MARKDOWN_LINE_BEGIN SCE_MARKDOWN_STRONG1 SCE_MARKDOWN_STRONG2 SCE_MARKDOWN_EM1 SCE_MARKDOWN_EM2 SCE_MARKDOWN_HEADER1 SCE_MARKDOWN_HEADER2 SCE_MARKDOWN_HEADER3 SCE_MARKDOWN_HEADER4 SCE_MARKDOWN_HEADER5 SCE_MARKDOWN_HEADER6 SCE_MARKDOWN_PRECHAR SCE_MARKDOWN_ULIST_ITEM SCE_MARKDOWN_OLIST_ITEM SCE_MARKDOWN_BLOCKQUOTE SCE_MARKDOWN_STRIKEOUT SCE_MARKDOWN_HRULE SCE_MARKDOWN_LINK SCE_MARKDOWN_CODE SCE_MARKDOWN_CODE2 SCE_MARKDOWN_CODEBK SCE_TXT2TAGS_DEFAULT SCE_TXT2TAGS_LINE_BEGIN SCE_TXT2TAGS_STRONG1 SCE_TXT2TAGS_STRONG2 SCE_TXT2TAGS_EM1 SCE_TXT2TAGS_EM2 SCE_TXT2TAGS_HEADER1 SCE_TXT2TAGS_HEADER2 SCE_TXT2TAGS_HEADER3 SCE_TXT2TAGS_HEADER4 SCE_TXT2TAGS_HEADER5 SCE_TXT2TAGS_HEADER6 SCE_TXT2TAGS_PRECHAR SCE_TXT2TAGS_ULIST_ITEM SCE_TXT2TAGS_OLIST_ITEM SCE_TXT2TAGS_BLOCKQUOTE SCE_TXT2TAGS_STRIKEOUT SCE_TXT2TAGS_HRULE SCE_TXT2TAGS_LINK SCE_TXT2TAGS_CODE SCE_TXT2TAGS_CODE2 SCE_TXT2TAGS_CODEBK SCE_TXT2TAGS_COMMENT SCE_TXT2TAGS_OPTION SCE_TXT2TAGS_PREPROC SCE_TXT2TAGS_POSTPROC SCE_A68K_DEFAULT SCE_A68K_COMMENT SCE_A68K_NUMBER_DEC SCE_A68K_NUMBER_BIN SCE_A68K_NUMBER_HEX SCE_A68K_STRING1 SCE_A68K_OPERATOR SCE_A68K_CPUINSTRUCTION SCE_A68K_EXTINSTRUCTION SCE_A68K_REGISTER SCE_A68K_DIRECTIVE SCE_A68K_MACRO_ARG SCE_A68K_LABEL SCE_A68K_STRING2 SCE_A68K_IDENTIFIER SCE_A68K_MACRO_DECLARATION SCE_A68K_COMMENT_WORD SCE_A68K_COMMENT_SPECIAL SCE_A68K_COMMENT_DOXYGEN SCE_MODULA_DEFAULT SCE_MODULA_COMMENT SCE_MODULA_DOXYCOMM SCE_MODULA_DOXYKEY SCE_MODULA_KEYWORD SCE_MODULA_RESERVED SCE_MODULA_NUMBER SCE_MODULA_BASENUM SCE_MODULA_FLOAT SCE_MODULA_STRING SCE_MODULA_STRSPEC SCE_MODULA_CHAR SCE_MODULA_CHARSPEC SCE_MODULA_PROC SCE_MODULA_PRAGMA SCE_MODULA_PRGKEY SCE_MODULA_OPERATOR SCE_MODULA_BADSTR SCE_COFFEESCRIPT_DEFAULT SCE_COFFEESCRIPT_COMMENT SCE_COFFEESCRIPT_COMMENTLINE SCE_COFFEESCRIPT_COMMENTDOC SCE_COFFEESCRIPT_NUMBER SCE_COFFEESCRIPT_WORD SCE_COFFEESCRIPT_STRING SCE_COFFEESCRIPT_CHARACTER SCE_COFFEESCRIPT_UUID SCE_COFFEESCRIPT_PREPROCESSOR SCE_COFFEESCRIPT_OPERATOR SCE_COFFEESCRIPT_IDENTIFIER SCE_COFFEESCRIPT_STRINGEOL SCE_COFFEESCRIPT_VERBATIM SCE_COFFEESCRIPT_REGEX SCE_COFFEESCRIPT_COMMENTLINEDOC SCE_COFFEESCRIPT_WORD2 SCE_COFFEESCRIPT_COMMENTDOCKEYWORD SCE_COFFEESCRIPT_COMMENTDOCKEYWORDERROR SCE_COFFEESCRIPT_GLOBALCLASS SCE_COFFEESCRIPT_STRINGRAW SCE_COFFEESCRIPT_TRIPLEVERBATIM SCE_COFFEESCRIPT_HASHQUOTEDSTRING SCE_COFFEESCRIPT_COMMENTBLOCK SCE_COFFEESCRIPT_VERBOSE_REGEX SCE_COFFEESCRIPT_VERBOSE_REGEX_COMMENT SCE_AVS_DEFAULT SCE_AVS_COMMENTBLOCK SCE_AVS_COMMENTBLOCKN SCE_AVS_COMMENTLINE SCE_AVS_NUMBER SCE_AVS_OPERATOR SCE_AVS_IDENTIFIER SCE_AVS_STRING SCE_AVS_TRIPLESTRING SCE_AVS_KEYWORD SCE_AVS_FILTER SCE_AVS_PLUGIN SCE_AVS_FUNCTION SCE_AVS_CLIPPROP SCE_AVS_USERDFN SCE_ECL_DEFAULT SCE_ECL_COMMENT SCE_ECL_COMMENTLINE SCE_ECL_NUMBER SCE_ECL_STRING SCE_ECL_WORD0 SCE_ECL_OPERATOR SCE_ECL_CHARACTER SCE_ECL_UUID SCE_ECL_PREPROCESSOR SCE_ECL_UNKNOWN SCE_ECL_IDENTIFIER SCE_ECL_STRINGEOL SCE_ECL_VERBATIM SCE_ECL_REGEX SCE_ECL_COMMENTLINEDOC SCE_ECL_WORD1 SCE_ECL_COMMENTDOCKEYWORD SCE_ECL_COMMENTDOCKEYWORDERROR SCE_ECL_WORD2 SCE_ECL_WORD3 SCE_ECL_WORD4 SCE_ECL_WORD5 SCE_ECL_COMMENTDOC SCE_ECL_ADDED SCE_ECL_DELETED SCE_ECL_CHANGED SCE_ECL_MOVED SC_CP_DBCS ); use constant { INVALID_POSITION => -1, # Define start of Scintilla messages to be greater than all Windows edit (EM_*) messages # as many EM_ messages can be used although that use is deprecated. SCI_START => 2000, SCI_OPTIONAL_START => 3000, SCI_LEXER_START => 4000, # WhiteSpace enumeration SCWS_INVISIBLE => 0, SCWS_VISIBLEALWAYS => 1, SCWS_VISIBLEAFTERINDENT => 2, # EndOfLine enumeration SC_EOL_CRLF => 0, SC_EOL_CR => 1, SC_EOL_LF => 2, # The SC_CP_UTF8 value can be used to enter Unicode mode. # This is the same value as CP_UTF8 in Windows SC_CP_UTF8 => 65001, # MarkerSymbol enumeration MARKER_MAX => 31, SC_MARK_CIRCLE => 0, SC_MARK_ROUNDRECT => 1, SC_MARK_ARROW => 2, SC_MARK_SMALLRECT => 3, SC_MARK_SHORTARROW => 4, SC_MARK_EMPTY => 5, SC_MARK_ARROWDOWN => 6, SC_MARK_MINUS => 7, SC_MARK_PLUS => 8, # Shapes used for outlining column. SC_MARK_VLINE => 9, SC_MARK_LCORNER => 10, SC_MARK_TCORNER => 11, SC_MARK_BOXPLUS => 12, SC_MARK_BOXPLUSCONNECTED => 13, SC_MARK_BOXMINUS => 14, SC_MARK_BOXMINUSCONNECTED => 15, SC_MARK_LCORNERCURVE => 16, SC_MARK_TCORNERCURVE => 17, SC_MARK_CIRCLEPLUS => 18, SC_MARK_CIRCLEPLUSCONNECTED => 19, SC_MARK_CIRCLEMINUS => 20, SC_MARK_CIRCLEMINUSCONNECTED => 21, # Invisible mark that only sets the line background colour. SC_MARK_BACKGROUND => 22, SC_MARK_DOTDOTDOT => 23, SC_MARK_ARROWS => 24, SC_MARK_PIXMAP => 25, SC_MARK_FULLRECT => 26, SC_MARK_LEFTRECT => 27, SC_MARK_AVAILABLE => 28, SC_MARK_UNDERLINE => 29, SC_MARK_RGBAIMAGE => 30, SC_MARK_CHARACTER => 10000, # MarkerOutline enumeration # Markers used for outlining column. SC_MARKNUM_FOLDEREND => 25, SC_MARKNUM_FOLDEROPENMID => 26, SC_MARKNUM_FOLDERMIDTAIL => 27, SC_MARKNUM_FOLDERTAIL => 28, SC_MARKNUM_FOLDERSUB => 29, SC_MARKNUM_FOLDER => 30, SC_MARKNUM_FOLDEROPEN => 31, SC_MASK_FOLDERS => 0xFE000000, # MarginType enumeration SC_MARGIN_SYMBOL => 0, SC_MARGIN_NUMBER => 1, SC_MARGIN_BACK => 2, SC_MARGIN_FORE => 3, SC_MARGIN_TEXT => 4, SC_MARGIN_RTEXT => 5, # StylesCommon enumeration STYLE_DEFAULT => 32, STYLE_LINENUMBER => 33, STYLE_BRACELIGHT => 34, STYLE_BRACEBAD => 35, STYLE_CONTROLCHAR => 36, STYLE_INDENTGUIDE => 37, STYLE_CALLTIP => 38, STYLE_LASTPREDEFINED => 39, STYLE_MAX => 255, # CharacterSet enumeration SC_CHARSET_ANSI => 0, SC_CHARSET_DEFAULT => 1, SC_CHARSET_BALTIC => 186, SC_CHARSET_CHINESEBIG5 => 136, SC_CHARSET_EASTEUROPE => 238, SC_CHARSET_GB2312 => 134, SC_CHARSET_GREEK => 161, SC_CHARSET_HANGUL => 129, SC_CHARSET_MAC => 77, SC_CHARSET_OEM => 255, SC_CHARSET_RUSSIAN => 204, SC_CHARSET_CYRILLIC => 1251, SC_CHARSET_SHIFTJIS => 128, SC_CHARSET_SYMBOL => 2, SC_CHARSET_TURKISH => 162, SC_CHARSET_JOHAB => 130, SC_CHARSET_HEBREW => 177, SC_CHARSET_ARABIC => 178, SC_CHARSET_VIETNAMESE => 163, SC_CHARSET_THAI => 222, SC_CHARSET_8859_15 => 1000, # CaseVisible enumeration SC_CASE_MIXED => 0, SC_CASE_UPPER => 1, SC_CASE_LOWER => 2, SC_FONT_SIZE_MULTIPLIER => 100, # FontWeight enumeration SC_WEIGHT_NORMAL => 400, SC_WEIGHT_SEMIBOLD => 600, SC_WEIGHT_BOLD => 700, # IndicatorStyle enumeration INDIC_PLAIN => 0, INDIC_SQUIGGLE => 1, INDIC_TT => 2, INDIC_DIAGONAL => 3, INDIC_STRIKE => 4, INDIC_HIDDEN => 5, INDIC_BOX => 6, INDIC_ROUNDBOX => 7, INDIC_STRAIGHTBOX => 8, INDIC_DASH => 9, INDIC_DOTS => 10, INDIC_SQUIGGLELOW => 11, INDIC_DOTBOX => 12, INDIC_MAX => 31, INDIC_CONTAINER => 8, INDIC0_MASK => 0x20, INDIC1_MASK => 0x40, INDIC2_MASK => 0x80, INDICS_MASK => 0xE0, # IndentView enumeration SC_IV_NONE => 0, SC_IV_REAL => 1, SC_IV_LOOKFORWARD => 2, SC_IV_LOOKBOTH => 3, # PrintOption enumeration # PrintColourMode - use same colours as screen. SC_PRINT_NORMAL => 0, # PrintColourMode - invert the light value of each style for printing. SC_PRINT_INVERTLIGHT => 1, # PrintColourMode - force black text on white background for printing. SC_PRINT_BLACKONWHITE => 2, # PrintColourMode - text stays coloured, but all background is forced to be white for printing. SC_PRINT_COLOURONWHITE => 3, # PrintColourMode - only the default-background is forced to be white for printing. SC_PRINT_COLOURONWHITEDEFAULTBG => 4, # FindOption enumeration SCFIND_WHOLEWORD => 2, SCFIND_MATCHCASE => 4, SCFIND_WORDSTART => 0x00100000, SCFIND_REGEXP => 0x00200000, SCFIND_POSIX => 0x00400000, # FoldLevel enumeration SC_FOLDLEVELBASE => 0x400, SC_FOLDLEVELWHITEFLAG => 0x1000, SC_FOLDLEVELHEADERFLAG => 0x2000, SC_FOLDLEVELNUMBERMASK => 0x0FFF, # FoldFlag enumeration SC_FOLDFLAG_LINEBEFORE_EXPANDED => 0x0002, SC_FOLDFLAG_LINEBEFORE_CONTRACTED => 0x0004, SC_FOLDFLAG_LINEAFTER_EXPANDED => 0x0008, SC_FOLDFLAG_LINEAFTER_CONTRACTED => 0x0010, SC_FOLDFLAG_LEVELNUMBERS => 0x0040, SC_TIME_FOREVER => 10000000, # Wrap enumeration SC_WRAP_NONE => 0, SC_WRAP_WORD => 1, SC_WRAP_CHAR => 2, # WrapVisualFlag enumeration SC_WRAPVISUALFLAG_NONE => 0x0000, SC_WRAPVISUALFLAG_END => 0x0001, SC_WRAPVISUALFLAG_START => 0x0002, # WrapVisualLocation enumeration SC_WRAPVISUALFLAGLOC_DEFAULT => 0x0000, SC_WRAPVISUALFLAGLOC_END_BY_TEXT => 0x0001, SC_WRAPVISUALFLAGLOC_START_BY_TEXT => 0x0002, # WrapIndentMode enumeration SC_WRAPINDENT_FIXED => 0, SC_WRAPINDENT_SAME => 1, SC_WRAPINDENT_INDENT => 2, # LineCache enumeration SC_CACHE_NONE => 0, SC_CACHE_CARET => 1, SC_CACHE_PAGE => 2, SC_CACHE_DOCUMENT => 3, # FontQuality enumeration SC_EFF_QUALITY_MASK => 0xF, SC_EFF_QUALITY_DEFAULT => 0, SC_EFF_QUALITY_NON_ANTIALIASED => 1, SC_EFF_QUALITY_ANTIALIASED => 2, SC_EFF_QUALITY_LCD_OPTIMIZED => 3, # MultiPaste enumeration SC_MULTIPASTE_ONCE => 0, SC_MULTIPASTE_EACH => 1, # EdgeVisualStyle enumeration EDGE_NONE => 0, EDGE_LINE => 1, EDGE_BACKGROUND => 2, # Status enumeration SC_STATUS_OK => 0, SC_STATUS_FAILURE => 1, SC_STATUS_BADALLOC => 2, # CursorShape enumeration SC_CURSORNORMAL => -1, SC_CURSORARROW => 2, SC_CURSORWAIT => 4, SC_CURSORREVERSEARROW => 7, # Constants for use with SetVisiblePolicy, similar to SetCaretPolicy. VISIBLE_SLOP => 0x01, VISIBLE_STRICT => 0x04, # CaretPolicy enumeration # Caret policy, used by SetXCaretPolicy and SetYCaretPolicy. # If CARET_SLOP is set, we can define a slop value: caretSlop. # This value defines an unwanted zone (UZ) where the caret is... unwanted. # This zone is defined as a number of pixels near the vertical margins, # and as a number of lines near the horizontal margins. # By keeping the caret away from the edges, it is seen within its context, # so it is likely that the identifier that the caret is on can be completely seen, # and that the current line is seen with some of the lines following it which are # often dependent on that line. CARET_SLOP => 0x01, # If CARET_STRICT is set, the policy is enforced... strictly. # The caret is centred on the display if slop is not set, # and cannot go in the UZ if slop is set. CARET_STRICT => 0x04, # If CARET_JUMPS is set, the display is moved more energetically # so the caret can move in the same direction longer before the policy is applied again. CARET_JUMPS => 0x10, # If CARET_EVEN is not set, instead of having symmetrical UZs, # the left and bottom UZs are extended up to right and top UZs respectively. # This way, we favour the displaying of useful information: the begining of lines, # where most code reside, and the lines after the caret, eg. the body of a function. CARET_EVEN => 0x08, # SelectionMode enumeration SC_SEL_STREAM => 0, SC_SEL_RECTANGLE => 1, SC_SEL_LINES => 2, SC_SEL_THIN => 3, # CaretSticky enumeration SC_CARETSTICKY_OFF => 0, SC_CARETSTICKY_ON => 1, SC_CARETSTICKY_WHITESPACE => 2, SC_ALPHA_TRANSPARENT => 0, SC_ALPHA_OPAQUE => 255, SC_ALPHA_NOALPHA => 256, # CaretStyle enumeration CARETSTYLE_INVISIBLE => 0, CARETSTYLE_LINE => 1, CARETSTYLE_BLOCK => 2, # MarginOption enumeration SC_MARGINOPTION_NONE => 0, SC_MARGINOPTION_SUBLINESELECT => 1, # AnnotationVisible enumeration ANNOTATION_HIDDEN => 0, ANNOTATION_STANDARD => 1, ANNOTATION_BOXED => 2, UNDO_MAY_COALESCE => 1, # VirtualSpace enumeration SCVS_NONE => 0, SCVS_RECTANGULARSELECTION => 1, SCVS_USERACCESSIBLE => 2, SC_TECHNOLOGY_DEFAULT => 0, SC_TECHNOLOGY_DIRECTWRITE => 1, # Maximum value of keywordSet parameter of SetKeyWords. KEYWORDSET_MAX => 8, # TypeProperty enumeration SC_TYPE_BOOLEAN => 0, SC_TYPE_INTEGER => 1, SC_TYPE_STRING => 2, # Notifications # Type of modification and the action which caused the modification. # These are defined as a bit mask to make it easy to specify which notifications are wanted. # One bit is set from each of SC_MOD_* and SC_PERFORMED_*. SC_MOD_INSERTTEXT => 0x1, SC_MOD_DELETETEXT => 0x2, SC_MOD_CHANGESTYLE => 0x4, SC_MOD_CHANGEFOLD => 0x8, SC_PERFORMED_USER => 0x10, SC_PERFORMED_UNDO => 0x20, SC_PERFORMED_REDO => 0x40, SC_MULTISTEPUNDOREDO => 0x80, SC_LASTSTEPINUNDOREDO => 0x100, SC_MOD_CHANGEMARKER => 0x200, SC_MOD_BEFOREINSERT => 0x400, SC_MOD_BEFOREDELETE => 0x800, SC_MULTILINEUNDOREDO => 0x1000, SC_STARTACTION => 0x2000, SC_MOD_CHANGEINDICATOR => 0x4000, SC_MOD_CHANGELINESTATE => 0x8000, SC_MOD_CHANGEMARGIN => 0x10000, SC_MOD_CHANGEANNOTATION => 0x20000, SC_MOD_CONTAINER => 0x40000, SC_MOD_LEXERSTATE => 0x80000, SC_MODEVENTMASKALL => 0xFFFFF, # Update enumeration SC_UPDATE_CONTENT => 0x1, SC_UPDATE_SELECTION => 0x2, SC_UPDATE_V_SCROLL => 0x4, SC_UPDATE_H_SCROLL => 0x8, # For compatibility, these go through the COMMAND notification rather than NOTIFY # and should have had exactly the same values as the EN_* constants. # Unfortunately the SETFOCUS and KILLFOCUS are flipped over from EN_* # As clients depend on these constants, this will not be changed. SCEN_CHANGE => 768, SCEN_SETFOCUS => 512, SCEN_KILLFOCUS => 256, # Keys enumeration SCK_DOWN => 300, SCK_UP => 301, SCK_LEFT => 302, SCK_RIGHT => 303, SCK_HOME => 304, SCK_END => 305, SCK_PRIOR => 306, SCK_NEXT => 307, SCK_DELETE => 308, SCK_INSERT => 309, SCK_ESCAPE => 7, SCK_BACK => 8, SCK_TAB => 9, SCK_RETURN => 13, SCK_ADD => 310, SCK_SUBTRACT => 311, SCK_DIVIDE => 312, SCK_WIN => 313, SCK_RWIN => 314, SCK_MENU => 315, # KeyMod enumeration SCMOD_NORM => 0, SCMOD_SHIFT => 1, SCMOD_CTRL => 2, SCMOD_ALT => 4, SCMOD_SUPER => 8, SCMOD_META => 16, # Lexer enumeration SCLEX_CONTAINER => 0, SCLEX_NULL => 1, SCLEX_PYTHON => 2, SCLEX_CPP => 3, SCLEX_HTML => 4, SCLEX_XML => 5, SCLEX_PERL => 6, SCLEX_SQL => 7, SCLEX_VB => 8, SCLEX_PROPERTIES => 9, SCLEX_ERRORLIST => 10, SCLEX_MAKEFILE => 11, SCLEX_BATCH => 12, SCLEX_XCODE => 13, SCLEX_LATEX => 14, SCLEX_LUA => 15, SCLEX_DIFF => 16, SCLEX_CONF => 17, SCLEX_PASCAL => 18, SCLEX_AVE => 19, SCLEX_ADA => 20, SCLEX_LISP => 21, SCLEX_RUBY => 22, SCLEX_EIFFEL => 23, SCLEX_EIFFELKW => 24, SCLEX_TCL => 25, SCLEX_NNCRONTAB => 26, SCLEX_BULLANT => 27, SCLEX_VBSCRIPT => 28, SCLEX_BAAN => 31, SCLEX_MATLAB => 32, SCLEX_SCRIPTOL => 33, SCLEX_ASM => 34, SCLEX_CPPNOCASE => 35, SCLEX_FORTRAN => 36, SCLEX_F77 => 37, SCLEX_CSS => 38, SCLEX_POV => 39, SCLEX_LOUT => 40, SCLEX_ESCRIPT => 41, SCLEX_PS => 42, SCLEX_NSIS => 43, SCLEX_MMIXAL => 44, SCLEX_CLW => 45, SCLEX_CLWNOCASE => 46, SCLEX_LOT => 47, SCLEX_YAML => 48, SCLEX_TEX => 49, SCLEX_METAPOST => 50, SCLEX_POWERBASIC => 51, SCLEX_FORTH => 52, SCLEX_ERLANG => 53, SCLEX_OCTAVE => 54, SCLEX_MSSQL => 55, SCLEX_VERILOG => 56, SCLEX_KIX => 57, SCLEX_GUI4CLI => 58, SCLEX_SPECMAN => 59, SCLEX_AU3 => 60, SCLEX_APDL => 61, SCLEX_BASH => 62, SCLEX_ASN1 => 63, SCLEX_VHDL => 64, SCLEX_CAML => 65, SCLEX_BLITZBASIC => 66, SCLEX_PUREBASIC => 67, SCLEX_HASKELL => 68, SCLEX_PHPSCRIPT => 69, SCLEX_TADS3 => 70, SCLEX_REBOL => 71, SCLEX_SMALLTALK => 72, SCLEX_FLAGSHIP => 73, SCLEX_CSOUND => 74, SCLEX_FREEBASIC => 75, SCLEX_INNOSETUP => 76, SCLEX_OPAL => 77, SCLEX_SPICE => 78, SCLEX_D => 79, SCLEX_CMAKE => 80, SCLEX_GAP => 81, SCLEX_PLM => 82, SCLEX_PROGRESS => 83, SCLEX_ABAQUS => 84, SCLEX_ASYMPTOTE => 85, SCLEX_R => 86, SCLEX_MAGIK => 87, SCLEX_POWERSHELL => 88, SCLEX_MYSQL => 89, SCLEX_PO => 90, SCLEX_TAL => 91, SCLEX_COBOL => 92, SCLEX_TACL => 93, SCLEX_SORCUS => 94, SCLEX_POWERPRO => 95, SCLEX_NIMROD => 96, SCLEX_SML => 97, SCLEX_MARKDOWN => 98, SCLEX_TXT2TAGS => 99, SCLEX_A68K => 100, SCLEX_MODULA => 101, SCLEX_COFFEESCRIPT => 102, SCLEX_TCMD => 103, SCLEX_AVS => 104, SCLEX_ECL => 105, # When a lexer specifies its language as SCLEX_AUTOMATIC it receives a # value assigned in sequence from SCLEX_AUTOMATIC+1. SCLEX_AUTOMATIC => 1000, # Lexical states for SCLEX_PYTHON SCE_P_DEFAULT => 0, SCE_P_COMMENTLINE => 1, SCE_P_NUMBER => 2, SCE_P_STRING => 3, SCE_P_CHARACTER => 4, SCE_P_WORD => 5, SCE_P_TRIPLE => 6, SCE_P_TRIPLEDOUBLE => 7, SCE_P_CLASSNAME => 8, SCE_P_DEFNAME => 9, SCE_P_OPERATOR => 10, SCE_P_IDENTIFIER => 11, SCE_P_COMMENTBLOCK => 12, SCE_P_STRINGEOL => 13, SCE_P_WORD2 => 14, SCE_P_DECORATOR => 15, # Lexical states for SCLEX_CPP SCE_C_DEFAULT => 0, SCE_C_COMMENT => 1, SCE_C_COMMENTLINE => 2, SCE_C_COMMENTDOC => 3, SCE_C_NUMBER => 4, SCE_C_WORD => 5, SCE_C_STRING => 6, SCE_C_CHARACTER => 7, SCE_C_UUID => 8, SCE_C_PREPROCESSOR => 9, SCE_C_OPERATOR => 10, SCE_C_IDENTIFIER => 11, SCE_C_STRINGEOL => 12, SCE_C_VERBATIM => 13, SCE_C_REGEX => 14, SCE_C_COMMENTLINEDOC => 15, SCE_C_WORD2 => 16, SCE_C_COMMENTDOCKEYWORD => 17, SCE_C_COMMENTDOCKEYWORDERROR => 18, SCE_C_GLOBALCLASS => 19, SCE_C_STRINGRAW => 20, SCE_C_TRIPLEVERBATIM => 21, SCE_C_HASHQUOTEDSTRING => 22, # Lexical states for SCLEX_D SCE_D_DEFAULT => 0, SCE_D_COMMENT => 1, SCE_D_COMMENTLINE => 2, SCE_D_COMMENTDOC => 3, SCE_D_COMMENTNESTED => 4, SCE_D_NUMBER => 5, SCE_D_WORD => 6, SCE_D_WORD2 => 7, SCE_D_WORD3 => 8, SCE_D_TYPEDEF => 9, SCE_D_STRING => 10, SCE_D_STRINGEOL => 11, SCE_D_CHARACTER => 12, SCE_D_OPERATOR => 13, SCE_D_IDENTIFIER => 14, SCE_D_COMMENTLINEDOC => 15, SCE_D_COMMENTDOCKEYWORD => 16, SCE_D_COMMENTDOCKEYWORDERROR => 17, SCE_D_STRINGB => 18, SCE_D_STRINGR => 19, SCE_D_WORD5 => 20, SCE_D_WORD6 => 21, SCE_D_WORD7 => 22, # Lexical states for SCLEX_TCL SCE_TCL_DEFAULT => 0, SCE_TCL_COMMENT => 1, SCE_TCL_COMMENTLINE => 2, SCE_TCL_NUMBER => 3, SCE_TCL_WORD_IN_QUOTE => 4, SCE_TCL_IN_QUOTE => 5, SCE_TCL_OPERATOR => 6, SCE_TCL_IDENTIFIER => 7, SCE_TCL_SUBSTITUTION => 8, SCE_TCL_SUB_BRACE => 9, SCE_TCL_MODIFIER => 10, SCE_TCL_EXPAND => 11, SCE_TCL_WORD => 12, SCE_TCL_WORD2 => 13, SCE_TCL_WORD3 => 14, SCE_TCL_WORD4 => 15, SCE_TCL_WORD5 => 16, SCE_TCL_WORD6 => 17, SCE_TCL_WORD7 => 18, SCE_TCL_WORD8 => 19, SCE_TCL_COMMENT_BOX => 20, SCE_TCL_BLOCK_COMMENT => 21, # Lexical states for SCLEX_HTML, SCLEX_XML SCE_H_DEFAULT => 0, SCE_H_TAG => 1, SCE_H_TAGUNKNOWN => 2, SCE_H_ATTRIBUTE => 3, SCE_H_ATTRIBUTEUNKNOWN => 4, SCE_H_NUMBER => 5, SCE_H_DOUBLESTRING => 6, SCE_H_SINGLESTRING => 7, SCE_H_OTHER => 8, SCE_H_COMMENT => 9, SCE_H_ENTITY => 10, # XML and ASP SCE_H_TAGEND => 11, SCE_H_XMLSTART => 12, SCE_H_XMLEND => 13, SCE_H_SCRIPT => 14, SCE_H_ASP => 15, SCE_H_ASPAT => 16, SCE_H_CDATA => 17, SCE_H_QUESTION => 18, # More HTML SCE_H_VALUE => 19, # X-Code SCE_H_XCCOMMENT => 20, # SGML SCE_H_SGML_DEFAULT => 21, SCE_H_SGML_COMMAND => 22, SCE_H_SGML_1ST_PARAM => 23, SCE_H_SGML_DOUBLESTRING => 24, SCE_H_SGML_SIMPLESTRING => 25, SCE_H_SGML_ERROR => 26, SCE_H_SGML_SPECIAL => 27, SCE_H_SGML_ENTITY => 28, SCE_H_SGML_COMMENT => 29, SCE_H_SGML_1ST_PARAM_COMMENT => 30, SCE_H_SGML_BLOCK_DEFAULT => 31, # Embedded Javascript SCE_HJ_START => 40, SCE_HJ_DEFAULT => 41, SCE_HJ_COMMENT => 42, SCE_HJ_COMMENTLINE => 43, SCE_HJ_COMMENTDOC => 44, SCE_HJ_NUMBER => 45, SCE_HJ_WORD => 46, SCE_HJ_KEYWORD => 47, SCE_HJ_DOUBLESTRING => 48, SCE_HJ_SINGLESTRING => 49, SCE_HJ_SYMBOLS => 50, SCE_HJ_STRINGEOL => 51, SCE_HJ_REGEX => 52, # ASP Javascript SCE_HJA_START => 55, SCE_HJA_DEFAULT => 56, SCE_HJA_COMMENT => 57, SCE_HJA_COMMENTLINE => 58, SCE_HJA_COMMENTDOC => 59, SCE_HJA_NUMBER => 60, SCE_HJA_WORD => 61, SCE_HJA_KEYWORD => 62, SCE_HJA_DOUBLESTRING => 63, SCE_HJA_SINGLESTRING => 64, SCE_HJA_SYMBOLS => 65, SCE_HJA_STRINGEOL => 66, SCE_HJA_REGEX => 67, # Embedded VBScript SCE_HB_START => 70, SCE_HB_DEFAULT => 71, SCE_HB_COMMENTLINE => 72, SCE_HB_NUMBER => 73, SCE_HB_WORD => 74, SCE_HB_STRING => 75, SCE_HB_IDENTIFIER => 76, SCE_HB_STRINGEOL => 77, # ASP VBScript SCE_HBA_START => 80, SCE_HBA_DEFAULT => 81, SCE_HBA_COMMENTLINE => 82, SCE_HBA_NUMBER => 83, SCE_HBA_WORD => 84, SCE_HBA_STRING => 85, SCE_HBA_IDENTIFIER => 86, SCE_HBA_STRINGEOL => 87, # Embedded Python SCE_HP_START => 90, SCE_HP_DEFAULT => 91, SCE_HP_COMMENTLINE => 92, SCE_HP_NUMBER => 93, SCE_HP_STRING => 94, SCE_HP_CHARACTER => 95, SCE_HP_WORD => 96, SCE_HP_TRIPLE => 97, SCE_HP_TRIPLEDOUBLE => 98, SCE_HP_CLASSNAME => 99, SCE_HP_DEFNAME => 100, SCE_HP_OPERATOR => 101, SCE_HP_IDENTIFIER => 102, # PHP SCE_HPHP_COMPLEX_VARIABLE => 104, # ASP Python SCE_HPA_START => 105, SCE_HPA_DEFAULT => 106, SCE_HPA_COMMENTLINE => 107, SCE_HPA_NUMBER => 108, SCE_HPA_STRING => 109, SCE_HPA_CHARACTER => 110, SCE_HPA_WORD => 111, SCE_HPA_TRIPLE => 112, SCE_HPA_TRIPLEDOUBLE => 113, SCE_HPA_CLASSNAME => 114, SCE_HPA_DEFNAME => 115, SCE_HPA_OPERATOR => 116, SCE_HPA_IDENTIFIER => 117, # PHP SCE_HPHP_DEFAULT => 118, SCE_HPHP_HSTRING => 119, SCE_HPHP_SIMPLESTRING => 120, SCE_HPHP_WORD => 121, SCE_HPHP_NUMBER => 122, SCE_HPHP_VARIABLE => 123, SCE_HPHP_COMMENT => 124, SCE_HPHP_COMMENTLINE => 125, SCE_HPHP_HSTRING_VARIABLE => 126, SCE_HPHP_OPERATOR => 127, # Lexical states for SCLEX_PERL SCE_PL_DEFAULT => 0, SCE_PL_ERROR => 1, SCE_PL_COMMENTLINE => 2, SCE_PL_POD => 3, SCE_PL_NUMBER => 4, SCE_PL_WORD => 5, SCE_PL_STRING => 6, SCE_PL_CHARACTER => 7, SCE_PL_PUNCTUATION => 8, SCE_PL_PREPROCESSOR => 9, SCE_PL_OPERATOR => 10, SCE_PL_IDENTIFIER => 11, SCE_PL_SCALAR => 12, SCE_PL_ARRAY => 13, SCE_PL_HASH => 14, SCE_PL_SYMBOLTABLE => 15, SCE_PL_VARIABLE_INDEXER => 16, SCE_PL_REGEX => 17, SCE_PL_REGSUBST => 18, SCE_PL_LONGQUOTE => 19, SCE_PL_BACKTICKS => 20, SCE_PL_DATASECTION => 21, SCE_PL_HERE_DELIM => 22, SCE_PL_HERE_Q => 23, SCE_PL_HERE_QQ => 24, SCE_PL_HERE_QX => 25, SCE_PL_STRING_Q => 26, SCE_PL_STRING_QQ => 27, SCE_PL_STRING_QX => 28, SCE_PL_STRING_QR => 29, SCE_PL_STRING_QW => 30, SCE_PL_POD_VERB => 31, SCE_PL_SUB_PROTOTYPE => 40, SCE_PL_FORMAT_IDENT => 41, SCE_PL_FORMAT => 42, SCE_PL_STRING_VAR => 43, SCE_PL_XLAT => 44, SCE_PL_REGEX_VAR => 54, SCE_PL_REGSUBST_VAR => 55, SCE_PL_BACKTICKS_VAR => 57, SCE_PL_HERE_QQ_VAR => 61, SCE_PL_HERE_QX_VAR => 62, SCE_PL_STRING_QQ_VAR => 64, SCE_PL_STRING_QX_VAR => 65, SCE_PL_STRING_QR_VAR => 66, # Lexical states for SCLEX_RUBY SCE_RB_DEFAULT => 0, SCE_RB_ERROR => 1, SCE_RB_COMMENTLINE => 2, SCE_RB_POD => 3, SCE_RB_NUMBER => 4, SCE_RB_WORD => 5, SCE_RB_STRING => 6, SCE_RB_CHARACTER => 7, SCE_RB_CLASSNAME => 8, SCE_RB_DEFNAME => 9, SCE_RB_OPERATOR => 10, SCE_RB_IDENTIFIER => 11, SCE_RB_REGEX => 12, SCE_RB_GLOBAL => 13, SCE_RB_SYMBOL => 14, SCE_RB_MODULE_NAME => 15, SCE_RB_INSTANCE_VAR => 16, SCE_RB_CLASS_VAR => 17, SCE_RB_BACKTICKS => 18, SCE_RB_DATASECTION => 19, SCE_RB_HERE_DELIM => 20, SCE_RB_HERE_Q => 21, SCE_RB_HERE_QQ => 22, SCE_RB_HERE_QX => 23, SCE_RB_STRING_Q => 24, SCE_RB_STRING_QQ => 25, SCE_RB_STRING_QX => 26, SCE_RB_STRING_QR => 27, SCE_RB_STRING_QW => 28, SCE_RB_WORD_DEMOTED => 29, SCE_RB_STDIN => 30, SCE_RB_STDOUT => 31, SCE_RB_STDERR => 40, SCE_RB_UPPER_BOUND => 41, # Lexical states for SCLEX_VB, SCLEX_VBSCRIPT, SCLEX_POWERBASIC SCE_B_DEFAULT => 0, SCE_B_COMMENT => 1, SCE_B_NUMBER => 2, SCE_B_KEYWORD => 3, SCE_B_STRING => 4, SCE_B_PREPROCESSOR => 5, SCE_B_OPERATOR => 6, SCE_B_IDENTIFIER => 7, SCE_B_DATE => 8, SCE_B_STRINGEOL => 9, SCE_B_KEYWORD2 => 10, SCE_B_KEYWORD3 => 11, SCE_B_KEYWORD4 => 12, SCE_B_CONSTANT => 13, SCE_B_ASM => 14, SCE_B_LABEL => 15, SCE_B_ERROR => 16, SCE_B_HEXNUMBER => 17, SCE_B_BINNUMBER => 18, # Lexical states for SCLEX_PROPERTIES SCE_PROPS_DEFAULT => 0, SCE_PROPS_COMMENT => 1, SCE_PROPS_SECTION => 2, SCE_PROPS_ASSIGNMENT => 3, SCE_PROPS_DEFVAL => 4, SCE_PROPS_KEY => 5, # Lexical states for SCLEX_LATEX SCE_L_DEFAULT => 0, SCE_L_COMMAND => 1, SCE_L_TAG => 2, SCE_L_MATH => 3, SCE_L_COMMENT => 4, SCE_L_TAG2 => 5, SCE_L_MATH2 => 6, SCE_L_COMMENT2 => 7, SCE_L_VERBATIM => 8, SCE_L_SHORTCMD => 9, SCE_L_SPECIAL => 10, SCE_L_CMDOPT => 11, SCE_L_ERROR => 12, # Lexical states for SCLEX_LUA SCE_LUA_DEFAULT => 0, SCE_LUA_COMMENT => 1, SCE_LUA_COMMENTLINE => 2, SCE_LUA_COMMENTDOC => 3, SCE_LUA_NUMBER => 4, SCE_LUA_WORD => 5, SCE_LUA_STRING => 6, SCE_LUA_CHARACTER => 7, SCE_LUA_LITERALSTRING => 8, SCE_LUA_PREPROCESSOR => 9, SCE_LUA_OPERATOR => 10, SCE_LUA_IDENTIFIER => 11, SCE_LUA_STRINGEOL => 12, SCE_LUA_WORD2 => 13, SCE_LUA_WORD3 => 14, SCE_LUA_WORD4 => 15, SCE_LUA_WORD5 => 16, SCE_LUA_WORD6 => 17, SCE_LUA_WORD7 => 18, SCE_LUA_WORD8 => 19, SCE_LUA_LABEL => 20, # Lexical states for SCLEX_ERRORLIST SCE_ERR_DEFAULT => 0, SCE_ERR_PYTHON => 1, SCE_ERR_GCC => 2, SCE_ERR_MS => 3, SCE_ERR_CMD => 4, SCE_ERR_BORLAND => 5, SCE_ERR_PERL => 6, SCE_ERR_NET => 7, SCE_ERR_LUA => 8, SCE_ERR_CTAG => 9, SCE_ERR_DIFF_CHANGED => 10, SCE_ERR_DIFF_ADDITION => 11, SCE_ERR_DIFF_DELETION => 12, SCE_ERR_DIFF_MESSAGE => 13, SCE_ERR_PHP => 14, SCE_ERR_ELF => 15, SCE_ERR_IFC => 16, SCE_ERR_IFORT => 17, SCE_ERR_ABSF => 18, SCE_ERR_TIDY => 19, SCE_ERR_JAVA_STACK => 20, SCE_ERR_VALUE => 21, # Lexical states for SCLEX_BATCH SCE_BAT_DEFAULT => 0, SCE_BAT_COMMENT => 1, SCE_BAT_WORD => 2, SCE_BAT_LABEL => 3, SCE_BAT_HIDE => 4, SCE_BAT_COMMAND => 5, SCE_BAT_IDENTIFIER => 6, SCE_BAT_OPERATOR => 7, # Lexical states for SCLEX_TCMD SCE_TCMD_DEFAULT => 0, SCE_TCMD_COMMENT => 1, SCE_TCMD_WORD => 2, SCE_TCMD_LABEL => 3, SCE_TCMD_HIDE => 4, SCE_TCMD_COMMAND => 5, SCE_TCMD_IDENTIFIER => 6, SCE_TCMD_OPERATOR => 7, SCE_TCMD_ENVIRONMENT => 8, SCE_TCMD_EXPANSION => 9, SCE_TCMD_CLABEL => 10, # Lexical states for SCLEX_MAKEFILE SCE_MAKE_DEFAULT => 0, SCE_MAKE_COMMENT => 1, SCE_MAKE_PREPROCESSOR => 2, SCE_MAKE_IDENTIFIER => 3, SCE_MAKE_OPERATOR => 4, SCE_MAKE_TARGET => 5, SCE_MAKE_IDEOL => 9, # Lexical states for SCLEX_DIFF SCE_DIFF_DEFAULT => 0, SCE_DIFF_COMMENT => 1, SCE_DIFF_COMMAND => 2, SCE_DIFF_HEADER => 3, SCE_DIFF_POSITION => 4, SCE_DIFF_DELETED => 5, SCE_DIFF_ADDED => 6, SCE_DIFF_CHANGED => 7, # Lexical states for SCLEX_CONF (Apache Configuration Files Lexer) SCE_CONF_DEFAULT => 0, SCE_CONF_COMMENT => 1, SCE_CONF_NUMBER => 2, SCE_CONF_IDENTIFIER => 3, SCE_CONF_EXTENSION => 4, SCE_CONF_PARAMETER => 5, SCE_CONF_STRING => 6, SCE_CONF_OPERATOR => 7, SCE_CONF_IP => 8, SCE_CONF_DIRECTIVE => 9, # Lexical states for SCLEX_AVE, Avenue SCE_AVE_DEFAULT => 0, SCE_AVE_COMMENT => 1, SCE_AVE_NUMBER => 2, SCE_AVE_WORD => 3, SCE_AVE_STRING => 6, SCE_AVE_ENUM => 7, SCE_AVE_STRINGEOL => 8, SCE_AVE_IDENTIFIER => 9, SCE_AVE_OPERATOR => 10, SCE_AVE_WORD1 => 11, SCE_AVE_WORD2 => 12, SCE_AVE_WORD3 => 13, SCE_AVE_WORD4 => 14, SCE_AVE_WORD5 => 15, SCE_AVE_WORD6 => 16, # Lexical states for SCLEX_ADA SCE_ADA_DEFAULT => 0, SCE_ADA_WORD => 1, SCE_ADA_IDENTIFIER => 2, SCE_ADA_NUMBER => 3, SCE_ADA_DELIMITER => 4, SCE_ADA_CHARACTER => 5, SCE_ADA_CHARACTEREOL => 6, SCE_ADA_STRING => 7, SCE_ADA_STRINGEOL => 8, SCE_ADA_LABEL => 9, SCE_ADA_COMMENTLINE => 10, SCE_ADA_ILLEGAL => 11, # Lexical states for SCLEX_BAAN SCE_BAAN_DEFAULT => 0, SCE_BAAN_COMMENT => 1, SCE_BAAN_COMMENTDOC => 2, SCE_BAAN_NUMBER => 3, SCE_BAAN_WORD => 4, SCE_BAAN_STRING => 5, SCE_BAAN_PREPROCESSOR => 6, SCE_BAAN_OPERATOR => 7, SCE_BAAN_IDENTIFIER => 8, SCE_BAAN_STRINGEOL => 9, SCE_BAAN_WORD2 => 10, # Lexical states for SCLEX_LISP SCE_LISP_DEFAULT => 0, SCE_LISP_COMMENT => 1, SCE_LISP_NUMBER => 2, SCE_LISP_KEYWORD => 3, SCE_LISP_KEYWORD_KW => 4, SCE_LISP_SYMBOL => 5, SCE_LISP_STRING => 6, SCE_LISP_STRINGEOL => 8, SCE_LISP_IDENTIFIER => 9, SCE_LISP_OPERATOR => 10, SCE_LISP_SPECIAL => 11, SCE_LISP_MULTI_COMMENT => 12, # Lexical states for SCLEX_EIFFEL and SCLEX_EIFFELKW SCE_EIFFEL_DEFAULT => 0, SCE_EIFFEL_COMMENTLINE => 1, SCE_EIFFEL_NUMBER => 2, SCE_EIFFEL_WORD => 3, SCE_EIFFEL_STRING => 4, SCE_EIFFEL_CHARACTER => 5, SCE_EIFFEL_OPERATOR => 6, SCE_EIFFEL_IDENTIFIER => 7, SCE_EIFFEL_STRINGEOL => 8, # Lexical states for SCLEX_NNCRONTAB (nnCron crontab Lexer) SCE_NNCRONTAB_DEFAULT => 0, SCE_NNCRONTAB_COMMENT => 1, SCE_NNCRONTAB_TASK => 2, SCE_NNCRONTAB_SECTION => 3, SCE_NNCRONTAB_KEYWORD => 4, SCE_NNCRONTAB_MODIFIER => 5, SCE_NNCRONTAB_ASTERISK => 6, SCE_NNCRONTAB_NUMBER => 7, SCE_NNCRONTAB_STRING => 8, SCE_NNCRONTAB_ENVIRONMENT => 9, SCE_NNCRONTAB_IDENTIFIER => 10, # Lexical states for SCLEX_FORTH (Forth Lexer) SCE_FORTH_DEFAULT => 0, SCE_FORTH_COMMENT => 1, SCE_FORTH_COMMENT_ML => 2, SCE_FORTH_IDENTIFIER => 3, SCE_FORTH_CONTROL => 4, SCE_FORTH_KEYWORD => 5, SCE_FORTH_DEFWORD => 6, SCE_FORTH_PREWORD1 => 7, SCE_FORTH_PREWORD2 => 8, SCE_FORTH_NUMBER => 9, SCE_FORTH_STRING => 10, SCE_FORTH_LOCALE => 11, # Lexical states for SCLEX_MATLAB SCE_MATLAB_DEFAULT => 0, SCE_MATLAB_COMMENT => 1, SCE_MATLAB_COMMAND => 2, SCE_MATLAB_NUMBER => 3, SCE_MATLAB_KEYWORD => 4, # single quoted string SCE_MATLAB_STRING => 5, SCE_MATLAB_OPERATOR => 6, SCE_MATLAB_IDENTIFIER => 7, SCE_MATLAB_DOUBLEQUOTESTRING => 8, # Lexical states for SCLEX_SCRIPTOL SCE_SCRIPTOL_DEFAULT => 0, SCE_SCRIPTOL_WHITE => 1, SCE_SCRIPTOL_COMMENTLINE => 2, SCE_SCRIPTOL_PERSISTENT => 3, SCE_SCRIPTOL_CSTYLE => 4, SCE_SCRIPTOL_COMMENTBLOCK => 5, SCE_SCRIPTOL_NUMBER => 6, SCE_SCRIPTOL_STRING => 7, SCE_SCRIPTOL_CHARACTER => 8, SCE_SCRIPTOL_STRINGEOL => 9, SCE_SCRIPTOL_KEYWORD => 10, SCE_SCRIPTOL_OPERATOR => 11, SCE_SCRIPTOL_IDENTIFIER => 12, SCE_SCRIPTOL_TRIPLE => 13, SCE_SCRIPTOL_CLASSNAME => 14, SCE_SCRIPTOL_PREPROCESSOR => 15, # Lexical states for SCLEX_ASM SCE_ASM_DEFAULT => 0, SCE_ASM_COMMENT => 1, SCE_ASM_NUMBER => 2, SCE_ASM_STRING => 3, SCE_ASM_OPERATOR => 4, SCE_ASM_IDENTIFIER => 5, SCE_ASM_CPUINSTRUCTION => 6, SCE_ASM_MATHINSTRUCTION => 7, SCE_ASM_REGISTER => 8, SCE_ASM_DIRECTIVE => 9, SCE_ASM_DIRECTIVEOPERAND => 10, SCE_ASM_COMMENTBLOCK => 11, SCE_ASM_CHARACTER => 12, SCE_ASM_STRINGEOL => 13, SCE_ASM_EXTINSTRUCTION => 14, SCE_ASM_COMMENTDIRECTIVE => 15, # Lexical states for SCLEX_FORTRAN SCE_F_DEFAULT => 0, SCE_F_COMMENT => 1, SCE_F_NUMBER => 2, SCE_F_STRING1 => 3, SCE_F_STRING2 => 4, SCE_F_STRINGEOL => 5, SCE_F_OPERATOR => 6, SCE_F_IDENTIFIER => 7, SCE_F_WORD => 8, SCE_F_WORD2 => 9, SCE_F_WORD3 => 10, SCE_F_PREPROCESSOR => 11, SCE_F_OPERATOR2 => 12, SCE_F_LABEL => 13, SCE_F_CONTINUATION => 14, # Lexical states for SCLEX_CSS SCE_CSS_DEFAULT => 0, SCE_CSS_TAG => 1, SCE_CSS_CLASS => 2, SCE_CSS_PSEUDOCLASS => 3, SCE_CSS_UNKNOWN_PSEUDOCLASS => 4, SCE_CSS_OPERATOR => 5, SCE_CSS_IDENTIFIER => 6, SCE_CSS_UNKNOWN_IDENTIFIER => 7, SCE_CSS_VALUE => 8, SCE_CSS_COMMENT => 9, SCE_CSS_ID => 10, SCE_CSS_IMPORTANT => 11, SCE_CSS_DIRECTIVE => 12, SCE_CSS_DOUBLESTRING => 13, SCE_CSS_SINGLESTRING => 14, SCE_CSS_IDENTIFIER2 => 15, SCE_CSS_ATTRIBUTE => 16, SCE_CSS_IDENTIFIER3 => 17, SCE_CSS_PSEUDOELEMENT => 18, SCE_CSS_EXTENDED_IDENTIFIER => 19, SCE_CSS_EXTENDED_PSEUDOCLASS => 20, SCE_CSS_EXTENDED_PSEUDOELEMENT => 21, SCE_CSS_MEDIA => 22, SCE_CSS_VARIABLE => 23, # Lexical states for SCLEX_POV SCE_POV_DEFAULT => 0, SCE_POV_COMMENT => 1, SCE_POV_COMMENTLINE => 2, SCE_POV_NUMBER => 3, SCE_POV_OPERATOR => 4, SCE_POV_IDENTIFIER => 5, SCE_POV_STRING => 6, SCE_POV_STRINGEOL => 7, SCE_POV_DIRECTIVE => 8, SCE_POV_BADDIRECTIVE => 9, SCE_POV_WORD2 => 10, SCE_POV_WORD3 => 11, SCE_POV_WORD4 => 12, SCE_POV_WORD5 => 13, SCE_POV_WORD6 => 14, SCE_POV_WORD7 => 15, SCE_POV_WORD8 => 16, # Lexical states for SCLEX_LOUT SCE_LOUT_DEFAULT => 0, SCE_LOUT_COMMENT => 1, SCE_LOUT_NUMBER => 2, SCE_LOUT_WORD => 3, SCE_LOUT_WORD2 => 4, SCE_LOUT_WORD3 => 5, SCE_LOUT_WORD4 => 6, SCE_LOUT_STRING => 7, SCE_LOUT_OPERATOR => 8, SCE_LOUT_IDENTIFIER => 9, SCE_LOUT_STRINGEOL => 10, # Lexical states for SCLEX_ESCRIPT SCE_ESCRIPT_DEFAULT => 0, SCE_ESCRIPT_COMMENT => 1, SCE_ESCRIPT_COMMENTLINE => 2, SCE_ESCRIPT_COMMENTDOC => 3, SCE_ESCRIPT_NUMBER => 4, SCE_ESCRIPT_WORD => 5, SCE_ESCRIPT_STRING => 6, SCE_ESCRIPT_OPERATOR => 7, SCE_ESCRIPT_IDENTIFIER => 8, SCE_ESCRIPT_BRACE => 9, SCE_ESCRIPT_WORD2 => 10, SCE_ESCRIPT_WORD3 => 11, # Lexical states for SCLEX_PS SCE_PS_DEFAULT => 0, SCE_PS_COMMENT => 1, SCE_PS_DSC_COMMENT => 2, SCE_PS_DSC_VALUE => 3, SCE_PS_NUMBER => 4, SCE_PS_NAME => 5, SCE_PS_KEYWORD => 6, SCE_PS_LITERAL => 7, SCE_PS_IMMEVAL => 8, SCE_PS_PAREN_ARRAY => 9, SCE_PS_PAREN_DICT => 10, SCE_PS_PAREN_PROC => 11, SCE_PS_TEXT => 12, SCE_PS_HEXSTRING => 13, SCE_PS_BASE85STRING => 14, SCE_PS_BADSTRINGCHAR => 15, # Lexical states for SCLEX_NSIS SCE_NSIS_DEFAULT => 0, SCE_NSIS_COMMENT => 1, SCE_NSIS_STRINGDQ => 2, SCE_NSIS_STRINGLQ => 3, SCE_NSIS_STRINGRQ => 4, SCE_NSIS_FUNCTION => 5, SCE_NSIS_VARIABLE => 6, SCE_NSIS_LABEL => 7, SCE_NSIS_USERDEFINED => 8, SCE_NSIS_SECTIONDEF => 9, SCE_NSIS_SUBSECTIONDEF => 10, SCE_NSIS_IFDEFINEDEF => 11, SCE_NSIS_MACRODEF => 12, SCE_NSIS_STRINGVAR => 13, SCE_NSIS_NUMBER => 14, SCE_NSIS_SECTIONGROUP => 15, SCE_NSIS_PAGEEX => 16, SCE_NSIS_FUNCTIONDEF => 17, SCE_NSIS_COMMENTBOX => 18, # Lexical states for SCLEX_MMIXAL SCE_MMIXAL_LEADWS => 0, SCE_MMIXAL_COMMENT => 1, SCE_MMIXAL_LABEL => 2, SCE_MMIXAL_OPCODE => 3, SCE_MMIXAL_OPCODE_PRE => 4, SCE_MMIXAL_OPCODE_VALID => 5, SCE_MMIXAL_OPCODE_UNKNOWN => 6, SCE_MMIXAL_OPCODE_POST => 7, SCE_MMIXAL_OPERANDS => 8, SCE_MMIXAL_NUMBER => 9, SCE_MMIXAL_REF => 10, SCE_MMIXAL_CHAR => 11, SCE_MMIXAL_STRING => 12, SCE_MMIXAL_REGISTER => 13, SCE_MMIXAL_HEX => 14, SCE_MMIXAL_OPERATOR => 15, SCE_MMIXAL_SYMBOL => 16, SCE_MMIXAL_INCLUDE => 17, # Lexical states for SCLEX_CLW SCE_CLW_DEFAULT => 0, SCE_CLW_LABEL => 1, SCE_CLW_COMMENT => 2, SCE_CLW_STRING => 3, SCE_CLW_USER_IDENTIFIER => 4, SCE_CLW_INTEGER_CONSTANT => 5, SCE_CLW_REAL_CONSTANT => 6, SCE_CLW_PICTURE_STRING => 7, SCE_CLW_KEYWORD => 8, SCE_CLW_COMPILER_DIRECTIVE => 9, SCE_CLW_RUNTIME_EXPRESSIONS => 10, SCE_CLW_BUILTIN_PROCEDURES_FUNCTION => 11, SCE_CLW_STRUCTURE_DATA_TYPE => 12, SCE_CLW_ATTRIBUTE => 13, SCE_CLW_STANDARD_EQUATE => 14, SCE_CLW_ERROR => 15, SCE_CLW_DEPRECATED => 16, # Lexical states for SCLEX_LOT SCE_LOT_DEFAULT => 0, SCE_LOT_HEADER => 1, SCE_LOT_BREAK => 2, SCE_LOT_SET => 3, SCE_LOT_PASS => 4, SCE_LOT_FAIL => 5, SCE_LOT_ABORT => 6, # Lexical states for SCLEX_YAML SCE_YAML_DEFAULT => 0, SCE_YAML_COMMENT => 1, SCE_YAML_IDENTIFIER => 2, SCE_YAML_KEYWORD => 3, SCE_YAML_NUMBER => 4, SCE_YAML_REFERENCE => 5, SCE_YAML_DOCUMENT => 6, SCE_YAML_TEXT => 7, SCE_YAML_ERROR => 8, SCE_YAML_OPERATOR => 9, # Lexical states for SCLEX_TEX SCE_TEX_DEFAULT => 0, SCE_TEX_SPECIAL => 1, SCE_TEX_GROUP => 2, SCE_TEX_SYMBOL => 3, SCE_TEX_COMMAND => 4, SCE_TEX_TEXT => 5, SCE_METAPOST_DEFAULT => 0, SCE_METAPOST_SPECIAL => 1, SCE_METAPOST_GROUP => 2, SCE_METAPOST_SYMBOL => 3, SCE_METAPOST_COMMAND => 4, SCE_METAPOST_TEXT => 5, SCE_METAPOST_EXTRA => 6, # Lexical states for SCLEX_ERLANG SCE_ERLANG_DEFAULT => 0, SCE_ERLANG_COMMENT => 1, SCE_ERLANG_VARIABLE => 2, SCE_ERLANG_NUMBER => 3, SCE_ERLANG_KEYWORD => 4, SCE_ERLANG_STRING => 5, SCE_ERLANG_OPERATOR => 6, SCE_ERLANG_ATOM => 7, SCE_ERLANG_FUNCTION_NAME => 8, SCE_ERLANG_CHARACTER => 9, SCE_ERLANG_MACRO => 10, SCE_ERLANG_RECORD => 11, SCE_ERLANG_PREPROC => 12, SCE_ERLANG_NODE_NAME => 13, SCE_ERLANG_COMMENT_FUNCTION => 14, SCE_ERLANG_COMMENT_MODULE => 15, SCE_ERLANG_COMMENT_DOC => 16, SCE_ERLANG_COMMENT_DOC_MACRO => 17, SCE_ERLANG_ATOM_QUOTED => 18, SCE_ERLANG_MACRO_QUOTED => 19, SCE_ERLANG_RECORD_QUOTED => 20, SCE_ERLANG_NODE_NAME_QUOTED => 21, SCE_ERLANG_BIFS => 22, SCE_ERLANG_MODULES => 23, SCE_ERLANG_MODULES_ATT => 24, SCE_ERLANG_UNKNOWN => 31, # Lexical states for SCLEX_OCTAVE are identical to MatLab # Lexical states for SCLEX_MSSQL SCE_MSSQL_DEFAULT => 0, SCE_MSSQL_COMMENT => 1, SCE_MSSQL_LINE_COMMENT => 2, SCE_MSSQL_NUMBER => 3, SCE_MSSQL_STRING => 4, SCE_MSSQL_OPERATOR => 5, SCE_MSSQL_IDENTIFIER => 6, SCE_MSSQL_VARIABLE => 7, SCE_MSSQL_COLUMN_NAME => 8, SCE_MSSQL_STATEMENT => 9, SCE_MSSQL_DATATYPE => 10, SCE_MSSQL_SYSTABLE => 11, SCE_MSSQL_GLOBAL_VARIABLE => 12, SCE_MSSQL_FUNCTION => 13, SCE_MSSQL_STORED_PROCEDURE => 14, SCE_MSSQL_DEFAULT_PREF_DATATYPE => 15, SCE_MSSQL_COLUMN_NAME_2 => 16, # Lexical states for SCLEX_VERILOG SCE_V_DEFAULT => 0, SCE_V_COMMENT => 1, SCE_V_COMMENTLINE => 2, SCE_V_COMMENTLINEBANG => 3, SCE_V_NUMBER => 4, SCE_V_WORD => 5, SCE_V_STRING => 6, SCE_V_WORD2 => 7, SCE_V_WORD3 => 8, SCE_V_PREPROCESSOR => 9, SCE_V_OPERATOR => 10, SCE_V_IDENTIFIER => 11, SCE_V_STRINGEOL => 12, SCE_V_USER => 19, # Lexical states for SCLEX_KIX SCE_KIX_DEFAULT => 0, SCE_KIX_COMMENT => 1, SCE_KIX_STRING1 => 2, SCE_KIX_STRING2 => 3, SCE_KIX_NUMBER => 4, SCE_KIX_VAR => 5, SCE_KIX_MACRO => 6, SCE_KIX_KEYWORD => 7, SCE_KIX_FUNCTIONS => 8, SCE_KIX_OPERATOR => 9, SCE_KIX_IDENTIFIER => 31, # Lexical states for SCLEX_GUI4CLI SCE_GC_DEFAULT => 0, SCE_GC_COMMENTLINE => 1, SCE_GC_COMMENTBLOCK => 2, SCE_GC_GLOBAL => 3, SCE_GC_EVENT => 4, SCE_GC_ATTRIBUTE => 5, SCE_GC_CONTROL => 6, SCE_GC_COMMAND => 7, SCE_GC_STRING => 8, SCE_GC_OPERATOR => 9, # Lexical states for SCLEX_SPECMAN SCE_SN_DEFAULT => 0, SCE_SN_CODE => 1, SCE_SN_COMMENTLINE => 2, SCE_SN_COMMENTLINEBANG => 3, SCE_SN_NUMBER => 4, SCE_SN_WORD => 5, SCE_SN_STRING => 6, SCE_SN_WORD2 => 7, SCE_SN_WORD3 => 8, SCE_SN_PREPROCESSOR => 9, SCE_SN_OPERATOR => 10, SCE_SN_IDENTIFIER => 11, SCE_SN_STRINGEOL => 12, SCE_SN_REGEXTAG => 13, SCE_SN_SIGNAL => 14, SCE_SN_USER => 19, # Lexical states for SCLEX_AU3 SCE_AU3_DEFAULT => 0, SCE_AU3_COMMENT => 1, SCE_AU3_COMMENTBLOCK => 2, SCE_AU3_NUMBER => 3, SCE_AU3_FUNCTION => 4, SCE_AU3_KEYWORD => 5, SCE_AU3_MACRO => 6, SCE_AU3_STRING => 7, SCE_AU3_OPERATOR => 8, SCE_AU3_VARIABLE => 9, SCE_AU3_SENT => 10, SCE_AU3_PREPROCESSOR => 11, SCE_AU3_SPECIAL => 12, SCE_AU3_EXPAND => 13, SCE_AU3_COMOBJ => 14, SCE_AU3_UDF => 15, # Lexical states for SCLEX_APDL SCE_APDL_DEFAULT => 0, SCE_APDL_COMMENT => 1, SCE_APDL_COMMENTBLOCK => 2, SCE_APDL_NUMBER => 3, SCE_APDL_STRING => 4, SCE_APDL_OPERATOR => 5, SCE_APDL_WORD => 6, SCE_APDL_PROCESSOR => 7, SCE_APDL_COMMAND => 8, SCE_APDL_SLASHCOMMAND => 9, SCE_APDL_STARCOMMAND => 10, SCE_APDL_ARGUMENT => 11, SCE_APDL_FUNCTION => 12, # Lexical states for SCLEX_BASH SCE_SH_DEFAULT => 0, SCE_SH_ERROR => 1, SCE_SH_COMMENTLINE => 2, SCE_SH_NUMBER => 3, SCE_SH_WORD => 4, SCE_SH_STRING => 5, SCE_SH_CHARACTER => 6, SCE_SH_OPERATOR => 7, SCE_SH_IDENTIFIER => 8, SCE_SH_SCALAR => 9, SCE_SH_PARAM => 10, SCE_SH_BACKTICKS => 11, SCE_SH_HERE_DELIM => 12, SCE_SH_HERE_Q => 13, # Lexical states for SCLEX_ASN1 SCE_ASN1_DEFAULT => 0, SCE_ASN1_COMMENT => 1, SCE_ASN1_IDENTIFIER => 2, SCE_ASN1_STRING => 3, SCE_ASN1_OID => 4, SCE_ASN1_SCALAR => 5, SCE_ASN1_KEYWORD => 6, SCE_ASN1_ATTRIBUTE => 7, SCE_ASN1_DESCRIPTOR => 8, SCE_ASN1_TYPE => 9, SCE_ASN1_OPERATOR => 10, # Lexical states for SCLEX_VHDL SCE_VHDL_DEFAULT => 0, SCE_VHDL_COMMENT => 1, SCE_VHDL_COMMENTLINEBANG => 2, SCE_VHDL_NUMBER => 3, SCE_VHDL_STRING => 4, SCE_VHDL_OPERATOR => 5, SCE_VHDL_IDENTIFIER => 6, SCE_VHDL_STRINGEOL => 7, SCE_VHDL_KEYWORD => 8, SCE_VHDL_STDOPERATOR => 9, SCE_VHDL_ATTRIBUTE => 10, SCE_VHDL_STDFUNCTION => 11, SCE_VHDL_STDPACKAGE => 12, SCE_VHDL_STDTYPE => 13, SCE_VHDL_USERWORD => 14, # Lexical states for SCLEX_CAML SCE_CAML_DEFAULT => 0, SCE_CAML_IDENTIFIER => 1, SCE_CAML_TAGNAME => 2, SCE_CAML_KEYWORD => 3, SCE_CAML_KEYWORD2 => 4, SCE_CAML_KEYWORD3 => 5, SCE_CAML_LINENUM => 6, SCE_CAML_OPERATOR => 7, SCE_CAML_NUMBER => 8, SCE_CAML_CHAR => 9, SCE_CAML_WHITE => 10, SCE_CAML_STRING => 11, SCE_CAML_COMMENT => 12, SCE_CAML_COMMENT1 => 13, SCE_CAML_COMMENT2 => 14, SCE_CAML_COMMENT3 => 15, # Lexical states for SCLEX_HASKELL SCE_HA_DEFAULT => 0, SCE_HA_IDENTIFIER => 1, SCE_HA_KEYWORD => 2, SCE_HA_NUMBER => 3, SCE_HA_STRING => 4, SCE_HA_CHARACTER => 5, SCE_HA_CLASS => 6, SCE_HA_MODULE => 7, SCE_HA_CAPITAL => 8, SCE_HA_DATA => 9, SCE_HA_IMPORT => 10, SCE_HA_OPERATOR => 11, SCE_HA_INSTANCE => 12, SCE_HA_COMMENTLINE => 13, SCE_HA_COMMENTBLOCK => 14, SCE_HA_COMMENTBLOCK2 => 15, SCE_HA_COMMENTBLOCK3 => 16, # Lexical states of SCLEX_TADS3 SCE_T3_DEFAULT => 0, SCE_T3_X_DEFAULT => 1, SCE_T3_PREPROCESSOR => 2, SCE_T3_BLOCK_COMMENT => 3, SCE_T3_LINE_COMMENT => 4, SCE_T3_OPERATOR => 5, SCE_T3_KEYWORD => 6, SCE_T3_NUMBER => 7, SCE_T3_IDENTIFIER => 8, SCE_T3_S_STRING => 9, SCE_T3_D_STRING => 10, SCE_T3_X_STRING => 11, SCE_T3_LIB_DIRECTIVE => 12, SCE_T3_MSG_PARAM => 13, SCE_T3_HTML_TAG => 14, SCE_T3_HTML_DEFAULT => 15, SCE_T3_HTML_STRING => 16, SCE_T3_USER1 => 17, SCE_T3_USER2 => 18, SCE_T3_USER3 => 19, SCE_T3_BRACE => 20, # Lexical states for SCLEX_REBOL SCE_REBOL_DEFAULT => 0, SCE_REBOL_COMMENTLINE => 1, SCE_REBOL_COMMENTBLOCK => 2, SCE_REBOL_PREFACE => 3, SCE_REBOL_OPERATOR => 4, SCE_REBOL_CHARACTER => 5, SCE_REBOL_QUOTEDSTRING => 6, SCE_REBOL_BRACEDSTRING => 7, SCE_REBOL_NUMBER => 8, SCE_REBOL_PAIR => 9, SCE_REBOL_TUPLE => 10, SCE_REBOL_BINARY => 11, SCE_REBOL_MONEY => 12, SCE_REBOL_ISSUE => 13, SCE_REBOL_TAG => 14, SCE_REBOL_FILE => 15, SCE_REBOL_EMAIL => 16, SCE_REBOL_URL => 17, SCE_REBOL_DATE => 18, SCE_REBOL_TIME => 19, SCE_REBOL_IDENTIFIER => 20, SCE_REBOL_WORD => 21, SCE_REBOL_WORD2 => 22, SCE_REBOL_WORD3 => 23, SCE_REBOL_WORD4 => 24, SCE_REBOL_WORD5 => 25, SCE_REBOL_WORD6 => 26, SCE_REBOL_WORD7 => 27, SCE_REBOL_WORD8 => 28, # Lexical states for SCLEX_SQL SCE_SQL_DEFAULT => 0, SCE_SQL_COMMENT => 1, SCE_SQL_COMMENTLINE => 2, SCE_SQL_COMMENTDOC => 3, SCE_SQL_NUMBER => 4, SCE_SQL_WORD => 5, SCE_SQL_STRING => 6, SCE_SQL_CHARACTER => 7, SCE_SQL_SQLPLUS => 8, SCE_SQL_SQLPLUS_PROMPT => 9, SCE_SQL_OPERATOR => 10, SCE_SQL_IDENTIFIER => 11, SCE_SQL_SQLPLUS_COMMENT => 13, SCE_SQL_COMMENTLINEDOC => 15, SCE_SQL_WORD2 => 16, SCE_SQL_COMMENTDOCKEYWORD => 17, SCE_SQL_COMMENTDOCKEYWORDERROR => 18, SCE_SQL_USER1 => 19, SCE_SQL_USER2 => 20, SCE_SQL_USER3 => 21, SCE_SQL_USER4 => 22, SCE_SQL_QUOTEDIDENTIFIER => 23, # Lexical states for SCLEX_SMALLTALK SCE_ST_DEFAULT => 0, SCE_ST_STRING => 1, SCE_ST_NUMBER => 2, SCE_ST_COMMENT => 3, SCE_ST_SYMBOL => 4, SCE_ST_BINARY => 5, SCE_ST_BOOL => 6, SCE_ST_SELF => 7, SCE_ST_SUPER => 8, SCE_ST_NIL => 9, SCE_ST_GLOBAL => 10, SCE_ST_RETURN => 11, SCE_ST_SPECIAL => 12, SCE_ST_KWSEND => 13, SCE_ST_ASSIGN => 14, SCE_ST_CHARACTER => 15, SCE_ST_SPEC_SEL => 16, # Lexical states for SCLEX_FLAGSHIP (clipper) SCE_FS_DEFAULT => 0, SCE_FS_COMMENT => 1, SCE_FS_COMMENTLINE => 2, SCE_FS_COMMENTDOC => 3, SCE_FS_COMMENTLINEDOC => 4, SCE_FS_COMMENTDOCKEYWORD => 5, SCE_FS_COMMENTDOCKEYWORDERROR => 6, SCE_FS_KEYWORD => 7, SCE_FS_KEYWORD2 => 8, SCE_FS_KEYWORD3 => 9, SCE_FS_KEYWORD4 => 10, SCE_FS_NUMBER => 11, SCE_FS_STRING => 12, SCE_FS_PREPROCESSOR => 13, SCE_FS_OPERATOR => 14, SCE_FS_IDENTIFIER => 15, SCE_FS_DATE => 16, SCE_FS_STRINGEOL => 17, SCE_FS_CONSTANT => 18, SCE_FS_WORDOPERATOR => 19, SCE_FS_DISABLEDCODE => 20, SCE_FS_DEFAULT_C => 21, SCE_FS_COMMENTDOC_C => 22, SCE_FS_COMMENTLINEDOC_C => 23, SCE_FS_KEYWORD_C => 24, SCE_FS_KEYWORD2_C => 25, SCE_FS_NUMBER_C => 26, SCE_FS_STRING_C => 27, SCE_FS_PREPROCESSOR_C => 28, SCE_FS_OPERATOR_C => 29, SCE_FS_IDENTIFIER_C => 30, SCE_FS_STRINGEOL_C => 31, # Lexical states for SCLEX_CSOUND SCE_CSOUND_DEFAULT => 0, SCE_CSOUND_COMMENT => 1, SCE_CSOUND_NUMBER => 2, SCE_CSOUND_OPERATOR => 3, SCE_CSOUND_INSTR => 4, SCE_CSOUND_IDENTIFIER => 5, SCE_CSOUND_OPCODE => 6, SCE_CSOUND_HEADERSTMT => 7, SCE_CSOUND_USERKEYWORD => 8, SCE_CSOUND_COMMENTBLOCK => 9, SCE_CSOUND_PARAM => 10, SCE_CSOUND_ARATE_VAR => 11, SCE_CSOUND_KRATE_VAR => 12, SCE_CSOUND_IRATE_VAR => 13, SCE_CSOUND_GLOBAL_VAR => 14, SCE_CSOUND_STRINGEOL => 15, # Lexical states for SCLEX_INNOSETUP SCE_INNO_DEFAULT => 0, SCE_INNO_COMMENT => 1, SCE_INNO_KEYWORD => 2, SCE_INNO_PARAMETER => 3, SCE_INNO_SECTION => 4, SCE_INNO_PREPROC => 5, SCE_INNO_INLINE_EXPANSION => 6, SCE_INNO_COMMENT_PASCAL => 7, SCE_INNO_KEYWORD_PASCAL => 8, SCE_INNO_KEYWORD_USER => 9, SCE_INNO_STRING_DOUBLE => 10, SCE_INNO_STRING_SINGLE => 11, SCE_INNO_IDENTIFIER => 12, # Lexical states for SCLEX_OPAL SCE_OPAL_SPACE => 0, SCE_OPAL_COMMENT_BLOCK => 1, SCE_OPAL_COMMENT_LINE => 2, SCE_OPAL_INTEGER => 3, SCE_OPAL_KEYWORD => 4, SCE_OPAL_SORT => 5, SCE_OPAL_STRING => 6, SCE_OPAL_PAR => 7, SCE_OPAL_BOOL_CONST => 8, SCE_OPAL_DEFAULT => 32, # Lexical states for SCLEX_SPICE SCE_SPICE_DEFAULT => 0, SCE_SPICE_IDENTIFIER => 1, SCE_SPICE_KEYWORD => 2, SCE_SPICE_KEYWORD2 => 3, SCE_SPICE_KEYWORD3 => 4, SCE_SPICE_NUMBER => 5, SCE_SPICE_DELIMITER => 6, SCE_SPICE_VALUE => 7, SCE_SPICE_COMMENTLINE => 8, # Lexical states for SCLEX_CMAKE SCE_CMAKE_DEFAULT => 0, SCE_CMAKE_COMMENT => 1, SCE_CMAKE_STRINGDQ => 2, SCE_CMAKE_STRINGLQ => 3, SCE_CMAKE_STRINGRQ => 4, SCE_CMAKE_COMMANDS => 5, SCE_CMAKE_PARAMETERS => 6, SCE_CMAKE_VARIABLE => 7, SCE_CMAKE_USERDEFINED => 8, SCE_CMAKE_WHILEDEF => 9, SCE_CMAKE_FOREACHDEF => 10, SCE_CMAKE_IFDEFINEDEF => 11, SCE_CMAKE_MACRODEF => 12, SCE_CMAKE_STRINGVAR => 13, SCE_CMAKE_NUMBER => 14, # Lexical states for SCLEX_GAP SCE_GAP_DEFAULT => 0, SCE_GAP_IDENTIFIER => 1, SCE_GAP_KEYWORD => 2, SCE_GAP_KEYWORD2 => 3, SCE_GAP_KEYWORD3 => 4, SCE_GAP_KEYWORD4 => 5, SCE_GAP_STRING => 6, SCE_GAP_CHAR => 7, SCE_GAP_OPERATOR => 8, SCE_GAP_COMMENT => 9, SCE_GAP_NUMBER => 10, SCE_GAP_STRINGEOL => 11, # Lexical state for SCLEX_PLM SCE_PLM_DEFAULT => 0, SCE_PLM_COMMENT => 1, SCE_PLM_STRING => 2, SCE_PLM_NUMBER => 3, SCE_PLM_IDENTIFIER => 4, SCE_PLM_OPERATOR => 5, SCE_PLM_CONTROL => 6, SCE_PLM_KEYWORD => 7, # Lexical state for SCLEX_PROGRESS SCE_4GL_DEFAULT => 0, SCE_4GL_NUMBER => 1, SCE_4GL_WORD => 2, SCE_4GL_STRING => 3, SCE_4GL_CHARACTER => 4, SCE_4GL_PREPROCESSOR => 5, SCE_4GL_OPERATOR => 6, SCE_4GL_IDENTIFIER => 7, SCE_4GL_BLOCK => 8, SCE_4GL_END => 9, SCE_4GL_COMMENT1 => 10, SCE_4GL_COMMENT2 => 11, SCE_4GL_COMMENT3 => 12, SCE_4GL_COMMENT4 => 13, SCE_4GL_COMMENT5 => 14, SCE_4GL_COMMENT6 => 15, SCE_4GL_DEFAULT_ => 16, SCE_4GL_NUMBER_ => 17, SCE_4GL_WORD_ => 18, SCE_4GL_STRING_ => 19, SCE_4GL_CHARACTER_ => 20, SCE_4GL_PREPROCESSOR_ => 21, SCE_4GL_OPERATOR_ => 22, SCE_4GL_IDENTIFIER_ => 23, SCE_4GL_BLOCK_ => 24, SCE_4GL_END_ => 25, SCE_4GL_COMMENT1_ => 26, SCE_4GL_COMMENT2_ => 27, SCE_4GL_COMMENT3_ => 28, SCE_4GL_COMMENT4_ => 29, SCE_4GL_COMMENT5_ => 30, SCE_4GL_COMMENT6_ => 31, # Lexical states for SCLEX_ABAQUS SCE_ABAQUS_DEFAULT => 0, SCE_ABAQUS_COMMENT => 1, SCE_ABAQUS_COMMENTBLOCK => 2, SCE_ABAQUS_NUMBER => 3, SCE_ABAQUS_STRING => 4, SCE_ABAQUS_OPERATOR => 5, SCE_ABAQUS_WORD => 6, SCE_ABAQUS_PROCESSOR => 7, SCE_ABAQUS_COMMAND => 8, SCE_ABAQUS_SLASHCOMMAND => 9, SCE_ABAQUS_STARCOMMAND => 10, SCE_ABAQUS_ARGUMENT => 11, SCE_ABAQUS_FUNCTION => 12, # Lexical states for SCLEX_ASYMPTOTE SCE_ASY_DEFAULT => 0, SCE_ASY_COMMENT => 1, SCE_ASY_COMMENTLINE => 2, SCE_ASY_NUMBER => 3, SCE_ASY_WORD => 4, SCE_ASY_STRING => 5, SCE_ASY_CHARACTER => 6, SCE_ASY_OPERATOR => 7, SCE_ASY_IDENTIFIER => 8, SCE_ASY_STRINGEOL => 9, SCE_ASY_COMMENTLINEDOC => 10, SCE_ASY_WORD2 => 11, # Lexical states for SCLEX_R SCE_R_DEFAULT => 0, SCE_R_COMMENT => 1, SCE_R_KWORD => 2, SCE_R_BASEKWORD => 3, SCE_R_OTHERKWORD => 4, SCE_R_NUMBER => 5, SCE_R_STRING => 6, SCE_R_STRING2 => 7, SCE_R_OPERATOR => 8, SCE_R_IDENTIFIER => 9, SCE_R_INFIX => 10, SCE_R_INFIXEOL => 11, # Lexical state for SCLEX_MAGIKSF SCE_MAGIK_DEFAULT => 0, SCE_MAGIK_COMMENT => 1, SCE_MAGIK_HYPER_COMMENT => 16, SCE_MAGIK_STRING => 2, SCE_MAGIK_CHARACTER => 3, SCE_MAGIK_NUMBER => 4, SCE_MAGIK_IDENTIFIER => 5, SCE_MAGIK_OPERATOR => 6, SCE_MAGIK_FLOW => 7, SCE_MAGIK_CONTAINER => 8, SCE_MAGIK_BRACKET_BLOCK => 9, SCE_MAGIK_BRACE_BLOCK => 10, SCE_MAGIK_SQBRACKET_BLOCK => 11, SCE_MAGIK_UNKNOWN_KEYWORD => 12, SCE_MAGIK_KEYWORD => 13, SCE_MAGIK_PRAGMA => 14, SCE_MAGIK_SYMBOL => 15, # Lexical state for SCLEX_POWERSHELL SCE_POWERSHELL_DEFAULT => 0, SCE_POWERSHELL_COMMENT => 1, SCE_POWERSHELL_STRING => 2, SCE_POWERSHELL_CHARACTER => 3, SCE_POWERSHELL_NUMBER => 4, SCE_POWERSHELL_VARIABLE => 5, SCE_POWERSHELL_OPERATOR => 6, SCE_POWERSHELL_IDENTIFIER => 7, SCE_POWERSHELL_KEYWORD => 8, SCE_POWERSHELL_CMDLET => 9, SCE_POWERSHELL_ALIAS => 10, SCE_POWERSHELL_FUNCTION => 11, SCE_POWERSHELL_USER1 => 12, SCE_POWERSHELL_COMMENTSTREAM => 13, # Lexical state for SCLEX_MYSQL SCE_MYSQL_DEFAULT => 0, SCE_MYSQL_COMMENT => 1, SCE_MYSQL_COMMENTLINE => 2, SCE_MYSQL_VARIABLE => 3, SCE_MYSQL_SYSTEMVARIABLE => 4, SCE_MYSQL_KNOWNSYSTEMVARIABLE => 5, SCE_MYSQL_NUMBER => 6, SCE_MYSQL_MAJORKEYWORD => 7, SCE_MYSQL_KEYWORD => 8, SCE_MYSQL_DATABASEOBJECT => 9, SCE_MYSQL_PROCEDUREKEYWORD => 10, SCE_MYSQL_STRING => 11, SCE_MYSQL_SQSTRING => 12, SCE_MYSQL_DQSTRING => 13, SCE_MYSQL_OPERATOR => 14, SCE_MYSQL_FUNCTION => 15, SCE_MYSQL_IDENTIFIER => 16, SCE_MYSQL_QUOTEDIDENTIFIER => 17, SCE_MYSQL_USER1 => 18, SCE_MYSQL_USER2 => 19, SCE_MYSQL_USER3 => 20, SCE_MYSQL_HIDDENCOMMAND => 21, # Lexical state for SCLEX_PO SCE_PO_DEFAULT => 0, SCE_PO_COMMENT => 1, SCE_PO_MSGID => 2, SCE_PO_MSGID_TEXT => 3, SCE_PO_MSGSTR => 4, SCE_PO_MSGSTR_TEXT => 5, SCE_PO_MSGCTXT => 6, SCE_PO_MSGCTXT_TEXT => 7, SCE_PO_FUZZY => 8, # Lexical states for SCLEX_PASCAL SCE_PAS_DEFAULT => 0, SCE_PAS_IDENTIFIER => 1, SCE_PAS_COMMENT => 2, SCE_PAS_COMMENT2 => 3, SCE_PAS_COMMENTLINE => 4, SCE_PAS_PREPROCESSOR => 5, SCE_PAS_PREPROCESSOR2 => 6, SCE_PAS_NUMBER => 7, SCE_PAS_HEXNUMBER => 8, SCE_PAS_WORD => 9, SCE_PAS_STRING => 10, SCE_PAS_STRINGEOL => 11, SCE_PAS_CHARACTER => 12, SCE_PAS_OPERATOR => 13, SCE_PAS_ASM => 14, # Lexical state for SCLEX_SORCUS SCE_SORCUS_DEFAULT => 0, SCE_SORCUS_COMMAND => 1, SCE_SORCUS_PARAMETER => 2, SCE_SORCUS_COMMENTLINE => 3, SCE_SORCUS_STRING => 4, SCE_SORCUS_STRINGEOL => 5, SCE_SORCUS_IDENTIFIER => 6, SCE_SORCUS_OPERATOR => 7, SCE_SORCUS_NUMBER => 8, SCE_SORCUS_CONSTANT => 9, # Lexical state for SCLEX_POWERPRO SCE_POWERPRO_DEFAULT => 0, SCE_POWERPRO_COMMENTBLOCK => 1, SCE_POWERPRO_COMMENTLINE => 2, SCE_POWERPRO_NUMBER => 3, SCE_POWERPRO_WORD => 4, SCE_POWERPRO_WORD2 => 5, SCE_POWERPRO_WORD3 => 6, SCE_POWERPRO_WORD4 => 7, SCE_POWERPRO_DOUBLEQUOTEDSTRING => 8, SCE_POWERPRO_SINGLEQUOTEDSTRING => 9, SCE_POWERPRO_LINECONTINUE => 10, SCE_POWERPRO_OPERATOR => 11, SCE_POWERPRO_IDENTIFIER => 12, SCE_POWERPRO_STRINGEOL => 13, SCE_POWERPRO_VERBATIM => 14, SCE_POWERPRO_ALTQUOTE => 15, SCE_POWERPRO_FUNCTION => 16, # Lexical states for SCLEX_SML SCE_SML_DEFAULT => 0, SCE_SML_IDENTIFIER => 1, SCE_SML_TAGNAME => 2, SCE_SML_KEYWORD => 3, SCE_SML_KEYWORD2 => 4, SCE_SML_KEYWORD3 => 5, SCE_SML_LINENUM => 6, SCE_SML_OPERATOR => 7, SCE_SML_NUMBER => 8, SCE_SML_CHAR => 9, SCE_SML_STRING => 11, SCE_SML_COMMENT => 12, SCE_SML_COMMENT1 => 13, SCE_SML_COMMENT2 => 14, SCE_SML_COMMENT3 => 15, # Lexical state for SCLEX_MARKDOWN SCE_MARKDOWN_DEFAULT => 0, SCE_MARKDOWN_LINE_BEGIN => 1, SCE_MARKDOWN_STRONG1 => 2, SCE_MARKDOWN_STRONG2 => 3, SCE_MARKDOWN_EM1 => 4, SCE_MARKDOWN_EM2 => 5, SCE_MARKDOWN_HEADER1 => 6, SCE_MARKDOWN_HEADER2 => 7, SCE_MARKDOWN_HEADER3 => 8, SCE_MARKDOWN_HEADER4 => 9, SCE_MARKDOWN_HEADER5 => 10, SCE_MARKDOWN_HEADER6 => 11, SCE_MARKDOWN_PRECHAR => 12, SCE_MARKDOWN_ULIST_ITEM => 13, SCE_MARKDOWN_OLIST_ITEM => 14, SCE_MARKDOWN_BLOCKQUOTE => 15, SCE_MARKDOWN_STRIKEOUT => 16, SCE_MARKDOWN_HRULE => 17, SCE_MARKDOWN_LINK => 18, SCE_MARKDOWN_CODE => 19, SCE_MARKDOWN_CODE2 => 20, SCE_MARKDOWN_CODEBK => 21, # Lexical state for SCLEX_TXT2TAGS SCE_TXT2TAGS_DEFAULT => 0, SCE_TXT2TAGS_LINE_BEGIN => 1, SCE_TXT2TAGS_STRONG1 => 2, SCE_TXT2TAGS_STRONG2 => 3, SCE_TXT2TAGS_EM1 => 4, SCE_TXT2TAGS_EM2 => 5, SCE_TXT2TAGS_HEADER1 => 6, SCE_TXT2TAGS_HEADER2 => 7, SCE_TXT2TAGS_HEADER3 => 8, SCE_TXT2TAGS_HEADER4 => 9, SCE_TXT2TAGS_HEADER5 => 10, SCE_TXT2TAGS_HEADER6 => 11, SCE_TXT2TAGS_PRECHAR => 12, SCE_TXT2TAGS_ULIST_ITEM => 13, SCE_TXT2TAGS_OLIST_ITEM => 14, SCE_TXT2TAGS_BLOCKQUOTE => 15, SCE_TXT2TAGS_STRIKEOUT => 16, SCE_TXT2TAGS_HRULE => 17, SCE_TXT2TAGS_LINK => 18, SCE_TXT2TAGS_CODE => 19, SCE_TXT2TAGS_CODE2 => 20, SCE_TXT2TAGS_CODEBK => 21, SCE_TXT2TAGS_COMMENT => 22, SCE_TXT2TAGS_OPTION => 23, SCE_TXT2TAGS_PREPROC => 24, SCE_TXT2TAGS_POSTPROC => 25, # Lexical states for SCLEX_A68K SCE_A68K_DEFAULT => 0, SCE_A68K_COMMENT => 1, SCE_A68K_NUMBER_DEC => 2, SCE_A68K_NUMBER_BIN => 3, SCE_A68K_NUMBER_HEX => 4, SCE_A68K_STRING1 => 5, SCE_A68K_OPERATOR => 6, SCE_A68K_CPUINSTRUCTION => 7, SCE_A68K_EXTINSTRUCTION => 8, SCE_A68K_REGISTER => 9, SCE_A68K_DIRECTIVE => 10, SCE_A68K_MACRO_ARG => 11, SCE_A68K_LABEL => 12, SCE_A68K_STRING2 => 13, SCE_A68K_IDENTIFIER => 14, SCE_A68K_MACRO_DECLARATION => 15, SCE_A68K_COMMENT_WORD => 16, SCE_A68K_COMMENT_SPECIAL => 17, SCE_A68K_COMMENT_DOXYGEN => 18, # Lexical states for SCLEX_MODULA SCE_MODULA_DEFAULT => 0, SCE_MODULA_COMMENT => 1, SCE_MODULA_DOXYCOMM => 2, SCE_MODULA_DOXYKEY => 3, SCE_MODULA_KEYWORD => 4, SCE_MODULA_RESERVED => 5, SCE_MODULA_NUMBER => 6, SCE_MODULA_BASENUM => 7, SCE_MODULA_FLOAT => 8, SCE_MODULA_STRING => 9, SCE_MODULA_STRSPEC => 10, SCE_MODULA_CHAR => 11, SCE_MODULA_CHARSPEC => 12, SCE_MODULA_PROC => 13, SCE_MODULA_PRAGMA => 14, SCE_MODULA_PRGKEY => 15, SCE_MODULA_OPERATOR => 16, SCE_MODULA_BADSTR => 17, # Lexical states for SCLEX_COFFEESCRIPT SCE_COFFEESCRIPT_DEFAULT => 0, SCE_COFFEESCRIPT_COMMENT => 1, SCE_COFFEESCRIPT_COMMENTLINE => 2, SCE_COFFEESCRIPT_COMMENTDOC => 3, SCE_COFFEESCRIPT_NUMBER => 4, SCE_COFFEESCRIPT_WORD => 5, SCE_COFFEESCRIPT_STRING => 6, SCE_COFFEESCRIPT_CHARACTER => 7, SCE_COFFEESCRIPT_UUID => 8, SCE_COFFEESCRIPT_PREPROCESSOR => 9, SCE_COFFEESCRIPT_OPERATOR => 10, SCE_COFFEESCRIPT_IDENTIFIER => 11, SCE_COFFEESCRIPT_STRINGEOL => 12, SCE_COFFEESCRIPT_VERBATIM => 13, SCE_COFFEESCRIPT_REGEX => 14, SCE_COFFEESCRIPT_COMMENTLINEDOC => 15, SCE_COFFEESCRIPT_WORD2 => 16, SCE_COFFEESCRIPT_COMMENTDOCKEYWORD => 17, SCE_COFFEESCRIPT_COMMENTDOCKEYWORDERROR => 18, SCE_COFFEESCRIPT_GLOBALCLASS => 19, SCE_COFFEESCRIPT_STRINGRAW => 20, SCE_COFFEESCRIPT_TRIPLEVERBATIM => 21, SCE_COFFEESCRIPT_HASHQUOTEDSTRING => 22, SCE_COFFEESCRIPT_COMMENTBLOCK => 22, SCE_COFFEESCRIPT_VERBOSE_REGEX => 23, SCE_COFFEESCRIPT_VERBOSE_REGEX_COMMENT => 24, # Lexical states for SCLEX_AVS SCE_AVS_DEFAULT => 0, SCE_AVS_COMMENTBLOCK => 1, SCE_AVS_COMMENTBLOCKN => 2, SCE_AVS_COMMENTLINE => 3, SCE_AVS_NUMBER => 4, SCE_AVS_OPERATOR => 5, SCE_AVS_IDENTIFIER => 6, SCE_AVS_STRING => 7, SCE_AVS_TRIPLESTRING => 8, SCE_AVS_KEYWORD => 9, SCE_AVS_FILTER => 10, SCE_AVS_PLUGIN => 11, SCE_AVS_FUNCTION => 12, SCE_AVS_CLIPPROP => 13, SCE_AVS_USERDFN => 14, # Lexical states for SCLEX_ECL SCE_ECL_DEFAULT => 0, SCE_ECL_COMMENT => 1, SCE_ECL_COMMENTLINE => 2, SCE_ECL_NUMBER => 3, SCE_ECL_STRING => 4, SCE_ECL_WORD0 => 5, SCE_ECL_OPERATOR => 6, SCE_ECL_CHARACTER => 7, SCE_ECL_UUID => 8, SCE_ECL_PREPROCESSOR => 9, SCE_ECL_UNKNOWN => 10, SCE_ECL_IDENTIFIER => 11, SCE_ECL_STRINGEOL => 12, SCE_ECL_VERBATIM => 13, SCE_ECL_REGEX => 14, SCE_ECL_COMMENTLINEDOC => 15, SCE_ECL_WORD1 => 16, SCE_ECL_COMMENTDOCKEYWORD => 17, SCE_ECL_COMMENTDOCKEYWORDERROR => 18, SCE_ECL_WORD2 => 19, SCE_ECL_WORD3 => 20, SCE_ECL_WORD4 => 21, SCE_ECL_WORD5 => 22, SCE_ECL_COMMENTDOC => 23, SCE_ECL_ADDED => 24, SCE_ECL_DELETED => 25, SCE_ECL_CHANGED => 26, SCE_ECL_MOVED => 27, # Deprecated in 2.21 # The SC_CP_DBCS value can be used to indicate a DBCS mode for GTK+. SC_CP_DBCS => 1, }; 1; __END__ =pod =head1 NAME Wx::Scintilla::Constant - A list of Wx::Scintilla constants =head1 DESCRIPTION This is a list of auto-generated constants from Scintilla.iface. =head1 CONSTANTS INVALID_POSITION (-1) Define start of Scintilla messages to be greater than all Windows edit (EM_*) messagesas many EM_ messages can be used although that use is deprecated. SCI_START (2000) SCI_OPTIONAL_START (3000) SCI_LEXER_START (4000) =head2 WhiteSpace enumeration SCWS_INVISIBLE (0) SCWS_VISIBLEALWAYS (1) SCWS_VISIBLEAFTERINDENT (2) =head2 EndOfLine enumeration SC_EOL_CRLF (0) SC_EOL_CR (1) SC_EOL_LF (2) The SC_CP_UTF8 value can be used to enter Unicode mode.This is the same value as CP_UTF8 in Windows SC_CP_UTF8 (65001) =head2 MarkerSymbol enumeration MARKER_MAX (31) SC_MARK_CIRCLE (0) SC_MARK_ROUNDRECT (1) SC_MARK_ARROW (2) SC_MARK_SMALLRECT (3) SC_MARK_SHORTARROW (4) SC_MARK_EMPTY (5) SC_MARK_ARROWDOWN (6) SC_MARK_MINUS (7) SC_MARK_PLUS (8) Shapes used for outlining column. SC_MARK_VLINE (9) SC_MARK_LCORNER (10) SC_MARK_TCORNER (11) SC_MARK_BOXPLUS (12) SC_MARK_BOXPLUSCONNECTED (13) SC_MARK_BOXMINUS (14) SC_MARK_BOXMINUSCONNECTED (15) SC_MARK_LCORNERCURVE (16) SC_MARK_TCORNERCURVE (17) SC_MARK_CIRCLEPLUS (18) SC_MARK_CIRCLEPLUSCONNECTED (19) SC_MARK_CIRCLEMINUS (20) SC_MARK_CIRCLEMINUSCONNECTED (21) Invisible mark that only sets the line background colour. SC_MARK_BACKGROUND (22) SC_MARK_DOTDOTDOT (23) SC_MARK_ARROWS (24) SC_MARK_PIXMAP (25) SC_MARK_FULLRECT (26) SC_MARK_LEFTRECT (27) SC_MARK_AVAILABLE (28) SC_MARK_UNDERLINE (29) SC_MARK_RGBAIMAGE (30) SC_MARK_CHARACTER (10000) =head2 MarkerOutline enumeration SC_MARKNUM_FOLDEREND (25) SC_MARKNUM_FOLDEROPENMID (26) SC_MARKNUM_FOLDERMIDTAIL (27) SC_MARKNUM_FOLDERTAIL (28) SC_MARKNUM_FOLDERSUB (29) SC_MARKNUM_FOLDER (30) SC_MARKNUM_FOLDEROPEN (31) SC_MASK_FOLDERS (0xFE000000) =head2 MarginType enumeration SC_MARGIN_SYMBOL (0) SC_MARGIN_NUMBER (1) SC_MARGIN_BACK (2) SC_MARGIN_FORE (3) SC_MARGIN_TEXT (4) SC_MARGIN_RTEXT (5) =head2 StylesCommon enumeration STYLE_DEFAULT (32) STYLE_LINENUMBER (33) STYLE_BRACELIGHT (34) STYLE_BRACEBAD (35) STYLE_CONTROLCHAR (36) STYLE_INDENTGUIDE (37) STYLE_CALLTIP (38) STYLE_LASTPREDEFINED (39) STYLE_MAX (255) =head2 CharacterSet enumeration SC_CHARSET_ANSI (0) SC_CHARSET_DEFAULT (1) SC_CHARSET_BALTIC (186) SC_CHARSET_CHINESEBIG5 (136) SC_CHARSET_EASTEUROPE (238) SC_CHARSET_GB2312 (134) SC_CHARSET_GREEK (161) SC_CHARSET_HANGUL (129) SC_CHARSET_MAC (77) SC_CHARSET_OEM (255) SC_CHARSET_RUSSIAN (204) SC_CHARSET_CYRILLIC (1251) SC_CHARSET_SHIFTJIS (128) SC_CHARSET_SYMBOL (2) SC_CHARSET_TURKISH (162) SC_CHARSET_JOHAB (130) SC_CHARSET_HEBREW (177) SC_CHARSET_ARABIC (178) SC_CHARSET_VIETNAMESE (163) SC_CHARSET_THAI (222) SC_CHARSET_8859_15 (1000) =head2 CaseVisible enumeration SC_CASE_MIXED (0) SC_CASE_UPPER (1) SC_CASE_LOWER (2) SC_FONT_SIZE_MULTIPLIER (100) =head2 FontWeight enumeration SC_WEIGHT_NORMAL (400) SC_WEIGHT_SEMIBOLD (600) SC_WEIGHT_BOLD (700) =head2 IndicatorStyle enumeration INDIC_PLAIN (0) INDIC_SQUIGGLE (1) INDIC_TT (2) INDIC_DIAGONAL (3) INDIC_STRIKE (4) INDIC_HIDDEN (5) INDIC_BOX (6) INDIC_ROUNDBOX (7) INDIC_STRAIGHTBOX (8) INDIC_DASH (9) INDIC_DOTS (10) INDIC_SQUIGGLELOW (11) INDIC_DOTBOX (12) INDIC_MAX (31) INDIC_CONTAINER (8) INDIC0_MASK (0x20) INDIC1_MASK (0x40) INDIC2_MASK (0x80) INDICS_MASK (0xE0) =head2 IndentView enumeration SC_IV_NONE (0) SC_IV_REAL (1) SC_IV_LOOKFORWARD (2) SC_IV_LOOKBOTH (3) =head2 PrintOption enumeration SC_PRINT_NORMAL (0) PrintColourMode - invert the light value of each style for printing. SC_PRINT_INVERTLIGHT (1) PrintColourMode - force black text on white background for printing. SC_PRINT_BLACKONWHITE (2) PrintColourMode - text stays coloured, but all background is forced to be white for printing. SC_PRINT_COLOURONWHITE (3) PrintColourMode - only the default-background is forced to be white for printing. SC_PRINT_COLOURONWHITEDEFAULTBG (4) =head2 FindOption enumeration SCFIND_WHOLEWORD (2) SCFIND_MATCHCASE (4) SCFIND_WORDSTART (0x00100000) SCFIND_REGEXP (0x00200000) SCFIND_POSIX (0x00400000) =head2 FoldLevel enumeration SC_FOLDLEVELBASE (0x400) SC_FOLDLEVELWHITEFLAG (0x1000) SC_FOLDLEVELHEADERFLAG (0x2000) SC_FOLDLEVELNUMBERMASK (0x0FFF) =head2 FoldFlag enumeration SC_FOLDFLAG_LINEBEFORE_EXPANDED (0x0002) SC_FOLDFLAG_LINEBEFORE_CONTRACTED (0x0004) SC_FOLDFLAG_LINEAFTER_EXPANDED (0x0008) SC_FOLDFLAG_LINEAFTER_CONTRACTED (0x0010) SC_FOLDFLAG_LEVELNUMBERS (0x0040) SC_TIME_FOREVER (10000000) =head2 Wrap enumeration SC_WRAP_NONE (0) SC_WRAP_WORD (1) SC_WRAP_CHAR (2) =head2 WrapVisualFlag enumeration SC_WRAPVISUALFLAG_NONE (0x0000) SC_WRAPVISUALFLAG_END (0x0001) SC_WRAPVISUALFLAG_START (0x0002) =head2 WrapVisualLocation enumeration SC_WRAPVISUALFLAGLOC_DEFAULT (0x0000) SC_WRAPVISUALFLAGLOC_END_BY_TEXT (0x0001) SC_WRAPVISUALFLAGLOC_START_BY_TEXT (0x0002) =head2 WrapIndentMode enumeration SC_WRAPINDENT_FIXED (0) SC_WRAPINDENT_SAME (1) SC_WRAPINDENT_INDENT (2) =head2 LineCache enumeration SC_CACHE_NONE (0) SC_CACHE_CARET (1) SC_CACHE_PAGE (2) SC_CACHE_DOCUMENT (3) =head2 FontQuality enumeration SC_EFF_QUALITY_MASK (0xF) SC_EFF_QUALITY_DEFAULT (0) SC_EFF_QUALITY_NON_ANTIALIASED (1) SC_EFF_QUALITY_ANTIALIASED (2) SC_EFF_QUALITY_LCD_OPTIMIZED (3) =head2 MultiPaste enumeration SC_MULTIPASTE_ONCE (0) SC_MULTIPASTE_EACH (1) =head2 EdgeVisualStyle enumeration EDGE_NONE (0) EDGE_LINE (1) EDGE_BACKGROUND (2) =head2 Status enumeration SC_STATUS_OK (0) SC_STATUS_FAILURE (1) SC_STATUS_BADALLOC (2) =head2 CursorShape enumeration SC_CURSORNORMAL (-1) SC_CURSORARROW (2) SC_CURSORWAIT (4) SC_CURSORREVERSEARROW (7) Constants for use with SetVisiblePolicy, similar to SetCaretPolicy. VISIBLE_SLOP (0x01) VISIBLE_STRICT (0x04) =head2 CaretPolicy enumeration CARET_SLOP (0x01) If CARET_STRICT is set, the policy is enforced... strictly.The caret is centred on the display if slop is not set,and cannot go in the UZ if slop is set. CARET_STRICT (0x04) If CARET_JUMPS is set, the display is moved more energeticallyso the caret can move in the same direction longer before the policy is applied again. CARET_JUMPS (0x10) If CARET_EVEN is not set, instead of having symmetrical UZs,the left and bottom UZs are extended up to right and top UZs respectively.This way, we favour the displaying of useful information: the begining of lines,where most code reside, and the lines after the caret, eg. the body of a function. CARET_EVEN (0x08) =head2 SelectionMode enumeration SC_SEL_STREAM (0) SC_SEL_RECTANGLE (1) SC_SEL_LINES (2) SC_SEL_THIN (3) =head2 CaretSticky enumeration SC_CARETSTICKY_OFF (0) SC_CARETSTICKY_ON (1) SC_CARETSTICKY_WHITESPACE (2) SC_ALPHA_TRANSPARENT (0) SC_ALPHA_OPAQUE (255) SC_ALPHA_NOALPHA (256) =head2 CaretStyle enumeration CARETSTYLE_INVISIBLE (0) CARETSTYLE_LINE (1) CARETSTYLE_BLOCK (2) =head2 MarginOption enumeration SC_MARGINOPTION_NONE (0) SC_MARGINOPTION_SUBLINESELECT (1) =head2 AnnotationVisible enumeration ANNOTATION_HIDDEN (0) ANNOTATION_STANDARD (1) ANNOTATION_BOXED (2) UNDO_MAY_COALESCE (1) =head2 VirtualSpace enumeration SCVS_NONE (0) SCVS_RECTANGULARSELECTION (1) SCVS_USERACCESSIBLE (2) SC_TECHNOLOGY_DEFAULT (0) SC_TECHNOLOGY_DIRECTWRITE (1) Maximum value of keywordSet parameter of SetKeyWords. KEYWORDSET_MAX (8) =head2 TypeProperty enumeration SC_TYPE_BOOLEAN (0) SC_TYPE_INTEGER (1) SC_TYPE_STRING (2) NotificationsType of modification and the action which caused the modification.These are defined as a bit mask to make it easy to specify which notifications are wanted.One bit is set from each of SC_MOD_* and SC_PERFORMED_*. SC_MOD_INSERTTEXT (0x1) SC_MOD_DELETETEXT (0x2) SC_MOD_CHANGESTYLE (0x4) SC_MOD_CHANGEFOLD (0x8) SC_PERFORMED_USER (0x10) SC_PERFORMED_UNDO (0x20) SC_PERFORMED_REDO (0x40) SC_MULTISTEPUNDOREDO (0x80) SC_LASTSTEPINUNDOREDO (0x100) SC_MOD_CHANGEMARKER (0x200) SC_MOD_BEFOREINSERT (0x400) SC_MOD_BEFOREDELETE (0x800) SC_MULTILINEUNDOREDO (0x1000) SC_STARTACTION (0x2000) SC_MOD_CHANGEINDICATOR (0x4000) SC_MOD_CHANGELINESTATE (0x8000) SC_MOD_CHANGEMARGIN (0x10000) SC_MOD_CHANGEANNOTATION (0x20000) SC_MOD_CONTAINER (0x40000) SC_MOD_LEXERSTATE (0x80000) SC_MODEVENTMASKALL (0xFFFFF) =head2 Update enumeration SC_UPDATE_CONTENT (0x1) SC_UPDATE_SELECTION (0x2) SC_UPDATE_V_SCROLL (0x4) SC_UPDATE_H_SCROLL (0x8) For compatibility, these go through the COMMAND notification rather than NOTIFYand should have had exactly the same values as the EN_* constants.Unfortunately the SETFOCUS and KILLFOCUS are flipped over from EN_*As clients depend on these constants, this will not be changed. SCEN_CHANGE (768) SCEN_SETFOCUS (512) SCEN_KILLFOCUS (256) =head2 Keys enumeration SCK_DOWN (300) SCK_UP (301) SCK_LEFT (302) SCK_RIGHT (303) SCK_HOME (304) SCK_END (305) SCK_PRIOR (306) SCK_NEXT (307) SCK_DELETE (308) SCK_INSERT (309) SCK_ESCAPE (7) SCK_BACK (8) SCK_TAB (9) SCK_RETURN (13) SCK_ADD (310) SCK_SUBTRACT (311) SCK_DIVIDE (312) SCK_WIN (313) SCK_RWIN (314) SCK_MENU (315) =head2 KeyMod enumeration SCMOD_NORM (0) SCMOD_SHIFT (1) SCMOD_CTRL (2) SCMOD_ALT (4) SCMOD_SUPER (8) SCMOD_META (16) =head2 Lexer enumeration SCLEX_CONTAINER (0) SCLEX_NULL (1) SCLEX_PYTHON (2) SCLEX_CPP (3) SCLEX_HTML (4) SCLEX_XML (5) SCLEX_PERL (6) SCLEX_SQL (7) SCLEX_VB (8) SCLEX_PROPERTIES (9) SCLEX_ERRORLIST (10) SCLEX_MAKEFILE (11) SCLEX_BATCH (12) SCLEX_XCODE (13) SCLEX_LATEX (14) SCLEX_LUA (15) SCLEX_DIFF (16) SCLEX_CONF (17) SCLEX_PASCAL (18) SCLEX_AVE (19) SCLEX_ADA (20) SCLEX_LISP (21) SCLEX_RUBY (22) SCLEX_EIFFEL (23) SCLEX_EIFFELKW (24) SCLEX_TCL (25) SCLEX_NNCRONTAB (26) SCLEX_BULLANT (27) SCLEX_VBSCRIPT (28) SCLEX_BAAN (31) SCLEX_MATLAB (32) SCLEX_SCRIPTOL (33) SCLEX_ASM (34) SCLEX_CPPNOCASE (35) SCLEX_FORTRAN (36) SCLEX_F77 (37) SCLEX_CSS (38) SCLEX_POV (39) SCLEX_LOUT (40) SCLEX_ESCRIPT (41) SCLEX_PS (42) SCLEX_NSIS (43) SCLEX_MMIXAL (44) SCLEX_CLW (45) SCLEX_CLWNOCASE (46) SCLEX_LOT (47) SCLEX_YAML (48) SCLEX_TEX (49) SCLEX_METAPOST (50) SCLEX_POWERBASIC (51) SCLEX_FORTH (52) SCLEX_ERLANG (53) SCLEX_OCTAVE (54) SCLEX_MSSQL (55) SCLEX_VERILOG (56) SCLEX_KIX (57) SCLEX_GUI4CLI (58) SCLEX_SPECMAN (59) SCLEX_AU3 (60) SCLEX_APDL (61) SCLEX_BASH (62) SCLEX_ASN1 (63) SCLEX_VHDL (64) SCLEX_CAML (65) SCLEX_BLITZBASIC (66) SCLEX_PUREBASIC (67) SCLEX_HASKELL (68) SCLEX_PHPSCRIPT (69) SCLEX_TADS3 (70) SCLEX_REBOL (71) SCLEX_SMALLTALK (72) SCLEX_FLAGSHIP (73) SCLEX_CSOUND (74) SCLEX_FREEBASIC (75) SCLEX_INNOSETUP (76) SCLEX_OPAL (77) SCLEX_SPICE (78) SCLEX_D (79) SCLEX_CMAKE (80) SCLEX_GAP (81) SCLEX_PLM (82) SCLEX_PROGRESS (83) SCLEX_ABAQUS (84) SCLEX_ASYMPTOTE (85) SCLEX_R (86) SCLEX_MAGIK (87) SCLEX_POWERSHELL (88) SCLEX_MYSQL (89) SCLEX_PO (90) SCLEX_TAL (91) SCLEX_COBOL (92) SCLEX_TACL (93) SCLEX_SORCUS (94) SCLEX_POWERPRO (95) SCLEX_NIMROD (96) SCLEX_SML (97) SCLEX_MARKDOWN (98) SCLEX_TXT2TAGS (99) SCLEX_A68K (100) SCLEX_MODULA (101) SCLEX_COFFEESCRIPT (102) SCLEX_TCMD (103) SCLEX_AVS (104) SCLEX_ECL (105) When a lexer specifies its language as SCLEX_AUTOMATIC it receives avalue assigned in sequence from SCLEX_AUTOMATIC+1. SCLEX_AUTOMATIC (1000) =head2 Lexical states for SCLEX_PYTHON SCE_P_DEFAULT (0) SCE_P_COMMENTLINE (1) SCE_P_NUMBER (2) SCE_P_STRING (3) SCE_P_CHARACTER (4) SCE_P_WORD (5) SCE_P_TRIPLE (6) SCE_P_TRIPLEDOUBLE (7) SCE_P_CLASSNAME (8) SCE_P_DEFNAME (9) SCE_P_OPERATOR (10) SCE_P_IDENTIFIER (11) SCE_P_COMMENTBLOCK (12) SCE_P_STRINGEOL (13) SCE_P_WORD2 (14) SCE_P_DECORATOR (15) =head2 Lexical states for SCLEX_CPP SCE_C_DEFAULT (0) SCE_C_COMMENT (1) SCE_C_COMMENTLINE (2) SCE_C_COMMENTDOC (3) SCE_C_NUMBER (4) SCE_C_WORD (5) SCE_C_STRING (6) SCE_C_CHARACTER (7) SCE_C_UUID (8) SCE_C_PREPROCESSOR (9) SCE_C_OPERATOR (10) SCE_C_IDENTIFIER (11) SCE_C_STRINGEOL (12) SCE_C_VERBATIM (13) SCE_C_REGEX (14) SCE_C_COMMENTLINEDOC (15) SCE_C_WORD2 (16) SCE_C_COMMENTDOCKEYWORD (17) SCE_C_COMMENTDOCKEYWORDERROR (18) SCE_C_GLOBALCLASS (19) SCE_C_STRINGRAW (20) SCE_C_TRIPLEVERBATIM (21) SCE_C_HASHQUOTEDSTRING (22) =head2 Lexical states for SCLEX_D SCE_D_DEFAULT (0) SCE_D_COMMENT (1) SCE_D_COMMENTLINE (2) SCE_D_COMMENTDOC (3) SCE_D_COMMENTNESTED (4) SCE_D_NUMBER (5) SCE_D_WORD (6) SCE_D_WORD2 (7) SCE_D_WORD3 (8) SCE_D_TYPEDEF (9) SCE_D_STRING (10) SCE_D_STRINGEOL (11) SCE_D_CHARACTER (12) SCE_D_OPERATOR (13) SCE_D_IDENTIFIER (14) SCE_D_COMMENTLINEDOC (15) SCE_D_COMMENTDOCKEYWORD (16) SCE_D_COMMENTDOCKEYWORDERROR (17) SCE_D_STRINGB (18) SCE_D_STRINGR (19) SCE_D_WORD5 (20) SCE_D_WORD6 (21) SCE_D_WORD7 (22) =head2 Lexical states for SCLEX_TCL SCE_TCL_DEFAULT (0) SCE_TCL_COMMENT (1) SCE_TCL_COMMENTLINE (2) SCE_TCL_NUMBER (3) SCE_TCL_WORD_IN_QUOTE (4) SCE_TCL_IN_QUOTE (5) SCE_TCL_OPERATOR (6) SCE_TCL_IDENTIFIER (7) SCE_TCL_SUBSTITUTION (8) SCE_TCL_SUB_BRACE (9) SCE_TCL_MODIFIER (10) SCE_TCL_EXPAND (11) SCE_TCL_WORD (12) SCE_TCL_WORD2 (13) SCE_TCL_WORD3 (14) SCE_TCL_WORD4 (15) SCE_TCL_WORD5 (16) SCE_TCL_WORD6 (17) SCE_TCL_WORD7 (18) SCE_TCL_WORD8 (19) SCE_TCL_COMMENT_BOX (20) SCE_TCL_BLOCK_COMMENT (21) =head2 Lexical states for SCLEX_HTML, SCLEX_XML SCE_H_DEFAULT (0) SCE_H_TAG (1) SCE_H_TAGUNKNOWN (2) SCE_H_ATTRIBUTE (3) SCE_H_ATTRIBUTEUNKNOWN (4) SCE_H_NUMBER (5) SCE_H_DOUBLESTRING (6) SCE_H_SINGLESTRING (7) SCE_H_OTHER (8) SCE_H_COMMENT (9) SCE_H_ENTITY (10) XML and ASP SCE_H_TAGEND (11) SCE_H_XMLSTART (12) SCE_H_XMLEND (13) SCE_H_SCRIPT (14) SCE_H_ASP (15) SCE_H_ASPAT (16) SCE_H_CDATA (17) SCE_H_QUESTION (18) More HTML SCE_H_VALUE (19) X-Code SCE_H_XCCOMMENT (20) SGML SCE_H_SGML_DEFAULT (21) SCE_H_SGML_COMMAND (22) SCE_H_SGML_1ST_PARAM (23) SCE_H_SGML_DOUBLESTRING (24) SCE_H_SGML_SIMPLESTRING (25) SCE_H_SGML_ERROR (26) SCE_H_SGML_SPECIAL (27) SCE_H_SGML_ENTITY (28) SCE_H_SGML_COMMENT (29) SCE_H_SGML_1ST_PARAM_COMMENT (30) SCE_H_SGML_BLOCK_DEFAULT (31) Embedded Javascript SCE_HJ_START (40) SCE_HJ_DEFAULT (41) SCE_HJ_COMMENT (42) SCE_HJ_COMMENTLINE (43) SCE_HJ_COMMENTDOC (44) SCE_HJ_NUMBER (45) SCE_HJ_WORD (46) SCE_HJ_KEYWORD (47) SCE_HJ_DOUBLESTRING (48) SCE_HJ_SINGLESTRING (49) SCE_HJ_SYMBOLS (50) SCE_HJ_STRINGEOL (51) SCE_HJ_REGEX (52) ASP Javascript SCE_HJA_START (55) SCE_HJA_DEFAULT (56) SCE_HJA_COMMENT (57) SCE_HJA_COMMENTLINE (58) SCE_HJA_COMMENTDOC (59) SCE_HJA_NUMBER (60) SCE_HJA_WORD (61) SCE_HJA_KEYWORD (62) SCE_HJA_DOUBLESTRING (63) SCE_HJA_SINGLESTRING (64) SCE_HJA_SYMBOLS (65) SCE_HJA_STRINGEOL (66) SCE_HJA_REGEX (67) Embedded VBScript SCE_HB_START (70) SCE_HB_DEFAULT (71) SCE_HB_COMMENTLINE (72) SCE_HB_NUMBER (73) SCE_HB_WORD (74) SCE_HB_STRING (75) SCE_HB_IDENTIFIER (76) SCE_HB_STRINGEOL (77) ASP VBScript SCE_HBA_START (80) SCE_HBA_DEFAULT (81) SCE_HBA_COMMENTLINE (82) SCE_HBA_NUMBER (83) SCE_HBA_WORD (84) SCE_HBA_STRING (85) SCE_HBA_IDENTIFIER (86) SCE_HBA_STRINGEOL (87) Embedded Python SCE_HP_START (90) SCE_HP_DEFAULT (91) SCE_HP_COMMENTLINE (92) SCE_HP_NUMBER (93) SCE_HP_STRING (94) SCE_HP_CHARACTER (95) SCE_HP_WORD (96) SCE_HP_TRIPLE (97) SCE_HP_TRIPLEDOUBLE (98) SCE_HP_CLASSNAME (99) SCE_HP_DEFNAME (100) SCE_HP_OPERATOR (101) SCE_HP_IDENTIFIER (102) PHP SCE_HPHP_COMPLEX_VARIABLE (104) ASP Python SCE_HPA_START (105) SCE_HPA_DEFAULT (106) SCE_HPA_COMMENTLINE (107) SCE_HPA_NUMBER (108) SCE_HPA_STRING (109) SCE_HPA_CHARACTER (110) SCE_HPA_WORD (111) SCE_HPA_TRIPLE (112) SCE_HPA_TRIPLEDOUBLE (113) SCE_HPA_CLASSNAME (114) SCE_HPA_DEFNAME (115) SCE_HPA_OPERATOR (116) SCE_HPA_IDENTIFIER (117) PHP SCE_HPHP_DEFAULT (118) SCE_HPHP_HSTRING (119) SCE_HPHP_SIMPLESTRING (120) SCE_HPHP_WORD (121) SCE_HPHP_NUMBER (122) SCE_HPHP_VARIABLE (123) SCE_HPHP_COMMENT (124) SCE_HPHP_COMMENTLINE (125) SCE_HPHP_HSTRING_VARIABLE (126) SCE_HPHP_OPERATOR (127) =head2 Lexical states for SCLEX_PERL SCE_PL_DEFAULT (0) SCE_PL_ERROR (1) SCE_PL_COMMENTLINE (2) SCE_PL_POD (3) SCE_PL_NUMBER (4) SCE_PL_WORD (5) SCE_PL_STRING (6) SCE_PL_CHARACTER (7) SCE_PL_PUNCTUATION (8) SCE_PL_PREPROCESSOR (9) SCE_PL_OPERATOR (10) SCE_PL_IDENTIFIER (11) SCE_PL_SCALAR (12) SCE_PL_ARRAY (13) SCE_PL_HASH (14) SCE_PL_SYMBOLTABLE (15) SCE_PL_VARIABLE_INDEXER (16) SCE_PL_REGEX (17) SCE_PL_REGSUBST (18) SCE_PL_LONGQUOTE (19) SCE_PL_BACKTICKS (20) SCE_PL_DATASECTION (21) SCE_PL_HERE_DELIM (22) SCE_PL_HERE_Q (23) SCE_PL_HERE_QQ (24) SCE_PL_HERE_QX (25) SCE_PL_STRING_Q (26) SCE_PL_STRING_QQ (27) SCE_PL_STRING_QX (28) SCE_PL_STRING_QR (29) SCE_PL_STRING_QW (30) SCE_PL_POD_VERB (31) SCE_PL_SUB_PROTOTYPE (40) SCE_PL_FORMAT_IDENT (41) SCE_PL_FORMAT (42) SCE_PL_STRING_VAR (43) SCE_PL_XLAT (44) SCE_PL_REGEX_VAR (54) SCE_PL_REGSUBST_VAR (55) SCE_PL_BACKTICKS_VAR (57) SCE_PL_HERE_QQ_VAR (61) SCE_PL_HERE_QX_VAR (62) SCE_PL_STRING_QQ_VAR (64) SCE_PL_STRING_QX_VAR (65) SCE_PL_STRING_QR_VAR (66) =head2 Lexical states for SCLEX_RUBY SCE_RB_DEFAULT (0) SCE_RB_ERROR (1) SCE_RB_COMMENTLINE (2) SCE_RB_POD (3) SCE_RB_NUMBER (4) SCE_RB_WORD (5) SCE_RB_STRING (6) SCE_RB_CHARACTER (7) SCE_RB_CLASSNAME (8) SCE_RB_DEFNAME (9) SCE_RB_OPERATOR (10) SCE_RB_IDENTIFIER (11) SCE_RB_REGEX (12) SCE_RB_GLOBAL (13) SCE_RB_SYMBOL (14) SCE_RB_MODULE_NAME (15) SCE_RB_INSTANCE_VAR (16) SCE_RB_CLASS_VAR (17) SCE_RB_BACKTICKS (18) SCE_RB_DATASECTION (19) SCE_RB_HERE_DELIM (20) SCE_RB_HERE_Q (21) SCE_RB_HERE_QQ (22) SCE_RB_HERE_QX (23) SCE_RB_STRING_Q (24) SCE_RB_STRING_QQ (25) SCE_RB_STRING_QX (26) SCE_RB_STRING_QR (27) SCE_RB_STRING_QW (28) SCE_RB_WORD_DEMOTED (29) SCE_RB_STDIN (30) SCE_RB_STDOUT (31) SCE_RB_STDERR (40) SCE_RB_UPPER_BOUND (41) =head2 Lexical states for SCLEX_VB, SCLEX_VBSCRIPT, SCLEX_POWERBASIC SCE_B_DEFAULT (0) SCE_B_COMMENT (1) SCE_B_NUMBER (2) SCE_B_KEYWORD (3) SCE_B_STRING (4) SCE_B_PREPROCESSOR (5) SCE_B_OPERATOR (6) SCE_B_IDENTIFIER (7) SCE_B_DATE (8) SCE_B_STRINGEOL (9) SCE_B_KEYWORD2 (10) SCE_B_KEYWORD3 (11) SCE_B_KEYWORD4 (12) SCE_B_CONSTANT (13) SCE_B_ASM (14) SCE_B_LABEL (15) SCE_B_ERROR (16) SCE_B_HEXNUMBER (17) SCE_B_BINNUMBER (18) =head2 Lexical states for SCLEX_PROPERTIES SCE_PROPS_DEFAULT (0) SCE_PROPS_COMMENT (1) SCE_PROPS_SECTION (2) SCE_PROPS_ASSIGNMENT (3) SCE_PROPS_DEFVAL (4) SCE_PROPS_KEY (5) =head2 Lexical states for SCLEX_LATEX SCE_L_DEFAULT (0) SCE_L_COMMAND (1) SCE_L_TAG (2) SCE_L_MATH (3) SCE_L_COMMENT (4) SCE_L_TAG2 (5) SCE_L_MATH2 (6) SCE_L_COMMENT2 (7) SCE_L_VERBATIM (8) SCE_L_SHORTCMD (9) SCE_L_SPECIAL (10) SCE_L_CMDOPT (11) SCE_L_ERROR (12) =head2 Lexical states for SCLEX_LUA SCE_LUA_DEFAULT (0) SCE_LUA_COMMENT (1) SCE_LUA_COMMENTLINE (2) SCE_LUA_COMMENTDOC (3) SCE_LUA_NUMBER (4) SCE_LUA_WORD (5) SCE_LUA_STRING (6) SCE_LUA_CHARACTER (7) SCE_LUA_LITERALSTRING (8) SCE_LUA_PREPROCESSOR (9) SCE_LUA_OPERATOR (10) SCE_LUA_IDENTIFIER (11) SCE_LUA_STRINGEOL (12) SCE_LUA_WORD2 (13) SCE_LUA_WORD3 (14) SCE_LUA_WORD4 (15) SCE_LUA_WORD5 (16) SCE_LUA_WORD6 (17) SCE_LUA_WORD7 (18) SCE_LUA_WORD8 (19) SCE_LUA_LABEL (20) =head2 Lexical states for SCLEX_ERRORLIST SCE_ERR_DEFAULT (0) SCE_ERR_PYTHON (1) SCE_ERR_GCC (2) SCE_ERR_MS (3) SCE_ERR_CMD (4) SCE_ERR_BORLAND (5) SCE_ERR_PERL (6) SCE_ERR_NET (7) SCE_ERR_LUA (8) SCE_ERR_CTAG (9) SCE_ERR_DIFF_CHANGED (10) SCE_ERR_DIFF_ADDITION (11) SCE_ERR_DIFF_DELETION (12) SCE_ERR_DIFF_MESSAGE (13) SCE_ERR_PHP (14) SCE_ERR_ELF (15) SCE_ERR_IFC (16) SCE_ERR_IFORT (17) SCE_ERR_ABSF (18) SCE_ERR_TIDY (19) SCE_ERR_JAVA_STACK (20) SCE_ERR_VALUE (21) =head2 Lexical states for SCLEX_BATCH SCE_BAT_DEFAULT (0) SCE_BAT_COMMENT (1) SCE_BAT_WORD (2) SCE_BAT_LABEL (3) SCE_BAT_HIDE (4) SCE_BAT_COMMAND (5) SCE_BAT_IDENTIFIER (6) SCE_BAT_OPERATOR (7) =head2 Lexical states for SCLEX_TCMD SCE_TCMD_DEFAULT (0) SCE_TCMD_COMMENT (1) SCE_TCMD_WORD (2) SCE_TCMD_LABEL (3) SCE_TCMD_HIDE (4) SCE_TCMD_COMMAND (5) SCE_TCMD_IDENTIFIER (6) SCE_TCMD_OPERATOR (7) SCE_TCMD_ENVIRONMENT (8) SCE_TCMD_EXPANSION (9) SCE_TCMD_CLABEL (10) =head2 Lexical states for SCLEX_MAKEFILE SCE_MAKE_DEFAULT (0) SCE_MAKE_COMMENT (1) SCE_MAKE_PREPROCESSOR (2) SCE_MAKE_IDENTIFIER (3) SCE_MAKE_OPERATOR (4) SCE_MAKE_TARGET (5) SCE_MAKE_IDEOL (9) =head2 Lexical states for SCLEX_DIFF SCE_DIFF_DEFAULT (0) SCE_DIFF_COMMENT (1) SCE_DIFF_COMMAND (2) SCE_DIFF_HEADER (3) SCE_DIFF_POSITION (4) SCE_DIFF_DELETED (5) SCE_DIFF_ADDED (6) SCE_DIFF_CHANGED (7) =head2 Lexical states for SCLEX_CONF (Apache Configuration Files Lexer) SCE_CONF_DEFAULT (0) SCE_CONF_COMMENT (1) SCE_CONF_NUMBER (2) SCE_CONF_IDENTIFIER (3) SCE_CONF_EXTENSION (4) SCE_CONF_PARAMETER (5) SCE_CONF_STRING (6) SCE_CONF_OPERATOR (7) SCE_CONF_IP (8) SCE_CONF_DIRECTIVE (9) =head2 Lexical states for SCLEX_AVE, Avenue SCE_AVE_DEFAULT (0) SCE_AVE_COMMENT (1) SCE_AVE_NUMBER (2) SCE_AVE_WORD (3) SCE_AVE_STRING (6) SCE_AVE_ENUM (7) SCE_AVE_STRINGEOL (8) SCE_AVE_IDENTIFIER (9) SCE_AVE_OPERATOR (10) SCE_AVE_WORD1 (11) SCE_AVE_WORD2 (12) SCE_AVE_WORD3 (13) SCE_AVE_WORD4 (14) SCE_AVE_WORD5 (15) SCE_AVE_WORD6 (16) =head2 Lexical states for SCLEX_ADA SCE_ADA_DEFAULT (0) SCE_ADA_WORD (1) SCE_ADA_IDENTIFIER (2) SCE_ADA_NUMBER (3) SCE_ADA_DELIMITER (4) SCE_ADA_CHARACTER (5) SCE_ADA_CHARACTEREOL (6) SCE_ADA_STRING (7) SCE_ADA_STRINGEOL (8) SCE_ADA_LABEL (9) SCE_ADA_COMMENTLINE (10) SCE_ADA_ILLEGAL (11) =head2 Lexical states for SCLEX_BAAN SCE_BAAN_DEFAULT (0) SCE_BAAN_COMMENT (1) SCE_BAAN_COMMENTDOC (2) SCE_BAAN_NUMBER (3) SCE_BAAN_WORD (4) SCE_BAAN_STRING (5) SCE_BAAN_PREPROCESSOR (6) SCE_BAAN_OPERATOR (7) SCE_BAAN_IDENTIFIER (8) SCE_BAAN_STRINGEOL (9) SCE_BAAN_WORD2 (10) =head2 Lexical states for SCLEX_LISP SCE_LISP_DEFAULT (0) SCE_LISP_COMMENT (1) SCE_LISP_NUMBER (2) SCE_LISP_KEYWORD (3) SCE_LISP_KEYWORD_KW (4) SCE_LISP_SYMBOL (5) SCE_LISP_STRING (6) SCE_LISP_STRINGEOL (8) SCE_LISP_IDENTIFIER (9) SCE_LISP_OPERATOR (10) SCE_LISP_SPECIAL (11) SCE_LISP_MULTI_COMMENT (12) =head2 Lexical states for SCLEX_EIFFEL and SCLEX_EIFFELKW SCE_EIFFEL_DEFAULT (0) SCE_EIFFEL_COMMENTLINE (1) SCE_EIFFEL_NUMBER (2) SCE_EIFFEL_WORD (3) SCE_EIFFEL_STRING (4) SCE_EIFFEL_CHARACTER (5) SCE_EIFFEL_OPERATOR (6) SCE_EIFFEL_IDENTIFIER (7) SCE_EIFFEL_STRINGEOL (8) =head2 Lexical states for SCLEX_NNCRONTAB (nnCron crontab Lexer) SCE_NNCRONTAB_DEFAULT (0) SCE_NNCRONTAB_COMMENT (1) SCE_NNCRONTAB_TASK (2) SCE_NNCRONTAB_SECTION (3) SCE_NNCRONTAB_KEYWORD (4) SCE_NNCRONTAB_MODIFIER (5) SCE_NNCRONTAB_ASTERISK (6) SCE_NNCRONTAB_NUMBER (7) SCE_NNCRONTAB_STRING (8) SCE_NNCRONTAB_ENVIRONMENT (9) SCE_NNCRONTAB_IDENTIFIER (10) =head2 Lexical states for SCLEX_FORTH (Forth Lexer) SCE_FORTH_DEFAULT (0) SCE_FORTH_COMMENT (1) SCE_FORTH_COMMENT_ML (2) SCE_FORTH_IDENTIFIER (3) SCE_FORTH_CONTROL (4) SCE_FORTH_KEYWORD (5) SCE_FORTH_DEFWORD (6) SCE_FORTH_PREWORD1 (7) SCE_FORTH_PREWORD2 (8) SCE_FORTH_NUMBER (9) SCE_FORTH_STRING (10) SCE_FORTH_LOCALE (11) =head2 Lexical states for SCLEX_MATLAB SCE_MATLAB_DEFAULT (0) SCE_MATLAB_COMMENT (1) SCE_MATLAB_COMMAND (2) SCE_MATLAB_NUMBER (3) SCE_MATLAB_KEYWORD (4) single quoted string SCE_MATLAB_STRING (5) SCE_MATLAB_OPERATOR (6) SCE_MATLAB_IDENTIFIER (7) SCE_MATLAB_DOUBLEQUOTESTRING (8) =head2 Lexical states for SCLEX_SCRIPTOL SCE_SCRIPTOL_DEFAULT (0) SCE_SCRIPTOL_WHITE (1) SCE_SCRIPTOL_COMMENTLINE (2) SCE_SCRIPTOL_PERSISTENT (3) SCE_SCRIPTOL_CSTYLE (4) SCE_SCRIPTOL_COMMENTBLOCK (5) SCE_SCRIPTOL_NUMBER (6) SCE_SCRIPTOL_STRING (7) SCE_SCRIPTOL_CHARACTER (8) SCE_SCRIPTOL_STRINGEOL (9) SCE_SCRIPTOL_KEYWORD (10) SCE_SCRIPTOL_OPERATOR (11) SCE_SCRIPTOL_IDENTIFIER (12) SCE_SCRIPTOL_TRIPLE (13) SCE_SCRIPTOL_CLASSNAME (14) SCE_SCRIPTOL_PREPROCESSOR (15) =head2 Lexical states for SCLEX_ASM SCE_ASM_DEFAULT (0) SCE_ASM_COMMENT (1) SCE_ASM_NUMBER (2) SCE_ASM_STRING (3) SCE_ASM_OPERATOR (4) SCE_ASM_IDENTIFIER (5) SCE_ASM_CPUINSTRUCTION (6) SCE_ASM_MATHINSTRUCTION (7) SCE_ASM_REGISTER (8) SCE_ASM_DIRECTIVE (9) SCE_ASM_DIRECTIVEOPERAND (10) SCE_ASM_COMMENTBLOCK (11) SCE_ASM_CHARACTER (12) SCE_ASM_STRINGEOL (13) SCE_ASM_EXTINSTRUCTION (14) SCE_ASM_COMMENTDIRECTIVE (15) =head2 Lexical states for SCLEX_FORTRAN SCE_F_DEFAULT (0) SCE_F_COMMENT (1) SCE_F_NUMBER (2) SCE_F_STRING1 (3) SCE_F_STRING2 (4) SCE_F_STRINGEOL (5) SCE_F_OPERATOR (6) SCE_F_IDENTIFIER (7) SCE_F_WORD (8) SCE_F_WORD2 (9) SCE_F_WORD3 (10) SCE_F_PREPROCESSOR (11) SCE_F_OPERATOR2 (12) SCE_F_LABEL (13) SCE_F_CONTINUATION (14) =head2 Lexical states for SCLEX_CSS SCE_CSS_DEFAULT (0) SCE_CSS_TAG (1) SCE_CSS_CLASS (2) SCE_CSS_PSEUDOCLASS (3) SCE_CSS_UNKNOWN_PSEUDOCLASS (4) SCE_CSS_OPERATOR (5) SCE_CSS_IDENTIFIER (6) SCE_CSS_UNKNOWN_IDENTIFIER (7) SCE_CSS_VALUE (8) SCE_CSS_COMMENT (9) SCE_CSS_ID (10) SCE_CSS_IMPORTANT (11) SCE_CSS_DIRECTIVE (12) SCE_CSS_DOUBLESTRING (13) SCE_CSS_SINGLESTRING (14) SCE_CSS_IDENTIFIER2 (15) SCE_CSS_ATTRIBUTE (16) SCE_CSS_IDENTIFIER3 (17) SCE_CSS_PSEUDOELEMENT (18) SCE_CSS_EXTENDED_IDENTIFIER (19) SCE_CSS_EXTENDED_PSEUDOCLASS (20) SCE_CSS_EXTENDED_PSEUDOELEMENT (21) SCE_CSS_MEDIA (22) SCE_CSS_VARIABLE (23) =head2 Lexical states for SCLEX_POV SCE_POV_DEFAULT (0) SCE_POV_COMMENT (1) SCE_POV_COMMENTLINE (2) SCE_POV_NUMBER (3) SCE_POV_OPERATOR (4) SCE_POV_IDENTIFIER (5) SCE_POV_STRING (6) SCE_POV_STRINGEOL (7) SCE_POV_DIRECTIVE (8) SCE_POV_BADDIRECTIVE (9) SCE_POV_WORD2 (10) SCE_POV_WORD3 (11) SCE_POV_WORD4 (12) SCE_POV_WORD5 (13) SCE_POV_WORD6 (14) SCE_POV_WORD7 (15) SCE_POV_WORD8 (16) =head2 Lexical states for SCLEX_LOUT SCE_LOUT_DEFAULT (0) SCE_LOUT_COMMENT (1) SCE_LOUT_NUMBER (2) SCE_LOUT_WORD (3) SCE_LOUT_WORD2 (4) SCE_LOUT_WORD3 (5) SCE_LOUT_WORD4 (6) SCE_LOUT_STRING (7) SCE_LOUT_OPERATOR (8) SCE_LOUT_IDENTIFIER (9) SCE_LOUT_STRINGEOL (10) =head2 Lexical states for SCLEX_ESCRIPT SCE_ESCRIPT_DEFAULT (0) SCE_ESCRIPT_COMMENT (1) SCE_ESCRIPT_COMMENTLINE (2) SCE_ESCRIPT_COMMENTDOC (3) SCE_ESCRIPT_NUMBER (4) SCE_ESCRIPT_WORD (5) SCE_ESCRIPT_STRING (6) SCE_ESCRIPT_OPERATOR (7) SCE_ESCRIPT_IDENTIFIER (8) SCE_ESCRIPT_BRACE (9) SCE_ESCRIPT_WORD2 (10) SCE_ESCRIPT_WORD3 (11) =head2 Lexical states for SCLEX_PS SCE_PS_DEFAULT (0) SCE_PS_COMMENT (1) SCE_PS_DSC_COMMENT (2) SCE_PS_DSC_VALUE (3) SCE_PS_NUMBER (4) SCE_PS_NAME (5) SCE_PS_KEYWORD (6) SCE_PS_LITERAL (7) SCE_PS_IMMEVAL (8) SCE_PS_PAREN_ARRAY (9) SCE_PS_PAREN_DICT (10) SCE_PS_PAREN_PROC (11) SCE_PS_TEXT (12) SCE_PS_HEXSTRING (13) SCE_PS_BASE85STRING (14) SCE_PS_BADSTRINGCHAR (15) =head2 Lexical states for SCLEX_NSIS SCE_NSIS_DEFAULT (0) SCE_NSIS_COMMENT (1) SCE_NSIS_STRINGDQ (2) SCE_NSIS_STRINGLQ (3) SCE_NSIS_STRINGRQ (4) SCE_NSIS_FUNCTION (5) SCE_NSIS_VARIABLE (6) SCE_NSIS_LABEL (7) SCE_NSIS_USERDEFINED (8) SCE_NSIS_SECTIONDEF (9) SCE_NSIS_SUBSECTIONDEF (10) SCE_NSIS_IFDEFINEDEF (11) SCE_NSIS_MACRODEF (12) SCE_NSIS_STRINGVAR (13) SCE_NSIS_NUMBER (14) SCE_NSIS_SECTIONGROUP (15) SCE_NSIS_PAGEEX (16) SCE_NSIS_FUNCTIONDEF (17) SCE_NSIS_COMMENTBOX (18) =head2 Lexical states for SCLEX_MMIXAL SCE_MMIXAL_LEADWS (0) SCE_MMIXAL_COMMENT (1) SCE_MMIXAL_LABEL (2) SCE_MMIXAL_OPCODE (3) SCE_MMIXAL_OPCODE_PRE (4) SCE_MMIXAL_OPCODE_VALID (5) SCE_MMIXAL_OPCODE_UNKNOWN (6) SCE_MMIXAL_OPCODE_POST (7) SCE_MMIXAL_OPERANDS (8) SCE_MMIXAL_NUMBER (9) SCE_MMIXAL_REF (10) SCE_MMIXAL_CHAR (11) SCE_MMIXAL_STRING (12) SCE_MMIXAL_REGISTER (13) SCE_MMIXAL_HEX (14) SCE_MMIXAL_OPERATOR (15) SCE_MMIXAL_SYMBOL (16) SCE_MMIXAL_INCLUDE (17) =head2 Lexical states for SCLEX_CLW SCE_CLW_DEFAULT (0) SCE_CLW_LABEL (1) SCE_CLW_COMMENT (2) SCE_CLW_STRING (3) SCE_CLW_USER_IDENTIFIER (4) SCE_CLW_INTEGER_CONSTANT (5) SCE_CLW_REAL_CONSTANT (6) SCE_CLW_PICTURE_STRING (7) SCE_CLW_KEYWORD (8) SCE_CLW_COMPILER_DIRECTIVE (9) SCE_CLW_RUNTIME_EXPRESSIONS (10) SCE_CLW_BUILTIN_PROCEDURES_FUNCTION (11) SCE_CLW_STRUCTURE_DATA_TYPE (12) SCE_CLW_ATTRIBUTE (13) SCE_CLW_STANDARD_EQUATE (14) SCE_CLW_ERROR (15) SCE_CLW_DEPRECATED (16) =head2 Lexical states for SCLEX_LOT SCE_LOT_DEFAULT (0) SCE_LOT_HEADER (1) SCE_LOT_BREAK (2) SCE_LOT_SET (3) SCE_LOT_PASS (4) SCE_LOT_FAIL (5) SCE_LOT_ABORT (6) =head2 Lexical states for SCLEX_YAML SCE_YAML_DEFAULT (0) SCE_YAML_COMMENT (1) SCE_YAML_IDENTIFIER (2) SCE_YAML_KEYWORD (3) SCE_YAML_NUMBER (4) SCE_YAML_REFERENCE (5) SCE_YAML_DOCUMENT (6) SCE_YAML_TEXT (7) SCE_YAML_ERROR (8) SCE_YAML_OPERATOR (9) =head2 Lexical states for SCLEX_TEX SCE_TEX_DEFAULT (0) SCE_TEX_SPECIAL (1) SCE_TEX_GROUP (2) SCE_TEX_SYMBOL (3) SCE_TEX_COMMAND (4) SCE_TEX_TEXT (5) SCE_METAPOST_DEFAULT (0) SCE_METAPOST_SPECIAL (1) SCE_METAPOST_GROUP (2) SCE_METAPOST_SYMBOL (3) SCE_METAPOST_COMMAND (4) SCE_METAPOST_TEXT (5) SCE_METAPOST_EXTRA (6) =head2 Lexical states for SCLEX_ERLANG SCE_ERLANG_DEFAULT (0) SCE_ERLANG_COMMENT (1) SCE_ERLANG_VARIABLE (2) SCE_ERLANG_NUMBER (3) SCE_ERLANG_KEYWORD (4) SCE_ERLANG_STRING (5) SCE_ERLANG_OPERATOR (6) SCE_ERLANG_ATOM (7) SCE_ERLANG_FUNCTION_NAME (8) SCE_ERLANG_CHARACTER (9) SCE_ERLANG_MACRO (10) SCE_ERLANG_RECORD (11) SCE_ERLANG_PREPROC (12) SCE_ERLANG_NODE_NAME (13) SCE_ERLANG_COMMENT_FUNCTION (14) SCE_ERLANG_COMMENT_MODULE (15) SCE_ERLANG_COMMENT_DOC (16) SCE_ERLANG_COMMENT_DOC_MACRO (17) SCE_ERLANG_ATOM_QUOTED (18) SCE_ERLANG_MACRO_QUOTED (19) SCE_ERLANG_RECORD_QUOTED (20) SCE_ERLANG_NODE_NAME_QUOTED (21) SCE_ERLANG_BIFS (22) SCE_ERLANG_MODULES (23) SCE_ERLANG_MODULES_ATT (24) SCE_ERLANG_UNKNOWN (31) =head2 Lexical states for SCLEX_MSSQL SCE_MSSQL_DEFAULT (0) SCE_MSSQL_COMMENT (1) SCE_MSSQL_LINE_COMMENT (2) SCE_MSSQL_NUMBER (3) SCE_MSSQL_STRING (4) SCE_MSSQL_OPERATOR (5) SCE_MSSQL_IDENTIFIER (6) SCE_MSSQL_VARIABLE (7) SCE_MSSQL_COLUMN_NAME (8) SCE_MSSQL_STATEMENT (9) SCE_MSSQL_DATATYPE (10) SCE_MSSQL_SYSTABLE (11) SCE_MSSQL_GLOBAL_VARIABLE (12) SCE_MSSQL_FUNCTION (13) SCE_MSSQL_STORED_PROCEDURE (14) SCE_MSSQL_DEFAULT_PREF_DATATYPE (15) SCE_MSSQL_COLUMN_NAME_2 (16) =head2 Lexical states for SCLEX_VERILOG SCE_V_DEFAULT (0) SCE_V_COMMENT (1) SCE_V_COMMENTLINE (2) SCE_V_COMMENTLINEBANG (3) SCE_V_NUMBER (4) SCE_V_WORD (5) SCE_V_STRING (6) SCE_V_WORD2 (7) SCE_V_WORD3 (8) SCE_V_PREPROCESSOR (9) SCE_V_OPERATOR (10) SCE_V_IDENTIFIER (11) SCE_V_STRINGEOL (12) SCE_V_USER (19) =head2 Lexical states for SCLEX_KIX SCE_KIX_DEFAULT (0) SCE_KIX_COMMENT (1) SCE_KIX_STRING1 (2) SCE_KIX_STRING2 (3) SCE_KIX_NUMBER (4) SCE_KIX_VAR (5) SCE_KIX_MACRO (6) SCE_KIX_KEYWORD (7) SCE_KIX_FUNCTIONS (8) SCE_KIX_OPERATOR (9) SCE_KIX_IDENTIFIER (31) =head2 Lexical states for SCLEX_GUI4CLI SCE_GC_DEFAULT (0) SCE_GC_COMMENTLINE (1) SCE_GC_COMMENTBLOCK (2) SCE_GC_GLOBAL (3) SCE_GC_EVENT (4) SCE_GC_ATTRIBUTE (5) SCE_GC_CONTROL (6) SCE_GC_COMMAND (7) SCE_GC_STRING (8) SCE_GC_OPERATOR (9) =head2 Lexical states for SCLEX_SPECMAN SCE_SN_DEFAULT (0) SCE_SN_CODE (1) SCE_SN_COMMENTLINE (2) SCE_SN_COMMENTLINEBANG (3) SCE_SN_NUMBER (4) SCE_SN_WORD (5) SCE_SN_STRING (6) SCE_SN_WORD2 (7) SCE_SN_WORD3 (8) SCE_SN_PREPROCESSOR (9) SCE_SN_OPERATOR (10) SCE_SN_IDENTIFIER (11) SCE_SN_STRINGEOL (12) SCE_SN_REGEXTAG (13) SCE_SN_SIGNAL (14) SCE_SN_USER (19) =head2 Lexical states for SCLEX_AU3 SCE_AU3_DEFAULT (0) SCE_AU3_COMMENT (1) SCE_AU3_COMMENTBLOCK (2) SCE_AU3_NUMBER (3) SCE_AU3_FUNCTION (4) SCE_AU3_KEYWORD (5) SCE_AU3_MACRO (6) SCE_AU3_STRING (7) SCE_AU3_OPERATOR (8) SCE_AU3_VARIABLE (9) SCE_AU3_SENT (10) SCE_AU3_PREPROCESSOR (11) SCE_AU3_SPECIAL (12) SCE_AU3_EXPAND (13) SCE_AU3_COMOBJ (14) SCE_AU3_UDF (15) =head2 Lexical states for SCLEX_APDL SCE_APDL_DEFAULT (0) SCE_APDL_COMMENT (1) SCE_APDL_COMMENTBLOCK (2) SCE_APDL_NUMBER (3) SCE_APDL_STRING (4) SCE_APDL_OPERATOR (5) SCE_APDL_WORD (6) SCE_APDL_PROCESSOR (7) SCE_APDL_COMMAND (8) SCE_APDL_SLASHCOMMAND (9) SCE_APDL_STARCOMMAND (10) SCE_APDL_ARGUMENT (11) SCE_APDL_FUNCTION (12) =head2 Lexical states for SCLEX_BASH SCE_SH_DEFAULT (0) SCE_SH_ERROR (1) SCE_SH_COMMENTLINE (2) SCE_SH_NUMBER (3) SCE_SH_WORD (4) SCE_SH_STRING (5) SCE_SH_CHARACTER (6) SCE_SH_OPERATOR (7) SCE_SH_IDENTIFIER (8) SCE_SH_SCALAR (9) SCE_SH_PARAM (10) SCE_SH_BACKTICKS (11) SCE_SH_HERE_DELIM (12) SCE_SH_HERE_Q (13) =head2 Lexical states for SCLEX_ASN1 SCE_ASN1_DEFAULT (0) SCE_ASN1_COMMENT (1) SCE_ASN1_IDENTIFIER (2) SCE_ASN1_STRING (3) SCE_ASN1_OID (4) SCE_ASN1_SCALAR (5) SCE_ASN1_KEYWORD (6) SCE_ASN1_ATTRIBUTE (7) SCE_ASN1_DESCRIPTOR (8) SCE_ASN1_TYPE (9) SCE_ASN1_OPERATOR (10) =head2 Lexical states for SCLEX_VHDL SCE_VHDL_DEFAULT (0) SCE_VHDL_COMMENT (1) SCE_VHDL_COMMENTLINEBANG (2) SCE_VHDL_NUMBER (3) SCE_VHDL_STRING (4) SCE_VHDL_OPERATOR (5) SCE_VHDL_IDENTIFIER (6) SCE_VHDL_STRINGEOL (7) SCE_VHDL_KEYWORD (8) SCE_VHDL_STDOPERATOR (9) SCE_VHDL_ATTRIBUTE (10) SCE_VHDL_STDFUNCTION (11) SCE_VHDL_STDPACKAGE (12) SCE_VHDL_STDTYPE (13) SCE_VHDL_USERWORD (14) =head2 Lexical states for SCLEX_CAML SCE_CAML_DEFAULT (0) SCE_CAML_IDENTIFIER (1) SCE_CAML_TAGNAME (2) SCE_CAML_KEYWORD (3) SCE_CAML_KEYWORD2 (4) SCE_CAML_KEYWORD3 (5) SCE_CAML_LINENUM (6) SCE_CAML_OPERATOR (7) SCE_CAML_NUMBER (8) SCE_CAML_CHAR (9) SCE_CAML_WHITE (10) SCE_CAML_STRING (11) SCE_CAML_COMMENT (12) SCE_CAML_COMMENT1 (13) SCE_CAML_COMMENT2 (14) SCE_CAML_COMMENT3 (15) =head2 Lexical states for SCLEX_HASKELL SCE_HA_DEFAULT (0) SCE_HA_IDENTIFIER (1) SCE_HA_KEYWORD (2) SCE_HA_NUMBER (3) SCE_HA_STRING (4) SCE_HA_CHARACTER (5) SCE_HA_CLASS (6) SCE_HA_MODULE (7) SCE_HA_CAPITAL (8) SCE_HA_DATA (9) SCE_HA_IMPORT (10) SCE_HA_OPERATOR (11) SCE_HA_INSTANCE (12) SCE_HA_COMMENTLINE (13) SCE_HA_COMMENTBLOCK (14) SCE_HA_COMMENTBLOCK2 (15) SCE_HA_COMMENTBLOCK3 (16) Lexical states of SCLEX_TADS3 SCE_T3_DEFAULT (0) SCE_T3_X_DEFAULT (1) SCE_T3_PREPROCESSOR (2) SCE_T3_BLOCK_COMMENT (3) SCE_T3_LINE_COMMENT (4) SCE_T3_OPERATOR (5) SCE_T3_KEYWORD (6) SCE_T3_NUMBER (7) SCE_T3_IDENTIFIER (8) SCE_T3_S_STRING (9) SCE_T3_D_STRING (10) SCE_T3_X_STRING (11) SCE_T3_LIB_DIRECTIVE (12) SCE_T3_MSG_PARAM (13) SCE_T3_HTML_TAG (14) SCE_T3_HTML_DEFAULT (15) SCE_T3_HTML_STRING (16) SCE_T3_USER1 (17) SCE_T3_USER2 (18) SCE_T3_USER3 (19) SCE_T3_BRACE (20) =head2 Lexical states for SCLEX_REBOL SCE_REBOL_DEFAULT (0) SCE_REBOL_COMMENTLINE (1) SCE_REBOL_COMMENTBLOCK (2) SCE_REBOL_PREFACE (3) SCE_REBOL_OPERATOR (4) SCE_REBOL_CHARACTER (5) SCE_REBOL_QUOTEDSTRING (6) SCE_REBOL_BRACEDSTRING (7) SCE_REBOL_NUMBER (8) SCE_REBOL_PAIR (9) SCE_REBOL_TUPLE (10) SCE_REBOL_BINARY (11) SCE_REBOL_MONEY (12) SCE_REBOL_ISSUE (13) SCE_REBOL_TAG (14) SCE_REBOL_FILE (15) SCE_REBOL_EMAIL (16) SCE_REBOL_URL (17) SCE_REBOL_DATE (18) SCE_REBOL_TIME (19) SCE_REBOL_IDENTIFIER (20) SCE_REBOL_WORD (21) SCE_REBOL_WORD2 (22) SCE_REBOL_WORD3 (23) SCE_REBOL_WORD4 (24) SCE_REBOL_WORD5 (25) SCE_REBOL_WORD6 (26) SCE_REBOL_WORD7 (27) SCE_REBOL_WORD8 (28) =head2 Lexical states for SCLEX_SQL SCE_SQL_DEFAULT (0) SCE_SQL_COMMENT (1) SCE_SQL_COMMENTLINE (2) SCE_SQL_COMMENTDOC (3) SCE_SQL_NUMBER (4) SCE_SQL_WORD (5) SCE_SQL_STRING (6) SCE_SQL_CHARACTER (7) SCE_SQL_SQLPLUS (8) SCE_SQL_SQLPLUS_PROMPT (9) SCE_SQL_OPERATOR (10) SCE_SQL_IDENTIFIER (11) SCE_SQL_SQLPLUS_COMMENT (13) SCE_SQL_COMMENTLINEDOC (15) SCE_SQL_WORD2 (16) SCE_SQL_COMMENTDOCKEYWORD (17) SCE_SQL_COMMENTDOCKEYWORDERROR (18) SCE_SQL_USER1 (19) SCE_SQL_USER2 (20) SCE_SQL_USER3 (21) SCE_SQL_USER4 (22) SCE_SQL_QUOTEDIDENTIFIER (23) =head2 Lexical states for SCLEX_SMALLTALK SCE_ST_DEFAULT (0) SCE_ST_STRING (1) SCE_ST_NUMBER (2) SCE_ST_COMMENT (3) SCE_ST_SYMBOL (4) SCE_ST_BINARY (5) SCE_ST_BOOL (6) SCE_ST_SELF (7) SCE_ST_SUPER (8) SCE_ST_NIL (9) SCE_ST_GLOBAL (10) SCE_ST_RETURN (11) SCE_ST_SPECIAL (12) SCE_ST_KWSEND (13) SCE_ST_ASSIGN (14) SCE_ST_CHARACTER (15) SCE_ST_SPEC_SEL (16) =head2 Lexical states for SCLEX_FLAGSHIP (clipper) SCE_FS_DEFAULT (0) SCE_FS_COMMENT (1) SCE_FS_COMMENTLINE (2) SCE_FS_COMMENTDOC (3) SCE_FS_COMMENTLINEDOC (4) SCE_FS_COMMENTDOCKEYWORD (5) SCE_FS_COMMENTDOCKEYWORDERROR (6) SCE_FS_KEYWORD (7) SCE_FS_KEYWORD2 (8) SCE_FS_KEYWORD3 (9) SCE_FS_KEYWORD4 (10) SCE_FS_NUMBER (11) SCE_FS_STRING (12) SCE_FS_PREPROCESSOR (13) SCE_FS_OPERATOR (14) SCE_FS_IDENTIFIER (15) SCE_FS_DATE (16) SCE_FS_STRINGEOL (17) SCE_FS_CONSTANT (18) SCE_FS_WORDOPERATOR (19) SCE_FS_DISABLEDCODE (20) SCE_FS_DEFAULT_C (21) SCE_FS_COMMENTDOC_C (22) SCE_FS_COMMENTLINEDOC_C (23) SCE_FS_KEYWORD_C (24) SCE_FS_KEYWORD2_C (25) SCE_FS_NUMBER_C (26) SCE_FS_STRING_C (27) SCE_FS_PREPROCESSOR_C (28) SCE_FS_OPERATOR_C (29) SCE_FS_IDENTIFIER_C (30) SCE_FS_STRINGEOL_C (31) =head2 Lexical states for SCLEX_CSOUND SCE_CSOUND_DEFAULT (0) SCE_CSOUND_COMMENT (1) SCE_CSOUND_NUMBER (2) SCE_CSOUND_OPERATOR (3) SCE_CSOUND_INSTR (4) SCE_CSOUND_IDENTIFIER (5) SCE_CSOUND_OPCODE (6) SCE_CSOUND_HEADERSTMT (7) SCE_CSOUND_USERKEYWORD (8) SCE_CSOUND_COMMENTBLOCK (9) SCE_CSOUND_PARAM (10) SCE_CSOUND_ARATE_VAR (11) SCE_CSOUND_KRATE_VAR (12) SCE_CSOUND_IRATE_VAR (13) SCE_CSOUND_GLOBAL_VAR (14) SCE_CSOUND_STRINGEOL (15) =head2 Lexical states for SCLEX_INNOSETUP SCE_INNO_DEFAULT (0) SCE_INNO_COMMENT (1) SCE_INNO_KEYWORD (2) SCE_INNO_PARAMETER (3) SCE_INNO_SECTION (4) SCE_INNO_PREPROC (5) SCE_INNO_INLINE_EXPANSION (6) SCE_INNO_COMMENT_PASCAL (7) SCE_INNO_KEYWORD_PASCAL (8) SCE_INNO_KEYWORD_USER (9) SCE_INNO_STRING_DOUBLE (10) SCE_INNO_STRING_SINGLE (11) SCE_INNO_IDENTIFIER (12) =head2 Lexical states for SCLEX_OPAL SCE_OPAL_SPACE (0) SCE_OPAL_COMMENT_BLOCK (1) SCE_OPAL_COMMENT_LINE (2) SCE_OPAL_INTEGER (3) SCE_OPAL_KEYWORD (4) SCE_OPAL_SORT (5) SCE_OPAL_STRING (6) SCE_OPAL_PAR (7) SCE_OPAL_BOOL_CONST (8) SCE_OPAL_DEFAULT (32) =head2 Lexical states for SCLEX_SPICE SCE_SPICE_DEFAULT (0) SCE_SPICE_IDENTIFIER (1) SCE_SPICE_KEYWORD (2) SCE_SPICE_KEYWORD2 (3) SCE_SPICE_KEYWORD3 (4) SCE_SPICE_NUMBER (5) SCE_SPICE_DELIMITER (6) SCE_SPICE_VALUE (7) SCE_SPICE_COMMENTLINE (8) =head2 Lexical states for SCLEX_CMAKE SCE_CMAKE_DEFAULT (0) SCE_CMAKE_COMMENT (1) SCE_CMAKE_STRINGDQ (2) SCE_CMAKE_STRINGLQ (3) SCE_CMAKE_STRINGRQ (4) SCE_CMAKE_COMMANDS (5) SCE_CMAKE_PARAMETERS (6) SCE_CMAKE_VARIABLE (7) SCE_CMAKE_USERDEFINED (8) SCE_CMAKE_WHILEDEF (9) SCE_CMAKE_FOREACHDEF (10) SCE_CMAKE_IFDEFINEDEF (11) SCE_CMAKE_MACRODEF (12) SCE_CMAKE_STRINGVAR (13) SCE_CMAKE_NUMBER (14) =head2 Lexical states for SCLEX_GAP SCE_GAP_DEFAULT (0) SCE_GAP_IDENTIFIER (1) SCE_GAP_KEYWORD (2) SCE_GAP_KEYWORD2 (3) SCE_GAP_KEYWORD3 (4) SCE_GAP_KEYWORD4 (5) SCE_GAP_STRING (6) SCE_GAP_CHAR (7) SCE_GAP_OPERATOR (8) SCE_GAP_COMMENT (9) SCE_GAP_NUMBER (10) SCE_GAP_STRINGEOL (11) =head2 Lexical state for SCLEX_PLM SCE_PLM_DEFAULT (0) SCE_PLM_COMMENT (1) SCE_PLM_STRING (2) SCE_PLM_NUMBER (3) SCE_PLM_IDENTIFIER (4) SCE_PLM_OPERATOR (5) SCE_PLM_CONTROL (6) SCE_PLM_KEYWORD (7) =head2 Lexical state for SCLEX_PROGRESS SCE_4GL_DEFAULT (0) SCE_4GL_NUMBER (1) SCE_4GL_WORD (2) SCE_4GL_STRING (3) SCE_4GL_CHARACTER (4) SCE_4GL_PREPROCESSOR (5) SCE_4GL_OPERATOR (6) SCE_4GL_IDENTIFIER (7) SCE_4GL_BLOCK (8) SCE_4GL_END (9) SCE_4GL_COMMENT1 (10) SCE_4GL_COMMENT2 (11) SCE_4GL_COMMENT3 (12) SCE_4GL_COMMENT4 (13) SCE_4GL_COMMENT5 (14) SCE_4GL_COMMENT6 (15) SCE_4GL_DEFAULT_ (16) SCE_4GL_NUMBER_ (17) SCE_4GL_WORD_ (18) SCE_4GL_STRING_ (19) SCE_4GL_CHARACTER_ (20) SCE_4GL_PREPROCESSOR_ (21) SCE_4GL_OPERATOR_ (22) SCE_4GL_IDENTIFIER_ (23) SCE_4GL_BLOCK_ (24) SCE_4GL_END_ (25) SCE_4GL_COMMENT1_ (26) SCE_4GL_COMMENT2_ (27) SCE_4GL_COMMENT3_ (28) SCE_4GL_COMMENT4_ (29) SCE_4GL_COMMENT5_ (30) SCE_4GL_COMMENT6_ (31) =head2 Lexical states for SCLEX_ABAQUS SCE_ABAQUS_DEFAULT (0) SCE_ABAQUS_COMMENT (1) SCE_ABAQUS_COMMENTBLOCK (2) SCE_ABAQUS_NUMBER (3) SCE_ABAQUS_STRING (4) SCE_ABAQUS_OPERATOR (5) SCE_ABAQUS_WORD (6) SCE_ABAQUS_PROCESSOR (7) SCE_ABAQUS_COMMAND (8) SCE_ABAQUS_SLASHCOMMAND (9) SCE_ABAQUS_STARCOMMAND (10) SCE_ABAQUS_ARGUMENT (11) SCE_ABAQUS_FUNCTION (12) =head2 Lexical states for SCLEX_ASYMPTOTE SCE_ASY_DEFAULT (0) SCE_ASY_COMMENT (1) SCE_ASY_COMMENTLINE (2) SCE_ASY_NUMBER (3) SCE_ASY_WORD (4) SCE_ASY_STRING (5) SCE_ASY_CHARACTER (6) SCE_ASY_OPERATOR (7) SCE_ASY_IDENTIFIER (8) SCE_ASY_STRINGEOL (9) SCE_ASY_COMMENTLINEDOC (10) SCE_ASY_WORD2 (11) =head2 Lexical states for SCLEX_R SCE_R_DEFAULT (0) SCE_R_COMMENT (1) SCE_R_KWORD (2) SCE_R_BASEKWORD (3) SCE_R_OTHERKWORD (4) SCE_R_NUMBER (5) SCE_R_STRING (6) SCE_R_STRING2 (7) SCE_R_OPERATOR (8) SCE_R_IDENTIFIER (9) SCE_R_INFIX (10) SCE_R_INFIXEOL (11) =head2 Lexical state for SCLEX_MAGIKSF SCE_MAGIK_DEFAULT (0) SCE_MAGIK_COMMENT (1) SCE_MAGIK_HYPER_COMMENT (16) SCE_MAGIK_STRING (2) SCE_MAGIK_CHARACTER (3) SCE_MAGIK_NUMBER (4) SCE_MAGIK_IDENTIFIER (5) SCE_MAGIK_OPERATOR (6) SCE_MAGIK_FLOW (7) SCE_MAGIK_CONTAINER (8) SCE_MAGIK_BRACKET_BLOCK (9) SCE_MAGIK_BRACE_BLOCK (10) SCE_MAGIK_SQBRACKET_BLOCK (11) SCE_MAGIK_UNKNOWN_KEYWORD (12) SCE_MAGIK_KEYWORD (13) SCE_MAGIK_PRAGMA (14) SCE_MAGIK_SYMBOL (15) =head2 Lexical state for SCLEX_POWERSHELL SCE_POWERSHELL_DEFAULT (0) SCE_POWERSHELL_COMMENT (1) SCE_POWERSHELL_STRING (2) SCE_POWERSHELL_CHARACTER (3) SCE_POWERSHELL_NUMBER (4) SCE_POWERSHELL_VARIABLE (5) SCE_POWERSHELL_OPERATOR (6) SCE_POWERSHELL_IDENTIFIER (7) SCE_POWERSHELL_KEYWORD (8) SCE_POWERSHELL_CMDLET (9) SCE_POWERSHELL_ALIAS (10) SCE_POWERSHELL_FUNCTION (11) SCE_POWERSHELL_USER1 (12) SCE_POWERSHELL_COMMENTSTREAM (13) =head2 Lexical state for SCLEX_MYSQL SCE_MYSQL_DEFAULT (0) SCE_MYSQL_COMMENT (1) SCE_MYSQL_COMMENTLINE (2) SCE_MYSQL_VARIABLE (3) SCE_MYSQL_SYSTEMVARIABLE (4) SCE_MYSQL_KNOWNSYSTEMVARIABLE (5) SCE_MYSQL_NUMBER (6) SCE_MYSQL_MAJORKEYWORD (7) SCE_MYSQL_KEYWORD (8) SCE_MYSQL_DATABASEOBJECT (9) SCE_MYSQL_PROCEDUREKEYWORD (10) SCE_MYSQL_STRING (11) SCE_MYSQL_SQSTRING (12) SCE_MYSQL_DQSTRING (13) SCE_MYSQL_OPERATOR (14) SCE_MYSQL_FUNCTION (15) SCE_MYSQL_IDENTIFIER (16) SCE_MYSQL_QUOTEDIDENTIFIER (17) SCE_MYSQL_USER1 (18) SCE_MYSQL_USER2 (19) SCE_MYSQL_USER3 (20) SCE_MYSQL_HIDDENCOMMAND (21) =head2 Lexical state for SCLEX_PO SCE_PO_DEFAULT (0) SCE_PO_COMMENT (1) SCE_PO_MSGID (2) SCE_PO_MSGID_TEXT (3) SCE_PO_MSGSTR (4) SCE_PO_MSGSTR_TEXT (5) SCE_PO_MSGCTXT (6) SCE_PO_MSGCTXT_TEXT (7) SCE_PO_FUZZY (8) =head2 Lexical states for SCLEX_PASCAL SCE_PAS_DEFAULT (0) SCE_PAS_IDENTIFIER (1) SCE_PAS_COMMENT (2) SCE_PAS_COMMENT2 (3) SCE_PAS_COMMENTLINE (4) SCE_PAS_PREPROCESSOR (5) SCE_PAS_PREPROCESSOR2 (6) SCE_PAS_NUMBER (7) SCE_PAS_HEXNUMBER (8) SCE_PAS_WORD (9) SCE_PAS_STRING (10) SCE_PAS_STRINGEOL (11) SCE_PAS_CHARACTER (12) SCE_PAS_OPERATOR (13) SCE_PAS_ASM (14) =head2 Lexical state for SCLEX_SORCUS SCE_SORCUS_DEFAULT (0) SCE_SORCUS_COMMAND (1) SCE_SORCUS_PARAMETER (2) SCE_SORCUS_COMMENTLINE (3) SCE_SORCUS_STRING (4) SCE_SORCUS_STRINGEOL (5) SCE_SORCUS_IDENTIFIER (6) SCE_SORCUS_OPERATOR (7) SCE_SORCUS_NUMBER (8) SCE_SORCUS_CONSTANT (9) =head2 Lexical state for SCLEX_POWERPRO SCE_POWERPRO_DEFAULT (0) SCE_POWERPRO_COMMENTBLOCK (1) SCE_POWERPRO_COMMENTLINE (2) SCE_POWERPRO_NUMBER (3) SCE_POWERPRO_WORD (4) SCE_POWERPRO_WORD2 (5) SCE_POWERPRO_WORD3 (6) SCE_POWERPRO_WORD4 (7) SCE_POWERPRO_DOUBLEQUOTEDSTRING (8) SCE_POWERPRO_SINGLEQUOTEDSTRING (9) SCE_POWERPRO_LINECONTINUE (10) SCE_POWERPRO_OPERATOR (11) SCE_POWERPRO_IDENTIFIER (12) SCE_POWERPRO_STRINGEOL (13) SCE_POWERPRO_VERBATIM (14) SCE_POWERPRO_ALTQUOTE (15) SCE_POWERPRO_FUNCTION (16) =head2 Lexical states for SCLEX_SML SCE_SML_DEFAULT (0) SCE_SML_IDENTIFIER (1) SCE_SML_TAGNAME (2) SCE_SML_KEYWORD (3) SCE_SML_KEYWORD2 (4) SCE_SML_KEYWORD3 (5) SCE_SML_LINENUM (6) SCE_SML_OPERATOR (7) SCE_SML_NUMBER (8) SCE_SML_CHAR (9) SCE_SML_STRING (11) SCE_SML_COMMENT (12) SCE_SML_COMMENT1 (13) SCE_SML_COMMENT2 (14) SCE_SML_COMMENT3 (15) =head2 Lexical state for SCLEX_MARKDOWN SCE_MARKDOWN_DEFAULT (0) SCE_MARKDOWN_LINE_BEGIN (1) SCE_MARKDOWN_STRONG1 (2) SCE_MARKDOWN_STRONG2 (3) SCE_MARKDOWN_EM1 (4) SCE_MARKDOWN_EM2 (5) SCE_MARKDOWN_HEADER1 (6) SCE_MARKDOWN_HEADER2 (7) SCE_MARKDOWN_HEADER3 (8) SCE_MARKDOWN_HEADER4 (9) SCE_MARKDOWN_HEADER5 (10) SCE_MARKDOWN_HEADER6 (11) SCE_MARKDOWN_PRECHAR (12) SCE_MARKDOWN_ULIST_ITEM (13) SCE_MARKDOWN_OLIST_ITEM (14) SCE_MARKDOWN_BLOCKQUOTE (15) SCE_MARKDOWN_STRIKEOUT (16) SCE_MARKDOWN_HRULE (17) SCE_MARKDOWN_LINK (18) SCE_MARKDOWN_CODE (19) SCE_MARKDOWN_CODE2 (20) SCE_MARKDOWN_CODEBK (21) =head2 Lexical state for SCLEX_TXT2TAGS SCE_TXT2TAGS_DEFAULT (0) SCE_TXT2TAGS_LINE_BEGIN (1) SCE_TXT2TAGS_STRONG1 (2) SCE_TXT2TAGS_STRONG2 (3) SCE_TXT2TAGS_EM1 (4) SCE_TXT2TAGS_EM2 (5) SCE_TXT2TAGS_HEADER1 (6) SCE_TXT2TAGS_HEADER2 (7) SCE_TXT2TAGS_HEADER3 (8) SCE_TXT2TAGS_HEADER4 (9) SCE_TXT2TAGS_HEADER5 (10) SCE_TXT2TAGS_HEADER6 (11) SCE_TXT2TAGS_PRECHAR (12) SCE_TXT2TAGS_ULIST_ITEM (13) SCE_TXT2TAGS_OLIST_ITEM (14) SCE_TXT2TAGS_BLOCKQUOTE (15) SCE_TXT2TAGS_STRIKEOUT (16) SCE_TXT2TAGS_HRULE (17) SCE_TXT2TAGS_LINK (18) SCE_TXT2TAGS_CODE (19) SCE_TXT2TAGS_CODE2 (20) SCE_TXT2TAGS_CODEBK (21) SCE_TXT2TAGS_COMMENT (22) SCE_TXT2TAGS_OPTION (23) SCE_TXT2TAGS_PREPROC (24) SCE_TXT2TAGS_POSTPROC (25) =head2 Lexical states for SCLEX_A68K SCE_A68K_DEFAULT (0) SCE_A68K_COMMENT (1) SCE_A68K_NUMBER_DEC (2) SCE_A68K_NUMBER_BIN (3) SCE_A68K_NUMBER_HEX (4) SCE_A68K_STRING1 (5) SCE_A68K_OPERATOR (6) SCE_A68K_CPUINSTRUCTION (7) SCE_A68K_EXTINSTRUCTION (8) SCE_A68K_REGISTER (9) SCE_A68K_DIRECTIVE (10) SCE_A68K_MACRO_ARG (11) SCE_A68K_LABEL (12) SCE_A68K_STRING2 (13) SCE_A68K_IDENTIFIER (14) SCE_A68K_MACRO_DECLARATION (15) SCE_A68K_COMMENT_WORD (16) SCE_A68K_COMMENT_SPECIAL (17) SCE_A68K_COMMENT_DOXYGEN (18) =head2 Lexical states for SCLEX_MODULA SCE_MODULA_DEFAULT (0) SCE_MODULA_COMMENT (1) SCE_MODULA_DOXYCOMM (2) SCE_MODULA_DOXYKEY (3) SCE_MODULA_KEYWORD (4) SCE_MODULA_RESERVED (5) SCE_MODULA_NUMBER (6) SCE_MODULA_BASENUM (7) SCE_MODULA_FLOAT (8) SCE_MODULA_STRING (9) SCE_MODULA_STRSPEC (10) SCE_MODULA_CHAR (11) SCE_MODULA_CHARSPEC (12) SCE_MODULA_PROC (13) SCE_MODULA_PRAGMA (14) SCE_MODULA_PRGKEY (15) SCE_MODULA_OPERATOR (16) SCE_MODULA_BADSTR (17) =head2 Lexical states for SCLEX_COFFEESCRIPT SCE_COFFEESCRIPT_DEFAULT (0) SCE_COFFEESCRIPT_COMMENT (1) SCE_COFFEESCRIPT_COMMENTLINE (2) SCE_COFFEESCRIPT_COMMENTDOC (3) SCE_COFFEESCRIPT_NUMBER (4) SCE_COFFEESCRIPT_WORD (5) SCE_COFFEESCRIPT_STRING (6) SCE_COFFEESCRIPT_CHARACTER (7) SCE_COFFEESCRIPT_UUID (8) SCE_COFFEESCRIPT_PREPROCESSOR (9) SCE_COFFEESCRIPT_OPERATOR (10) SCE_COFFEESCRIPT_IDENTIFIER (11) SCE_COFFEESCRIPT_STRINGEOL (12) SCE_COFFEESCRIPT_VERBATIM (13) SCE_COFFEESCRIPT_REGEX (14) SCE_COFFEESCRIPT_COMMENTLINEDOC (15) SCE_COFFEESCRIPT_WORD2 (16) SCE_COFFEESCRIPT_COMMENTDOCKEYWORD (17) SCE_COFFEESCRIPT_COMMENTDOCKEYWORDERROR (18) SCE_COFFEESCRIPT_GLOBALCLASS (19) SCE_COFFEESCRIPT_STRINGRAW (20) SCE_COFFEESCRIPT_TRIPLEVERBATIM (21) SCE_COFFEESCRIPT_HASHQUOTEDSTRING (22) SCE_COFFEESCRIPT_COMMENTBLOCK (22) SCE_COFFEESCRIPT_VERBOSE_REGEX (23) SCE_COFFEESCRIPT_VERBOSE_REGEX_COMMENT (24) =head2 Lexical states for SCLEX_AVS SCE_AVS_DEFAULT (0) SCE_AVS_COMMENTBLOCK (1) SCE_AVS_COMMENTBLOCKN (2) SCE_AVS_COMMENTLINE (3) SCE_AVS_NUMBER (4) SCE_AVS_OPERATOR (5) SCE_AVS_IDENTIFIER (6) SCE_AVS_STRING (7) SCE_AVS_TRIPLESTRING (8) SCE_AVS_KEYWORD (9) SCE_AVS_FILTER (10) SCE_AVS_PLUGIN (11) SCE_AVS_FUNCTION (12) SCE_AVS_CLIPPROP (13) SCE_AVS_USERDFN (14) =head2 Lexical states for SCLEX_ECL SCE_ECL_DEFAULT (0) SCE_ECL_COMMENT (1) SCE_ECL_COMMENTLINE (2) SCE_ECL_NUMBER (3) SCE_ECL_STRING (4) SCE_ECL_WORD0 (5) SCE_ECL_OPERATOR (6) SCE_ECL_CHARACTER (7) SCE_ECL_UUID (8) SCE_ECL_PREPROCESSOR (9) SCE_ECL_UNKNOWN (10) SCE_ECL_IDENTIFIER (11) SCE_ECL_STRINGEOL (12) SCE_ECL_VERBATIM (13) SCE_ECL_REGEX (14) SCE_ECL_COMMENTLINEDOC (15) SCE_ECL_WORD1 (16) SCE_ECL_COMMENTDOCKEYWORD (17) SCE_ECL_COMMENTDOCKEYWORDERROR (18) SCE_ECL_WORD2 (19) SCE_ECL_WORD3 (20) SCE_ECL_WORD4 (21) SCE_ECL_WORD5 (22) SCE_ECL_COMMENTDOC (23) SCE_ECL_ADDED (24) SCE_ECL_DELETED (25) SCE_ECL_CHANGED (26) SCE_ECL_MOVED (27) Deprecated in 2.21The SC_CP_DBCS value can be used to indicate a DBCS mode for GTK+. SC_CP_DBCS (1) =head1 AUTHOR Ahmad M. Zawawi =head1 COPYRIGHT Copyright 2011 Ahmad M. Zawawi. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut Wx-Scintilla-0.38/t000755001750001750 011727344243 14525 5ustar00azawawiazawawi000000000000Wx-Scintilla-0.38/t/03_editor.t000444001750001750 643611727344243 16650 0ustar00azawawiazawawi000000000000#!/usr/bin/perl use strict; BEGIN { $^W = 1; } use Test::More; BEGIN { unless ( $ENV{DISPLAY} or $^O eq 'MSWin32' ) { plan skip_all => 'Needs DISPLAY'; exit 0; } } plan( tests => 3 ); #----> My first scintilla Wx editor :) package My::Scintilla::Editor; # Load Wx::Scintilla use Wx::Scintilla (); # replaces use Wx::STC use base 'Wx::Scintilla::TextCtrl'; # replaces Wx::StyledTextCtrl use Wx qw(:everything); use Wx::Event; # Override the constructor to Enable Perl support in the editor sub new { my ( $class, $parent ) = @_; my $self = $class->SUPER::new( $parent, -1, [ -1, -1 ], [ 750, 700 ] ); # Set the font my $font = Wx::Font->new( 10, wxTELETYPE, wxNORMAL, wxNORMAL ); $self->SetFont($font); $self->StyleSetFont( Wx::Scintilla::STYLE_DEFAULT, $font ); $self->StyleClearAll(); # Set the various Perl lexer colors $self->StyleSetForeground( 0, Wx::Colour->new( 0x00, 0x00, 0x7f ) ); $self->StyleSetForeground( 1, Wx::Colour->new( 0xff, 0x00, 0x00 ) ); $self->StyleSetForeground( 2, Wx::Colour->new( 0x00, 0x7f, 0x00 ) ); $self->StyleSetForeground( 3, Wx::Colour->new( 0x7f, 0x7f, 0x7f ) ); $self->StyleSetForeground( 4, Wx::Colour->new( 0x00, 0x7f, 0x7f ) ); $self->StyleSetForeground( 5, Wx::Colour->new( 0x00, 0x00, 0x7f ) ); $self->StyleSetForeground( 6, Wx::Colour->new( 0xff, 0x7f, 0x00 ) ); $self->StyleSetForeground( 7, Wx::Colour->new( 0x7f, 0x00, 0x7f ) ); $self->StyleSetForeground( 8, Wx::Colour->new( 0x00, 0x00, 0x00 ) ); $self->StyleSetForeground( 9, Wx::Colour->new( 0x7f, 0x7f, 0x7f ) ); $self->StyleSetForeground( 10, Wx::Colour->new( 0x00, 0x00, 0x7f ) ); $self->StyleSetForeground( 11, Wx::Colour->new( 0x00, 0x00, 0xff ) ); $self->StyleSetForeground( 12, Wx::Colour->new( 0x7f, 0x00, 0x7f ) ); $self->StyleSetForeground( 13, Wx::Colour->new( 0x40, 0x80, 0xff ) ); $self->StyleSetForeground( 17, Wx::Colour->new( 0xff, 0x00, 0x7f ) ); $self->StyleSetForeground( 18, Wx::Colour->new( 0x7f, 0x7f, 0x00 ) ); $self->StyleSetBold( 12, 1 ); $self->StyleSetSpec( Wx::Scintilla::SCE_H_TAG, "fore:#0000ff" ); # set the lexer to Perl 5 $self->SetLexer(Wx::Scintilla::SCLEX_PERL); my $text = 'Hello world, Scintilla'; $self->SetText($text); main::ok( $text eq $self->GetText, 'SetText, GetText work' ); $self->SetFocus; return $self; } package MyTimer; use vars qw(@ISA); @ISA = qw(Wx::Timer); sub Notify { my $self = shift; my $frame = Wx::wxTheApp()->GetTopWindow; $frame->Destroy; main::ok( 1, "Timer works.. Destroyed frame!" ); } #----> DEMO EDITOR APPLICATION # First, define an application object class to encapsulate the application itself package DemoEditorApp; use strict; use warnings; use Wx; use base 'Wx::App'; # We must override OnInit to build the window sub OnInit { my $self = shift; my $frame = $self->{frame} = Wx::Frame->new( undef, # no parent window -1, # no window id 'My First Scintilla Editor!', # Window title ); my $editor = My::Scintilla::Editor->new( $frame, # Parent window ); main::ok( $editor, 'Editor instance created' ); # Uncomment this to observe the test # $frame->Show(1); MyTimer->new->Start( 500, 1 ); return 1; } # Create the application object, and pass control to it. package main; my $app = DemoEditorApp->new; $app->MainLoop; Wx-Scintilla-0.38/t/01_load.t000444001750001750 15611727344243 16250 0ustar00azawawiazawawi000000000000#!/usr/bin/perl use strict; BEGIN { $^W = 1; print "1..1\n"; } use Wx; use Wx::Scintilla; print "ok\n"; Wx-Scintilla-0.38/t/03_editor_child.t000444001750001750 643611727344243 20013 0ustar00azawawiazawawi000000000000#!/usr/bin/perl use strict; BEGIN { $^W = 1; } use Test::More; BEGIN { unless ( $ENV{DISPLAY} or $^O eq 'MSWin32' ) { plan skip_all => 'Needs DISPLAY'; exit 0; } } plan( tests => 3 ); #----> My first scintilla Wx editor :) package My::Scintilla::Editor; # Load Wx::Scintilla use Wx::Scintilla (); # replaces use Wx::STC use base 'Wx::Scintilla::TextCtrl'; # replaces Wx::StyledTextCtrl use Wx qw(:everything); use Wx::Event; # Override the constructor to Enable Perl support in the editor sub new { my ( $class, $parent ) = @_; my $self = $class->SUPER::new( $parent, -1, [ -1, -1 ], [ 750, 700 ] ); # Set the font my $font = Wx::Font->new( 10, wxTELETYPE, wxNORMAL, wxNORMAL ); $self->SetFont($font); $self->StyleSetFont( Wx::Scintilla::STYLE_DEFAULT, $font ); $self->StyleClearAll(); # Set the various Perl lexer colors $self->StyleSetForeground( 0, Wx::Colour->new( 0x00, 0x00, 0x7f ) ); $self->StyleSetForeground( 1, Wx::Colour->new( 0xff, 0x00, 0x00 ) ); $self->StyleSetForeground( 2, Wx::Colour->new( 0x00, 0x7f, 0x00 ) ); $self->StyleSetForeground( 3, Wx::Colour->new( 0x7f, 0x7f, 0x7f ) ); $self->StyleSetForeground( 4, Wx::Colour->new( 0x00, 0x7f, 0x7f ) ); $self->StyleSetForeground( 5, Wx::Colour->new( 0x00, 0x00, 0x7f ) ); $self->StyleSetForeground( 6, Wx::Colour->new( 0xff, 0x7f, 0x00 ) ); $self->StyleSetForeground( 7, Wx::Colour->new( 0x7f, 0x00, 0x7f ) ); $self->StyleSetForeground( 8, Wx::Colour->new( 0x00, 0x00, 0x00 ) ); $self->StyleSetForeground( 9, Wx::Colour->new( 0x7f, 0x7f, 0x7f ) ); $self->StyleSetForeground( 10, Wx::Colour->new( 0x00, 0x00, 0x7f ) ); $self->StyleSetForeground( 11, Wx::Colour->new( 0x00, 0x00, 0xff ) ); $self->StyleSetForeground( 12, Wx::Colour->new( 0x7f, 0x00, 0x7f ) ); $self->StyleSetForeground( 13, Wx::Colour->new( 0x40, 0x80, 0xff ) ); $self->StyleSetForeground( 17, Wx::Colour->new( 0xff, 0x00, 0x7f ) ); $self->StyleSetForeground( 18, Wx::Colour->new( 0x7f, 0x7f, 0x00 ) ); $self->StyleSetBold( 12, 1 ); $self->StyleSetSpec( Wx::Scintilla::SCE_H_TAG, "fore:#0000ff" ); # set the lexer to Perl 5 $self->SetLexer(Wx::Scintilla::SCLEX_PERL); my $text = 'Hello world, Scintilla'; $self->SetText($text); main::ok( $text eq $self->GetText, 'SetText, GetText work' ); $self->SetFocus; return $self; } package MyTimer; use vars qw(@ISA); @ISA = qw(Wx::Timer); sub Notify { my $self = shift; my $frame = Wx::wxTheApp()->GetTopWindow; $frame->Destroy; main::ok( 1, "Timer works.. Destroyed frame!" ); } #----> DEMO EDITOR APPLICATION # First, define an application object class to encapsulate the application itself package DemoEditorApp; use strict; use warnings; use Wx; use base 'Wx::App'; # We must override OnInit to build the window sub OnInit { my $self = shift; my $frame = $self->{frame} = Wx::Frame->new( undef, # no parent window -1, # no window id 'My First Scintilla Editor!', # Window title ); my $editor = My::Scintilla::Editor->new( $frame, # Parent window ); main::ok( $editor, 'Editor instance created' ); # Uncomment this to observe the test # $frame->Show(1); MyTimer->new->Start( 500, 1 ); return 1; } # Create the application object, and pass control to it. package main; my $app = DemoEditorApp->new; $app->MainLoop; Wx-Scintilla-0.38/t/02_inheritance.t000444001750001750 33011727344243 17615 0ustar00azawawiazawawi000000000000#!/usr/bin/perl use strict; BEGIN { $^W = 1; } use Wx; use lib "t/lib"; use Test::More 'no_plan'; use Tests_Helper qw(:inheritance); BEGIN { test_inheritance_start() } use Wx::Scintilla; test_inheritance_end(); Wx-Scintilla-0.38/t/lib000755001750001750 011727344243 15273 5ustar00azawawiazawawi000000000000Wx-Scintilla-0.38/t/lib/Tests_Helper.pm000444001750001750 1203611727344243 20411 0ustar00azawawiazawawi000000000000############################################################################# ## Name: t/Tests_Helper.pm ## Purpose: some test helper functions ## Author: Mattia Barbon ## Modified by: ## Created: 02/06/2001 ## RCS-ID: $Id: Tests_Helper.pm 2057 2007-06-18 23:03:00Z mbarbon $ ## Copyright: (c) 2001-2003, 2005 Mattia Barbon ## Licence: This program is free software; you can redistribute it and/or ## modify it under the same terms as Perl itself ############################################################################# package Tests_Helper; use strict; use Wx; require Exporter; use Test::More (); *ok = \&Test::More::ok; *is = \&Test::More::is; *diag = \&Test::More::diag; use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK); @ISA = qw(Exporter); %EXPORT_TAGS = ( inheritance => [ qw(test_inheritance test_inheritance_all test_inheritance_start test_inheritance_end) ], ); @EXPORT_OK = ( qw(test_app app_timeout test_frame in_frame), @{$EXPORT_TAGS{inheritance}} ); sub in_frame($) { my $callback = shift; my $sub = sub { my $frame = Tests_Helper_Frame->new( $callback ); $frame->Show( 1 ); }; test_app( $sub ); Wx::wxTheApp->MainLoop; } sub app_timeout($) { test_app( sub { my $frame = Wx::Frame->new( undef, -1, 'test' ); my $timer = Wx::Timer->new( $frame ); Wx::Event::EVT_TIMER( $frame, -1, sub { Wx::wxTheApp()->ExitMainLoop; $frame->Destroy; } ); $timer->Start( 500, 1 ); Wx::WakeUpIdle(); $frame->Show( 1 ); } ); } sub test_app { my $function = shift; return Tests_Helper_App->new( $function ); } sub test_frame { my $class = shift; my @params = @_; my $function = sub { my $frame = $class->new( @params ); }; my $app = Tests_Helper_App->new( $function ); return $app; } sub test_inheritance { my( %perl_inheritance, %cpp_inheritance ); LOOP: foreach my $i ( @_ ) { my $key = $i; my $cn = "wx${key}"; my $ci = Wx::ClassInfo::FindClass( $cn ) or next LOOP; while ( 1 ) { push @{$cpp_inheritance{$key}}, cpp_2_perl( $cn ); last unless $ci; $cn = $ci->GetBaseClassName1(); last unless $cn; $ci = Wx::ClassInfo::FindClass( $cn ); } my $class = $key; while ( $class ) { push @{$perl_inheritance{$key}}, "Wx::$class"; last unless exists $Wx::{"${class}::"}{ISA} && @{ $Wx::{"${class}::"}{ISA} }; die $class unless defined @{ $Wx::{"${class}::"}{ISA} }[0]; $class = substr @{ $Wx::{"${class}::"}{ISA} }[0], 4; } } CLASSES: foreach my $i ( keys %perl_inheritance ) { my $pi = $perl_inheritance{$i}; my $ci = $cpp_inheritance{$i}; my @pi = @$pi; my @ci = @$ci; COMPARE: while ( @ci ) { my( $c_class ) = shift @ci; next if $c_class =~ m/Wx::Generic(?:ListCtrl|ImageList)/; next if $c_class =~ m/(?:Base|GTK|X11)$/; next if $c_class =~ m/StatusBar/; #FIXME// ad hoc next if $c_class eq 'Wx::Object'; my( $p_class ); while ( @pi ) { $p_class = shift @pi; next COMPARE if $c_class eq $p_class; } ok( 0, $pi->[0] . ' inheritance chain' ); diag( "C++ : @{$ci}" ); diag( "Perl: @{$pi}" ); next CLASSES; } ok( 1, $pi->[0] . ' inheritance chain' ); } } { my %classes_skip; sub test_inheritance_start { foreach my $i ( keys %Wx:: ) { next unless $i =~ m/^([^_].*)::$/; $classes_skip{$1} = 1; } } sub test_inheritance_end { my @classes; foreach my $i ( keys %Wx:: ) { next unless $i =~ m/^([^_].*)::$/; next if exists $classes_skip{$1}; push @classes, $1; } test_inheritance( @classes ); } } sub test_inheritance_all { my @classes; foreach my $i ( keys %Wx:: ) { next unless $i =~ m/^([^_].*)::$/; push @classes, $1; } test_inheritance( @classes ); } # utility sub perl_2_cpp { my( $v ) = $_[0]; $v =~ s/^Wx::/wx/; $v; } sub cpp_2_perl { my( $v ) = $_[0]; $v =~ s/^wx/Wx::/; $v; } package Tests_Helper_App; use base 'Wx::App'; my $on_init; sub new { my $class = shift; my $function = shift; $on_init = $function; my $this = $class->SUPER::new( @_ ); $this->SetExitOnFrameDelete(1); return $this; } sub OnInit { &$on_init; return 1; } package Tests_Helper_Frame; use base 'Wx::Frame'; sub new { my $ref = shift; my $callback = shift; my $self = $ref->SUPER::new( undef, -1, "Test Frame" ); my $timer = Wx::Timer->new( $self ); Wx::Event::EVT_TIMER( $self, -1, sub { &$callback( $self, $_[1] ); $self->Destroy; } ); $timer->Start( 500, 1 ); Wx::WakeUpIdle(); return $self; } sub Destroy { my $self = shift; $self->SUPER::Destroy; Wx::wxTheApp()->ExitMainLoop; Wx::WakeUpIdle(); } 1; # Local variables: # # mode: cperl # # End: # Wx-Scintilla-0.38/wx-scintilla000755001750001750 011727344243 16700 5ustar00azawawiazawawi000000000000Wx-Scintilla-0.38/wx-scintilla/include000755001750001750 011727344243 20323 5ustar00azawawiazawawi000000000000Wx-Scintilla-0.38/wx-scintilla/include/private.h000444001750001750 206711727344243 22310 0ustar00azawawiazawawi000000000000//////////////////////////////////////////////////////////////////////////// // Name: private.h // Purpose: Private declarations for wxSTC // Author: Robin Dunn // Created: 2007-07-15 // RCS-ID: $Id$ // Copyright: (c) 2000 by Total Control Software // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_STC_PRIVATE_H_ #define _WX_STC_PRIVATE_H_ #include "wx/defs.h" #include "wx/string.h" //---------------------------------------------------------------------- // Utility functions used within wxSTC #if wxUSE_UNICODE extern wxString stc2wx(const char* str); extern wxString stc2wx(const char* str, size_t len); extern const wxWX2MBbuf wx2stc(const wxString& str); #else // not UNICODE inline wxString stc2wx(const char* str) { return wxString(str); } inline wxString stc2wx(const char* str, size_t len) { return wxString(str, len); } inline const wxWX2MBbuf wx2stc(const wxString& str) { return str.mbc_str(); } #endif // UNICODE #endif // _WX_STC_PRIVATE_H_ Wx-Scintilla-0.38/wx-scintilla/include/WxScintilla.h000444001750001750 41176611727344243 23151 0ustar00azawawiazawawi000000000000//////////////////////////////////////////////////////////////////////////// // Name: WxScintilla.h // Purpose: A wxWidgets implementation of Scintilla. This class is the // one meant to be used directly by wx applications. It does not // derive directly from the Scintilla classes, and in fact there // is no mention of Scintilla classes at all in this header. // This class delegates all method calls and events to the // Scintilla objects and so forth. This allows the use of // Scintilla without polluting the namespace with all the // classes and itentifiers from Scintilla. // // Author: Robin Dunn // // Created: 13-Jan-2000 // RCS-ID: $Id$ // Copyright: (c) 2000 by Total Control Software // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /* IMPORTANT: include/wx/stc/stc.h is generated by src/stc/gen_iface.py from src/stc/stc.h.in, don't edit stc.h file as your changes will be lost after the next regeneration, edit stc.h.in and rerun the gen_iface.py script instead! Parts of this file generated by the script are found in between the special "{{{" and "}}}" markers, the rest of it is copied verbatim from src.h.in. */ #ifndef _WX_STC_STC_H_ #define _WX_STC_STC_H_ #include "wx/defs.h" #include "wx/control.h" #include "wx/dnd.h" #include "wx/stopwatch.h" class WXDLLIMPEXP_FWD_CORE wxScrollBar; /* Versions before 2.8.11 dont' have wxIntPtr defined */ #ifndef wxIntPtr #if SIZEOF_LONG >= SIZEOF_VOID_P && SIZEOF_LONG >= SIZEOF_SIZE_T /* normal case */ typedef unsigned long wxUIntPtr; typedef long wxIntPtr; #elif SIZEOF_SIZE_T >= SIZEOF_VOID_P /* Win64 case */ typedef size_t wxUIntPtr; #define wxIntPtr ssize_t #else /* This should never happen for the current architectures but if you're using one where it does, please contact wx-dev@lists.wxwidgets.org. */ #error "Pointers can't be stored inside integer types." #endif #endif #ifdef WXMAKINGDLL_STC #define WXDLLIMPEXP_STC WXEXPORT #elif defined(WXUSINGDLL) #define WXDLLIMPEXP_STC WXIMPORT #else // not making nor using DLL #define WXDLLIMPEXP_STC #endif // SWIG can't handle "#if" type of conditionals, only "#ifdef" #if wxUSE_DRAG_AND_DROP #define STC_USE_DND 1 #endif //---------------------------------------------------------------------- // STC constants generated section {{{ #define wxSTC_INVALID_POSITION -1 // Define start of Scintilla messages to be greater than all Windows edit (EM_*) messages // as many EM_ messages can be used although that use is deprecated. #define wxSTC_START 2000 #define wxSTC_OPTIONAL_START 3000 #define wxSTC_LEXER_START 4000 #define wxSTC_WS_INVISIBLE 0 #define wxSTC_WS_VISIBLEALWAYS 1 #define wxSTC_WS_VISIBLEAFTERINDENT 2 #define wxSTC_EOL_CRLF 0 #define wxSTC_EOL_CR 1 #define wxSTC_EOL_LF 2 #define wxSTC_WEIGHT_BOLD 700 // The SC_CP_UTF8 value can be used to enter Unicode mode. // This is the same value as CP_UTF8 in Windows #define wxSTC_CP_UTF8 65001 // The SC_CP_DBCS value can be used to indicate a DBCS mode for GTK+. #define wxSTC_CP_DBCS 1 #define wxSTC_MARKER_MAX 31 #define wxSTC_MARK_CIRCLE 0 #define wxSTC_MARK_ROUNDRECT 1 #define wxSTC_MARK_ARROW 2 #define wxSTC_MARK_SMALLRECT 3 #define wxSTC_MARK_SHORTARROW 4 #define wxSTC_MARK_EMPTY 5 #define wxSTC_MARK_ARROWDOWN 6 #define wxSTC_MARK_MINUS 7 #define wxSTC_MARK_PLUS 8 // Shapes used for outlining column. #define wxSTC_MARK_VLINE 9 #define wxSTC_MARK_LCORNER 10 #define wxSTC_MARK_TCORNER 11 #define wxSTC_MARK_BOXPLUS 12 #define wxSTC_MARK_BOXPLUSCONNECTED 13 #define wxSTC_MARK_BOXMINUS 14 #define wxSTC_MARK_BOXMINUSCONNECTED 15 #define wxSTC_MARK_LCORNERCURVE 16 #define wxSTC_MARK_TCORNERCURVE 17 #define wxSTC_MARK_CIRCLEPLUS 18 #define wxSTC_MARK_CIRCLEPLUSCONNECTED 19 #define wxSTC_MARK_CIRCLEMINUS 20 #define wxSTC_MARK_CIRCLEMINUSCONNECTED 21 // Invisible mark that only sets the line background color. #define wxSTC_MARK_BACKGROUND 22 #define wxSTC_MARK_DOTDOTDOT 23 #define wxSTC_MARK_ARROWS 24 #define wxSTC_MARK_PIXMAP 25 #define wxSTC_MARK_FULLRECT 26 #define wxSTC_MARK_LEFTRECT 27 #define wxSTC_MARK_AVAILABLE 28 #define wxSTC_MARK_UNDERLINE 29 #define wxSTC_MARK_CHARACTER 10000 // Markers used for outlining column. #define wxSTC_MARKNUM_FOLDEREND 25 #define wxSTC_MARKNUM_FOLDEROPENMID 26 #define wxSTC_MARKNUM_FOLDERMIDTAIL 27 #define wxSTC_MARKNUM_FOLDERTAIL 28 #define wxSTC_MARKNUM_FOLDERSUB 29 #define wxSTC_MARKNUM_FOLDER 30 #define wxSTC_MARKNUM_FOLDEROPEN 31 #define wxSTC_MASK_FOLDERS 0xFE000000 #define wxSTC_MARGIN_SYMBOL 0 #define wxSTC_MARGIN_NUMBER 1 #define wxSTC_MARGIN_BACK 2 #define wxSTC_MARGIN_FORE 3 #define wxSTC_MARGIN_TEXT 4 #define wxSTC_MARGIN_RTEXT 5 // Styles in range 32..38 are predefined for parts of the UI and are not used as normal styles. // Style 39 is for future use. #define wxSTC_STYLE_DEFAULT 32 #define wxSTC_STYLE_LINENUMBER 33 #define wxSTC_STYLE_BRACELIGHT 34 #define wxSTC_STYLE_BRACEBAD 35 #define wxSTC_STYLE_CONTROLCHAR 36 #define wxSTC_STYLE_INDENTGUIDE 37 #define wxSTC_STYLE_CALLTIP 38 #define wxSTC_STYLE_LASTPREDEFINED 39 #define wxSTC_STYLE_MAX 255 // Character set identifiers are used in StyleSetCharacterSet. // The values are the same as the Windows *_CHARSET values. #define wxSTC_CHARSET_ANSI 0 #define wxSTC_CHARSET_DEFAULT 1 #define wxSTC_CHARSET_BALTIC 186 #define wxSTC_CHARSET_CHINESEBIG5 136 #define wxSTC_CHARSET_EASTEUROPE 238 #define wxSTC_CHARSET_GB2312 134 #define wxSTC_CHARSET_GREEK 161 #define wxSTC_CHARSET_HANGUL 129 #define wxSTC_CHARSET_MAC 77 #define wxSTC_CHARSET_OEM 255 #define wxSTC_CHARSET_RUSSIAN 204 #define wxSTC_CHARSET_CYRILLIC 1251 #define wxSTC_CHARSET_SHIFTJIS 128 #define wxSTC_CHARSET_SYMBOL 2 #define wxSTC_CHARSET_TURKISH 162 #define wxSTC_CHARSET_JOHAB 130 #define wxSTC_CHARSET_HEBREW 177 #define wxSTC_CHARSET_ARABIC 178 #define wxSTC_CHARSET_VIETNAMESE 163 #define wxSTC_CHARSET_THAI 222 #define wxSTC_CHARSET_8859_15 1000 #define wxSTC_CASE_MIXED 0 #define wxSTC_CASE_UPPER 1 #define wxSTC_CASE_LOWER 2 // Indicator style enumeration and some constants #define wxSTC_INDIC_PLAIN 0 #define wxSTC_INDIC_SQUIGGLE 1 #define wxSTC_INDIC_TT 2 #define wxSTC_INDIC_DIAGONAL 3 #define wxSTC_INDIC_STRIKE 4 #define wxSTC_INDIC_HIDDEN 5 #define wxSTC_INDIC_BOX 6 #define wxSTC_INDIC_ROUNDBOX 7 #define wxSTC_INDIC_STRAIGHTBOX 8 #define wxSTC_INDIC_DASH 9 #define wxSTC_INDIC_DOTS 10 #define wxSTC_INDIC_SQUIGGLELOW 11 #define wxSTC_INDIC_DOTBOX 12 #define wxSTC_INDIC_MAX 31 #define wxSTC_INDIC_CONTAINER 8 #define wxSTC_INDIC0_MASK 0x20 #define wxSTC_INDIC1_MASK 0x40 #define wxSTC_INDIC2_MASK 0x80 #define wxSTC_INDICS_MASK 0xE0 #define wxSTC_IV_NONE 0 #define wxSTC_IV_REAL 1 #define wxSTC_IV_LOOKFORWARD 2 #define wxSTC_IV_LOOKBOTH 3 // PrintColourMode - use same colours as screen. #define wxSTC_PRINT_NORMAL 0 // PrintColourMode - invert the light value of each style for printing. #define wxSTC_PRINT_INVERTLIGHT 1 // PrintColourMode - force black text on white background for printing. #define wxSTC_PRINT_BLACKONWHITE 2 // PrintColourMode - text stays coloured, but all background is forced to be white for printing. #define wxSTC_PRINT_COLOURONWHITE 3 // PrintColourMode - only the default-background is forced to be white for printing. #define wxSTC_PRINT_COLOURONWHITEDEFAULTBG 4 #define wxSTC_FIND_WHOLEWORD 2 #define wxSTC_FIND_MATCHCASE 4 #define wxSTC_FIND_WORDSTART 0x00100000 #define wxSTC_FIND_REGEXP 0x00200000 #define wxSTC_FIND_POSIX 0x00400000 #define wxSTC_FOLDLEVELBASE 0x400 #define wxSTC_FOLDLEVELWHITEFLAG 0x1000 #define wxSTC_FOLDLEVELHEADERFLAG 0x2000 #define wxSTC_FOLDLEVELNUMBERMASK 0x0FFF #define wxSTC_FOLDFLAG_LINEBEFORE_EXPANDED 0x0002 #define wxSTC_FOLDFLAG_LINEBEFORE_CONTRACTED 0x0004 #define wxSTC_FOLDFLAG_LINEAFTER_EXPANDED 0x0008 #define wxSTC_FOLDFLAG_LINEAFTER_CONTRACTED 0x0010 #define wxSTC_FOLDFLAG_LEVELNUMBERS 0x0040 #define wxSTC_TIME_FOREVER 10000000 #define wxSTC_WRAP_NONE 0 #define wxSTC_WRAP_WORD 1 #define wxSTC_WRAP_CHAR 2 #define wxSTC_WRAPVISUALFLAG_NONE 0x0000 #define wxSTC_WRAPVISUALFLAG_END 0x0001 #define wxSTC_WRAPVISUALFLAG_START 0x0002 #define wxSTC_WRAPVISUALFLAGLOC_DEFAULT 0x0000 #define wxSTC_WRAPVISUALFLAGLOC_END_BY_TEXT 0x0001 #define wxSTC_WRAPVISUALFLAGLOC_START_BY_TEXT 0x0002 #define wxSTC_WRAPINDENT_FIXED 0 #define wxSTC_WRAPINDENT_SAME 1 #define wxSTC_WRAPINDENT_INDENT 2 #define wxSTC_CACHE_NONE 0 #define wxSTC_CACHE_CARET 1 #define wxSTC_CACHE_PAGE 2 #define wxSTC_CACHE_DOCUMENT 3 // Control font anti-aliasing. #define wxSTC_EFF_QUALITY_MASK 0xF #define wxSTC_EFF_QUALITY_DEFAULT 0 #define wxSTC_EFF_QUALITY_NON_ANTIALIASED 1 #define wxSTC_EFF_QUALITY_ANTIALIASED 2 #define wxSTC_EFF_QUALITY_LCD_OPTIMIZED 3 #define wxSTC_EDGE_NONE 0 #define wxSTC_EDGE_LINE 1 #define wxSTC_EDGE_BACKGROUND 2 #define wxSTC_STATUS_OK 0 #define wxSTC_STATUS_FAILURE 1 #define wxSTC_STATUS_BADALLOC 2 #define wxSTC_CURSORNORMAL -1 #define wxSTC_CURSORWAIT 4 // Constants for use with SetVisiblePolicy, similar to SetCaretPolicy. #define wxSTC_VISIBLE_SLOP 0x01 #define wxSTC_VISIBLE_STRICT 0x04 // Caret policy, used by SetXCaretPolicy and SetYCaretPolicy. // If CARET_SLOP is set, we can define a slop value: caretSlop. // This value defines an unwanted zone (UZ) where the caret is... unwanted. // This zone is defined as a number of pixels near the vertical margins, // and as a number of lines near the horizontal margins. // By keeping the caret away from the edges, it is seen within its context, // so it is likely that the identifier that the caret is on can be completely seen, // and that the current line is seen with some of the lines following it which are // often dependent on that line. #define wxSTC_CARET_SLOP 0x01 // If CARET_STRICT is set, the policy is enforced... strictly. // The caret is centred on the display if slop is not set, // and cannot go in the UZ if slop is set. #define wxSTC_CARET_STRICT 0x04 // If CARET_JUMPS is set, the display is moved more energetically // so the caret can move in the same direction longer before the policy is applied again. #define wxSTC_CARET_JUMPS 0x10 // If CARET_EVEN is not set, instead of having symmetrical UZs, // the left and bottom UZs are extended up to right and top UZs respectively. // This way, we favour the displaying of useful information: the begining of lines, // where most code reside, and the lines after the caret, eg. the body of a function. #define wxSTC_CARET_EVEN 0x08 #define wxSTC_SEL_STREAM 0 #define wxSTC_SEL_RECTANGLE 1 #define wxSTC_SEL_LINES 2 #define wxSTC_SEL_THIN 3 #define wxSTC_ALPHA_TRANSPARENT 0 #define wxSTC_ALPHA_OPAQUE 255 #define wxSTC_ALPHA_NOALPHA 256 #define wxSTC_CARETSTYLE_INVISIBLE 0 #define wxSTC_CARETSTYLE_LINE 1 #define wxSTC_CARETSTYLE_BLOCK 2 #define wxSTC_ANNOTATION_HIDDEN 0 #define wxSTC_ANNOTATION_STANDARD 1 #define wxSTC_ANNOTATION_BOXED 2 #define wxSTC_UNDO_MAY_COALESCE 1 #define wxSTC_SCVS_NONE 0 #define wxSTC_SCVS_RECTANGULARSELECTION 1 #define wxSTC_SCVS_USERACCESSIBLE 2 // Maximum value of keywordSet parameter of SetKeyWords. #define wxSTC_KEYWORDSET_MAX 8 // Notifications // Type of modification and the action which caused the modification. // These are defined as a bit mask to make it easy to specify which notifications are wanted. // One bit is set from each of SC_MOD_* and SC_PERFORMED_*. #define wxSTC_MOD_INSERTTEXT 0x1 #define wxSTC_MOD_DELETETEXT 0x2 #define wxSTC_MOD_CHANGESTYLE 0x4 #define wxSTC_MOD_CHANGEFOLD 0x8 #define wxSTC_PERFORMED_USER 0x10 #define wxSTC_PERFORMED_UNDO 0x20 #define wxSTC_PERFORMED_REDO 0x40 #define wxSTC_MULTISTEPUNDOREDO 0x80 #define wxSTC_LASTSTEPINUNDOREDO 0x100 #define wxSTC_MOD_CHANGEMARKER 0x200 #define wxSTC_MOD_BEFOREINSERT 0x400 #define wxSTC_MOD_BEFOREDELETE 0x800 #define wxSTC_MULTILINEUNDOREDO 0x1000 #define wxSTC_STARTACTION 0x2000 #define wxSTC_MOD_CHANGEINDICATOR 0x4000 #define wxSTC_MOD_CHANGELINESTATE 0x8000 #define wxSTC_MOD_CHANGEMARGIN 0x10000 #define wxSTC_MOD_CHANGEANNOTATION 0x20000 #define wxSTC_MOD_CONTAINER 0x40000 #define wxSTC_MODEVENTMASKALL 0x7FFFF // Symbolic key codes and modifier flags. // ASCII and other printable characters below 256. // Extended keys above 300. #define wxSTC_KEY_DOWN 300 #define wxSTC_KEY_UP 301 #define wxSTC_KEY_LEFT 302 #define wxSTC_KEY_RIGHT 303 #define wxSTC_KEY_HOME 304 #define wxSTC_KEY_END 305 #define wxSTC_KEY_PRIOR 306 #define wxSTC_KEY_NEXT 307 #define wxSTC_KEY_DELETE 308 #define wxSTC_KEY_INSERT 309 #define wxSTC_KEY_ESCAPE 7 #define wxSTC_KEY_BACK 8 #define wxSTC_KEY_TAB 9 #define wxSTC_KEY_RETURN 13 #define wxSTC_KEY_ADD 310 #define wxSTC_KEY_SUBTRACT 311 #define wxSTC_KEY_DIVIDE 312 #define wxSTC_KEY_WIN 313 #define wxSTC_KEY_RWIN 314 #define wxSTC_KEY_MENU 315 #define wxSTC_SCMOD_NORM 0 #define wxSTC_SCMOD_SHIFT 1 #define wxSTC_SCMOD_CTRL 2 #define wxSTC_SCMOD_ALT 4 #define wxSTC_SCMOD_SUPER 8 // For SciLexer.h #define wxSTC_LEX_CONTAINER 0 #define wxSTC_LEX_NULL 1 #define wxSTC_LEX_PYTHON 2 #define wxSTC_LEX_CPP 3 #define wxSTC_LEX_HTML 4 #define wxSTC_LEX_XML 5 #define wxSTC_LEX_PERL 6 #define wxSTC_LEX_SQL 7 #define wxSTC_LEX_VB 8 #define wxSTC_LEX_PROPERTIES 9 #define wxSTC_LEX_ERRORLIST 10 #define wxSTC_LEX_MAKEFILE 11 #define wxSTC_LEX_BATCH 12 #define wxSTC_LEX_XCODE 13 #define wxSTC_LEX_LATEX 14 #define wxSTC_LEX_LUA 15 #define wxSTC_LEX_DIFF 16 #define wxSTC_LEX_CONF 17 #define wxSTC_LEX_PASCAL 18 #define wxSTC_LEX_AVE 19 #define wxSTC_LEX_ADA 20 #define wxSTC_LEX_LISP 21 #define wxSTC_LEX_RUBY 22 #define wxSTC_LEX_EIFFEL 23 #define wxSTC_LEX_EIFFELKW 24 #define wxSTC_LEX_TCL 25 #define wxSTC_LEX_NNCRONTAB 26 #define wxSTC_LEX_BULLANT 27 #define wxSTC_LEX_VBSCRIPT 28 #define wxSTC_LEX_BAAN 31 #define wxSTC_LEX_MATLAB 32 #define wxSTC_LEX_SCRIPTOL 33 #define wxSTC_LEX_ASM 34 #define wxSTC_LEX_CPPNOCASE 35 #define wxSTC_LEX_FORTRAN 36 #define wxSTC_LEX_F77 37 #define wxSTC_LEX_CSS 38 #define wxSTC_LEX_POV 39 #define wxSTC_LEX_LOUT 40 #define wxSTC_LEX_ESCRIPT 41 #define wxSTC_LEX_PS 42 #define wxSTC_LEX_NSIS 43 #define wxSTC_LEX_MMIXAL 44 #define wxSTC_LEX_CLW 45 #define wxSTC_LEX_CLWNOCASE 46 #define wxSTC_LEX_LOT 47 #define wxSTC_LEX_YAML 48 #define wxSTC_LEX_TEX 49 #define wxSTC_LEX_METAPOST 50 #define wxSTC_LEX_POWERBASIC 51 #define wxSTC_LEX_FORTH 52 #define wxSTC_LEX_ERLANG 53 #define wxSTC_LEX_OCTAVE 54 #define wxSTC_LEX_MSSQL 55 #define wxSTC_LEX_VERILOG 56 #define wxSTC_LEX_KIX 57 #define wxSTC_LEX_GUI4CLI 58 #define wxSTC_LEX_SPECMAN 59 #define wxSTC_LEX_AU3 60 #define wxSTC_LEX_APDL 61 #define wxSTC_LEX_BASH 62 #define wxSTC_LEX_ASN1 63 #define wxSTC_LEX_VHDL 64 #define wxSTC_LEX_CAML 65 #define wxSTC_LEX_BLITZBASIC 66 #define wxSTC_LEX_PUREBASIC 67 #define wxSTC_LEX_HASKELL 68 #define wxSTC_LEX_PHPSCRIPT 69 #define wxSTC_LEX_TADS3 70 #define wxSTC_LEX_REBOL 71 #define wxSTC_LEX_SMALLTALK 72 #define wxSTC_LEX_FLAGSHIP 73 #define wxSTC_LEX_CSOUND 74 #define wxSTC_LEX_FREEBASIC 75 #define wxSTC_LEX_INNOSETUP 76 #define wxSTC_LEX_OPAL 77 #define wxSTC_LEX_SPICE 78 #define wxSTC_LEX_D 79 #define wxSTC_LEX_CMAKE 80 #define wxSTC_LEX_GAP 81 #define wxSTC_LEX_PLM 82 #define wxSTC_LEX_PROGRESS 83 #define wxSTC_LEX_ABAQUS 84 #define wxSTC_LEX_ASYMPTOTE 85 #define wxSTC_LEX_R 86 #define wxSTC_LEX_MAGIK 87 #define wxSTC_LEX_POWERSHELL 88 #define wxSTC_LEX_MYSQL 89 #define wxSTC_LEX_PO 90 #define wxSTC_LEX_TAL 91 #define wxSTC_LEX_COBOL 92 #define wxSTC_LEX_TACL 93 #define wxSTC_LEX_SORCUS 94 #define wxSTC_LEX_POWERPRO 95 #define wxSTC_LEX_NIMROD 96 #define wxSTC_LEX_SML 97 #define wxSTC_LEX_MARKDOWN 98 // When a lexer specifies its language as SCLEX_AUTOMATIC it receives a // value assigned in sequence from SCLEX_AUTOMATIC+1. #define wxSTC_LEX_AUTOMATIC 1000 // Lexical states for SCLEX_PYTHON #define wxSTC_P_DEFAULT 0 #define wxSTC_P_COMMENTLINE 1 #define wxSTC_P_NUMBER 2 #define wxSTC_P_STRING 3 #define wxSTC_P_CHARACTER 4 #define wxSTC_P_WORD 5 #define wxSTC_P_TRIPLE 6 #define wxSTC_P_TRIPLEDOUBLE 7 #define wxSTC_P_CLASSNAME 8 #define wxSTC_P_DEFNAME 9 #define wxSTC_P_OPERATOR 10 #define wxSTC_P_IDENTIFIER 11 #define wxSTC_P_COMMENTBLOCK 12 #define wxSTC_P_STRINGEOL 13 #define wxSTC_P_WORD2 14 #define wxSTC_P_DECORATOR 15 // Lexical states for SCLEX_CPP #define wxSTC_C_DEFAULT 0 #define wxSTC_C_COMMENT 1 #define wxSTC_C_COMMENTLINE 2 #define wxSTC_C_COMMENTDOC 3 #define wxSTC_C_NUMBER 4 #define wxSTC_C_WORD 5 #define wxSTC_C_STRING 6 #define wxSTC_C_CHARACTER 7 #define wxSTC_C_UUID 8 #define wxSTC_C_PREPROCESSOR 9 #define wxSTC_C_OPERATOR 10 #define wxSTC_C_IDENTIFIER 11 #define wxSTC_C_STRINGEOL 12 #define wxSTC_C_VERBATIM 13 #define wxSTC_C_REGEX 14 #define wxSTC_C_COMMENTLINEDOC 15 #define wxSTC_C_WORD2 16 #define wxSTC_C_COMMENTDOCKEYWORD 17 #define wxSTC_C_COMMENTDOCKEYWORDERROR 18 #define wxSTC_C_GLOBALCLASS 19 // Lexical states for SCLEX_D #define wxSTC_D_DEFAULT 0 #define wxSTC_D_COMMENT 1 #define wxSTC_D_COMMENTLINE 2 #define wxSTC_D_COMMENTDOC 3 #define wxSTC_D_COMMENTNESTED 4 #define wxSTC_D_NUMBER 5 #define wxSTC_D_WORD 6 #define wxSTC_D_WORD2 7 #define wxSTC_D_WORD3 8 #define wxSTC_D_TYPEDEF 9 #define wxSTC_D_STRING 10 #define wxSTC_D_STRINGEOL 11 #define wxSTC_D_CHARACTER 12 #define wxSTC_D_OPERATOR 13 #define wxSTC_D_IDENTIFIER 14 #define wxSTC_D_COMMENTLINEDOC 15 #define wxSTC_D_COMMENTDOCKEYWORD 16 #define wxSTC_D_COMMENTDOCKEYWORDERROR 17 #define wxSTC_D_STRINGB 18 #define wxSTC_D_STRINGR 19 #define wxSTC_D_WORD5 20 #define wxSTC_D_WORD6 21 #define wxSTC_D_WORD7 22 // Lexical states for SCLEX_TCL #define wxSTC_TCL_DEFAULT 0 #define wxSTC_TCL_COMMENT 1 #define wxSTC_TCL_COMMENTLINE 2 #define wxSTC_TCL_NUMBER 3 #define wxSTC_TCL_WORD_IN_QUOTE 4 #define wxSTC_TCL_IN_QUOTE 5 #define wxSTC_TCL_OPERATOR 6 #define wxSTC_TCL_IDENTIFIER 7 #define wxSTC_TCL_SUBSTITUTION 8 #define wxSTC_TCL_SUB_BRACE 9 #define wxSTC_TCL_MODIFIER 10 #define wxSTC_TCL_EXPAND 11 #define wxSTC_TCL_WORD 12 #define wxSTC_TCL_WORD2 13 #define wxSTC_TCL_WORD3 14 #define wxSTC_TCL_WORD4 15 #define wxSTC_TCL_WORD5 16 #define wxSTC_TCL_WORD6 17 #define wxSTC_TCL_WORD7 18 #define wxSTC_TCL_WORD8 19 #define wxSTC_TCL_COMMENT_BOX 20 #define wxSTC_TCL_BLOCK_COMMENT 21 // Lexical states for SCLEX_HTML, SCLEX_XML #define wxSTC_H_DEFAULT 0 #define wxSTC_H_TAG 1 #define wxSTC_H_TAGUNKNOWN 2 #define wxSTC_H_ATTRIBUTE 3 #define wxSTC_H_ATTRIBUTEUNKNOWN 4 #define wxSTC_H_NUMBER 5 #define wxSTC_H_DOUBLESTRING 6 #define wxSTC_H_SINGLESTRING 7 #define wxSTC_H_OTHER 8 #define wxSTC_H_COMMENT 9 #define wxSTC_H_ENTITY 10 // XML and ASP #define wxSTC_H_TAGEND 11 #define wxSTC_H_XMLSTART 12 #define wxSTC_H_XMLEND 13 #define wxSTC_H_SCRIPT 14 #define wxSTC_H_ASP 15 #define wxSTC_H_ASPAT 16 #define wxSTC_H_CDATA 17 #define wxSTC_H_QUESTION 18 // More HTML #define wxSTC_H_VALUE 19 // X-Code #define wxSTC_H_XCCOMMENT 20 // SGML #define wxSTC_H_SGML_DEFAULT 21 #define wxSTC_H_SGML_COMMAND 22 #define wxSTC_H_SGML_1ST_PARAM 23 #define wxSTC_H_SGML_DOUBLESTRING 24 #define wxSTC_H_SGML_SIMPLESTRING 25 #define wxSTC_H_SGML_ERROR 26 #define wxSTC_H_SGML_SPECIAL 27 #define wxSTC_H_SGML_ENTITY 28 #define wxSTC_H_SGML_COMMENT 29 #define wxSTC_H_SGML_1ST_PARAM_COMMENT 30 #define wxSTC_H_SGML_BLOCK_DEFAULT 31 // Embedded Javascript #define wxSTC_HJ_START 40 #define wxSTC_HJ_DEFAULT 41 #define wxSTC_HJ_COMMENT 42 #define wxSTC_HJ_COMMENTLINE 43 #define wxSTC_HJ_COMMENTDOC 44 #define wxSTC_HJ_NUMBER 45 #define wxSTC_HJ_WORD 46 #define wxSTC_HJ_KEYWORD 47 #define wxSTC_HJ_DOUBLESTRING 48 #define wxSTC_HJ_SINGLESTRING 49 #define wxSTC_HJ_SYMBOLS 50 #define wxSTC_HJ_STRINGEOL 51 #define wxSTC_HJ_REGEX 52 // ASP Javascript #define wxSTC_HJA_START 55 #define wxSTC_HJA_DEFAULT 56 #define wxSTC_HJA_COMMENT 57 #define wxSTC_HJA_COMMENTLINE 58 #define wxSTC_HJA_COMMENTDOC 59 #define wxSTC_HJA_NUMBER 60 #define wxSTC_HJA_WORD 61 #define wxSTC_HJA_KEYWORD 62 #define wxSTC_HJA_DOUBLESTRING 63 #define wxSTC_HJA_SINGLESTRING 64 #define wxSTC_HJA_SYMBOLS 65 #define wxSTC_HJA_STRINGEOL 66 #define wxSTC_HJA_REGEX 67 // Embedded VBScript #define wxSTC_HB_START 70 #define wxSTC_HB_DEFAULT 71 #define wxSTC_HB_COMMENTLINE 72 #define wxSTC_HB_NUMBER 73 #define wxSTC_HB_WORD 74 #define wxSTC_HB_STRING 75 #define wxSTC_HB_IDENTIFIER 76 #define wxSTC_HB_STRINGEOL 77 // ASP VBScript #define wxSTC_HBA_START 80 #define wxSTC_HBA_DEFAULT 81 #define wxSTC_HBA_COMMENTLINE 82 #define wxSTC_HBA_NUMBER 83 #define wxSTC_HBA_WORD 84 #define wxSTC_HBA_STRING 85 #define wxSTC_HBA_IDENTIFIER 86 #define wxSTC_HBA_STRINGEOL 87 // Embedded Python #define wxSTC_HP_START 90 #define wxSTC_HP_DEFAULT 91 #define wxSTC_HP_COMMENTLINE 92 #define wxSTC_HP_NUMBER 93 #define wxSTC_HP_STRING 94 #define wxSTC_HP_CHARACTER 95 #define wxSTC_HP_WORD 96 #define wxSTC_HP_TRIPLE 97 #define wxSTC_HP_TRIPLEDOUBLE 98 #define wxSTC_HP_CLASSNAME 99 #define wxSTC_HP_DEFNAME 100 #define wxSTC_HP_OPERATOR 101 #define wxSTC_HP_IDENTIFIER 102 // PHP #define wxSTC_HPHP_COMPLEX_VARIABLE 104 // ASP Python #define wxSTC_HPA_START 105 #define wxSTC_HPA_DEFAULT 106 #define wxSTC_HPA_COMMENTLINE 107 #define wxSTC_HPA_NUMBER 108 #define wxSTC_HPA_STRING 109 #define wxSTC_HPA_CHARACTER 110 #define wxSTC_HPA_WORD 111 #define wxSTC_HPA_TRIPLE 112 #define wxSTC_HPA_TRIPLEDOUBLE 113 #define wxSTC_HPA_CLASSNAME 114 #define wxSTC_HPA_DEFNAME 115 #define wxSTC_HPA_OPERATOR 116 #define wxSTC_HPA_IDENTIFIER 117 // PHP #define wxSTC_HPHP_DEFAULT 118 #define wxSTC_HPHP_HSTRING 119 #define wxSTC_HPHP_SIMPLESTRING 120 #define wxSTC_HPHP_WORD 121 #define wxSTC_HPHP_NUMBER 122 #define wxSTC_HPHP_VARIABLE 123 #define wxSTC_HPHP_COMMENT 124 #define wxSTC_HPHP_COMMENTLINE 125 #define wxSTC_HPHP_HSTRING_VARIABLE 126 #define wxSTC_HPHP_OPERATOR 127 // Lexical states for SCLEX_PERL #define wxSTC_PL_DEFAULT 0 #define wxSTC_PL_ERROR 1 #define wxSTC_PL_COMMENTLINE 2 #define wxSTC_PL_POD 3 #define wxSTC_PL_NUMBER 4 #define wxSTC_PL_WORD 5 #define wxSTC_PL_STRING 6 #define wxSTC_PL_CHARACTER 7 #define wxSTC_PL_PUNCTUATION 8 #define wxSTC_PL_PREPROCESSOR 9 #define wxSTC_PL_OPERATOR 10 #define wxSTC_PL_IDENTIFIER 11 #define wxSTC_PL_SCALAR 12 #define wxSTC_PL_ARRAY 13 #define wxSTC_PL_HASH 14 #define wxSTC_PL_SYMBOLTABLE 15 #define wxSTC_PL_VARIABLE_INDEXER 16 #define wxSTC_PL_REGEX 17 #define wxSTC_PL_REGSUBST 18 #define wxSTC_PL_LONGQUOTE 19 #define wxSTC_PL_BACKTICKS 20 #define wxSTC_PL_DATASECTION 21 #define wxSTC_PL_HERE_DELIM 22 #define wxSTC_PL_HERE_Q 23 #define wxSTC_PL_HERE_QQ 24 #define wxSTC_PL_HERE_QX 25 #define wxSTC_PL_STRING_Q 26 #define wxSTC_PL_STRING_QQ 27 #define wxSTC_PL_STRING_QX 28 #define wxSTC_PL_STRING_QR 29 #define wxSTC_PL_STRING_QW 30 #define wxSTC_PL_POD_VERB 31 #define wxSTC_PL_SUB_PROTOTYPE 40 #define wxSTC_PL_FORMAT_IDENT 41 #define wxSTC_PL_FORMAT 42 #define wxSTC_PL_STRING_VAR 43 #define wxSTC_PL_XLAT 44 #define wxSTC_PL_REGEX_VAR 54 #define wxSTC_PL_REGSUBST_VAR 55 #define wxSTC_PL_BACKTICKS_VAR 57 #define wxSTC_PL_HERE_QQ_VAR 61 #define wxSTC_PL_HERE_QX_VAR 62 #define wxSTC_PL_STRING_QQ_VAR 64 #define wxSTC_PL_STRING_QX_VAR 65 #define wxSTC_PL_STRING_QR_VAR 66 // Lexical states for SCLEX_RUBY #define wxSTC_RB_DEFAULT 0 #define wxSTC_RB_ERROR 1 #define wxSTC_RB_COMMENTLINE 2 #define wxSTC_RB_POD 3 #define wxSTC_RB_NUMBER 4 #define wxSTC_RB_WORD 5 #define wxSTC_RB_STRING 6 #define wxSTC_RB_CHARACTER 7 #define wxSTC_RB_CLASSNAME 8 #define wxSTC_RB_DEFNAME 9 #define wxSTC_RB_OPERATOR 10 #define wxSTC_RB_IDENTIFIER 11 #define wxSTC_RB_REGEX 12 #define wxSTC_RB_GLOBAL 13 #define wxSTC_RB_SYMBOL 14 #define wxSTC_RB_MODULE_NAME 15 #define wxSTC_RB_INSTANCE_VAR 16 #define wxSTC_RB_CLASS_VAR 17 #define wxSTC_RB_BACKTICKS 18 #define wxSTC_RB_DATASECTION 19 #define wxSTC_RB_HERE_DELIM 20 #define wxSTC_RB_HERE_Q 21 #define wxSTC_RB_HERE_QQ 22 #define wxSTC_RB_HERE_QX 23 #define wxSTC_RB_STRING_Q 24 #define wxSTC_RB_STRING_QQ 25 #define wxSTC_RB_STRING_QX 26 #define wxSTC_RB_STRING_QR 27 #define wxSTC_RB_STRING_QW 28 #define wxSTC_RB_WORD_DEMOTED 29 #define wxSTC_RB_STDIN 30 #define wxSTC_RB_STDOUT 31 #define wxSTC_RB_STDERR 40 #define wxSTC_RB_UPPER_BOUND 41 // Lexical states for SCLEX_VB, SCLEX_VBSCRIPT, SCLEX_POWERBASIC #define wxSTC_B_DEFAULT 0 #define wxSTC_B_COMMENT 1 #define wxSTC_B_NUMBER 2 #define wxSTC_B_KEYWORD 3 #define wxSTC_B_STRING 4 #define wxSTC_B_PREPROCESSOR 5 #define wxSTC_B_OPERATOR 6 #define wxSTC_B_IDENTIFIER 7 #define wxSTC_B_DATE 8 #define wxSTC_B_STRINGEOL 9 #define wxSTC_B_KEYWORD2 10 #define wxSTC_B_KEYWORD3 11 #define wxSTC_B_KEYWORD4 12 #define wxSTC_B_CONSTANT 13 #define wxSTC_B_ASM 14 #define wxSTC_B_LABEL 15 #define wxSTC_B_ERROR 16 #define wxSTC_B_HEXNUMBER 17 #define wxSTC_B_BINNUMBER 18 // Lexical states for SCLEX_PROPERTIES #define wxSTC_PROPS_DEFAULT 0 #define wxSTC_PROPS_COMMENT 1 #define wxSTC_PROPS_SECTION 2 #define wxSTC_PROPS_ASSIGNMENT 3 #define wxSTC_PROPS_DEFVAL 4 #define wxSTC_PROPS_KEY 5 // Lexical states for SCLEX_LATEX #define wxSTC_L_DEFAULT 0 #define wxSTC_L_COMMAND 1 #define wxSTC_L_TAG 2 #define wxSTC_L_MATH 3 #define wxSTC_L_COMMENT 4 // Lexical states for SCLEX_LUA #define wxSTC_LUA_DEFAULT 0 #define wxSTC_LUA_COMMENT 1 #define wxSTC_LUA_COMMENTLINE 2 #define wxSTC_LUA_COMMENTDOC 3 #define wxSTC_LUA_NUMBER 4 #define wxSTC_LUA_WORD 5 #define wxSTC_LUA_STRING 6 #define wxSTC_LUA_CHARACTER 7 #define wxSTC_LUA_LITERALSTRING 8 #define wxSTC_LUA_PREPROCESSOR 9 #define wxSTC_LUA_OPERATOR 10 #define wxSTC_LUA_IDENTIFIER 11 #define wxSTC_LUA_STRINGEOL 12 #define wxSTC_LUA_WORD2 13 #define wxSTC_LUA_WORD3 14 #define wxSTC_LUA_WORD4 15 #define wxSTC_LUA_WORD5 16 #define wxSTC_LUA_WORD6 17 #define wxSTC_LUA_WORD7 18 #define wxSTC_LUA_WORD8 19 // Lexical states for SCLEX_ERRORLIST #define wxSTC_ERR_DEFAULT 0 #define wxSTC_ERR_PYTHON 1 #define wxSTC_ERR_GCC 2 #define wxSTC_ERR_MS 3 #define wxSTC_ERR_CMD 4 #define wxSTC_ERR_BORLAND 5 #define wxSTC_ERR_PERL 6 #define wxSTC_ERR_NET 7 #define wxSTC_ERR_LUA 8 #define wxSTC_ERR_CTAG 9 #define wxSTC_ERR_DIFF_CHANGED 10 #define wxSTC_ERR_DIFF_ADDITION 11 #define wxSTC_ERR_DIFF_DELETION 12 #define wxSTC_ERR_DIFF_MESSAGE 13 #define wxSTC_ERR_PHP 14 #define wxSTC_ERR_ELF 15 #define wxSTC_ERR_IFC 16 #define wxSTC_ERR_IFORT 17 #define wxSTC_ERR_ABSF 18 #define wxSTC_ERR_TIDY 19 #define wxSTC_ERR_JAVA_STACK 20 #define wxSTC_ERR_VALUE 21 // Lexical states for SCLEX_BATCH #define wxSTC_BAT_DEFAULT 0 #define wxSTC_BAT_COMMENT 1 #define wxSTC_BAT_WORD 2 #define wxSTC_BAT_LABEL 3 #define wxSTC_BAT_HIDE 4 #define wxSTC_BAT_COMMAND 5 #define wxSTC_BAT_IDENTIFIER 6 #define wxSTC_BAT_OPERATOR 7 // Lexical states for SCLEX_MAKEFILE #define wxSTC_MAKE_DEFAULT 0 #define wxSTC_MAKE_COMMENT 1 #define wxSTC_MAKE_PREPROCESSOR 2 #define wxSTC_MAKE_IDENTIFIER 3 #define wxSTC_MAKE_OPERATOR 4 #define wxSTC_MAKE_TARGET 5 #define wxSTC_MAKE_IDEOL 9 // Lexical states for SCLEX_DIFF #define wxSTC_DIFF_DEFAULT 0 #define wxSTC_DIFF_COMMENT 1 #define wxSTC_DIFF_COMMAND 2 #define wxSTC_DIFF_HEADER 3 #define wxSTC_DIFF_POSITION 4 #define wxSTC_DIFF_DELETED 5 #define wxSTC_DIFF_ADDED 6 #define wxSTC_DIFF_CHANGED 7 // Lexical states for SCLEX_CONF (Apache Configuration Files Lexer) #define wxSTC_CONF_DEFAULT 0 #define wxSTC_CONF_COMMENT 1 #define wxSTC_CONF_NUMBER 2 #define wxSTC_CONF_IDENTIFIER 3 #define wxSTC_CONF_EXTENSION 4 #define wxSTC_CONF_PARAMETER 5 #define wxSTC_CONF_STRING 6 #define wxSTC_CONF_OPERATOR 7 #define wxSTC_CONF_IP 8 #define wxSTC_CONF_DIRECTIVE 9 // Lexical states for SCLEX_AVE, Avenue #define wxSTC_AVE_DEFAULT 0 #define wxSTC_AVE_COMMENT 1 #define wxSTC_AVE_NUMBER 2 #define wxSTC_AVE_WORD 3 #define wxSTC_AVE_STRING 6 #define wxSTC_AVE_ENUM 7 #define wxSTC_AVE_STRINGEOL 8 #define wxSTC_AVE_IDENTIFIER 9 #define wxSTC_AVE_OPERATOR 10 #define wxSTC_AVE_WORD1 11 #define wxSTC_AVE_WORD2 12 #define wxSTC_AVE_WORD3 13 #define wxSTC_AVE_WORD4 14 #define wxSTC_AVE_WORD5 15 #define wxSTC_AVE_WORD6 16 // Lexical states for SCLEX_ADA #define wxSTC_ADA_DEFAULT 0 #define wxSTC_ADA_WORD 1 #define wxSTC_ADA_IDENTIFIER 2 #define wxSTC_ADA_NUMBER 3 #define wxSTC_ADA_DELIMITER 4 #define wxSTC_ADA_CHARACTER 5 #define wxSTC_ADA_CHARACTEREOL 6 #define wxSTC_ADA_STRING 7 #define wxSTC_ADA_STRINGEOL 8 #define wxSTC_ADA_LABEL 9 #define wxSTC_ADA_COMMENTLINE 10 #define wxSTC_ADA_ILLEGAL 11 // Lexical states for SCLEX_BAAN #define wxSTC_BAAN_DEFAULT 0 #define wxSTC_BAAN_COMMENT 1 #define wxSTC_BAAN_COMMENTDOC 2 #define wxSTC_BAAN_NUMBER 3 #define wxSTC_BAAN_WORD 4 #define wxSTC_BAAN_STRING 5 #define wxSTC_BAAN_PREPROCESSOR 6 #define wxSTC_BAAN_OPERATOR 7 #define wxSTC_BAAN_IDENTIFIER 8 #define wxSTC_BAAN_STRINGEOL 9 #define wxSTC_BAAN_WORD2 10 // Lexical states for SCLEX_LISP #define wxSTC_LISP_DEFAULT 0 #define wxSTC_LISP_COMMENT 1 #define wxSTC_LISP_NUMBER 2 #define wxSTC_LISP_KEYWORD 3 #define wxSTC_LISP_KEYWORD_KW 4 #define wxSTC_LISP_SYMBOL 5 #define wxSTC_LISP_STRING 6 #define wxSTC_LISP_STRINGEOL 8 #define wxSTC_LISP_IDENTIFIER 9 #define wxSTC_LISP_OPERATOR 10 #define wxSTC_LISP_SPECIAL 11 #define wxSTC_LISP_MULTI_COMMENT 12 // Lexical states for SCLEX_EIFFEL and SCLEX_EIFFELKW #define wxSTC_EIFFEL_DEFAULT 0 #define wxSTC_EIFFEL_COMMENTLINE 1 #define wxSTC_EIFFEL_NUMBER 2 #define wxSTC_EIFFEL_WORD 3 #define wxSTC_EIFFEL_STRING 4 #define wxSTC_EIFFEL_CHARACTER 5 #define wxSTC_EIFFEL_OPERATOR 6 #define wxSTC_EIFFEL_IDENTIFIER 7 #define wxSTC_EIFFEL_STRINGEOL 8 // Lexical states for SCLEX_NNCRONTAB (nnCron crontab Lexer) #define wxSTC_NNCRONTAB_DEFAULT 0 #define wxSTC_NNCRONTAB_COMMENT 1 #define wxSTC_NNCRONTAB_TASK 2 #define wxSTC_NNCRONTAB_SECTION 3 #define wxSTC_NNCRONTAB_KEYWORD 4 #define wxSTC_NNCRONTAB_MODIFIER 5 #define wxSTC_NNCRONTAB_ASTERISK 6 #define wxSTC_NNCRONTAB_NUMBER 7 #define wxSTC_NNCRONTAB_STRING 8 #define wxSTC_NNCRONTAB_ENVIRONMENT 9 #define wxSTC_NNCRONTAB_IDENTIFIER 10 // Lexical states for SCLEX_FORTH (Forth Lexer) #define wxSTC_FORTH_DEFAULT 0 #define wxSTC_FORTH_COMMENT 1 #define wxSTC_FORTH_COMMENT_ML 2 #define wxSTC_FORTH_IDENTIFIER 3 #define wxSTC_FORTH_CONTROL 4 #define wxSTC_FORTH_KEYWORD 5 #define wxSTC_FORTH_DEFWORD 6 #define wxSTC_FORTH_PREWORD1 7 #define wxSTC_FORTH_PREWORD2 8 #define wxSTC_FORTH_NUMBER 9 #define wxSTC_FORTH_STRING 10 #define wxSTC_FORTH_LOCALE 11 // Lexical states for SCLEX_MATLAB #define wxSTC_MATLAB_DEFAULT 0 #define wxSTC_MATLAB_COMMENT 1 #define wxSTC_MATLAB_COMMAND 2 #define wxSTC_MATLAB_NUMBER 3 #define wxSTC_MATLAB_KEYWORD 4 // single quoted string #define wxSTC_MATLAB_STRING 5 #define wxSTC_MATLAB_OPERATOR 6 #define wxSTC_MATLAB_IDENTIFIER 7 #define wxSTC_MATLAB_DOUBLEQUOTESTRING 8 // Lexical states for SCLEX_SCRIPTOL #define wxSTC_SCRIPTOL_DEFAULT 0 #define wxSTC_SCRIPTOL_WHITE 1 #define wxSTC_SCRIPTOL_COMMENTLINE 2 #define wxSTC_SCRIPTOL_PERSISTENT 3 #define wxSTC_SCRIPTOL_CSTYLE 4 #define wxSTC_SCRIPTOL_COMMENTBLOCK 5 #define wxSTC_SCRIPTOL_NUMBER 6 #define wxSTC_SCRIPTOL_STRING 7 #define wxSTC_SCRIPTOL_CHARACTER 8 #define wxSTC_SCRIPTOL_STRINGEOL 9 #define wxSTC_SCRIPTOL_KEYWORD 10 #define wxSTC_SCRIPTOL_OPERATOR 11 #define wxSTC_SCRIPTOL_IDENTIFIER 12 #define wxSTC_SCRIPTOL_TRIPLE 13 #define wxSTC_SCRIPTOL_CLASSNAME 14 #define wxSTC_SCRIPTOL_PREPROCESSOR 15 // Lexical states for SCLEX_ASM #define wxSTC_ASM_DEFAULT 0 #define wxSTC_ASM_COMMENT 1 #define wxSTC_ASM_NUMBER 2 #define wxSTC_ASM_STRING 3 #define wxSTC_ASM_OPERATOR 4 #define wxSTC_ASM_IDENTIFIER 5 #define wxSTC_ASM_CPUINSTRUCTION 6 #define wxSTC_ASM_MATHINSTRUCTION 7 #define wxSTC_ASM_REGISTER 8 #define wxSTC_ASM_DIRECTIVE 9 #define wxSTC_ASM_DIRECTIVEOPERAND 10 #define wxSTC_ASM_COMMENTBLOCK 11 #define wxSTC_ASM_CHARACTER 12 #define wxSTC_ASM_STRINGEOL 13 #define wxSTC_ASM_EXTINSTRUCTION 14 // Lexical states for SCLEX_FORTRAN #define wxSTC_F_DEFAULT 0 #define wxSTC_F_COMMENT 1 #define wxSTC_F_NUMBER 2 #define wxSTC_F_STRING1 3 #define wxSTC_F_STRING2 4 #define wxSTC_F_STRINGEOL 5 #define wxSTC_F_OPERATOR 6 #define wxSTC_F_IDENTIFIER 7 #define wxSTC_F_WORD 8 #define wxSTC_F_WORD2 9 #define wxSTC_F_WORD3 10 #define wxSTC_F_PREPROCESSOR 11 #define wxSTC_F_OPERATOR2 12 #define wxSTC_F_LABEL 13 #define wxSTC_F_CONTINUATION 14 // Lexical states for SCLEX_CSS #define wxSTC_CSS_DEFAULT 0 #define wxSTC_CSS_TAG 1 #define wxSTC_CSS_CLASS 2 #define wxSTC_CSS_PSEUDOCLASS 3 #define wxSTC_CSS_UNKNOWN_PSEUDOCLASS 4 #define wxSTC_CSS_OPERATOR 5 #define wxSTC_CSS_IDENTIFIER 6 #define wxSTC_CSS_UNKNOWN_IDENTIFIER 7 #define wxSTC_CSS_VALUE 8 #define wxSTC_CSS_COMMENT 9 #define wxSTC_CSS_ID 10 #define wxSTC_CSS_IMPORTANT 11 #define wxSTC_CSS_DIRECTIVE 12 #define wxSTC_CSS_DOUBLESTRING 13 #define wxSTC_CSS_SINGLESTRING 14 #define wxSTC_CSS_IDENTIFIER2 15 #define wxSTC_CSS_ATTRIBUTE 16 #define wxSTC_CSS_IDENTIFIER3 17 #define wxSTC_CSS_PSEUDOELEMENT 18 #define wxSTC_CSS_EXTENDED_IDENTIFIER 19 #define wxSTC_CSS_EXTENDED_PSEUDOCLASS 20 #define wxSTC_CSS_EXTENDED_PSEUDOELEMENT 21 // Lexical states for SCLEX_POV #define wxSTC_POV_DEFAULT 0 #define wxSTC_POV_COMMENT 1 #define wxSTC_POV_COMMENTLINE 2 #define wxSTC_POV_NUMBER 3 #define wxSTC_POV_OPERATOR 4 #define wxSTC_POV_IDENTIFIER 5 #define wxSTC_POV_STRING 6 #define wxSTC_POV_STRINGEOL 7 #define wxSTC_POV_DIRECTIVE 8 #define wxSTC_POV_BADDIRECTIVE 9 #define wxSTC_POV_WORD2 10 #define wxSTC_POV_WORD3 11 #define wxSTC_POV_WORD4 12 #define wxSTC_POV_WORD5 13 #define wxSTC_POV_WORD6 14 #define wxSTC_POV_WORD7 15 #define wxSTC_POV_WORD8 16 // Lexical states for SCLEX_LOUT #define wxSTC_LOUT_DEFAULT 0 #define wxSTC_LOUT_COMMENT 1 #define wxSTC_LOUT_NUMBER 2 #define wxSTC_LOUT_WORD 3 #define wxSTC_LOUT_WORD2 4 #define wxSTC_LOUT_WORD3 5 #define wxSTC_LOUT_WORD4 6 #define wxSTC_LOUT_STRING 7 #define wxSTC_LOUT_OPERATOR 8 #define wxSTC_LOUT_IDENTIFIER 9 #define wxSTC_LOUT_STRINGEOL 10 // Lexical states for SCLEX_ESCRIPT #define wxSTC_ESCRIPT_DEFAULT 0 #define wxSTC_ESCRIPT_COMMENT 1 #define wxSTC_ESCRIPT_COMMENTLINE 2 #define wxSTC_ESCRIPT_COMMENTDOC 3 #define wxSTC_ESCRIPT_NUMBER 4 #define wxSTC_ESCRIPT_WORD 5 #define wxSTC_ESCRIPT_STRING 6 #define wxSTC_ESCRIPT_OPERATOR 7 #define wxSTC_ESCRIPT_IDENTIFIER 8 #define wxSTC_ESCRIPT_BRACE 9 #define wxSTC_ESCRIPT_WORD2 10 #define wxSTC_ESCRIPT_WORD3 11 // Lexical states for SCLEX_PS #define wxSTC_PS_DEFAULT 0 #define wxSTC_PS_COMMENT 1 #define wxSTC_PS_DSC_COMMENT 2 #define wxSTC_PS_DSC_VALUE 3 #define wxSTC_PS_NUMBER 4 #define wxSTC_PS_NAME 5 #define wxSTC_PS_KEYWORD 6 #define wxSTC_PS_LITERAL 7 #define wxSTC_PS_IMMEVAL 8 #define wxSTC_PS_PAREN_ARRAY 9 #define wxSTC_PS_PAREN_DICT 10 #define wxSTC_PS_PAREN_PROC 11 #define wxSTC_PS_TEXT 12 #define wxSTC_PS_HEXSTRING 13 #define wxSTC_PS_BASE85STRING 14 #define wxSTC_PS_BADSTRINGCHAR 15 // Lexical states for SCLEX_NSIS #define wxSTC_NSIS_DEFAULT 0 #define wxSTC_NSIS_COMMENT 1 #define wxSTC_NSIS_STRINGDQ 2 #define wxSTC_NSIS_STRINGLQ 3 #define wxSTC_NSIS_STRINGRQ 4 #define wxSTC_NSIS_FUNCTION 5 #define wxSTC_NSIS_VARIABLE 6 #define wxSTC_NSIS_LABEL 7 #define wxSTC_NSIS_USERDEFINED 8 #define wxSTC_NSIS_SECTIONDEF 9 #define wxSTC_NSIS_SUBSECTIONDEF 10 #define wxSTC_NSIS_IFDEFINEDEF 11 #define wxSTC_NSIS_MACRODEF 12 #define wxSTC_NSIS_STRINGVAR 13 #define wxSTC_NSIS_NUMBER 14 #define wxSTC_NSIS_SECTIONGROUP 15 #define wxSTC_NSIS_PAGEEX 16 #define wxSTC_NSIS_FUNCTIONDEF 17 #define wxSTC_NSIS_COMMENTBOX 18 // Lexical states for SCLEX_MMIXAL #define wxSTC_MMIXAL_LEADWS 0 #define wxSTC_MMIXAL_COMMENT 1 #define wxSTC_MMIXAL_LABEL 2 #define wxSTC_MMIXAL_OPCODE 3 #define wxSTC_MMIXAL_OPCODE_PRE 4 #define wxSTC_MMIXAL_OPCODE_VALID 5 #define wxSTC_MMIXAL_OPCODE_UNKNOWN 6 #define wxSTC_MMIXAL_OPCODE_POST 7 #define wxSTC_MMIXAL_OPERANDS 8 #define wxSTC_MMIXAL_NUMBER 9 #define wxSTC_MMIXAL_REF 10 #define wxSTC_MMIXAL_CHAR 11 #define wxSTC_MMIXAL_STRING 12 #define wxSTC_MMIXAL_REGISTER 13 #define wxSTC_MMIXAL_HEX 14 #define wxSTC_MMIXAL_OPERATOR 15 #define wxSTC_MMIXAL_SYMBOL 16 #define wxSTC_MMIXAL_INCLUDE 17 // Lexical states for SCLEX_CLW #define wxSTC_CLW_DEFAULT 0 #define wxSTC_CLW_LABEL 1 #define wxSTC_CLW_COMMENT 2 #define wxSTC_CLW_STRING 3 #define wxSTC_CLW_USER_IDENTIFIER 4 #define wxSTC_CLW_INTEGER_CONSTANT 5 #define wxSTC_CLW_REAL_CONSTANT 6 #define wxSTC_CLW_PICTURE_STRING 7 #define wxSTC_CLW_KEYWORD 8 #define wxSTC_CLW_COMPILER_DIRECTIVE 9 #define wxSTC_CLW_RUNTIME_EXPRESSIONS 10 #define wxSTC_CLW_BUILTIN_PROCEDURES_FUNCTION 11 #define wxSTC_CLW_STRUCTURE_DATA_TYPE 12 #define wxSTC_CLW_ATTRIBUTE 13 #define wxSTC_CLW_STANDARD_EQUATE 14 #define wxSTC_CLW_ERROR 15 #define wxSTC_CLW_DEPRECATED 16 // Lexical states for SCLEX_LOT #define wxSTC_LOT_DEFAULT 0 #define wxSTC_LOT_HEADER 1 #define wxSTC_LOT_BREAK 2 #define wxSTC_LOT_SET 3 #define wxSTC_LOT_PASS 4 #define wxSTC_LOT_FAIL 5 #define wxSTC_LOT_ABORT 6 // Lexical states for SCLEX_YAML #define wxSTC_YAML_DEFAULT 0 #define wxSTC_YAML_COMMENT 1 #define wxSTC_YAML_IDENTIFIER 2 #define wxSTC_YAML_KEYWORD 3 #define wxSTC_YAML_NUMBER 4 #define wxSTC_YAML_REFERENCE 5 #define wxSTC_YAML_DOCUMENT 6 #define wxSTC_YAML_TEXT 7 #define wxSTC_YAML_ERROR 8 #define wxSTC_YAML_OPERATOR 9 // Lexical states for SCLEX_TEX #define wxSTC_TEX_DEFAULT 0 #define wxSTC_TEX_SPECIAL 1 #define wxSTC_TEX_GROUP 2 #define wxSTC_TEX_SYMBOL 3 #define wxSTC_TEX_COMMAND 4 #define wxSTC_TEX_TEXT 5 #define wxSTC_METAPOST_DEFAULT 0 #define wxSTC_METAPOST_SPECIAL 1 #define wxSTC_METAPOST_GROUP 2 #define wxSTC_METAPOST_SYMBOL 3 #define wxSTC_METAPOST_COMMAND 4 #define wxSTC_METAPOST_TEXT 5 #define wxSTC_METAPOST_EXTRA 6 // Lexical states for SCLEX_ERLANG #define wxSTC_ERLANG_DEFAULT 0 #define wxSTC_ERLANG_COMMENT 1 #define wxSTC_ERLANG_VARIABLE 2 #define wxSTC_ERLANG_NUMBER 3 #define wxSTC_ERLANG_KEYWORD 4 #define wxSTC_ERLANG_STRING 5 #define wxSTC_ERLANG_OPERATOR 6 #define wxSTC_ERLANG_ATOM 7 #define wxSTC_ERLANG_FUNCTION_NAME 8 #define wxSTC_ERLANG_CHARACTER 9 #define wxSTC_ERLANG_MACRO 10 #define wxSTC_ERLANG_RECORD 11 #define wxSTC_ERLANG_PREPROC 12 #define wxSTC_ERLANG_NODE_NAME 13 #define wxSTC_ERLANG_COMMENT_FUNCTION 14 #define wxSTC_ERLANG_COMMENT_MODULE 15 #define wxSTC_ERLANG_COMMENT_DOC 16 #define wxSTC_ERLANG_COMMENT_DOC_MACRO 17 #define wxSTC_ERLANG_ATOM_QUOTED 18 #define wxSTC_ERLANG_MACRO_QUOTED 19 #define wxSTC_ERLANG_RECORD_QUOTED 20 #define wxSTC_ERLANG_NODE_NAME_QUOTED 21 #define wxSTC_ERLANG_BIFS 22 #define wxSTC_ERLANG_MODULES 23 #define wxSTC_ERLANG_MODULES_ATT 24 #define wxSTC_ERLANG_UNKNOWN 31 // Lexical states for SCLEX_OCTAVE are identical to MatLab // Lexical states for SCLEX_MSSQL #define wxSTC_MSSQL_DEFAULT 0 #define wxSTC_MSSQL_COMMENT 1 #define wxSTC_MSSQL_LINE_COMMENT 2 #define wxSTC_MSSQL_NUMBER 3 #define wxSTC_MSSQL_STRING 4 #define wxSTC_MSSQL_OPERATOR 5 #define wxSTC_MSSQL_IDENTIFIER 6 #define wxSTC_MSSQL_VARIABLE 7 #define wxSTC_MSSQL_COLUMN_NAME 8 #define wxSTC_MSSQL_STATEMENT 9 #define wxSTC_MSSQL_DATATYPE 10 #define wxSTC_MSSQL_SYSTABLE 11 #define wxSTC_MSSQL_GLOBAL_VARIABLE 12 #define wxSTC_MSSQL_FUNCTION 13 #define wxSTC_MSSQL_STORED_PROCEDURE 14 #define wxSTC_MSSQL_DEFAULT_PREF_DATATYPE 15 #define wxSTC_MSSQL_COLUMN_NAME_2 16 // Lexical states for SCLEX_VERILOG #define wxSTC_V_DEFAULT 0 #define wxSTC_V_COMMENT 1 #define wxSTC_V_COMMENTLINE 2 #define wxSTC_V_COMMENTLINEBANG 3 #define wxSTC_V_NUMBER 4 #define wxSTC_V_WORD 5 #define wxSTC_V_STRING 6 #define wxSTC_V_WORD2 7 #define wxSTC_V_WORD3 8 #define wxSTC_V_PREPROCESSOR 9 #define wxSTC_V_OPERATOR 10 #define wxSTC_V_IDENTIFIER 11 #define wxSTC_V_STRINGEOL 12 #define wxSTC_V_USER 19 // Lexical states for SCLEX_KIX #define wxSTC_KIX_DEFAULT 0 #define wxSTC_KIX_COMMENT 1 #define wxSTC_KIX_STRING1 2 #define wxSTC_KIX_STRING2 3 #define wxSTC_KIX_NUMBER 4 #define wxSTC_KIX_VAR 5 #define wxSTC_KIX_MACRO 6 #define wxSTC_KIX_KEYWORD 7 #define wxSTC_KIX_FUNCTIONS 8 #define wxSTC_KIX_OPERATOR 9 #define wxSTC_KIX_IDENTIFIER 31 // Lexical states for SCLEX_GUI4CLI #define wxSTC_GC_DEFAULT 0 #define wxSTC_GC_COMMENTLINE 1 #define wxSTC_GC_COMMENTBLOCK 2 #define wxSTC_GC_GLOBAL 3 #define wxSTC_GC_EVENT 4 #define wxSTC_GC_ATTRIBUTE 5 #define wxSTC_GC_CONTROL 6 #define wxSTC_GC_COMMAND 7 #define wxSTC_GC_STRING 8 #define wxSTC_GC_OPERATOR 9 // Lexical states for SCLEX_SPECMAN #define wxSTC_SN_DEFAULT 0 #define wxSTC_SN_CODE 1 #define wxSTC_SN_COMMENTLINE 2 #define wxSTC_SN_COMMENTLINEBANG 3 #define wxSTC_SN_NUMBER 4 #define wxSTC_SN_WORD 5 #define wxSTC_SN_STRING 6 #define wxSTC_SN_WORD2 7 #define wxSTC_SN_WORD3 8 #define wxSTC_SN_PREPROCESSOR 9 #define wxSTC_SN_OPERATOR 10 #define wxSTC_SN_IDENTIFIER 11 #define wxSTC_SN_STRINGEOL 12 #define wxSTC_SN_REGEXTAG 13 #define wxSTC_SN_SIGNAL 14 #define wxSTC_SN_USER 19 // Lexical states for SCLEX_AU3 #define wxSTC_AU3_DEFAULT 0 #define wxSTC_AU3_COMMENT 1 #define wxSTC_AU3_COMMENTBLOCK 2 #define wxSTC_AU3_NUMBER 3 #define wxSTC_AU3_FUNCTION 4 #define wxSTC_AU3_KEYWORD 5 #define wxSTC_AU3_MACRO 6 #define wxSTC_AU3_STRING 7 #define wxSTC_AU3_OPERATOR 8 #define wxSTC_AU3_VARIABLE 9 #define wxSTC_AU3_SENT 10 #define wxSTC_AU3_PREPROCESSOR 11 #define wxSTC_AU3_SPECIAL 12 #define wxSTC_AU3_EXPAND 13 #define wxSTC_AU3_COMOBJ 14 #define wxSTC_AU3_UDF 15 // Lexical states for SCLEX_APDL #define wxSTC_APDL_DEFAULT 0 #define wxSTC_APDL_COMMENT 1 #define wxSTC_APDL_COMMENTBLOCK 2 #define wxSTC_APDL_NUMBER 3 #define wxSTC_APDL_STRING 4 #define wxSTC_APDL_OPERATOR 5 #define wxSTC_APDL_WORD 6 #define wxSTC_APDL_PROCESSOR 7 #define wxSTC_APDL_COMMAND 8 #define wxSTC_APDL_SLASHCOMMAND 9 #define wxSTC_APDL_STARCOMMAND 10 #define wxSTC_APDL_ARGUMENT 11 #define wxSTC_APDL_FUNCTION 12 // Lexical states for SCLEX_BASH #define wxSTC_SH_DEFAULT 0 #define wxSTC_SH_ERROR 1 #define wxSTC_SH_COMMENTLINE 2 #define wxSTC_SH_NUMBER 3 #define wxSTC_SH_WORD 4 #define wxSTC_SH_STRING 5 #define wxSTC_SH_CHARACTER 6 #define wxSTC_SH_OPERATOR 7 #define wxSTC_SH_IDENTIFIER 8 #define wxSTC_SH_SCALAR 9 #define wxSTC_SH_PARAM 10 #define wxSTC_SH_BACKTICKS 11 #define wxSTC_SH_HERE_DELIM 12 #define wxSTC_SH_HERE_Q 13 // Lexical states for SCLEX_ASN1 #define wxSTC_ASN1_DEFAULT 0 #define wxSTC_ASN1_COMMENT 1 #define wxSTC_ASN1_IDENTIFIER 2 #define wxSTC_ASN1_STRING 3 #define wxSTC_ASN1_OID 4 #define wxSTC_ASN1_SCALAR 5 #define wxSTC_ASN1_KEYWORD 6 #define wxSTC_ASN1_ATTRIBUTE 7 #define wxSTC_ASN1_DESCRIPTOR 8 #define wxSTC_ASN1_TYPE 9 #define wxSTC_ASN1_OPERATOR 10 // Lexical states for SCLEX_VHDL #define wxSTC_VHDL_DEFAULT 0 #define wxSTC_VHDL_COMMENT 1 #define wxSTC_VHDL_COMMENTLINEBANG 2 #define wxSTC_VHDL_NUMBER 3 #define wxSTC_VHDL_STRING 4 #define wxSTC_VHDL_OPERATOR 5 #define wxSTC_VHDL_IDENTIFIER 6 #define wxSTC_VHDL_STRINGEOL 7 #define wxSTC_VHDL_KEYWORD 8 #define wxSTC_VHDL_STDOPERATOR 9 #define wxSTC_VHDL_ATTRIBUTE 10 #define wxSTC_VHDL_STDFUNCTION 11 #define wxSTC_VHDL_STDPACKAGE 12 #define wxSTC_VHDL_STDTYPE 13 #define wxSTC_VHDL_USERWORD 14 // Lexical states for SCLEX_CAML #define wxSTC_CAML_DEFAULT 0 #define wxSTC_CAML_IDENTIFIER 1 #define wxSTC_CAML_TAGNAME 2 #define wxSTC_CAML_KEYWORD 3 #define wxSTC_CAML_KEYWORD2 4 #define wxSTC_CAML_KEYWORD3 5 #define wxSTC_CAML_LINENUM 6 #define wxSTC_CAML_OPERATOR 7 #define wxSTC_CAML_NUMBER 8 #define wxSTC_CAML_CHAR 9 #define wxSTC_CAML_WHITE 10 #define wxSTC_CAML_STRING 11 #define wxSTC_CAML_COMMENT 12 #define wxSTC_CAML_COMMENT1 13 #define wxSTC_CAML_COMMENT2 14 #define wxSTC_CAML_COMMENT3 15 // Lexical states for SCLEX_HASKELL #define wxSTC_HA_DEFAULT 0 #define wxSTC_HA_IDENTIFIER 1 #define wxSTC_HA_KEYWORD 2 #define wxSTC_HA_NUMBER 3 #define wxSTC_HA_STRING 4 #define wxSTC_HA_CHARACTER 5 #define wxSTC_HA_CLASS 6 #define wxSTC_HA_MODULE 7 #define wxSTC_HA_CAPITAL 8 #define wxSTC_HA_DATA 9 #define wxSTC_HA_IMPORT 10 #define wxSTC_HA_OPERATOR 11 #define wxSTC_HA_INSTANCE 12 #define wxSTC_HA_COMMENTLINE 13 #define wxSTC_HA_COMMENTBLOCK 14 #define wxSTC_HA_COMMENTBLOCK2 15 #define wxSTC_HA_COMMENTBLOCK3 16 // Lexical states of SCLEX_TADS3 #define wxSTC_T3_DEFAULT 0 #define wxSTC_T3_X_DEFAULT 1 #define wxSTC_T3_PREPROCESSOR 2 #define wxSTC_T3_BLOCK_COMMENT 3 #define wxSTC_T3_LINE_COMMENT 4 #define wxSTC_T3_OPERATOR 5 #define wxSTC_T3_KEYWORD 6 #define wxSTC_T3_NUMBER 7 #define wxSTC_T3_IDENTIFIER 8 #define wxSTC_T3_S_STRING 9 #define wxSTC_T3_D_STRING 10 #define wxSTC_T3_X_STRING 11 #define wxSTC_T3_LIB_DIRECTIVE 12 #define wxSTC_T3_MSG_PARAM 13 #define wxSTC_T3_HTML_TAG 14 #define wxSTC_T3_HTML_DEFAULT 15 #define wxSTC_T3_HTML_STRING 16 #define wxSTC_T3_USER1 17 #define wxSTC_T3_USER2 18 #define wxSTC_T3_USER3 19 #define wxSTC_T3_BRACE 20 // Lexical states for SCLEX_REBOL #define wxSTC_REBOL_DEFAULT 0 #define wxSTC_REBOL_COMMENTLINE 1 #define wxSTC_REBOL_COMMENTBLOCK 2 #define wxSTC_REBOL_PREFACE 3 #define wxSTC_REBOL_OPERATOR 4 #define wxSTC_REBOL_CHARACTER 5 #define wxSTC_REBOL_QUOTEDSTRING 6 #define wxSTC_REBOL_BRACEDSTRING 7 #define wxSTC_REBOL_NUMBER 8 #define wxSTC_REBOL_PAIR 9 #define wxSTC_REBOL_TUPLE 10 #define wxSTC_REBOL_BINARY 11 #define wxSTC_REBOL_MONEY 12 #define wxSTC_REBOL_ISSUE 13 #define wxSTC_REBOL_TAG 14 #define wxSTC_REBOL_FILE 15 #define wxSTC_REBOL_EMAIL 16 #define wxSTC_REBOL_URL 17 #define wxSTC_REBOL_DATE 18 #define wxSTC_REBOL_TIME 19 #define wxSTC_REBOL_IDENTIFIER 20 #define wxSTC_REBOL_WORD 21 #define wxSTC_REBOL_WORD2 22 #define wxSTC_REBOL_WORD3 23 #define wxSTC_REBOL_WORD4 24 #define wxSTC_REBOL_WORD5 25 #define wxSTC_REBOL_WORD6 26 #define wxSTC_REBOL_WORD7 27 #define wxSTC_REBOL_WORD8 28 // Lexical states for SCLEX_SQL #define wxSTC_SQL_DEFAULT 0 #define wxSTC_SQL_COMMENT 1 #define wxSTC_SQL_COMMENTLINE 2 #define wxSTC_SQL_COMMENTDOC 3 #define wxSTC_SQL_NUMBER 4 #define wxSTC_SQL_WORD 5 #define wxSTC_SQL_STRING 6 #define wxSTC_SQL_CHARACTER 7 #define wxSTC_SQL_SQLPLUS 8 #define wxSTC_SQL_SQLPLUS_PROMPT 9 #define wxSTC_SQL_OPERATOR 10 #define wxSTC_SQL_IDENTIFIER 11 #define wxSTC_SQL_SQLPLUS_COMMENT 13 #define wxSTC_SQL_COMMENTLINEDOC 15 #define wxSTC_SQL_WORD2 16 #define wxSTC_SQL_COMMENTDOCKEYWORD 17 #define wxSTC_SQL_COMMENTDOCKEYWORDERROR 18 #define wxSTC_SQL_USER1 19 #define wxSTC_SQL_USER2 20 #define wxSTC_SQL_USER3 21 #define wxSTC_SQL_USER4 22 #define wxSTC_SQL_QUOTEDIDENTIFIER 23 // Lexical states for SCLEX_SMALLTALK #define wxSTC_ST_DEFAULT 0 #define wxSTC_ST_STRING 1 #define wxSTC_ST_NUMBER 2 #define wxSTC_ST_COMMENT 3 #define wxSTC_ST_SYMBOL 4 #define wxSTC_ST_BINARY 5 #define wxSTC_ST_BOOL 6 #define wxSTC_ST_SELF 7 #define wxSTC_ST_SUPER 8 #define wxSTC_ST_NIL 9 #define wxSTC_ST_GLOBAL 10 #define wxSTC_ST_RETURN 11 #define wxSTC_ST_SPECIAL 12 #define wxSTC_ST_KWSEND 13 #define wxSTC_ST_ASSIGN 14 #define wxSTC_ST_CHARACTER 15 #define wxSTC_ST_SPEC_SEL 16 // Lexical states for SCLEX_FLAGSHIP (clipper) #define wxSTC_FS_DEFAULT 0 #define wxSTC_FS_COMMENT 1 #define wxSTC_FS_COMMENTLINE 2 #define wxSTC_FS_COMMENTDOC 3 #define wxSTC_FS_COMMENTLINEDOC 4 #define wxSTC_FS_COMMENTDOCKEYWORD 5 #define wxSTC_FS_COMMENTDOCKEYWORDERROR 6 #define wxSTC_FS_KEYWORD 7 #define wxSTC_FS_KEYWORD2 8 #define wxSTC_FS_KEYWORD3 9 #define wxSTC_FS_KEYWORD4 10 #define wxSTC_FS_NUMBER 11 #define wxSTC_FS_STRING 12 #define wxSTC_FS_PREPROCESSOR 13 #define wxSTC_FS_OPERATOR 14 #define wxSTC_FS_IDENTIFIER 15 #define wxSTC_FS_DATE 16 #define wxSTC_FS_STRINGEOL 17 #define wxSTC_FS_CONSTANT 18 #define wxSTC_FS_ASM 19 #define wxSTC_FS_LABEL 20 #define wxSTC_FS_ERROR 21 #define wxSTC_FS_HEXNUMBER 22 #define wxSTC_FS_BINNUMBER 23 // Lexical states for SCLEX_CSOUND #define wxSTC_CSOUND_DEFAULT 0 #define wxSTC_CSOUND_COMMENT 1 #define wxSTC_CSOUND_NUMBER 2 #define wxSTC_CSOUND_OPERATOR 3 #define wxSTC_CSOUND_INSTR 4 #define wxSTC_CSOUND_IDENTIFIER 5 #define wxSTC_CSOUND_OPCODE 6 #define wxSTC_CSOUND_HEADERSTMT 7 #define wxSTC_CSOUND_USERKEYWORD 8 #define wxSTC_CSOUND_COMMENTBLOCK 9 #define wxSTC_CSOUND_PARAM 10 #define wxSTC_CSOUND_ARATE_VAR 11 #define wxSTC_CSOUND_KRATE_VAR 12 #define wxSTC_CSOUND_IRATE_VAR 13 #define wxSTC_CSOUND_GLOBAL_VAR 14 #define wxSTC_CSOUND_STRINGEOL 15 // Lexical states for SCLEX_INNOSETUP #define wxSTC_INNO_DEFAULT 0 #define wxSTC_INNO_COMMENT 1 #define wxSTC_INNO_KEYWORD 2 #define wxSTC_INNO_PARAMETER 3 #define wxSTC_INNO_SECTION 4 #define wxSTC_INNO_PREPROC 5 #define wxSTC_INNO_INLINE_EXPANSION 6 #define wxSTC_INNO_COMMENT_PASCAL 7 #define wxSTC_INNO_KEYWORD_PASCAL 8 #define wxSTC_INNO_KEYWORD_USER 9 #define wxSTC_INNO_STRING_DOUBLE 10 #define wxSTC_INNO_STRING_SINGLE 11 #define wxSTC_INNO_IDENTIFIER 12 // Lexical states for SCLEX_OPAL #define wxSTC_OPAL_SPACE 0 #define wxSTC_OPAL_COMMENT_BLOCK 1 #define wxSTC_OPAL_COMMENT_LINE 2 #define wxSTC_OPAL_INTEGER 3 #define wxSTC_OPAL_KEYWORD 4 #define wxSTC_OPAL_SORT 5 #define wxSTC_OPAL_STRING 6 #define wxSTC_OPAL_PAR 7 #define wxSTC_OPAL_BOOL_CONST 8 #define wxSTC_OPAL_DEFAULT 32 // Lexical states for SCLEX_SPICE #define wxSTC_SPICE_DEFAULT 0 #define wxSTC_SPICE_IDENTIFIER 1 #define wxSTC_SPICE_KEYWORD 2 #define wxSTC_SPICE_KEYWORD2 3 #define wxSTC_SPICE_KEYWORD3 4 #define wxSTC_SPICE_NUMBER 5 #define wxSTC_SPICE_DELIMITER 6 #define wxSTC_SPICE_VALUE 7 #define wxSTC_SPICE_COMMENTLINE 8 // Lexical states for SCLEX_CMAKE #define wxSTC_CMAKE_DEFAULT 0 #define wxSTC_CMAKE_COMMENT 1 #define wxSTC_CMAKE_STRINGDQ 2 #define wxSTC_CMAKE_STRINGLQ 3 #define wxSTC_CMAKE_STRINGRQ 4 #define wxSTC_CMAKE_COMMANDS 5 #define wxSTC_CMAKE_PARAMETERS 6 #define wxSTC_CMAKE_VARIABLE 7 #define wxSTC_CMAKE_USERDEFINED 8 #define wxSTC_CMAKE_WHILEDEF 9 #define wxSTC_CMAKE_FOREACHDEF 10 #define wxSTC_CMAKE_IFDEFINEDEF 11 #define wxSTC_CMAKE_MACRODEF 12 #define wxSTC_CMAKE_STRINGVAR 13 #define wxSTC_CMAKE_NUMBER 14 // Lexical states for SCLEX_GAP #define wxSTC_GAP_DEFAULT 0 #define wxSTC_GAP_IDENTIFIER 1 #define wxSTC_GAP_KEYWORD 2 #define wxSTC_GAP_KEYWORD2 3 #define wxSTC_GAP_KEYWORD3 4 #define wxSTC_GAP_KEYWORD4 5 #define wxSTC_GAP_STRING 6 #define wxSTC_GAP_CHAR 7 #define wxSTC_GAP_OPERATOR 8 #define wxSTC_GAP_COMMENT 9 #define wxSTC_GAP_NUMBER 10 #define wxSTC_GAP_STRINGEOL 11 // Lexical state for SCLEX_PLM #define wxSTC_PLM_DEFAULT 0 #define wxSTC_PLM_COMMENT 1 #define wxSTC_PLM_STRING 2 #define wxSTC_PLM_NUMBER 3 #define wxSTC_PLM_IDENTIFIER 4 #define wxSTC_PLM_OPERATOR 5 #define wxSTC_PLM_CONTROL 6 #define wxSTC_PLM_KEYWORD 7 // Lexical state for SCLEX_PROGRESS #define wxSTC_4GL_DEFAULT 0 #define wxSTC_4GL_NUMBER 1 #define wxSTC_4GL_WORD 2 #define wxSTC_4GL_STRING 3 #define wxSTC_4GL_CHARACTER 4 #define wxSTC_4GL_PREPROCESSOR 5 #define wxSTC_4GL_OPERATOR 6 #define wxSTC_4GL_IDENTIFIER 7 #define wxSTC_4GL_BLOCK 8 #define wxSTC_4GL_END 9 #define wxSTC_4GL_COMMENT1 10 #define wxSTC_4GL_COMMENT2 11 #define wxSTC_4GL_COMMENT3 12 #define wxSTC_4GL_COMMENT4 13 #define wxSTC_4GL_COMMENT5 14 #define wxSTC_4GL_COMMENT6 15 #define wxSTC_4GL_DEFAULT_ 16 #define wxSTC_4GL_NUMBER_ 17 #define wxSTC_4GL_WORD_ 18 #define wxSTC_4GL_STRING_ 19 #define wxSTC_4GL_CHARACTER_ 20 #define wxSTC_4GL_PREPROCESSOR_ 21 #define wxSTC_4GL_OPERATOR_ 22 #define wxSTC_4GL_IDENTIFIER_ 23 #define wxSTC_4GL_BLOCK_ 24 #define wxSTC_4GL_END_ 25 #define wxSTC_4GL_COMMENT1_ 26 #define wxSTC_4GL_COMMENT2_ 27 #define wxSTC_4GL_COMMENT3_ 28 #define wxSTC_4GL_COMMENT4_ 29 #define wxSTC_4GL_COMMENT5_ 30 #define wxSTC_4GL_COMMENT6_ 31 // Lexical states for SCLEX_ABAQUS #define wxSTC_ABAQUS_DEFAULT 0 #define wxSTC_ABAQUS_COMMENT 1 #define wxSTC_ABAQUS_COMMENTBLOCK 2 #define wxSTC_ABAQUS_NUMBER 3 #define wxSTC_ABAQUS_STRING 4 #define wxSTC_ABAQUS_OPERATOR 5 #define wxSTC_ABAQUS_WORD 6 #define wxSTC_ABAQUS_PROCESSOR 7 #define wxSTC_ABAQUS_COMMAND 8 #define wxSTC_ABAQUS_SLASHCOMMAND 9 #define wxSTC_ABAQUS_STARCOMMAND 10 #define wxSTC_ABAQUS_ARGUMENT 11 #define wxSTC_ABAQUS_FUNCTION 12 // Lexical states for SCLEX_ASYMPTOTE #define wxSTC_ASY_DEFAULT 0 #define wxSTC_ASY_COMMENT 1 #define wxSTC_ASY_COMMENTLINE 2 #define wxSTC_ASY_NUMBER 3 #define wxSTC_ASY_WORD 4 #define wxSTC_ASY_STRING 5 #define wxSTC_ASY_CHARACTER 6 #define wxSTC_ASY_OPERATOR 7 #define wxSTC_ASY_IDENTIFIER 8 #define wxSTC_ASY_STRINGEOL 9 #define wxSTC_ASY_COMMENTLINEDOC 10 #define wxSTC_ASY_WORD2 11 // Lexical states for SCLEX_R #define wxSTC_R_DEFAULT 0 #define wxSTC_R_COMMENT 1 #define wxSTC_R_KWORD 2 #define wxSTC_R_BASEKWORD 3 #define wxSTC_R_OTHERKWORD 4 #define wxSTC_R_NUMBER 5 #define wxSTC_R_STRING 6 #define wxSTC_R_STRING2 7 #define wxSTC_R_OPERATOR 8 #define wxSTC_R_IDENTIFIER 9 #define wxSTC_R_INFIX 10 #define wxSTC_R_INFIXEOL 11 // Lexical state for SCLEX_MAGIKSF #define wxSTC_MAGIK_DEFAULT 0 #define wxSTC_MAGIK_COMMENT 1 #define wxSTC_MAGIK_HYPER_COMMENT 16 #define wxSTC_MAGIK_STRING 2 #define wxSTC_MAGIK_CHARACTER 3 #define wxSTC_MAGIK_NUMBER 4 #define wxSTC_MAGIK_IDENTIFIER 5 #define wxSTC_MAGIK_OPERATOR 6 #define wxSTC_MAGIK_FLOW 7 #define wxSTC_MAGIK_CONTAINER 8 #define wxSTC_MAGIK_BRACKET_BLOCK 9 #define wxSTC_MAGIK_BRACE_BLOCK 10 #define wxSTC_MAGIK_SQBRACKET_BLOCK 11 #define wxSTC_MAGIK_UNKNOWN_KEYWORD 12 #define wxSTC_MAGIK_KEYWORD 13 #define wxSTC_MAGIK_PRAGMA 14 #define wxSTC_MAGIK_SYMBOL 15 // Lexical state for SCLEX_POWERSHELL #define wxSTC_POWERSHELL_DEFAULT 0 #define wxSTC_POWERSHELL_COMMENT 1 #define wxSTC_POWERSHELL_STRING 2 #define wxSTC_POWERSHELL_CHARACTER 3 #define wxSTC_POWERSHELL_NUMBER 4 #define wxSTC_POWERSHELL_VARIABLE 5 #define wxSTC_POWERSHELL_OPERATOR 6 #define wxSTC_POWERSHELL_IDENTIFIER 7 #define wxSTC_POWERSHELL_KEYWORD 8 #define wxSTC_POWERSHELL_CMDLET 9 #define wxSTC_POWERSHELL_ALIAS 10 // Lexical state for SCLEX_MYSQL #define wxSTC_MYSQL_DEFAULT 0 #define wxSTC_MYSQL_COMMENT 1 #define wxSTC_MYSQL_COMMENTLINE 2 #define wxSTC_MYSQL_VARIABLE 3 #define wxSTC_MYSQL_SYSTEMVARIABLE 4 #define wxSTC_MYSQL_KNOWNSYSTEMVARIABLE 5 #define wxSTC_MYSQL_NUMBER 6 #define wxSTC_MYSQL_MAJORKEYWORD 7 #define wxSTC_MYSQL_KEYWORD 8 #define wxSTC_MYSQL_DATABASEOBJECT 9 #define wxSTC_MYSQL_PROCEDUREKEYWORD 10 #define wxSTC_MYSQL_STRING 11 #define wxSTC_MYSQL_SQSTRING 12 #define wxSTC_MYSQL_DQSTRING 13 #define wxSTC_MYSQL_OPERATOR 14 #define wxSTC_MYSQL_FUNCTION 15 #define wxSTC_MYSQL_IDENTIFIER 16 #define wxSTC_MYSQL_QUOTEDIDENTIFIER 17 #define wxSTC_MYSQL_USER1 18 #define wxSTC_MYSQL_USER2 19 #define wxSTC_MYSQL_USER3 20 #define wxSTC_MYSQL_HIDDENCOMMAND 21 // Lexical state for SCLEX_PO #define wxSTC_PO_DEFAULT 0 #define wxSTC_PO_COMMENT 1 #define wxSTC_PO_MSGID 2 #define wxSTC_PO_MSGID_TEXT 3 #define wxSTC_PO_MSGSTR 4 #define wxSTC_PO_MSGSTR_TEXT 5 #define wxSTC_PO_MSGCTXT 6 #define wxSTC_PO_MSGCTXT_TEXT 7 #define wxSTC_PO_FUZZY 8 // Lexical states for SCLEX_PASCAL #define wxSTC_PAS_DEFAULT 0 #define wxSTC_PAS_IDENTIFIER 1 #define wxSTC_PAS_COMMENT 2 #define wxSTC_PAS_COMMENT2 3 #define wxSTC_PAS_COMMENTLINE 4 #define wxSTC_PAS_PREPROCESSOR 5 #define wxSTC_PAS_PREPROCESSOR2 6 #define wxSTC_PAS_NUMBER 7 #define wxSTC_PAS_HEXNUMBER 8 #define wxSTC_PAS_WORD 9 #define wxSTC_PAS_STRING 10 #define wxSTC_PAS_STRINGEOL 11 #define wxSTC_PAS_CHARACTER 12 #define wxSTC_PAS_OPERATOR 13 #define wxSTC_PAS_ASM 14 // Lexical state for SCLEX_SORCUS #define wxSTC_SORCUS_DEFAULT 0 #define wxSTC_SORCUS_COMMAND 1 #define wxSTC_SORCUS_PARAMETER 2 #define wxSTC_SORCUS_COMMENTLINE 3 #define wxSTC_SORCUS_STRING 4 #define wxSTC_SORCUS_STRINGEOL 5 #define wxSTC_SORCUS_IDENTIFIER 6 #define wxSTC_SORCUS_OPERATOR 7 #define wxSTC_SORCUS_NUMBER 8 #define wxSTC_SORCUS_CONSTANT 9 // Lexical state for SCLEX_POWERPRO #define wxSTC_POWERPRO_DEFAULT 0 #define wxSTC_POWERPRO_COMMENTBLOCK 1 #define wxSTC_POWERPRO_COMMENTLINE 2 #define wxSTC_POWERPRO_NUMBER 3 #define wxSTC_POWERPRO_WORD 4 #define wxSTC_POWERPRO_WORD2 5 #define wxSTC_POWERPRO_WORD3 6 #define wxSTC_POWERPRO_WORD4 7 #define wxSTC_POWERPRO_DOUBLEQUOTEDSTRING 8 #define wxSTC_POWERPRO_SINGLEQUOTEDSTRING 9 #define wxSTC_POWERPRO_LINECONTINUE 10 #define wxSTC_POWERPRO_OPERATOR 11 #define wxSTC_POWERPRO_IDENTIFIER 12 #define wxSTC_POWERPRO_STRINGEOL 13 #define wxSTC_POWERPRO_VERBATIM 14 #define wxSTC_POWERPRO_ALTQUOTE 15 #define wxSTC_POWERPRO_FUNCTION 16 // Lexical states for SCLEX_SML #define wxSTC_SML_DEFAULT 0 #define wxSTC_SML_IDENTIFIER 1 #define wxSTC_SML_TAGNAME 2 #define wxSTC_SML_KEYWORD 3 #define wxSTC_SML_KEYWORD2 4 #define wxSTC_SML_KEYWORD3 5 #define wxSTC_SML_LINENUM 6 #define wxSTC_SML_OPERATOR 7 #define wxSTC_SML_NUMBER 8 #define wxSTC_SML_CHAR 9 #define wxSTC_SML_STRING 11 #define wxSTC_SML_COMMENT 12 #define wxSTC_SML_COMMENT1 13 #define wxSTC_SML_COMMENT2 14 #define wxSTC_SML_COMMENT3 15 // Lexical state for SCLEX_MARKDOWN #define wxSTC_MARKDOWN_DEFAULT 0 #define wxSTC_MARKDOWN_LINE_BEGIN 1 #define wxSTC_MARKDOWN_STRONG1 2 #define wxSTC_MARKDOWN_STRONG2 3 #define wxSTC_MARKDOWN_EM1 4 #define wxSTC_MARKDOWN_EM2 5 #define wxSTC_MARKDOWN_HEADER1 6 #define wxSTC_MARKDOWN_HEADER2 7 #define wxSTC_MARKDOWN_HEADER3 8 #define wxSTC_MARKDOWN_HEADER4 9 #define wxSTC_MARKDOWN_HEADER5 10 #define wxSTC_MARKDOWN_HEADER6 11 #define wxSTC_MARKDOWN_PRECHAR 12 #define wxSTC_MARKDOWN_ULIST_ITEM 13 #define wxSTC_MARKDOWN_OLIST_ITEM 14 #define wxSTC_MARKDOWN_BLOCKQUOTE 15 #define wxSTC_MARKDOWN_STRIKEOUT 16 #define wxSTC_MARKDOWN_HRULE 17 #define wxSTC_MARKDOWN_LINK 18 #define wxSTC_MARKDOWN_CODE 19 #define wxSTC_MARKDOWN_CODE2 20 #define wxSTC_MARKDOWN_CODEBK 21 //}}} class ScintillaWX; // forward declare class WordList; struct SCNotification; extern WXDLLIMPEXP_STC const wxChar* wxSTCNameStr; class WXDLLIMPEXP_STC wxScintillaTextCtrl; class WXDLLIMPEXP_STC wxScintillaTextEvent; //---------------------------------------------------------------------- class WXDLLIMPEXP_STC wxScintillaTextCtrl : public wxControl { public: wxScintillaTextCtrl(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxSTCNameStr); wxScintillaTextCtrl() { m_swx = NULL; } ~wxScintillaTextCtrl(); bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxSTCNameStr); //---------------------------------------------------------------------- // Generated method declaration section {{{ // Add text to the document at current position. void AddText(const wxString& text); // Add array of cells to document. void AddStyledText(const wxMemoryBuffer& data); // Insert string at a position. void InsertText(int pos, const wxString& text); // Delete all text in the document. void ClearAll(); // Set all style bytes to 0, remove all folding information. void ClearDocumentStyle(); // Returns the number of bytes in the document. int GetLength(); // Returns the character byte at the position. int GetCharAt(int pos); // Returns the position of the caret. int GetCurrentPos(); // Returns the position of the opposite end of the selection to the caret. int GetAnchor(); // Returns the style byte at the position. int GetStyleAt(int pos); // Redoes the next action on the undo history. void Redo(); // Choose between collecting actions into the undo // history and discarding them. void SetUndoCollection(bool collectUndo); // Select all the text in the document. void SelectAll(); // Remember the current position in the undo history as the position // at which the document was saved. void SetSavePoint(); // Retrieve a buffer of cells. wxMemoryBuffer GetStyledText(int startPos, int endPos); // Are there any redoable actions in the undo history? bool CanRedo(); // Retrieve the line number at which a particular marker is located. int MarkerLineFromHandle(int handle); // Delete a marker. void MarkerDeleteHandle(int handle); // Is undo history being collected? bool GetUndoCollection(); // Are white space characters currently visible? // Returns one of SCWS_* constants. int GetViewWhiteSpace(); // Make white space characters invisible, always visible or visible outside indentation. void SetViewWhiteSpace(int viewWS); // Find the position from a point within the window. int PositionFromPoint(wxPoint pt); // Find the position from a point within the window but return // INVALID_POSITION if not close to text. int PositionFromPointClose(int x, int y); // Set caret to start of a line and ensure it is visible. void GotoLine(int line); // Set caret to a position and ensure it is visible. void GotoPos(int pos); // Set the selection anchor to a position. The anchor is the opposite // end of the selection from the caret. void SetAnchor(int posAnchor); // Retrieve the text of the line containing the caret. // Returns the index of the caret on the line. wxString GetCurLine(int* linePos=NULL); // Retrieve the position of the last correctly styled character. int GetEndStyled(); // Convert all line endings in the document to one mode. void ConvertEOLs(int eolMode); // Retrieve the current end of line mode - one of CRLF, CR, or LF. int GetEOLMode(); // Set the current end of line mode. void SetEOLMode(int eolMode); // Set the current styling position to pos and the styling mask to mask. // The styling mask can be used to protect some bits in each styling byte from modification. void StartStyling(int pos, int mask); // Change style from current styling position for length characters to a style // and move the current styling position to after this newly styled segment. void SetStyling(int length, int style); // Is drawing done first into a buffer or direct to the screen? bool GetBufferedDraw(); // If drawing is buffered then each line of text is drawn into a bitmap buffer // before drawing it to the screen to avoid flicker. void SetBufferedDraw(bool buffered); // Change the visible size of a tab to be a multiple of the width of a space character. void SetTabWidth(int tabWidth); // Retrieve the visible size of a tab. int GetTabWidth(); // Set the code page used to interpret the bytes of the document as characters. void SetCodePage(int codePage); // Set the symbol used for a particular marker number, // and optionally the fore and background colours. void MarkerDefine(int markerNumber, int markerSymbol, const wxColour& foreground = wxNullColour, const wxColour& background = wxNullColour); // Set the foreground colour used for a particular marker number. void MarkerSetForeground(int markerNumber, const wxColour& fore); // Set the background colour used for a particular marker number. void MarkerSetBackground(int markerNumber, const wxColour& back); // Add a marker to a line, returning an ID which can be used to find or delete the marker. int MarkerAdd(int line, int markerNumber); // Delete a marker from a line. void MarkerDelete(int line, int markerNumber); // Delete all markers with a particular number from all lines. void MarkerDeleteAll(int markerNumber); // Get a bit mask of all the markers set on a line. int MarkerGet(int line); // Find the next line after lineStart that includes a marker in mask. int MarkerNext(int lineStart, int markerMask); // Find the previous line before lineStart that includes a marker in mask. int MarkerPrevious(int lineStart, int markerMask); // Define a marker from a bitmap void MarkerDefineBitmap(int markerNumber, const wxBitmap& bmp); // Add a set of markers to a line. void MarkerAddSet(int line, int set); // Set the alpha used for a marker that is drawn in the text area, not the margin. void MarkerSetAlpha(int markerNumber, int alpha); // Set a margin to be either numeric or symbolic. void SetMarginType(int margin, int marginType); // Retrieve the type of a margin. int GetMarginType(int margin); // Set the width of a margin to a width expressed in pixels. void SetMarginWidth(int margin, int pixelWidth); // Retrieve the width of a margin in pixels. int GetMarginWidth(int margin); // Set a mask that determines which markers are displayed in a margin. void SetMarginMask(int margin, int mask); // Retrieve the marker mask of a margin. int GetMarginMask(int margin); // Make a margin sensitive or insensitive to mouse clicks. void SetMarginSensitive(int margin, bool sensitive); // Retrieve the mouse click sensitivity of a margin. bool GetMarginSensitive(int margin); // Clear all the styles and make equivalent to the global default style. void StyleClearAll(); // Set the foreground colour of a style. void StyleSetForeground(int style, const wxColour& fore); // Set the background colour of a style. void StyleSetBackground(int style, const wxColour& back); // Set a style to be bold or not. void StyleSetBold(int style, bool bold); // Set a style to be italic or not. void StyleSetItalic(int style, bool italic); // Set the size of characters of a style. void StyleSetSize(int style, int sizePoints); // Set the font of a style. void StyleSetFaceName(int style, const wxString& fontName); // Set a style to have its end of line filled or not. void StyleSetEOLFilled(int style, bool filled); // Reset the default style to its state at startup void StyleResetDefault(); // Set a style to be underlined or not. void StyleSetUnderline(int style, bool underline); // Get the foreground colour of a style. wxColour StyleGetForeground(int style); // Get the background colour of a style. wxColour StyleGetBackground(int style); // Get is a style bold or not. bool StyleGetBold(int style); // Get is a style italic or not. bool StyleGetItalic(int style); // Get the size of characters of a style. int StyleGetSize(int style); // Get the font facename of a style wxString StyleGetFaceName(int style); // Get is a style to have its end of line filled or not. bool StyleGetEOLFilled(int style); // Get is a style underlined or not. bool StyleGetUnderline(int style); // Get is a style mixed case, or to force upper or lower case. int StyleGetCase(int style); // Get the character set of the font in a style. int StyleGetCharacterSet(int style); // Get is a style visible or not. bool StyleGetVisible(int style); // Get is a style changeable or not (read only). // Experimental feature, currently buggy. bool StyleGetChangeable(int style); // Get is a style a hotspot or not. bool StyleGetHotSpot(int style); // Set a style to be mixed case, or to force upper or lower case. void StyleSetCase(int style, int caseForce); // Set a style to be a hotspot or not. void StyleSetHotSpot(int style, bool hotspot); // Set the foreground colour of the main and additional selections and whether to use this setting. void SetSelForeground(bool useSetting, const wxColour& fore); // Set the background colour of the main and additional selections and whether to use this setting. void SetSelBackground(bool useSetting, const wxColour& back); // Get the alpha of the selection. int GetSelAlpha(); // Set the alpha of the selection. void SetSelAlpha(int alpha); // Is the selection end of line filled? bool GetSelEOLFilled(); // Set the selection to have its end of line filled or not. void SetSelEOLFilled(bool filled); // Set the foreground colour of the caret. void SetCaretForeground(const wxColour& fore); // When key+modifier combination km is pressed perform msg. void CmdKeyAssign(int key, int modifiers, int cmd); // When key+modifier combination km is pressed do nothing. void CmdKeyClear(int key, int modifiers); // Drop all key mappings. void CmdKeyClearAll(); // Set the styles for a segment of the document. void SetStyleBytes(int length, char* styleBytes); // Set a style to be visible or not. void StyleSetVisible(int style, bool visible); // Get the time in milliseconds that the caret is on and off. int GetCaretPeriod(); // Get the time in milliseconds that the caret is on and off. 0 = steady on. void SetCaretPeriod(int periodMilliseconds); // Set the set of characters making up words for when moving or selecting by word. // First sets defaults like SetCharsDefault. void SetWordChars(const wxString& characters); // Start a sequence of actions that is undone and redone as a unit. // May be nested. void BeginUndoAction(); // End a sequence of actions that is undone and redone as a unit. void EndUndoAction(); // Set an indicator to plain, squiggle or TT. void IndicatorSetStyle(int indic, int style); // Retrieve the style of an indicator. int IndicatorGetStyle(int indic); // Set the foreground colour of an indicator. void IndicatorSetForeground(int indic, const wxColour& fore); // Retrieve the foreground colour of an indicator. wxColour IndicatorGetForeground(int indic); // Set an indicator to draw under text or over(default). void IndicatorSetUnder(int indic, bool under); // Retrieve whether indicator drawn under or over text. bool IndicatorGetUnder(int indic); // Set the foreground colour of all whitespace and whether to use this setting. void SetWhitespaceForeground(bool useSetting, const wxColour& fore); // Set the background colour of all whitespace and whether to use this setting. void SetWhitespaceBackground(bool useSetting, const wxColour& back); // Set the size of the dots used to mark space characters. void SetWhitespaceSize(int size); // Get the size of the dots used to mark space characters. int GetWhitespaceSize(); // Divide each styling byte into lexical class bits (default: 5) and indicator // bits (default: 3). If a lexer requires more than 32 lexical states, then this // is used to expand the possible states. void SetStyleBits(int bits); // Retrieve number of bits in style bytes used to hold the lexical state. int GetStyleBits(); // Used to hold extra styling information for each line. void SetLineState(int line, int state); // Retrieve the extra styling information for a line. int GetLineState(int line); // Retrieve the last line number that has line state. int GetMaxLineState(); // Is the background of the line containing the caret in a different colour? bool GetCaretLineVisible(); // Display the background of the line containing the caret in a different colour. void SetCaretLineVisible(bool show); // Get the colour of the background of the line containing the caret. wxColour GetCaretLineBackground(); // Set the colour of the background of the line containing the caret. void SetCaretLineBackground(const wxColour& back); // Set a style to be changeable or not (read only). // Experimental feature, currently buggy. void StyleSetChangeable(int style, bool changeable); // Display a auto-completion list. // The lenEntered parameter indicates how many characters before // the caret should be used to provide context. void AutoCompShow(int lenEntered, const wxString& itemList); // Remove the auto-completion list from the screen. void AutoCompCancel(); // Is there an auto-completion list visible? bool AutoCompActive(); // Retrieve the position of the caret when the auto-completion list was displayed. int AutoCompPosStart(); // User has selected an item so remove the list and insert the selection. void AutoCompComplete(); // Define a set of character that when typed cancel the auto-completion list. void AutoCompStops(const wxString& characterSet); // Change the separator character in the string setting up an auto-completion list. // Default is space but can be changed if items contain space. void AutoCompSetSeparator(int separatorCharacter); // Retrieve the auto-completion list separator character. int AutoCompGetSeparator(); // Select the item in the auto-completion list that starts with a string. void AutoCompSelect(const wxString& text); // Should the auto-completion list be cancelled if the user backspaces to a // position before where the box was created. void AutoCompSetCancelAtStart(bool cancel); // Retrieve whether auto-completion cancelled by backspacing before start. bool AutoCompGetCancelAtStart(); // Define a set of characters that when typed will cause the autocompletion to // choose the selected item. void AutoCompSetFillUps(const wxString& characterSet); // Should a single item auto-completion list automatically choose the item. void AutoCompSetChooseSingle(bool chooseSingle); // Retrieve whether a single item auto-completion list automatically choose the item. bool AutoCompGetChooseSingle(); // Set whether case is significant when performing auto-completion searches. void AutoCompSetIgnoreCase(bool ignoreCase); // Retrieve state of ignore case flag. bool AutoCompGetIgnoreCase(); // Display a list of strings and send notification when user chooses one. void UserListShow(int listType, const wxString& itemList); // Set whether or not autocompletion is hidden automatically when nothing matches. void AutoCompSetAutoHide(bool autoHide); // Retrieve whether or not autocompletion is hidden automatically when nothing matches. bool AutoCompGetAutoHide(); // Set whether or not autocompletion deletes any word characters // after the inserted text upon completion. void AutoCompSetDropRestOfWord(bool dropRestOfWord); // Retrieve whether or not autocompletion deletes any word characters // after the inserted text upon completion. bool AutoCompGetDropRestOfWord(); // Register an image for use in autocompletion lists. void RegisterImage(int type, const wxBitmap& bmp); // Clear all the registered images. void ClearRegisteredImages(); // Retrieve the auto-completion list type-separator character. int AutoCompGetTypeSeparator(); // Change the type-separator character in the string setting up an auto-completion list. // Default is '?' but can be changed if items contain '?'. void AutoCompSetTypeSeparator(int separatorCharacter); // Set the maximum width, in characters, of auto-completion and user lists. // Set to 0 to autosize to fit longest item, which is the default. void AutoCompSetMaxWidth(int characterCount); // Get the maximum width, in characters, of auto-completion and user lists. int AutoCompGetMaxWidth(); // Set the maximum height, in rows, of auto-completion and user lists. // The default is 5 rows. void AutoCompSetMaxHeight(int rowCount); // Set the maximum height, in rows, of auto-completion and user lists. int AutoCompGetMaxHeight(); // Set the number of spaces used for one level of indentation. void SetIndent(int indentSize); // Retrieve indentation size. int GetIndent(); // Indentation will only use space characters if useTabs is false, otherwise // it will use a combination of tabs and spaces. void SetUseTabs(bool useTabs); // Retrieve whether tabs will be used in indentation. bool GetUseTabs(); // Change the indentation of a line to a number of columns. void SetLineIndentation(int line, int indentSize); // Retrieve the number of columns that a line is indented. int GetLineIndentation(int line); // Retrieve the position before the first non indentation character on a line. int GetLineIndentPosition(int line); // Retrieve the column number of a position, taking tab width into account. int GetColumn(int pos); // Show or hide the horizontal scroll bar. void SetUseHorizontalScrollBar(bool show); // Is the horizontal scroll bar visible? bool GetUseHorizontalScrollBar(); // Show or hide indentation guides. void SetIndentationGuides(int indentView); // Are the indentation guides visible? int GetIndentationGuides(); // Set the highlighted indentation guide column. // 0 = no highlighted guide. void SetHighlightGuide(int column); // Get the highlighted indentation guide column. int GetHighlightGuide(); // Get the position after the last visible characters on a line. int GetLineEndPosition(int line); // Get the code page used to interpret the bytes of the document as characters. int GetCodePage(); // Get the foreground colour of the caret. wxColour GetCaretForeground(); // In read-only mode? bool GetReadOnly(); // Sets the position of the caret. void SetCurrentPos(int pos); // Sets the position that starts the selection - this becomes the anchor. void SetSelectionStart(int pos); // Returns the position at the start of the selection. int GetSelectionStart(); // Sets the position that ends the selection - this becomes the currentPosition. void SetSelectionEnd(int pos); // Returns the position at the end of the selection. int GetSelectionEnd(); // Sets the print magnification added to the point size of each style for printing. void SetPrintMagnification(int magnification); // Returns the print magnification. int GetPrintMagnification(); // Modify colours when printing for clearer printed text. void SetPrintColourMode(int mode); // Returns the print colour mode. int GetPrintColourMode(); // Find some text in the document. int FindText(int minPos, int maxPos, const wxString& text, int flags=0); // On Windows, will draw the document into a display context such as a printer. int FormatRange(bool doDraw, int startPos, int endPos, wxDC* draw, wxDC* target, wxRect renderRect, wxRect pageRect); // Retrieve the display line at the top of the display. int GetFirstVisibleLine(); // Retrieve the contents of a line. wxString GetLine(int line); // Returns the number of lines in the document. There is always at least one. int GetLineCount(); // Sets the size in pixels of the left margin. void SetMarginLeft(int pixelWidth); // Returns the size in pixels of the left margin. int GetMarginLeft(); // Sets the size in pixels of the right margin. void SetMarginRight(int pixelWidth); // Returns the size in pixels of the right margin. int GetMarginRight(); // Is the document different from when it was last saved? bool GetModify(); // Retrieve the selected text. wxString GetSelectedText(); // Retrieve a range of text. wxString GetTextRange(int startPos, int endPos); // Draw the selection in normal style or with selection highlighted. void HideSelection(bool normal); // Retrieve the line containing a position. int LineFromPosition(int pos); // Retrieve the position at the start of a line. int PositionFromLine(int line); // Scroll horizontally and vertically. void LineScroll(int columns, int lines); // Ensure the caret is visible. void EnsureCaretVisible(); // Replace the selected text with the argument text. void ReplaceSelection(const wxString& text); // Set to read only or read write. void SetReadOnly(bool readOnly); // Will a paste succeed? bool CanPaste(); // Are there any undoable actions in the undo history? bool CanUndo(); // Delete the undo history. void EmptyUndoBuffer(); // Undo one action in the undo history. void Undo(); // Cut the selection to the clipboard. void Cut(); // Copy the selection to the clipboard. void Copy(); // Paste the contents of the clipboard into the document replacing the selection. void Paste(); // Clear the selection. void Clear(); // Replace the contents of the document with the argument text. void SetText(const wxString& text); // Retrieve all the text in the document. wxString GetText(); // Retrieve the number of characters in the document. int GetTextLength(); // Set to overtype (true) or insert mode. void SetOvertype(bool overtype); // Returns true if overtype mode is active otherwise false is returned. bool GetOvertype(); // Set the width of the insert mode caret. void SetCaretWidth(int pixelWidth); // Returns the width of the insert mode caret. int GetCaretWidth(); // Sets the position that starts the target which is used for updating the // document without affecting the scroll position. void SetTargetStart(int pos); // Get the position that starts the target. int GetTargetStart(); // Sets the position that ends the target which is used for updating the // document without affecting the scroll position. void SetTargetEnd(int pos); // Get the position that ends the target. int GetTargetEnd(); // Replace the target text with the argument text. // Text is counted so it can contain NULs. // Returns the length of the replacement text. int ReplaceTarget(const wxString& text); // Replace the target text with the argument text after \d processing. // Text is counted so it can contain NULs. // Looks for \d where d is between 1 and 9 and replaces these with the strings // matched in the last search operation which were surrounded by \( and \). // Returns the length of the replacement text including any change // caused by processing the \d patterns. int ReplaceTargetRE(const wxString& text); // Search for a counted string in the target and set the target to the found // range. Text is counted so it can contain NULs. // Returns length of range or -1 for failure in which case target is not moved. int SearchInTarget(const wxString& text); // Set the search flags used by SearchInTarget. void SetSearchFlags(int flags); // Get the search flags used by SearchInTarget. int GetSearchFlags(); // Show a call tip containing a definition near position pos. void CallTipShow(int pos, const wxString& definition); // Remove the call tip from the screen. void CallTipCancel(); // Is there an active call tip? bool CallTipActive(); // Retrieve the position where the caret was before displaying the call tip. int CallTipPosAtStart(); // Highlight a segment of the definition. void CallTipSetHighlight(int start, int end); // Set the background colour for the call tip. void CallTipSetBackground(const wxColour& back); // Set the foreground colour for the call tip. void CallTipSetForeground(const wxColour& fore); // Set the foreground colour for the highlighted part of the call tip. void CallTipSetForegroundHighlight(const wxColour& fore); // Enable use of STYLE_CALLTIP and set call tip tab size in pixels. void CallTipUseStyle(int tabSize); // Find the display line of a document line taking hidden lines into account. int VisibleFromDocLine(int line); // Find the document line of a display line taking hidden lines into account. int DocLineFromVisible(int lineDisplay); // The number of display lines needed to wrap a document line int WrapCount(int line); // Set the fold level of a line. // This encodes an integer level along with flags indicating whether the // line is a header and whether it is effectively white space. void SetFoldLevel(int line, int level); // Retrieve the fold level of a line. int GetFoldLevel(int line); // Find the last child line of a header line. int GetLastChild(int line, int level); // Find the parent line of a child line. int GetFoldParent(int line); // Make a range of lines visible. void ShowLines(int lineStart, int lineEnd); // Make a range of lines invisible. void HideLines(int lineStart, int lineEnd); // Is a line visible? bool GetLineVisible(int line); // Show the children of a header line. void SetFoldExpanded(int line, bool expanded); // Is a header line expanded? bool GetFoldExpanded(int line); // Switch a header line between expanded and contracted. void ToggleFold(int line); // Ensure a particular line is visible by expanding any header line hiding it. void EnsureVisible(int line); // Set some style options for folding. void SetFoldFlags(int flags); // Ensure a particular line is visible by expanding any header line hiding it. // Use the currently set visibility policy to determine which range to display. void EnsureVisibleEnforcePolicy(int line); // Sets whether a tab pressed when caret is within indentation indents. void SetTabIndents(bool tabIndents); // Does a tab pressed when caret is within indentation indent? bool GetTabIndents(); // Sets whether a backspace pressed when caret is within indentation unindents. void SetBackSpaceUnIndents(bool bsUnIndents); // Does a backspace pressed when caret is within indentation unindent? bool GetBackSpaceUnIndents(); // Sets the time the mouse must sit still to generate a mouse dwell event. void SetMouseDwellTime(int periodMilliseconds); // Retrieve the time the mouse must sit still to generate a mouse dwell event. int GetMouseDwellTime(); // Get position of start of word. int WordStartPosition(int pos, bool onlyWordCharacters); // Get position of end of word. int WordEndPosition(int pos, bool onlyWordCharacters); // Sets whether text is word wrapped. void SetWrapMode(int mode); // Retrieve whether text is word wrapped. int GetWrapMode(); // Set the display mode of visual flags for wrapped lines. void SetWrapVisualFlags(int wrapVisualFlags); // Retrive the display mode of visual flags for wrapped lines. int GetWrapVisualFlags(); // Set the location of visual flags for wrapped lines. void SetWrapVisualFlagsLocation(int wrapVisualFlagsLocation); // Retrive the location of visual flags for wrapped lines. int GetWrapVisualFlagsLocation(); // Set the start indent for wrapped lines. void SetWrapStartIndent(int indent); // Retrive the start indent for wrapped lines. int GetWrapStartIndent(); // Sets how wrapped sublines are placed. Default is fixed. void SetWrapIndentMode(int mode); // Retrieve how wrapped sublines are placed. Default is fixed. int GetWrapIndentMode(); // Sets the degree of caching of layout information. void SetLayoutCache(int mode); // Retrieve the degree of caching of layout information. int GetLayoutCache(); // Sets the document width assumed for scrolling. void SetScrollWidth(int pixelWidth); // Retrieve the document width assumed for scrolling. int GetScrollWidth(); // Sets whether the maximum width line displayed is used to set scroll width. void SetScrollWidthTracking(bool tracking); // Retrieve whether the scroll width tracks wide lines. bool GetScrollWidthTracking(); // Measure the pixel width of some text in a particular style. // NUL terminated text argument. // Does not handle tab or control characters. int TextWidth(int style, const wxString& text); // Sets the scroll range so that maximum scroll position has // the last line at the bottom of the view (default). // Setting this to false allows scrolling one page below the last line. void SetEndAtLastLine(bool endAtLastLine); // Retrieve whether the maximum scroll position has the last // line at the bottom of the view. bool GetEndAtLastLine(); // Retrieve the height of a particular line of text in pixels. int TextHeight(int line); // Show or hide the vertical scroll bar. void SetUseVerticalScrollBar(bool show); // Is the vertical scroll bar visible? bool GetUseVerticalScrollBar(); // Append a string to the end of the document without changing the selection. void AppendText(const wxString& text); // Is drawing done in two phases with backgrounds drawn before foregrounds? bool GetTwoPhaseDraw(); // In twoPhaseDraw mode, drawing is performed in two phases, first the background // and then the foreground. This avoids chopping off characters that overlap the next run. void SetTwoPhaseDraw(bool twoPhase); // Scroll so that a display line is at the top of the display. void SetFirstVisibleLine(int lineDisplay); // Make the target range start and end be the same as the selection range start and end. void TargetFromSelection(); // Join the lines in the target. void LinesJoin(); // Split the lines in the target into lines that are less wide than pixelWidth // where possible. void LinesSplit(int pixelWidth); // Set the colours used as a chequerboard pattern in the fold margin void SetFoldMarginColour(bool useSetting, const wxColour& back); void SetFoldMarginHiColour(bool useSetting, const wxColour& fore); // Move caret down one line. void LineDown(); // Move caret down one line extending selection to new caret position. void LineDownExtend(); // Move caret up one line. void LineUp(); // Move caret up one line extending selection to new caret position. void LineUpExtend(); // Move caret left one character. void CharLeft(); // Move caret left one character extending selection to new caret position. void CharLeftExtend(); // Move caret right one character. void CharRight(); // Move caret right one character extending selection to new caret position. void CharRightExtend(); // Move caret left one word. void WordLeft(); // Move caret left one word extending selection to new caret position. void WordLeftExtend(); // Move caret right one word. void WordRight(); // Move caret right one word extending selection to new caret position. void WordRightExtend(); // Move caret to first position on line. void Home(); // Move caret to first position on line extending selection to new caret position. void HomeExtend(); // Move caret to last position on line. void LineEnd(); // Move caret to last position on line extending selection to new caret position. void LineEndExtend(); // Move caret to first position in document. void DocumentStart(); // Move caret to first position in document extending selection to new caret position. void DocumentStartExtend(); // Move caret to last position in document. void DocumentEnd(); // Move caret to last position in document extending selection to new caret position. void DocumentEndExtend(); // Move caret one page up. void PageUp(); // Move caret one page up extending selection to new caret position. void PageUpExtend(); // Move caret one page down. void PageDown(); // Move caret one page down extending selection to new caret position. void PageDownExtend(); // Switch from insert to overtype mode or the reverse. void EditToggleOvertype(); // Cancel any modes such as call tip or auto-completion list display. void Cancel(); // Delete the selection or if no selection, the character before the caret. void DeleteBack(); // If selection is empty or all on one line replace the selection with a tab character. // If more than one line selected, indent the lines. void Tab(); // Dedent the selected lines. void BackTab(); // Insert a new line, may use a CRLF, CR or LF depending on EOL mode. void NewLine(); // Insert a Form Feed character. void FormFeed(); // Move caret to before first visible character on line. // If already there move to first character on line. void VCHome(); // Like VCHome but extending selection to new caret position. void VCHomeExtend(); // Magnify the displayed text by increasing the sizes by 1 point. void ZoomIn(); // Make the displayed text smaller by decreasing the sizes by 1 point. void ZoomOut(); // Delete the word to the left of the caret. void DelWordLeft(); // Delete the word to the right of the caret. void DelWordRight(); // Delete the word to the right of the caret, but not the trailing non-word characters. void DelWordRightEnd(); // Cut the line containing the caret. void LineCut(); // Delete the line containing the caret. void LineDelete(); // Switch the current line with the previous. void LineTranspose(); // Duplicate the current line. void LineDuplicate(); // Transform the selection to lower case. void LowerCase(); // Transform the selection to upper case. void UpperCase(); // Scroll the document down, keeping the caret visible. void LineScrollDown(); // Scroll the document up, keeping the caret visible. void LineScrollUp(); // Delete the selection or if no selection, the character before the caret. // Will not delete the character before at the start of a line. void DeleteBackNotLine(); // Move caret to first position on display line. void HomeDisplay(); // Move caret to first position on display line extending selection to // new caret position. void HomeDisplayExtend(); // Move caret to last position on display line. void LineEndDisplay(); // Move caret to last position on display line extending selection to new // caret position. void LineEndDisplayExtend(); // These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)? // except they behave differently when word-wrap is enabled: // They go first to the start / end of the display line, like (Home|LineEnd)Display // The difference is that, the cursor is already at the point, it goes on to the start // or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?. void HomeWrap(); void HomeWrapExtend(); void LineEndWrap(); void LineEndWrapExtend(); void VCHomeWrap(); void VCHomeWrapExtend(); // Copy the line containing the caret. void LineCopy(); // Move the caret inside current view if it's not there already. void MoveCaretInsideView(); // How many characters are on a line, including end of line characters? int LineLength(int line); // Highlight the characters at two positions. void BraceHighlight(int pos1, int pos2); // Highlight the character at a position indicating there is no matching brace. void BraceBadLight(int pos); // Find the position of a matching brace or INVALID_POSITION if no match. int BraceMatch(int pos); // Are the end of line characters visible? bool GetViewEOL(); // Make the end of line characters visible or invisible. void SetViewEOL(bool visible); // Retrieve a pointer to the document object. void* GetDocPointer(); // Change the document object used. void SetDocPointer(void* docPointer); // Set which document modification events are sent to the container. void SetModEventMask(int mask); // Retrieve the column number which text should be kept within. int GetEdgeColumn(); // Set the column number of the edge. // If text goes past the edge then it is highlighted. void SetEdgeColumn(int column); // Retrieve the edge highlight mode. int GetEdgeMode(); // The edge may be displayed by a line (EDGE_LINE) or by highlighting text that // goes beyond it (EDGE_BACKGROUND) or not displayed at all (EDGE_NONE). void SetEdgeMode(int mode); // Retrieve the colour used in edge indication. wxColour GetEdgeColour(); // Change the colour used in edge indication. void SetEdgeColour(const wxColour& edgeColour); // Sets the current caret position to be the search anchor. void SearchAnchor(); // Find some text starting at the search anchor. // Does not ensure the selection is visible. int SearchNext(int flags, const wxString& text); // Find some text starting at the search anchor and moving backwards. // Does not ensure the selection is visible. int SearchPrev(int flags, const wxString& text); // Retrieves the number of lines completely visible. int LinesOnScreen(); // Set whether a pop up menu is displayed automatically when the user presses // the wrong mouse button. void UsePopUp(bool allowPopUp); // Is the selection rectangular? The alternative is the more common stream selection. bool SelectionIsRectangle(); // Set the zoom level. This number of points is added to the size of all fonts. // It may be positive to magnify or negative to reduce. void SetZoom(int zoom); // Retrieve the zoom level. int GetZoom(); // Create a new document object. // Starts with reference count of 1 and not selected into editor. void* CreateDocument(); // Extend life of document. void AddRefDocument(void* docPointer); // Release a reference to the document, deleting document if it fades to black. void ReleaseDocument(void* docPointer); // Get which document modification events are sent to the container. int GetModEventMask(); // Change internal focus flag. void SetSTCFocus(bool focus); // Get internal focus flag. bool GetSTCFocus(); // Change error status - 0 = OK. void SetStatus(int statusCode); // Get error status. int GetStatus(); // Set whether the mouse is captured when its button is pressed. void SetMouseDownCaptures(bool captures); // Get whether mouse gets captured. bool GetMouseDownCaptures(); // Sets the cursor to one of the SC_CURSOR* values. void SetSTCCursor(int cursorType); // Get cursor type. int GetSTCCursor(); // Change the way control characters are displayed: // If symbol is < 32, keep the drawn way, else, use the given character. void SetControlCharSymbol(int symbol); // Get the way control characters are displayed. int GetControlCharSymbol(); // Move to the previous change in capitalisation. void WordPartLeft(); // Move to the previous change in capitalisation extending selection // to new caret position. void WordPartLeftExtend(); // Move to the change next in capitalisation. void WordPartRight(); // Move to the next change in capitalisation extending selection // to new caret position. void WordPartRightExtend(); // Set the way the display area is determined when a particular line // is to be moved to by Find, FindNext, GotoLine, etc. void SetVisiblePolicy(int visiblePolicy, int visibleSlop); // Delete back from the current position to the start of the line. void DelLineLeft(); // Delete forwards from the current position to the end of the line. void DelLineRight(); // Get and Set the xOffset (ie, horizonal scroll position). void SetXOffset(int newOffset); int GetXOffset(); // Set the last x chosen value to be the caret x position. void ChooseCaretX(); // Set the way the caret is kept visible when going sideway. // The exclusion zone is given in pixels. void SetXCaretPolicy(int caretPolicy, int caretSlop); // Set the way the line the caret is on is kept visible. // The exclusion zone is given in lines. void SetYCaretPolicy(int caretPolicy, int caretSlop); // Set printing to line wrapped (SC_WRAP_WORD) or not line wrapped (SC_WRAP_NONE). void SetPrintWrapMode(int mode); // Is printing line wrapped? int GetPrintWrapMode(); // Set a fore colour for active hotspots. void SetHotspotActiveForeground(bool useSetting, const wxColour& fore); // Get the fore colour for active hotspots. wxColour GetHotspotActiveForeground(); // Set a back colour for active hotspots. void SetHotspotActiveBackground(bool useSetting, const wxColour& back); // Get the back colour for active hotspots. wxColour GetHotspotActiveBackground(); // Enable / Disable underlining active hotspots. void SetHotspotActiveUnderline(bool underline); // Get whether underlining for active hotspots. bool GetHotspotActiveUnderline(); // Limit hotspots to single line so hotspots on two lines don't merge. void SetHotspotSingleLine(bool singleLine); // Get the HotspotSingleLine property bool GetHotspotSingleLine(); // Move caret between paragraphs (delimited by empty lines). void ParaDown(); void ParaDownExtend(); void ParaUp(); void ParaUpExtend(); // Given a valid document position, return the previous position taking code // page into account. Returns 0 if passed 0. int PositionBefore(int pos); // Given a valid document position, return the next position taking code // page into account. Maximum value returned is the last position in the document. int PositionAfter(int pos); // Copy a range of text to the clipboard. Positions are clipped into the document. void CopyRange(int start, int end); // Copy argument text to the clipboard. void CopyText(int length, const wxString& text); // Set the selection mode to stream (SC_SEL_STREAM) or rectangular (SC_SEL_RECTANGLE/SC_SEL_THIN) or // by lines (SC_SEL_LINES). void SetSelectionMode(int mode); // Get the mode of the current selection. int GetSelectionMode(); // Retrieve the position of the start of the selection at the given line (INVALID_POSITION if no selection on this line). int GetLineSelStartPosition(int line); // Retrieve the position of the end of the selection at the given line (INVALID_POSITION if no selection on this line). int GetLineSelEndPosition(int line); // Move caret down one line, extending rectangular selection to new caret position. void LineDownRectExtend(); // Move caret up one line, extending rectangular selection to new caret position. void LineUpRectExtend(); // Move caret left one character, extending rectangular selection to new caret position. void CharLeftRectExtend(); // Move caret right one character, extending rectangular selection to new caret position. void CharRightRectExtend(); // Move caret to first position on line, extending rectangular selection to new caret position. void HomeRectExtend(); // Move caret to before first visible character on line. // If already there move to first character on line. // In either case, extend rectangular selection to new caret position. void VCHomeRectExtend(); // Move caret to last position on line, extending rectangular selection to new caret position. void LineEndRectExtend(); // Move caret one page up, extending rectangular selection to new caret position. void PageUpRectExtend(); // Move caret one page down, extending rectangular selection to new caret position. void PageDownRectExtend(); // Move caret to top of page, or one page up if already at top of page. void StutteredPageUp(); // Move caret to top of page, or one page up if already at top of page, extending selection to new caret position. void StutteredPageUpExtend(); // Move caret to bottom of page, or one page down if already at bottom of page. void StutteredPageDown(); // Move caret to bottom of page, or one page down if already at bottom of page, extending selection to new caret position. void StutteredPageDownExtend(); // Move caret left one word, position cursor at end of word. void WordLeftEnd(); // Move caret left one word, position cursor at end of word, extending selection to new caret position. void WordLeftEndExtend(); // Move caret right one word, position cursor at end of word. void WordRightEnd(); // Move caret right one word, position cursor at end of word, extending selection to new caret position. void WordRightEndExtend(); // Set the set of characters making up whitespace for when moving or selecting by word. // Should be called after SetWordChars. void SetWhitespaceChars(const wxString& characters); // Reset the set of characters for whitespace and word characters to the defaults. void SetCharsDefault(); // Get currently selected item position in the auto-completion list int AutoCompGetCurrent(); // Enlarge the document to a particular size of text bytes. void Allocate(int bytes); // Find the position of a column on a line taking into account tabs and // multi-byte characters. If beyond end of line, return line end position. int FindColumn(int line, int column); // Can the caret preferred x position only be changed by explicit movement commands? bool GetCaretSticky(); // Stop the caret preferred x position changing when the user types. void SetCaretSticky(bool useCaretStickyBehaviour); // Switch between sticky and non-sticky: meant to be bound to a key. void ToggleCaretSticky(); // Enable/Disable convert-on-paste for line endings void SetPasteConvertEndings(bool convert); // Get convert-on-paste setting bool GetPasteConvertEndings(); // Duplicate the selection. If selection empty duplicate the line containing the caret. void SelectionDuplicate(); // Set background alpha of the caret line. void SetCaretLineBackAlpha(int alpha); // Get the background alpha of the caret line. int GetCaretLineBackAlpha(); // Set the style of the caret to be drawn. void SetCaretStyle(int caretStyle); // Returns the current style of the caret. int GetCaretStyle(); // Set the indicator used for IndicatorFillRange and IndicatorClearRange void SetIndicatorCurrent(int indicator); // Get the current indicator int GetIndicatorCurrent(); // Set the value used for IndicatorFillRange void SetIndicatorValue(int value); // Get the current indicator vaue int GetIndicatorValue(); // Turn a indicator on over a range. void IndicatorFillRange(int position, int fillLength); // Turn a indicator off over a range. void IndicatorClearRange(int position, int clearLength); // Are any indicators present at position? int IndicatorAllOnFor(int position); // What value does a particular indicator have at at a position? int IndicatorValueAt(int indicator, int position); // Where does a particular indicator start? int IndicatorStart(int indicator, int position); // Where does a particular indicator end? int IndicatorEnd(int indicator, int position); // Set number of entries in position cache void SetPositionCacheSize(int size); // How many entries are allocated to the position cache? int GetPositionCacheSize(); // Copy the selection, if selection empty copy the line with the caret void CopyAllowLine(); // Compact the document buffer and return a read-only pointer to the // characters in the document. const char* GetCharacterPointer(); // Always interpret keyboard input as Unicode void SetKeysUnicode(bool keysUnicode); // Are keys always interpreted as Unicode? bool GetKeysUnicode(); // Set the alpha fill colour of the given indicator. void IndicatorSetAlpha(int indicator, int alpha); // Get the alpha fill colour of the given indicator. int IndicatorGetAlpha(int indicator); // Set extra ascent for each line void SetExtraAscent(int extraAscent); // Get extra ascent for each line int GetExtraAscent(); // Set extra descent for each line void SetExtraDescent(int extraDescent); // Get extra descent for each line int GetExtraDescent(); // Which symbol was defined for markerNumber with MarkerDefine int GetMarkerSymbolDefined(int markerNumber); // Set the text in the text margin for a line void MarginSetText(int line, const wxString& text); // Get the text in the text margin for a line wxString MarginGetText(int line); // Set the style number for the text margin for a line void MarginSetStyle(int line, int style); // Get the style number for the text margin for a line int MarginGetStyle(int line); // Set the style in the text margin for a line void MarginSetStyles(int line, const wxString& styles); // Get the styles in the text margin for a line wxString MarginGetStyles(int line); // Clear the margin text on all lines void MarginTextClearAll(); // Get the start of the range of style numbers used for margin text void MarginSetStyleOffset(int style); // Get the start of the range of style numbers used for margin text int MarginGetStyleOffset(); // Set the annotation text for a line void AnnotationSetText(int line, const wxString& text); // Get the annotation text for a line wxString AnnotationGetText(int line); // Set the style number for the annotations for a line void AnnotationSetStyle(int line, int style); // Get the style number for the annotations for a line int AnnotationGetStyle(int line); // Set the annotation styles for a line void AnnotationSetStyles(int line, const wxString& styles); // Get the annotation styles for a line wxString AnnotationGetStyles(int line); // Get the number of annotation lines for a line int AnnotationGetLines(int line); // Clear the annotations from all lines void AnnotationClearAll(); // Set the visibility for the annotations for a view void AnnotationSetVisible(int visible); // Get the visibility for the annotations for a view int AnnotationGetVisible(); // Get the start of the range of style numbers used for annotations void AnnotationSetStyleOffset(int style); // Get the start of the range of style numbers used for annotations int AnnotationGetStyleOffset(); // Add a container action to the undo stack void AddUndoAction(int token, int flags); // Find the position of a character from a point within the window. int CharPositionFromPoint(int x, int y); // Find the position of a character from a point within the window. // Return INVALID_POSITION if not close to text. int CharPositionFromPointClose(int x, int y); // Set whether multiple selections can be made void SetMultipleSelection(bool multipleSelection); // Whether multiple selections can be made bool GetMultipleSelection(); // Set whether typing can be performed into multiple selections void SetAdditionalSelectionTyping(bool additionalSelectionTyping); // Whether typing can be performed into multiple selections bool GetAdditionalSelectionTyping(); // Set whether additional carets will blink void SetAdditionalCaretsBlink(bool additionalCaretsBlink); // Whether additional carets will blink bool GetAdditionalCaretsBlink(); // Set whether additional carets are visible void SetAdditionalCaretsVisible(bool additionalCaretsBlink); // Whether additional carets are visible bool GetAdditionalCaretsVisible(); // How many selections are there? int GetSelections(); // Clear selections to a single empty stream selection void ClearSelections(); // Add a selection int AddSelection(int caret, int anchor); // Set the main selection void SetMainSelection(int selection); // Which selection is the main selection int GetMainSelection(); void SetSelectionNCaret(int selection, int pos); int GetSelectionNCaret(int selection); void SetSelectionNAnchor(int selection, int posAnchor); int GetSelectionNAnchor(int selection); void SetSelectionNCaretVirtualSpace(int selection, int space); int GetSelectionNCaretVirtualSpace(int selection); void SetSelectionNAnchorVirtualSpace(int selection, int space); int GetSelectionNAnchorVirtualSpace(int selection); // Sets the position that starts the selection - this becomes the anchor. void SetSelectionNStart(int selection, int pos); // Returns the position at the start of the selection. int GetSelectionNStart(int selection); // Sets the position that ends the selection - this becomes the currentPosition. void SetSelectionNEnd(int selection, int pos); // Returns the position at the end of the selection. int GetSelectionNEnd(int selection); void SetRectangularSelectionCaret(int pos); int GetRectangularSelectionCaret(); void SetRectangularSelectionAnchor(int posAnchor); int GetRectangularSelectionAnchor(); void SetRectangularSelectionCaretVirtualSpace(int space); int GetRectangularSelectionCaretVirtualSpace(); void SetRectangularSelectionAnchorVirtualSpace(int space); int GetRectangularSelectionAnchorVirtualSpace(); void SetVirtualSpaceOptions(int virtualSpaceOptions); int GetVirtualSpaceOptions(); // On GTK+, allow selecting the modifier key to use for mouse-based // rectangular selection. Often the window manager requires Alt+Mouse Drag // for moving windows. // Valid values are SCMOD_CTRL(default), SCMOD_ALT, or SCMOD_SUPER. void SetRectangularSelectionModifier(int modifier); // Get the modifier key used for rectangular selection. int GetRectangularSelectionModifier(); // Set the foreground colour of additional selections. // Must have previously called SetSelFore with non-zero first argument for this to have an effect. void SetAdditionalSelForeground(const wxColour& fore); // Set the background colour of additional selections. // Must have previously called SetSelBack with non-zero first argument for this to have an effect. void SetAdditionalSelBackground(const wxColour& back); // Set the alpha of the selection. void SetAdditionalSelAlpha(int alpha); // Get the alpha of the selection. int GetAdditionalSelAlpha(); // Set the foreground colour of additional carets. void SetAdditionalCaretForeground(const wxColour& fore); // Get the foreground colour of additional carets. wxColour GetAdditionalCaretForeground(); // Set the main selection to the next selection. void RotateSelection(); // Swap that caret and anchor of the main selection. void SwapMainAnchorCaret(); // Start notifying the container of all key presses and commands. void StartRecord(); // Stop notifying the container of all key presses and commands. void StopRecord(); // Set the lexing language of the document. void SetLexer(int lexer); // Retrieve the lexing language of the document. int GetLexer(); // Colourise a segment of the document using the current lexing language. void Colourise(int start, int end); // Set up a value that may be used by a lexer for some optional feature. void SetProperty(const wxString& key, const wxString& value); // Set up the key words used by the lexer. void SetKeyWords(int keywordSet, const wxString& keyWords); // Set the lexing language of the document based on string name. void SetLexerLanguage(const wxString& language); // Retrieve a 'property' value previously set with SetProperty. wxString GetProperty(const wxString& key); // Retrieve a 'property' value previously set with SetProperty, // with '$()' variable replacement on returned buffer. wxString GetPropertyExpanded(const wxString& key); // Retrieve a 'property' value previously set with SetProperty, // interpreted as an int AFTER any '$()' variable replacement. int GetPropertyInt(const wxString& key); // Retrieve the number of bits the current lexer needs for styling. int GetStyleBitsNeeded(); //}}} //---------------------------------------------------------------------- // Manually declared methods // Returns the line number of the line with the caret. int GetCurrentLine(); // Extract style settings from a spec-string which is composed of one or // more of the following comma separated elements: // // bold turns on bold // italic turns on italics // fore:[name or #RRGGBB] sets the foreground colour // back:[name or #RRGGBB] sets the background colour // face:[facename] sets the font face name to use // size:[num] sets the font size in points // eol turns on eol filling // underline turns on underlining // void StyleSetSpec(int styleNum, const wxString& spec); // Get the font of a style. wxFont StyleGetFont(int style); // Set style size, face, bold, italic, and underline attributes from // a wxFont's attributes. void StyleSetFont(int styleNum, wxFont& font); // Set all font style attributes at once. void StyleSetFontAttr(int styleNum, int size, const wxString& faceName, bool bold, bool italic, bool underline, wxFontEncoding encoding=wxFONTENCODING_DEFAULT); // Set the character set of the font in a style. Converts the Scintilla // character set values to a wxFontEncoding. void StyleSetCharacterSet(int style, int characterSet); // Set the font encoding to be used by a style. void StyleSetFontEncoding(int style, wxFontEncoding encoding); // Set the left and right margin in the edit area, measured in pixels. void SetMargins(int left, int right); // Retrieve the point in the window where a position is displayed. wxPoint PointFromPosition(int pos); // Remove any selection and sets the caret at position. The caret is not scrolled into view. void SetEmptySelection(int pos); // Scroll enough to make the given line visible void ScrollToLine(int line); // Scroll enough to make the given column visible void ScrollToColumn(int column); // Send a message to Scintilla // // NB: this method is not really const as it can modify the control but it // has to be declared as such as it's called from both const and // non-const methods and we can't distinguish between the two wxIntPtr SendMsg(int msg, wxUIntPtr wp=0, wxIntPtr lp=0); // Set the vertical scrollbar to use instead of the ont that's built-in. void SetVScrollBar(wxScrollBar* bar); // Set the horizontal scrollbar to use instead of the ont that's built-in. void SetHScrollBar(wxScrollBar* bar); // Can be used to prevent the EVT_CHAR handler from adding the char bool GetLastKeydownProcessed() { return m_lastKeyDownConsumed; } void SetLastKeydownProcessed(bool val) { m_lastKeyDownConsumed = val; } // Write the contents of the editor to filename bool SaveFile(const wxString& filename); // Load the contents of filename into the editor bool LoadFile(const wxString& filename); #ifdef STC_USE_DND // Allow for simulating a DnD DragOver wxDragResult DoDragOver(wxCoord x, wxCoord y, wxDragResult def); // Allow for simulating a DnD DropText bool DoDropText(long x, long y, const wxString& data); #endif // Specify whether anti-aliased fonts should be used. Will have no effect // on some platforms, but on some (wxMac for example) can greatly improve // performance. void SetUseAntiAliasing(bool useAA); // Returns the current UseAntiAliasing setting. bool GetUseAntiAliasing(); // The following methods are nearly equivallent to their similarly named // cousins above. The difference is that these methods bypass wxString // and always use a char* even if used in a unicode build of wxWidgets. // In that case the character data will be utf-8 encoded since that is // what is used internally by Scintilla in unicode builds. // Add text to the document at current position. void AddTextRaw(const char* text); // Insert string at a position. void InsertTextRaw(int pos, const char* text); // Retrieve the text of the line containing the caret. // Returns the index of the caret on the line. wxCharBuffer GetCurLineRaw(int* linePos=NULL); // Retrieve the contents of a line. wxCharBuffer GetLineRaw(int line); // Retrieve the selected text. wxCharBuffer GetSelectedTextRaw(); // Retrieve a range of text. wxCharBuffer GetTextRangeRaw(int startPos, int endPos); // Replace the contents of the document with the argument text. void SetTextRaw(const char* text); // Retrieve all the text in the document. wxCharBuffer GetTextRaw(); // Append a string to the end of the document without changing the selection. void AppendTextRaw(const char* text); virtual void SetInsertionPoint(long pos) { SetCurrentPos(pos); } virtual long GetInsertionPoint() { return GetCurrentPos(); } virtual long GetLastPosition() { return GetTextLength(); } virtual void SetSelection(long from, long to) { if ( from == -1 && to == -1 ) { SelectAll(); } else { SetSelectionStart(from); SetSelectionEnd(to); } } #ifdef SWIG void GetSelection(long* OUTPUT, long* OUTPUT); #else virtual void GetSelection(long *from, long *to) { if ( from ) *from = GetSelectionStart(); if ( to ) *to = GetSelectionEnd(); } // kept for compatibility only void GetSelection(int *from, int *to) { long f, t; GetSelection(&f, &t); if ( from ) *from = f; if ( to ) *to = t; } #endif virtual bool IsEditable() { return !GetReadOnly(); } virtual void SetEditable(bool editable) { SetReadOnly(!editable); } protected: virtual wxString DoGetValue() { return GetText(); } virtual wxWindow *GetEditableWindow() { return this; } #ifndef SWIG // Event handlers void OnPaint(wxPaintEvent& evt); void OnScrollWin(wxScrollWinEvent& evt); void OnScroll(wxScrollEvent& evt); void OnSize(wxSizeEvent& evt); void OnMouseLeftDown(wxMouseEvent& evt); void OnMouseMove(wxMouseEvent& evt); void OnMouseLeftUp(wxMouseEvent& evt); void OnMouseRightUp(wxMouseEvent& evt); void OnMouseMiddleUp(wxMouseEvent& evt); void OnContextMenu(wxContextMenuEvent& evt); void OnMouseWheel(wxMouseEvent& evt); void OnChar(wxKeyEvent& evt); void OnKeyDown(wxKeyEvent& evt); void OnLoseFocus(wxFocusEvent& evt); void OnGainFocus(wxFocusEvent& evt); void OnSysColourChanged(wxSysColourChangedEvent& evt); void OnEraseBackground(wxEraseEvent& evt); void OnMenu(wxCommandEvent& evt); void OnListBox(wxCommandEvent& evt); void OnIdle(wxIdleEvent& evt); virtual wxSize DoGetBestSize(); // Turn notifications from Scintilla into events void NotifyChange(); void NotifyParent(SCNotification* scn); private: DECLARE_EVENT_TABLE() DECLARE_DYNAMIC_CLASS(wxScintillaTextCtrl) protected: ScintillaWX* m_swx; wxStopWatch m_stopWatch; wxScrollBar* m_vScrollBar; wxScrollBar* m_hScrollBar; bool m_lastKeyDownConsumed; // the timestamp that consists of the last wheel event // added to the time taken to process that event. long m_lastWheelTimestamp; friend class ScintillaWX; friend class Platform; #endif // !SWIG }; //---------------------------------------------------------------------- class WXDLLIMPEXP_STC wxScintillaTextEvent : public wxCommandEvent { public: wxScintillaTextEvent(wxEventType commandType=0, int id=0); wxScintillaTextEvent(const wxScintillaTextEvent& event); ~wxScintillaTextEvent() {} void SetPosition(int pos) { m_position = pos; } void SetKey(int k) { m_key = k; } void SetModifiers(int m) { m_modifiers = m; } void SetModificationType(int t) { m_modificationType = t; } void SetText(const wxString& t) { m_text = t; } void SetLength(int len) { m_length = len; } void SetLinesAdded(int num) { m_linesAdded = num; } void SetLine(int val) { m_line = val; } void SetFoldLevelNow(int val) { m_foldLevelNow = val; } void SetFoldLevelPrev(int val) { m_foldLevelPrev = val; } void SetMargin(int val) { m_margin = val; } void SetMessage(int val) { m_message = val; } void SetWParam(int val) { m_wParam = val; } void SetLParam(int val) { m_lParam = val; } void SetListType(int val) { m_listType = val; } void SetX(int val) { m_x = val; } void SetY(int val) { m_y = val; } void SetDragText(const wxString& val) { m_dragText = val; } void SetDragAllowMove(bool val) { m_dragAllowMove = val; } #ifdef STC_USE_DND void SetDragResult(wxDragResult val) { m_dragResult = val; } #endif int GetPosition() const { return m_position; } int GetKey() const { return m_key; } int GetModifiers() const { return m_modifiers; } int GetModificationType() const { return m_modificationType; } wxString GetText() const { return m_text; } int GetLength() const { return m_length; } int GetLinesAdded() const { return m_linesAdded; } int GetLine() const { return m_line; } int GetFoldLevelNow() const { return m_foldLevelNow; } int GetFoldLevelPrev() const { return m_foldLevelPrev; } int GetMargin() const { return m_margin; } int GetMessage() const { return m_message; } int GetWParam() const { return m_wParam; } int GetLParam() const { return m_lParam; } int GetListType() const { return m_listType; } int GetX() const { return m_x; } int GetY() const { return m_y; } wxString GetDragText() { return m_dragText; } bool GetDragAllowMove() { return m_dragAllowMove; } #ifdef STC_USE_DND wxDragResult GetDragResult() { return m_dragResult; } #endif bool GetShift(); bool GetControl(); bool GetAlt(); virtual wxEvent* Clone() const { return new wxScintillaTextEvent(*this); } private: DECLARE_DYNAMIC_CLASS(wxScintillaTextEvent) int m_position; int m_key; int m_modifiers; int m_modificationType; // wxEVT_STC_MODIFIED wxString m_text; int m_length; int m_linesAdded; int m_line; int m_foldLevelNow; int m_foldLevelPrev; int m_margin; // wxEVT_STC_MARGINCLICK int m_message; // wxEVT_STC_MACRORECORD int m_wParam; int m_lParam; int m_listType; int m_x; int m_y; wxString m_dragText; // wxEVT_STC_START_DRAG, wxEVT_STC_DO_DROP bool m_dragAllowMove; // wxEVT_STC_START_DRAG #if wxUSE_DRAG_AND_DROP wxDragResult m_dragResult; // wxEVT_STC_DRAG_OVER,wxEVT_STC_DO_DROP #endif }; BEGIN_DECLARE_EVENT_TYPES() DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_CHANGE, 1650) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_STYLENEEDED, 1651) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_CHARADDED, 1652) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_SAVEPOINTREACHED, 1653) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_SAVEPOINTLEFT, 1654) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_ROMODIFYATTEMPT, 1655) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_KEY, 1656) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_DOUBLECLICK, 1657) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_UPDATEUI, 1658) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_MODIFIED, 1659) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_MACRORECORD, 1660) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_MARGINCLICK, 1661) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_NEEDSHOWN, 1662) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_PAINTED, 1664) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_USERLISTSELECTION, 1665) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_URIDROPPED, 1666) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_DWELLSTART, 1667) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_DWELLEND, 1668) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_START_DRAG, 1669) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_DRAG_OVER, 1670) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_DO_DROP, 1671) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_ZOOM, 1672) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_HOTSPOT_CLICK, 1673) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_HOTSPOT_DCLICK, 1674) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_CALLTIP_CLICK, 1675) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_AUTOCOMP_SELECTION, 1676) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_INDICATOR_CLICK, 1677) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_INDICATOR_RELEASE, 1678) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_AUTOCOMP_CANCELLED, 1679) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_AUTOCOMP_CHAR_DELETED, 1680) END_DECLARE_EVENT_TYPES() typedef void (wxEvtHandler::*wxScintillaTextEventFunction)(wxScintillaTextEvent&); #define wxScintillaTextEventHandler( func ) \ wxEVENT_HANDLER_CAST( wxScintillaTextEventFunction, func ) #define EVT_STC_CHANGE(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHANGE, id, wxID_ANY, wxScintillaTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_STYLENEEDED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_STYLENEEDED, id, wxID_ANY, wxScintillaTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_CHARADDED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHARADDED, id, wxID_ANY, wxScintillaTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_SAVEPOINTREACHED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTREACHED, id, wxID_ANY, wxScintillaTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_SAVEPOINTLEFT(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTLEFT, id, wxID_ANY, wxScintillaTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_ROMODIFYATTEMPT(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ROMODIFYATTEMPT, id, wxID_ANY, wxScintillaTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_KEY(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_KEY, id, wxID_ANY, wxScintillaTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_DOUBLECLICK(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DOUBLECLICK, id, wxID_ANY, wxScintillaTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_UPDATEUI(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_UPDATEUI, id, wxID_ANY, wxScintillaTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_MODIFIED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MODIFIED, id, wxID_ANY, wxScintillaTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_MACRORECORD(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MACRORECORD, id, wxID_ANY, wxScintillaTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_MARGINCLICK(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MARGINCLICK, id, wxID_ANY, wxScintillaTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_NEEDSHOWN(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_NEEDSHOWN, id, wxID_ANY, wxScintillaTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_PAINTED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_PAINTED, id, wxID_ANY, wxScintillaTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_USERLISTSELECTION(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_USERLISTSELECTION, id, wxID_ANY, wxScintillaTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_URIDROPPED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_URIDROPPED, id, wxID_ANY, wxScintillaTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_DWELLSTART(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLSTART, id, wxID_ANY, wxScintillaTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_DWELLEND(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLEND, id, wxID_ANY, wxScintillaTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_START_DRAG(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_START_DRAG, id, wxID_ANY, wxScintillaTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_DRAG_OVER(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DRAG_OVER, id, wxID_ANY, wxScintillaTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_DO_DROP(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DO_DROP, id, wxID_ANY, wxScintillaTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_ZOOM(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ZOOM, id, wxID_ANY, wxScintillaTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_HOTSPOT_CLICK(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_CLICK, id, wxID_ANY, wxScintillaTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_HOTSPOT_DCLICK(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_DCLICK, id, wxID_ANY, wxScintillaTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_CALLTIP_CLICK(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CALLTIP_CLICK, id, wxID_ANY, wxScintillaTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_AUTOCOMP_SELECTION(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_AUTOCOMP_SELECTION, id, wxID_ANY, wxScintillaTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_INDICATOR_CLICK(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_INDICATOR_CLICK, id, wxID_ANY, wxScintillaTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_INDICATOR_RELEASE(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_INDICATOR_RELEASE, id, wxID_ANY, wxScintillaTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_AUTOCOMP_CANCELLED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_AUTOCOMP_CANCELLED, id, wxID_ANY, wxScintillaTextEventHandler( fn ), (wxObject *) NULL ), #define EVT_STC_AUTOCOMP_CHAR_DELETED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_AUTOCOMP_CHAR_DELETED, id, wxID_ANY, wxScintillaTextEventHandler( fn ), (wxObject *) NULL ), #endif // _WX_STC_STC_H_ Wx-Scintilla-0.38/wx-scintilla/src000755001750001750 011727344243 17467 5ustar00azawawiazawawi000000000000Wx-Scintilla-0.38/wx-scintilla/src/scintilla_cwc.h000444001750001750 11311727344243 22566 0ustar00azawawiazawawi000000000000#define __WX__ #define SCI_LEXER #define LINK_LEXERS #include "wx/wx_cwc.h"Wx-Scintilla-0.38/wx-scintilla/src/scintilla_cwc_d.h000444001750001750 11511727344243 23073 0ustar00azawawiazawawi000000000000#define __WX__ #define SCI_LEXER #define LINK_LEXERS #include "wx/wx_cwc_d.h"Wx-Scintilla-0.38/wx-scintilla/src/scintilla_cw_d.h000444001750001750 11411727344243 22727 0ustar00azawawiazawawi000000000000#define __WX__ #define SCI_LEXER #define LINK_LEXERS #include "wx/wx_cw_d.h"Wx-Scintilla-0.38/wx-scintilla/src/ScintillaWX.cpp000444001750001750 7707011727344243 22564 0ustar00azawawiazawawi000000000000//////////////////////////////////////////////////////////////////////////// // Name: ScintillaWX.cxx // Purpose: A wxWidgets implementation of Scintilla. A class derived // from ScintillaBase that uses the "wx platform" defined in // PlatformWX.cxx This class is one end of a bridge between // the wx world and the Scintilla world. It needs a peer // object of type wxScintillaTextCtrl to function. // // Author: Robin Dunn // // Created: 13-Jan-2000 // RCS-ID: $Id$ // Copyright: (c) 2000 by Total Control Software // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" #ifdef __BORLANDC__ #pragma hdrstop #endif #ifndef WX_PRECOMP #include "wx/scrolbar.h" #include "wx/menu.h" #include "wx/timer.h" #endif // WX_PRECOMP #include "wx/textbuf.h" #include "wx/dataobj.h" #include "wx/clipbrd.h" #include "wx/dnd.h" #include "ScintillaWX.h" #include "LexerModule.h" #include "ExternalLexer.h" #include "WxScintilla.h" #include "private.h" #include "PlatWX.h" #ifdef __WXMSW__ // GetHwndOf() #include "wx/msw/private.h" #endif //---------------------------------------------------------------------- // Helper classes class wxSTCTimer : public wxTimer { public: wxSTCTimer(ScintillaWX* swx) { m_swx = swx; } void Notify() { m_swx->DoTick(); } private: ScintillaWX* m_swx; }; #if wxUSE_DRAG_AND_DROP bool wxSTCDropTarget::OnDropText(wxCoord x, wxCoord y, const wxString& data) { return m_swx->DoDropText(x, y, data); } wxDragResult wxSTCDropTarget::OnEnter(wxCoord x, wxCoord y, wxDragResult def) { return m_swx->DoDragEnter(x, y, def); } wxDragResult wxSTCDropTarget::OnDragOver(wxCoord x, wxCoord y, wxDragResult def) { return m_swx->DoDragOver(x, y, def); } void wxSTCDropTarget::OnLeave() { m_swx->DoDragLeave(); } #endif // wxUSE_DRAG_AND_DROP #if wxUSE_POPUPWIN #include "wx/popupwin.h" #define wxSTCCallTipBase wxPopupWindow #else #include "wx/frame.h" #define wxSTCCallTipBase wxFrame #endif #include "wx/dcbuffer.h" class wxSTCCallTip : public wxSTCCallTipBase { public: wxSTCCallTip(wxWindow* parent, CallTip* ct, ScintillaWX* swx) : #if wxUSE_POPUPWIN wxSTCCallTipBase(parent, wxBORDER_NONE), #else wxSTCCallTipBase(parent, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxFRAME_NO_TASKBAR | wxFRAME_FLOAT_ON_PARENT | wxBORDER_NONE #ifdef __WXMAC__ | wxPOPUP_WINDOW #endif ), #endif m_ct(ct), m_swx(swx), m_cx(wxDefaultCoord), m_cy(wxDefaultCoord) { SetBackgroundStyle(wxBG_STYLE_CUSTOM); } ~wxSTCCallTip() { #if wxUSE_POPUPWIN && defined(__WXGTK__) wxRect rect = GetRect(); rect.x = m_cx; rect.y = m_cy; GetParent()->Refresh(false, &rect); #endif } bool AcceptsFocus() const { return false; } void OnPaint(wxPaintEvent& WXUNUSED(evt)) { wxAutoBufferedPaintDC dc(this); Surface* surfaceWindow = Surface::Allocate(SC_TECHNOLOGY_DEFAULT); surfaceWindow->Init(&dc, m_ct->wDraw.GetID()); m_ct->PaintCT(surfaceWindow); surfaceWindow->Release(); delete surfaceWindow; } void OnFocus(wxFocusEvent& event) { GetParent()->SetFocus(); event.Skip(); } void OnLeftDown(wxMouseEvent& event) { wxPoint pt = event.GetPosition(); Point p(pt.x, pt.y); m_ct->MouseClick(p); m_swx->CallTipClick(); } virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO) { // convert coords to screen coords since we're a top-level window if (x != wxDefaultCoord) { m_cx = x; GetParent()->ClientToScreen(&x, NULL); } if (y != wxDefaultCoord) { m_cy = y; GetParent()->ClientToScreen(NULL, &y); } wxSTCCallTipBase::DoSetSize(x, y, width, height, sizeFlags); } #if wxUSE_POPUPWIN #else virtual bool Show( bool show = true ) { // Although we're a frame, we always want the parent to be active, so // raise it whenever we get shown. bool rv = wxSTCCallTipBase::Show(show); if (rv && show) { wxTopLevelWindow *frame = wxDynamicCast( wxGetTopLevelParent(GetParent()), wxTopLevelWindow); if (frame) frame->Raise(); } return rv; } #endif wxPoint GetMyPosition() { return wxPoint(m_cx, m_cy); } private: CallTip* m_ct; ScintillaWX* m_swx; int m_cx, m_cy; DECLARE_EVENT_TABLE() }; BEGIN_EVENT_TABLE(wxSTCCallTip, wxSTCCallTipBase) EVT_PAINT(wxSTCCallTip::OnPaint) EVT_SET_FOCUS(wxSTCCallTip::OnFocus) EVT_LEFT_DOWN(wxSTCCallTip::OnLeftDown) END_EVENT_TABLE() //---------------------------------------------------------------------- #if wxUSE_DATAOBJ static wxTextFileType wxConvertEOLMode(int scintillaMode) { wxTextFileType type; switch (scintillaMode) { case wxSTC_EOL_CRLF: type = wxTextFileType_Dos; break; case wxSTC_EOL_CR: type = wxTextFileType_Mac; break; case wxSTC_EOL_LF: type = wxTextFileType_Unix; break; default: type = wxTextBuffer::typeDefault; break; } return type; } #endif // wxUSE_DATAOBJ //---------------------------------------------------------------------- // Constructor/Destructor ScintillaWX::ScintillaWX(wxScintillaTextCtrl* win) { capturedMouse = false; focusEvent = false; wMain = win; stc = win; wheelRotation = 0; Initialise(); #ifdef __WXMSW__ sysCaretBitmap = 0; sysCaretWidth = 0; sysCaretHeight = 0; #endif } ScintillaWX::~ScintillaWX() { Finalise(); } //---------------------------------------------------------------------- // base class virtuals void ScintillaWX::Initialise() { //ScintillaBase::Initialise(); #if wxUSE_DRAG_AND_DROP dropTarget = new wxSTCDropTarget; dropTarget->SetScintilla(this); stc->SetDropTarget(dropTarget); #endif // wxUSE_DRAG_AND_DROP vs.extraFontFlag = true; // UseAntiAliasing } void ScintillaWX::Finalise() { ScintillaBase::Finalise(); SetTicking(false); SetIdle(false); DestroySystemCaret(); } void ScintillaWX::StartDrag() { #if wxUSE_DRAG_AND_DROP wxString dragText = stc2wx(drag.s, drag.len); // Send an event to allow the drag text to be changed wxScintillaTextEvent evt(wxEVT_STC_START_DRAG, stc->GetId()); evt.SetEventObject(stc); evt.SetDragText(dragText); evt.SetDragAllowMove(true); evt.SetPosition(wxMin(stc->GetSelectionStart(), stc->GetSelectionEnd())); stc->GetEventHandler()->ProcessEvent(evt); dragText = evt.GetDragText(); if (dragText.length()) { wxDropSource source(stc); wxTextDataObject data(dragText); wxDragResult result; source.SetData(data); dropWentOutside = true; inDragDrop = ddDragging; result = source.DoDragDrop(evt.GetDragAllowMove()); if (result == wxDragMove && dropWentOutside) ClearSelection(); inDragDrop = ddNone; SetDragPosition(SelectionPosition(invalidPosition)); } #endif // wxUSE_DRAG_AND_DROP } bool ScintillaWX::SetIdle(bool on) { if (idler.state != on) { // connect or disconnect the EVT_IDLE handler if (on) stc->Connect(wxID_ANY, wxEVT_IDLE, wxIdleEventHandler(wxScintillaTextCtrl::OnIdle)); else stc->Disconnect(wxID_ANY, wxEVT_IDLE, wxIdleEventHandler(wxScintillaTextCtrl::OnIdle)); idler.state = on; } return idler.state; } void ScintillaWX::SetTicking(bool on) { wxSTCTimer* steTimer; if (timer.ticking != on) { timer.ticking = on; if (timer.ticking) { steTimer = new wxSTCTimer(this); steTimer->Start(timer.tickSize); timer.tickerID = steTimer; } else { steTimer = (wxSTCTimer*)timer.tickerID; steTimer->Stop(); delete steTimer; timer.tickerID = 0; } } timer.ticksToWait = caret.period; } void ScintillaWX::SetMouseCapture(bool on) { if (mouseDownCaptures) { if (on && !capturedMouse) stc->CaptureMouse(); else if (!on && capturedMouse && stc->HasCapture()) stc->ReleaseMouse(); capturedMouse = on; } } bool ScintillaWX::HaveMouseCapture() { return capturedMouse; } void ScintillaWX::ScrollText(int linesToMove) { int dy = vs.lineHeight * (linesToMove); stc->ScrollWindow(0, dy); stc->Update(); } void ScintillaWX::SetVerticalScrollPos() { if (stc->m_vScrollBar == NULL) { // Use built-in scrollbar stc->SetScrollPos(wxVERTICAL, topLine); } else { // otherwise use the one that's been given to us stc->m_vScrollBar->SetThumbPosition(topLine); } } void ScintillaWX::SetHorizontalScrollPos() { if (stc->m_hScrollBar == NULL) { // Use built-in scrollbar stc->SetScrollPos(wxHORIZONTAL, xOffset); } else { // otherwise use the one that's been given to us stc->m_hScrollBar->SetThumbPosition(xOffset); } } const int H_SCROLL_STEP = 20; bool ScintillaWX::ModifyScrollBars(int nMax, int nPage) { bool modified = false; int vertEnd = nMax; if (!verticalScrollBarVisible) vertEnd = 0; // Check the vertical scrollbar if (stc->m_vScrollBar == NULL) { // Use built-in scrollbar int sbMax = stc->GetScrollRange(wxVERTICAL); int sbThumb = stc->GetScrollThumb(wxVERTICAL); int sbPos = stc->GetScrollPos(wxVERTICAL); if (sbMax != vertEnd || sbThumb != nPage) { stc->SetScrollbar(wxVERTICAL, sbPos, nPage, vertEnd+1); modified = true; } } else { // otherwise use the one that's been given to us int sbMax = stc->m_vScrollBar->GetRange(); int sbPage = stc->m_vScrollBar->GetPageSize(); int sbPos = stc->m_vScrollBar->GetThumbPosition(); if (sbMax != vertEnd || sbPage != nPage) { stc->m_vScrollBar->SetScrollbar(sbPos, nPage, vertEnd+1, nPage); modified = true; } } // Check the horizontal scrollbar PRectangle rcText = GetTextRectangle(); int horizEnd = scrollWidth; if (horizEnd < 0) horizEnd = 0; if (!horizontalScrollBarVisible || (wrapState != eWrapNone)) horizEnd = 0; int pageWidth = rcText.Width(); if (stc->m_hScrollBar == NULL) { // Use built-in scrollbar int sbMax = stc->GetScrollRange(wxHORIZONTAL); int sbThumb = stc->GetScrollThumb(wxHORIZONTAL); int sbPos = stc->GetScrollPos(wxHORIZONTAL); if ((sbMax != horizEnd) || (sbThumb != pageWidth) || (sbPos != 0)) { stc->SetScrollbar(wxHORIZONTAL, sbPos, pageWidth, horizEnd); modified = true; if (scrollWidth < pageWidth) { HorizontalScrollTo(0); } } } else { // otherwise use the one that's been given to us int sbMax = stc->m_hScrollBar->GetRange(); int sbThumb = stc->m_hScrollBar->GetPageSize(); int sbPos = stc->m_hScrollBar->GetThumbPosition(); if ((sbMax != horizEnd) || (sbThumb != pageWidth) || (sbPos != 0)) { stc->m_hScrollBar->SetScrollbar(sbPos, pageWidth, horizEnd, pageWidth); modified = true; if (scrollWidth < pageWidth) { HorizontalScrollTo(0); } } } return modified; } void ScintillaWX::NotifyChange() { stc->NotifyChange(); } void ScintillaWX::NotifyParent(SCNotification scn) { stc->NotifyParent(&scn); } // This method is overloaded from ScintillaBase in order to prevent the // AutoComplete window from being destroyed when it gets the focus. There is // a side effect that the AutoComp will also not be destroyed when switching // to another window, but I think that is okay. void ScintillaWX::CancelModes() { if (! focusEvent) AutoCompleteCancel(); ct.CallTipCancel(); Editor::CancelModes(); } void ScintillaWX::Copy() { if (!sel.Empty()) { SelectionText st; CopySelectionRange(&st); CopyToClipboard(st); } } void ScintillaWX::Paste() { pdoc->BeginUndoAction(); ClearSelection(); #if wxUSE_DATAOBJ wxTextDataObject data; bool gotData = false; wxTheClipboard->UsePrimarySelection(false); if (wxTheClipboard->Open()) { gotData = wxTheClipboard->GetData(data); wxTheClipboard->Close(); } if (gotData) { wxString text = wxTextBuffer::Translate(data.GetText(), wxConvertEOLMode(pdoc->eolMode)); wxWX2MBbuf buf = (wxWX2MBbuf)wx2stc(text); #if wxUSE_UNICODE // free up the old character buffer in case the text is real big data.SetText(wxEmptyString); text = wxEmptyString; #endif int len = strlen(buf); int caretMain = sel.MainCaret(); pdoc->InsertString(caretMain, buf, len); SetEmptySelection(caretMain + len); } #endif // wxUSE_DATAOBJ pdoc->EndUndoAction(); NotifyChange(); Redraw(); } void ScintillaWX::CopyToClipboard(const SelectionText& st) { #if wxUSE_CLIPBOARD if ( !st.len ) return; wxTheClipboard->UsePrimarySelection(false); if (wxTheClipboard->Open()) { wxString text = wxTextBuffer::Translate(stc2wx(st.s, st.len-1)); wxTheClipboard->SetData(new wxTextDataObject(text)); wxTheClipboard->Close(); } #else wxUnusedVar(st); #endif // wxUSE_CLIPBOARD } bool ScintillaWX::CanPaste() { #if wxUSE_CLIPBOARD bool canPaste = false; bool didOpen; if (Editor::CanPaste()) { wxTheClipboard->UsePrimarySelection(false); didOpen = !wxTheClipboard->IsOpened(); if ( didOpen ) wxTheClipboard->Open(); if (wxTheClipboard->IsOpened()) { canPaste = wxTheClipboard->IsSupported(wxUSE_UNICODE ? wxDF_UNICODETEXT : wxDF_TEXT); if (didOpen) wxTheClipboard->Close(); } } return canPaste; #else return false; #endif // wxUSE_CLIPBOARD } void ScintillaWX::CreateCallTipWindow(PRectangle) { if (! ct.wCallTip.Created() ) { ct.wCallTip = new wxSTCCallTip(stc, &ct, this); ct.wDraw = ct.wCallTip; } } void ScintillaWX::AddToPopUp(const char *label, int cmd, bool enabled) { if (!label[0]) ((wxMenu*)popup.GetID())->AppendSeparator(); else ((wxMenu*)popup.GetID())->Append(cmd, wxGetTranslation(stc2wx(label))); if (!enabled) ((wxMenu*)popup.GetID())->Enable(cmd, enabled); } // This is called by the Editor base class whenever something is selected. // For wxGTK we can put this text in the primary selection and then other apps // can paste with the middle button. void ScintillaWX::ClaimSelection() { #ifdef __WXGTK__ // Put the selected text in the PRIMARY selection if (!sel.Empty()) { SelectionText st; CopySelectionRange(&st); wxTheClipboard->UsePrimarySelection(true); if (wxTheClipboard->Open()) { wxString text = stc2wx(st.s, st.len); wxTheClipboard->SetData(new wxTextDataObject(text)); wxTheClipboard->Close(); } wxTheClipboard->UsePrimarySelection(false); } #endif } void ScintillaWX::UpdateSystemCaret() { #ifdef __WXMSW__ if (hasFocus) { if (HasCaretSizeChanged()) { DestroySystemCaret(); CreateSystemCaret(); } Point pos = PointMainCaret(); ::SetCaretPos(pos.x, pos.y); } #endif } bool ScintillaWX::HasCaretSizeChanged() { #ifdef __WXMSW__ if ( (vs.caretWidth && (sysCaretWidth != vs.caretWidth)) || (vs.lineHeight && (sysCaretHeight != vs.lineHeight)) ) { return true; } #endif return false; } bool ScintillaWX::CreateSystemCaret() { #ifdef __WXMSW__ sysCaretWidth = vs.caretWidth; if (0 == sysCaretWidth) { sysCaretWidth = 1; } sysCaretHeight = vs.lineHeight; int bitmapSize = (((sysCaretWidth + 15) & ~15) >> 3) * sysCaretHeight; char *bits = new char[bitmapSize]; memset(bits, 0, bitmapSize); sysCaretBitmap = ::CreateBitmap(sysCaretWidth, sysCaretHeight, 1, 1, reinterpret_cast(bits)); delete [] bits; BOOL retval = ::CreateCaret(GetHwndOf(stc), sysCaretBitmap, sysCaretWidth, sysCaretHeight); ::ShowCaret(GetHwndOf(stc)); return retval != 0; #else return false; #endif } bool ScintillaWX::DestroySystemCaret() { #ifdef __WXMSW__ ::HideCaret(GetHwndOf(stc)); BOOL retval = ::DestroyCaret(); if (sysCaretBitmap) { ::DeleteObject(sysCaretBitmap); sysCaretBitmap = 0; } return retval != 0; #else return false; #endif } //---------------------------------------------------------------------- sptr_t ScintillaWX::DefWndProc(unsigned int /*iMessage*/, uptr_t /*wParam*/, sptr_t /*lParam*/) { return 0; } sptr_t ScintillaWX::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { switch (iMessage) { case SCI_CALLTIPSHOW: { // NOTE: This is copied here from scintilla/src/ScintillaBase.cxx // because of the little tweak that needs done below for wxGTK. // When updating new versions double check that this is still // needed, and that any new code there is copied here too. Point pt = LocationFromPosition(wParam); char* defn = reinterpret_cast(lParam); AutoCompleteCancel(); pt.y += vs.lineHeight; int ctStyle = ct.UseStyleCallTip() ? STYLE_CALLTIP : STYLE_DEFAULT; if (ct.UseStyleCallTip()) { ct.SetForeBack(vs.styles[STYLE_CALLTIP].fore, vs.styles[STYLE_CALLTIP].back); } int caretMain = sel.MainCaret(); PRectangle rc = ct.CallTipStart(caretMain, pt, vs.lineHeight, defn, vs.styles[ctStyle].fontName, vs.styles[ctStyle].sizeZoomed, CodePage(), vs.styles[ctStyle].characterSet, vs.technology, wMain); // If the call-tip window would be out of the client // space, adjust so it displays above the text. PRectangle rcClient = GetClientRectangle(); if (rc.bottom > rcClient.bottom) { #ifdef __WXGTK__ int offset = int(vs.lineHeight * 1.25) + rc.Height(); #else int offset = vs.lineHeight + rc.Height(); #endif rc.top -= offset; rc.bottom -= offset; } // Now display the window. CreateCallTipWindow(rc); ct.wCallTip.SetPositionRelative(rc, wMain); ct.wCallTip.Show(); break; } #ifdef SCI_LEXER case SCI_LOADLEXERLIBRARY: LexerManager::GetInstance()->Load((const char*)lParam); break; #endif default: return ScintillaBase::WndProc(iMessage, wParam, lParam); } return 0; } //---------------------------------------------------------------------- // Event delegates void ScintillaWX::DoPaint(wxDC* dc, wxRect rect) { paintState = painting; Surface* surfaceWindow = Surface::Allocate(vs.technology); surfaceWindow->Init(dc, wMain.GetID()); rcPaint = PRectangleFromwxRect(rect); PRectangle rcClient = GetClientRectangle(); paintingAllText = rcPaint.Contains(rcClient); ClipChildren(*dc, rcPaint); Paint(surfaceWindow, rcPaint); delete surfaceWindow; if (paintState == paintAbandoned) { // Painting area was insufficient to cover new styling or brace // highlight positions FullPaint(); } paintState = notPainting; } void ScintillaWX::DoHScroll(int type, int pos) { int xPos = xOffset; PRectangle rcText = GetTextRectangle(); int pageWidth = rcText.Width() * 2 / 3; if (type == wxEVT_SCROLLWIN_LINEUP || type == wxEVT_SCROLL_LINEUP) xPos -= H_SCROLL_STEP; else if (type == wxEVT_SCROLLWIN_LINEDOWN || type == wxEVT_SCROLL_LINEDOWN) xPos += H_SCROLL_STEP; else if (type == wxEVT_SCROLLWIN_PAGEUP || type == wxEVT_SCROLL_PAGEUP) xPos -= pageWidth; else if (type == wxEVT_SCROLLWIN_PAGEDOWN || type == wxEVT_SCROLL_PAGEDOWN) { xPos += pageWidth; if (xPos > scrollWidth - rcText.Width()) { xPos = scrollWidth - rcText.Width(); } } else if (type == wxEVT_SCROLLWIN_TOP || type == wxEVT_SCROLL_TOP) xPos = 0; else if (type == wxEVT_SCROLLWIN_BOTTOM || type == wxEVT_SCROLL_BOTTOM) xPos = scrollWidth; else if (type == wxEVT_SCROLLWIN_THUMBTRACK || type == wxEVT_SCROLL_THUMBTRACK) xPos = pos; HorizontalScrollTo(xPos); } void ScintillaWX::DoVScroll(int type, int pos) { int topLineNew = topLine; if (type == wxEVT_SCROLLWIN_LINEUP || type == wxEVT_SCROLL_LINEUP) topLineNew -= 1; else if (type == wxEVT_SCROLLWIN_LINEDOWN || type == wxEVT_SCROLL_LINEDOWN) topLineNew += 1; else if (type == wxEVT_SCROLLWIN_PAGEUP || type == wxEVT_SCROLL_PAGEUP) topLineNew -= LinesToScroll(); else if (type == wxEVT_SCROLLWIN_PAGEDOWN || type == wxEVT_SCROLL_PAGEDOWN) topLineNew += LinesToScroll(); else if (type == wxEVT_SCROLLWIN_TOP || type == wxEVT_SCROLL_TOP) topLineNew = 0; else if (type == wxEVT_SCROLLWIN_BOTTOM || type == wxEVT_SCROLL_BOTTOM) topLineNew = MaxScrollPos(); else if (type == wxEVT_SCROLLWIN_THUMBTRACK || type == wxEVT_SCROLL_THUMBTRACK) topLineNew = pos; ScrollTo(topLineNew); } void ScintillaWX::DoMouseWheel(int rotation, int delta, int linesPerAction, int ctrlDown, bool isPageScroll ) { int topLineNew = topLine; int lines; if (ctrlDown) { // Zoom the fonts if Ctrl key down if (rotation < 0) { KeyCommand(SCI_ZOOMIN); } else { KeyCommand(SCI_ZOOMOUT); } } else { // otherwise just scroll the window if ( !delta ) delta = 120; wheelRotation += rotation; lines = wheelRotation / delta; wheelRotation -= lines * delta; if (lines != 0) { if (isPageScroll) lines = lines * LinesOnScreen(); // lines is either +1 or -1 else lines *= linesPerAction; topLineNew -= lines; ScrollTo(topLineNew); } } } void ScintillaWX::DoSize(int WXUNUSED(width), int WXUNUSED(height)) { ChangeSize(); } void ScintillaWX::DoLoseFocus(){ focusEvent = true; SetFocusState(false); focusEvent = false; DestroySystemCaret(); } void ScintillaWX::DoGainFocus(){ focusEvent = true; SetFocusState(true); focusEvent = false; DestroySystemCaret(); CreateSystemCaret(); } void ScintillaWX::DoSysColourChange() { InvalidateStyleData(); } void ScintillaWX::DoLeftButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt) { ButtonDown(pt, curTime, shift, ctrl, alt); } void ScintillaWX::DoLeftButtonUp(Point pt, unsigned int curTime, bool ctrl) { ButtonUp(pt, curTime, ctrl); } void ScintillaWX::DoLeftButtonMove(Point pt) { ButtonMove(pt); } #ifdef __WXGTK__ void ScintillaWX::DoMiddleButtonUp(Point pt) { // Set the current position to the mouse click point and // then paste in the PRIMARY selection, if any. wxGTK only. int newPos = PositionFromLocation(pt); MovePositionTo(newPos, Selection::noSel, true); pdoc->BeginUndoAction(); wxTextDataObject data; bool gotData = false; wxTheClipboard->UsePrimarySelection(true); if (wxTheClipboard->Open()) { gotData = wxTheClipboard->GetData(data); wxTheClipboard->Close(); } wxTheClipboard->UsePrimarySelection(false); if (gotData) { wxString text = wxTextBuffer::Translate(data.GetText(), wxConvertEOLMode(pdoc->eolMode)); wxWX2MBbuf buf = (wxWX2MBbuf)wx2stc(text); int len = strlen(buf); int caretMain = sel.MainCaret(); pdoc->InsertString(caretMain, buf, len); SetEmptySelection(caretMain + len); } pdoc->EndUndoAction(); NotifyChange(); Redraw(); ShowCaretAtCurrentPosition(); EnsureCaretVisible(); } #else void ScintillaWX::DoMiddleButtonUp(Point WXUNUSED(pt)) { } #endif void ScintillaWX::DoAddChar(int key) { #if wxUSE_UNICODE wxChar wszChars[2]; wszChars[0] = (wxChar)key; wszChars[1] = 0; wxWX2MBbuf buf = (wxWX2MBbuf)wx2stc(wszChars); AddCharUTF((char*)buf.data(), strlen(buf)); #else AddChar((char)key); #endif } int ScintillaWX::DoKeyDown(const wxKeyEvent& evt, bool* consumed) { int key = evt.GetKeyCode(); bool shift = evt.ShiftDown(), ctrl = evt.ControlDown(), alt = evt.AltDown(); if (ctrl && key >= 1 && key <= 26 && key != WXK_BACK) key += 'A' - 1; switch (key) { case WXK_DOWN: key = SCK_DOWN; break; case WXK_UP: key = SCK_UP; break; case WXK_LEFT: key = SCK_LEFT; break; case WXK_RIGHT: key = SCK_RIGHT; break; case WXK_HOME: key = SCK_HOME; break; case WXK_END: key = SCK_END; break; case WXK_PAGEUP: key = SCK_PRIOR; break; case WXK_PAGEDOWN: key = SCK_NEXT; break; case WXK_NUMPAD_DOWN: key = SCK_DOWN; break; case WXK_NUMPAD_UP: key = SCK_UP; break; case WXK_NUMPAD_LEFT: key = SCK_LEFT; break; case WXK_NUMPAD_RIGHT: key = SCK_RIGHT; break; case WXK_NUMPAD_HOME: key = SCK_HOME; break; case WXK_NUMPAD_END: key = SCK_END; break; case WXK_NUMPAD_PAGEUP: key = SCK_PRIOR; break; case WXK_NUMPAD_PAGEDOWN: key = SCK_NEXT; break; case WXK_NUMPAD_DELETE: key = SCK_DELETE; break; case WXK_NUMPAD_INSERT: key = SCK_INSERT; break; case WXK_DELETE: key = SCK_DELETE; break; case WXK_INSERT: key = SCK_INSERT; break; case WXK_ESCAPE: key = SCK_ESCAPE; break; case WXK_BACK: key = SCK_BACK; break; case WXK_TAB: key = SCK_TAB; break; case WXK_NUMPAD_ENTER: // fall through case WXK_RETURN: key = SCK_RETURN; break; case WXK_ADD: // fall through case WXK_NUMPAD_ADD: key = SCK_ADD; break; case WXK_SUBTRACT: // fall through case WXK_NUMPAD_SUBTRACT: key = SCK_SUBTRACT; break; case WXK_DIVIDE: // fall through case WXK_NUMPAD_DIVIDE: key = SCK_DIVIDE; break; case WXK_CONTROL: key = 0; break; case WXK_ALT: key = 0; break; case WXK_SHIFT: key = 0; break; case WXK_MENU: key = 0; break; } #ifdef __WXMAC__ if ( evt.MetaDown() ) { // check for a few common Mac Meta-key combos and remap them to Ctrl // for Scintilla switch ( key ) { case 'Z': // Undo case 'X': // Cut case 'C': // Copy case 'V': // Paste case 'A': // Select All ctrl = true; break; } } #endif int rv = KeyDown(key, shift, ctrl, alt, consumed); if (key) return rv; else return 1; } void ScintillaWX::DoCommand(int ID) { Command(ID); } void ScintillaWX::DoContextMenu(Point pt) { if (displayPopupMenu) ContextMenu(pt); } void ScintillaWX::DoOnListBox() { AutoCompleteCompleted(); } void ScintillaWX::DoOnIdle(wxIdleEvent& evt) { if ( Idle() ) evt.RequestMore(); else SetIdle(false); } //---------------------------------------------------------------------- #if wxUSE_DRAG_AND_DROP bool ScintillaWX::DoDropText(long x, long y, const wxString& data) { SetDragPosition(SelectionPosition(invalidPosition)); wxString text = wxTextBuffer::Translate(data, wxConvertEOLMode(pdoc->eolMode)); // Send an event to allow the drag details to be changed wxScintillaTextEvent evt(wxEVT_STC_DO_DROP, stc->GetId()); evt.SetEventObject(stc); evt.SetDragResult(dragResult); evt.SetX(x); evt.SetY(y); evt.SetPosition(PositionFromLocation(Point(x,y))); evt.SetDragText(text); stc->GetEventHandler()->ProcessEvent(evt); dragResult = evt.GetDragResult(); if (dragResult == wxDragMove || dragResult == wxDragCopy) { DropAt(SelectionPosition(evt.GetPosition()), wx2stc(evt.GetDragText()), dragResult == wxDragMove, false); // TODO: rectangular? return true; } return false; } wxDragResult ScintillaWX::DoDragEnter(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), wxDragResult def) { dragResult = def; return dragResult; } wxDragResult ScintillaWX::DoDragOver(wxCoord x, wxCoord y, wxDragResult def) { SetDragPosition(SelectionPosition(PositionFromLocation(Point(x, y)))); // Send an event to allow the drag result to be changed wxScintillaTextEvent evt(wxEVT_STC_DRAG_OVER, stc->GetId()); evt.SetEventObject(stc); evt.SetDragResult(def); evt.SetX(x); evt.SetY(y); evt.SetPosition(PositionFromLocation(Point(x,y))); stc->GetEventHandler()->ProcessEvent(evt); dragResult = evt.GetDragResult(); return dragResult; } void ScintillaWX::DoDragLeave() { SetDragPosition(SelectionPosition(invalidPosition)); } #endif // wxUSE_DRAG_AND_DROP //---------------------------------------------------------------------- // Force the whole window to be repainted void ScintillaWX::FullPaint() { #ifndef __WXMAC__ stc->Refresh(false); #endif stc->Update(); } void ScintillaWX::DoScrollToLine(int line) { ScrollTo(line); } void ScintillaWX::DoScrollToColumn(int column) { HorizontalScrollTo(column * vs.spaceWidth); } // wxGTK doesn't appear to need this explicit clipping code any longer, but I // will leave it here commented out for a while just in case... void ScintillaWX::ClipChildren(wxDC& WXUNUSED(dc), PRectangle WXUNUSED(rect)) { // wxRegion rgn(wxRectFromPRectangle(rect)); // if (ac.Active()) { // wxRect childRect = ((wxWindow*)ac.lb->GetID())->GetRect(); // rgn.Subtract(childRect); // } // if (ct.inCallTipMode) { // wxSTCCallTip* tip = (wxSTCCallTip*)ct.wCallTip.GetID(); // wxRect childRect = tip->GetRect(); // #if wxUSE_POPUPWIN // childRect.SetPosition(tip->GetMyPosition()); // #endif // rgn.Subtract(childRect); // } // dc.SetClippingRegion(rgn); } void ScintillaWX::SetUseAntiAliasing(bool useAA) { vs.extraFontFlag = useAA; InvalidateStyleRedraw(); } bool ScintillaWX::GetUseAntiAliasing() { return vs.extraFontFlag != 0; } //---------------------------------------------------------------------- //---------------------------------------------------------------------- Wx-Scintilla-0.38/wx-scintilla/src/PlatWX.cpp000444001750001750 12136211727344243 21554 0ustar00azawawiazawawi000000000000// Scintilla source code edit control // PlatWX.cxx - implementation of platform facilities on wxWidgets // Copyright 1998-1999 by Neil Hodgson // Robin Dunn // The License.txt file describes the conditions under which this software may be distributed. // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" #ifdef __BORLANDC__ #pragma hdrstop #endif #ifndef WX_PRECOMP #include "wx/menu.h" #include "wx/dcmemory.h" #include "wx/settings.h" #endif // WX_PRECOMP #include #include #if wxUSE_DISPLAY #include "wx/display.h" #endif #include "wx/encconv.h" #include "wx/listctrl.h" #include "wx/mstream.h" #include "wx/image.h" #include "wx/imaglist.h" #include "wx/tokenzr.h" #ifdef wxHAVE_RAW_BITMAP #include "wx/rawbmp.h" #endif #if wxUSE_GRAPHICS_CONTEXT #include "wx/dcgraph.h" #endif #include "Platform.h" #include "PlatWX.h" #include "WxScintilla.h" #include "private.h" Point Point::FromLong(long lpoint) { return Point(lpoint & 0xFFFF, lpoint >> 16); } wxRect wxRectFromPRectangle(PRectangle prc) { wxRect r(prc.left, prc.top, prc.Width(), prc.Height()); return r; } PRectangle PRectangleFromwxRect(wxRect rc) { return PRectangle(rc.GetLeft(), rc.GetTop(), rc.GetRight()+1, rc.GetBottom()+1); } wxColour wxColourFromCA(const ColourDesired& ca) { ColourDesired cd(ca.AsLong()); return wxColour((unsigned char)cd.GetRed(), (unsigned char)cd.GetGreen(), (unsigned char)cd.GetBlue()); } wxColour wxColourFromCAandAlpha(const ColourDesired& ca, int alpha) { ColourDesired cd(ca.AsLong()); return wxColour((unsigned char)cd.GetRed(), (unsigned char)cd.GetGreen(), (unsigned char)cd.GetBlue(), (unsigned char)alpha); } //---------------------------------------------------------------------- Font::Font() { fid = 0; ascent = 0; } Font::~Font() { } void Font::Create(const FontParameters &fp) { Release(); // The minus one is done because since Scintilla uses SC_SHARSET_DEFAULT // internally and we need to have wxFONENCODING_DEFAULT == SC_SHARSET_DEFAULT // so we adjust the encoding before passing it to Scintilla. See also // wxStyledTextCtrl::StyleSetCharacterSet wxFontEncoding encoding = (wxFontEncoding)(fp.characterSet-1); wxFontEncodingArray ea = wxEncodingConverter::GetPlatformEquivalents(encoding); if (ea.GetCount()) encoding = ea[0]; wxFont* font = new wxFont(fp.size, wxDEFAULT, fp.italic ? wxITALIC : wxNORMAL, (fp.weight == wxSTC_WEIGHT_BOLD) ? wxBOLD : wxNORMAL, false, stc2wx(fp.faceName), encoding); fid = font; } void Font::Release() { if (fid) delete (wxFont*)fid; fid = 0; } //---------------------------------------------------------------------- class SurfaceImpl : public Surface { private: wxDC* hdc; bool hdcOwned; wxBitmap* bitmap; int x; int y; bool unicodeMode; public: SurfaceImpl(); ~SurfaceImpl(); virtual void Init(WindowID wid); virtual void Init(SurfaceID sid, WindowID wid); virtual void InitPixMap(int width, int height, Surface *surface_, WindowID wid); virtual void Release(); virtual bool Initialised(); virtual void PenColour(ColourDesired fore); virtual int LogPixelsY(); virtual int DeviceHeightFont(int points); virtual void MoveTo(int x_, int y_); virtual void LineTo(int x_, int y_); virtual void Polygon(Point *pts, int npts, ColourDesired fore, ColourDesired back); virtual void RectangleDraw(PRectangle rc, ColourDesired fore, ColourDesired back); virtual void FillRectangle(PRectangle rc, ColourDesired back); virtual void FillRectangle(PRectangle rc, Surface &surfacePattern); virtual void RoundedRectangle(PRectangle rc, ColourDesired fore, ColourDesired back); virtual void AlphaRectangle(PRectangle rc, int cornerSize, ColourDesired fill, int alphaFill, ColourDesired outline, int alphaOutline, int flags); virtual void DrawRGBAImage(PRectangle rc, int width, int height, const unsigned char *pixelsImage); virtual void Ellipse(PRectangle rc, ColourDesired fore, ColourDesired back); virtual void Copy(PRectangle rc, Point from, Surface &surfaceSource); virtual void DrawTextNoClip(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore, ColourDesired back); virtual void DrawTextClipped(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore, ColourDesired back); virtual void DrawTextTransparent(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore); virtual void MeasureWidths(Font &font_, const char *s, int len, XYPOSITION *positions); virtual XYPOSITION WidthText(Font &font_, const char *s, int len); virtual XYPOSITION WidthChar(Font &font_, char ch); virtual XYPOSITION Ascent(Font &font_); virtual XYPOSITION Descent(Font &font_); virtual XYPOSITION InternalLeading(Font &font_); virtual XYPOSITION ExternalLeading(Font &font_); virtual XYPOSITION Height(Font &font_); virtual XYPOSITION AverageCharWidth(Font &font_); virtual void SetClip(PRectangle rc); virtual void FlushCachedState(); virtual void SetUnicodeMode(bool unicodeMode_); virtual void SetDBCSMode(int codePage); void BrushColour(ColourDesired back); void SetFont(Font &font_); }; SurfaceImpl::SurfaceImpl() : hdc(0), hdcOwned(0), bitmap(0), x(0), y(0), unicodeMode(0) {} SurfaceImpl::~SurfaceImpl() { Release(); } void SurfaceImpl::Init(WindowID wid) { #if 0 Release(); hdc = new wxMemoryDC(); hdcOwned = true; #else // On Mac and GTK the DC is not really valid until it has a bitmap // selected into it. So instead of just creating the DC with no bitmap, // go ahead and give it one. InitPixMap(1,1,NULL,wid); #endif } void SurfaceImpl::Init(SurfaceID hdc_, WindowID) { Release(); hdc = (wxDC*)hdc_; } void SurfaceImpl::InitPixMap(int width, int height, Surface *WXUNUSED(surface_), WindowID) { Release(); hdc = new wxMemoryDC(); hdcOwned = true; if (width < 1) width = 1; if (height < 1) height = 1; bitmap = new wxBitmap(width, height); ((wxMemoryDC*)hdc)->SelectObject(*bitmap); } void SurfaceImpl::Release() { if (bitmap) { ((wxMemoryDC*)hdc)->SelectObject(wxNullBitmap); delete bitmap; bitmap = 0; } if (hdcOwned) { delete hdc; hdc = 0; hdcOwned = false; } } bool SurfaceImpl::Initialised() { return hdc != 0; } void SurfaceImpl::PenColour(ColourDesired fore) { hdc->SetPen(wxPen(wxColourFromCA(fore))); } void SurfaceImpl::BrushColour(ColourDesired back) { hdc->SetBrush(wxBrush(wxColourFromCA(back))); } void SurfaceImpl::SetFont(Font &font_) { if (font_.GetID()) { hdc->SetFont(*((wxFont*)font_.GetID())); } } int SurfaceImpl::LogPixelsY() { return hdc->GetPPI().y; } int SurfaceImpl::DeviceHeightFont(int points) { return points; } void SurfaceImpl::MoveTo(int x_, int y_) { x = x_; y = y_; } void SurfaceImpl::LineTo(int x_, int y_) { hdc->DrawLine(x,y, x_,y_); x = x_; y = y_; } void SurfaceImpl::Polygon(Point *pts, int npts, ColourDesired fore, ColourDesired back) { PenColour(fore); BrushColour(back); std::vector points; for (int i=0; i< npts; i++) { points.push_back(wxPoint(pts[i].x, pts[i].y)); } hdc->DrawPolygon(npts, &points[0]); } void SurfaceImpl::RectangleDraw(PRectangle rc, ColourDesired fore, ColourDesired back) { PenColour(fore); BrushColour(back); hdc->DrawRectangle(wxRectFromPRectangle(rc)); } void SurfaceImpl::FillRectangle(PRectangle rc, ColourDesired back) { const wxPen oldPen = hdc->GetPen(); BrushColour(back); hdc->SetPen(*wxTRANSPARENT_PEN); hdc->DrawRectangle(wxRectFromPRectangle(rc)); hdc->SetPen( oldPen ); } void SurfaceImpl::FillRectangle(PRectangle rc, Surface &surfacePattern) { wxBrush br; if (((SurfaceImpl&)surfacePattern).bitmap) br = wxBrush(*((SurfaceImpl&)surfacePattern).bitmap); else // Something is wrong so display in red br = wxBrush(*wxRED); hdc->SetPen(*wxTRANSPARENT_PEN); hdc->SetBrush(br); hdc->DrawRectangle(wxRectFromPRectangle(rc)); } void SurfaceImpl::RoundedRectangle(PRectangle rc, ColourDesired fore, ColourDesired back) { PenColour(fore); BrushColour(back); hdc->DrawRoundedRectangle(wxRectFromPRectangle(rc), 4); } #ifdef __WXMSW__ #define wxPy_premultiply(p, a) ((p) * (a) / 0xff) #else #define wxPy_premultiply(p, a) (p) #endif void SurfaceImpl::AlphaRectangle(PRectangle rc, int cornerSize, ColourDesired fill, int alphaFill, ColourDesired outline, int alphaOutline, int /*flags*/) { #if wxUSE_GRAPHICS_CONTEXT wxGCDC dc(*(wxMemoryDC*)hdc); wxColour penColour(wxColourFromCAandAlpha(outline, alphaOutline)); wxColour brushColour(wxColourFromCAandAlpha(fill, alphaFill)); dc.SetPen(wxPen(penColour)); dc.SetBrush(wxBrush(brushColour)); dc.DrawRoundedRectangle(wxRectFromPRectangle(rc), cornerSize); return; #else #ifdef wxHAVE_RAW_BITMAP // TODO: do something with cornerSize wxUnusedVar(cornerSize); int x, y; wxRect r = wxRectFromPRectangle(rc); wxBitmap bmp(r.width, r.height, 32); wxAlphaPixelData pixData(bmp); pixData.UseAlpha(); // Set the fill pixels ColourDesired cdf(fill.AsLong()); int red = cdf.GetRed(); int green = cdf.GetGreen(); int blue = cdf.GetBlue(); wxAlphaPixelData::Iterator p(pixData); for (y=0; yDrawBitmap(bmp, r.x, r.y, true); #else wxUnusedVar(cornerSize); wxUnusedVar(alphaFill); wxUnusedVar(alphaOutline); RectangleDraw(rc, outline, fill); #endif #endif } //TODO implement SurfaceImpl::DrawRGBAImage void SurfaceImpl::DrawRGBAImage(PRectangle rc, int width, int height, const unsigned char *pixelsImage) { printf("RegisterRGBAImage is not implemented! Please contact the author\n"); } void SurfaceImpl::Ellipse(PRectangle rc, ColourDesired fore, ColourDesired back) { PenColour(fore); BrushColour(back); hdc->DrawEllipse(wxRectFromPRectangle(rc)); } void SurfaceImpl::Copy(PRectangle rc, Point from, Surface &surfaceSource) { wxRect r = wxRectFromPRectangle(rc); hdc->Blit(r.x, r.y, r.width, r.height, ((SurfaceImpl&)surfaceSource).hdc, from.x, from.y, wxCOPY); } void SurfaceImpl::DrawTextNoClip(PRectangle rc, Font &font, XYPOSITION ybase, const char *s, int len, ColourDesired fore, ColourDesired back) { SetFont(font); hdc->SetTextForeground(wxColourFromCA(fore)); hdc->SetTextBackground(wxColourFromCA(back)); FillRectangle(rc, back); // ybase is where the baseline should be, but wxWin uses the upper left // corner, so I need to calculate the real position for the text... hdc->DrawText(stc2wx(s, len), rc.left, ybase - font.ascent); } void SurfaceImpl::DrawTextClipped(PRectangle rc, Font &font, XYPOSITION ybase, const char *s, int len, ColourDesired fore, ColourDesired back) { SetFont(font); hdc->SetTextForeground(wxColourFromCA(fore)); hdc->SetTextBackground(wxColourFromCA(back)); FillRectangle(rc, back); hdc->SetClippingRegion(wxRectFromPRectangle(rc)); // see comments above hdc->DrawText(stc2wx(s, len), rc.left, ybase - font.ascent); hdc->DestroyClippingRegion(); } void SurfaceImpl::DrawTextTransparent(PRectangle rc, Font &font, XYPOSITION ybase, const char *s, int len, ColourDesired fore) { SetFont(font); hdc->SetTextForeground(wxColourFromCA(fore)); hdc->SetBackgroundMode(wxTRANSPARENT); // ybase is where the baseline should be, but wxWin uses the upper left // corner, so I need to calculate the real position for the text... hdc->DrawText(stc2wx(s, len), rc.left, ybase - font.ascent); hdc->SetBackgroundMode(wxSOLID); } void SurfaceImpl::MeasureWidths(Font &font, const char *s, int len, XYPOSITION *positions) { wxString str = stc2wx(s, len); wxArrayInt tpos; SetFont(font); hdc->GetPartialTextExtents(str, tpos); #if wxUSE_UNICODE // Map the widths for UCS-2 characters back to the UTF-8 input string // NOTE: I don't think this is right for when sizeof(wxChar) > 2, ie wxGTK2 // so figure it out and fix it! size_t i = 0; size_t ui = 0; while ((int)i < len) { unsigned char uch = (unsigned char)s[i]; positions[i++] = tpos[ui]; if (uch >= 0x80) { if (uch < (0x80 + 0x40 + 0x20)) { positions[i++] = tpos[ui]; } else { positions[i++] = tpos[ui]; positions[i++] = tpos[ui]; } } ui++; } #else // If not unicode then just use the widths we have #if wxUSE_STL std::copy(tpos.begin(), tpos.end(), positions); #else memcpy(positions, tpos.begin(), len * sizeof(int)); #endif #endif } XYPOSITION SurfaceImpl::WidthText(Font &font, const char *s, int len) { SetFont(font); int w; int h; hdc->GetTextExtent(stc2wx(s, len), &w, &h); return w; } XYPOSITION SurfaceImpl::WidthChar(Font &font, char ch) { SetFont(font); int w; int h; char s[2] = { ch, 0 }; hdc->GetTextExtent(stc2wx(s, 1), &w, &h); return w; } #define EXTENT_TEST wxT(" `~!@#$%^&*()-_=+\\|[]{};:\"\'<,>.?/1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") XYPOSITION SurfaceImpl::Ascent(Font &font) { SetFont(font); int w, h, d, e; hdc->GetTextExtent(EXTENT_TEST, &w, &h, &d, &e); font.ascent = h - d; return font.ascent; } XYPOSITION SurfaceImpl::Descent(Font &font) { SetFont(font); int w, h, d, e; hdc->GetTextExtent(EXTENT_TEST, &w, &h, &d, &e); return d; } XYPOSITION SurfaceImpl::InternalLeading(Font &WXUNUSED(font)) { return 0; } XYPOSITION SurfaceImpl::ExternalLeading(Font &font) { SetFont(font); int w, h, d, e; hdc->GetTextExtent(EXTENT_TEST, &w, &h, &d, &e); return e; } XYPOSITION SurfaceImpl::Height(Font &font) { SetFont(font); return hdc->GetCharHeight() + 1; } XYPOSITION SurfaceImpl::AverageCharWidth(Font &font) { SetFont(font); return hdc->GetCharWidth(); } void SurfaceImpl::SetClip(PRectangle rc) { hdc->SetClippingRegion(wxRectFromPRectangle(rc)); } void SurfaceImpl::FlushCachedState() { } void SurfaceImpl::SetUnicodeMode(bool unicodeMode_) { unicodeMode=unicodeMode_; } void SurfaceImpl::SetDBCSMode(int WXUNUSED(codePage)) { // dbcsMode = codePage == SC_CP_DBCS; } Surface *Surface::Allocate(int technology) { return new SurfaceImpl; } //---------------------------------------------------------------------- inline wxWindow* GETWIN(WindowID id) { return (wxWindow*)id; } Window::~Window() { } void Window::Destroy() { if (wid) { Show(false); GETWIN(wid)->Destroy(); } wid = 0; } bool Window::HasFocus() { return wxWindow::FindFocus() == GETWIN(wid); } PRectangle Window::GetPosition() { if (! wid) return PRectangle(); wxRect rc(GETWIN(wid)->GetPosition(), GETWIN(wid)->GetSize()); return PRectangleFromwxRect(rc); } void Window::SetPosition(PRectangle rc) { wxRect r = wxRectFromPRectangle(rc); GETWIN(wid)->SetSize(r); } void Window::SetPositionRelative(PRectangle rc, Window) { SetPosition(rc); // ???? } PRectangle Window::GetClientPosition() { if (! wid) return PRectangle(); wxSize sz = GETWIN(wid)->GetClientSize(); return PRectangle(0, 0, sz.x, sz.y); } void Window::Show(bool show) { GETWIN(wid)->Show(show); } void Window::InvalidateAll() { GETWIN(wid)->Refresh(false); } void Window::InvalidateRectangle(PRectangle rc) { wxRect r = wxRectFromPRectangle(rc); GETWIN(wid)->Refresh(false, &r); } void Window::SetFont(Font &font) { GETWIN(wid)->SetFont(*((wxFont*)font.GetID())); } void Window::SetCursor(Cursor curs) { wxStockCursor cursorId; switch (curs) { case cursorText: cursorId = wxCURSOR_IBEAM; break; case cursorArrow: cursorId = wxCURSOR_ARROW; break; case cursorUp: cursorId = wxCURSOR_ARROW; // ** no up arrow... wxCURSOR_UPARROW; break; case cursorWait: cursorId = wxCURSOR_WAIT; break; case cursorHoriz: cursorId = wxCURSOR_SIZEWE; break; case cursorVert: cursorId = wxCURSOR_SIZENS; break; case cursorReverseArrow: cursorId = wxCURSOR_RIGHT_ARROW; break; case cursorHand: cursorId = wxCURSOR_HAND; break; default: cursorId = wxCURSOR_ARROW; break; } wxCursor wc = wxCursor(cursorId); if(curs != cursorLast) { GETWIN(wid)->SetCursor(wc); cursorLast = curs; } } void Window::SetTitle(const char *s) { GETWIN(wid)->SetLabel(stc2wx(s)); } // Returns rectangle of monitor pt is on PRectangle Window::GetMonitorRect(Point pt) { wxRect rect; if (! wid) return PRectangle(); #if wxUSE_DISPLAY // Get the display the point is found on int n = wxDisplay::GetFromPoint(wxPoint(pt.x, pt.y)); wxDisplay dpy(n == wxNOT_FOUND ? 0 : n); rect = dpy.GetGeometry(); #else wxUnusedVar(pt); #endif return PRectangleFromwxRect(rect); } //---------------------------------------------------------------------- // Helper classes for ListBox // This is a simple subclass of wxListView that just resets focus to the // parent when it gets it. class wxSTCListBox : public wxListView { public: wxSTCListBox(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style) : wxListView() { #ifdef __WXMSW__ Hide(); // don't flicker as we move it around... #endif Create(parent, id, pos, size, style); } void OnFocus(wxFocusEvent& event) { GetParent()->SetFocus(); event.Skip(); } void OnKillFocus(wxFocusEvent& WXUNUSED(event)) { // Do nothing. Prevents base class from resetting the colors... } #ifdef __WXMAC__ // For some reason I don't understand yet the focus doesn't really leave // the listbox like it should, so if we get any events feed them back to // the wxSTC void OnKeyDown(wxKeyEvent& event) { GetGrandParent()->GetEventHandler()->ProcessEvent(event); } void OnChar(wxKeyEvent& event) { GetGrandParent()->GetEventHandler()->ProcessEvent(event); } // And we need to force the focus back when being destroyed ~wxSTCListBox() { GetGrandParent()->SetFocus(); } #endif private: DECLARE_EVENT_TABLE() }; BEGIN_EVENT_TABLE(wxSTCListBox, wxListView) EVT_SET_FOCUS( wxSTCListBox::OnFocus) EVT_KILL_FOCUS(wxSTCListBox::OnKillFocus) #ifdef __WXMAC__ EVT_KEY_DOWN( wxSTCListBox::OnKeyDown) EVT_CHAR( wxSTCListBox::OnChar) #endif END_EVENT_TABLE() #if wxUSE_POPUPWIN //----------------------------------- #include "wx/popupwin.h" // A popup window to place the wxSTCListBox upon class wxSTCListBoxWin : public wxPopupWindow { private: wxListView* lv; CallBackAction doubleClickAction; void* doubleClickActionData; public: wxSTCListBoxWin(wxWindow* parent, wxWindowID id, Point WXUNUSED(location)) : wxPopupWindow(parent, wxBORDER_SIMPLE) { lv = new wxSTCListBox(parent, id, wxPoint(-50,-50), wxDefaultSize, wxLC_REPORT | wxLC_SINGLE_SEL | wxLC_NO_HEADER | wxBORDER_NONE); lv->SetCursor(wxCursor(wxCURSOR_ARROW)); lv->InsertColumn(0, wxEmptyString); lv->InsertColumn(1, wxEmptyString); // NOTE: We need to fool the wxListView into thinking that it has the // focus so it will use the normal selection colour and will look // "right" to the user. But since the wxPopupWindow or its children // can't receive focus then we have to pull a fast one and temporarily // parent the listctrl on the STC window and then call SetFocus and // then reparent it back to the popup. lv->SetFocus(); lv->Reparent(this); #ifdef __WXMSW__ lv->Show(); #endif } // Set position in client coords virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO) { if (x != wxDefaultCoord) { GetParent()->ClientToScreen(&x, NULL); } if (y != wxDefaultCoord) { GetParent()->ClientToScreen(NULL, &y); } wxPopupWindow::DoSetSize(x, y, width, height, sizeFlags); } // return position as if it were in client coords virtual void DoGetPosition( int *x, int *y ) const { int sx, sy; wxPopupWindow::DoGetPosition(&sx, &sy); GetParent()->ScreenToClient(&sx, &sy); if (x) *x = sx; if (y) *y = sy; } bool Destroy() { if ( !wxPendingDelete.Member(this) ) wxPendingDelete.Append(this); return true; } int IconWidth() { wxImageList* il = lv->GetImageList(wxIMAGE_LIST_SMALL); if (il != NULL) { int w, h; il->GetSize(0, w, h); return w; } return 0; } void SetDoubleClickAction(CallBackAction action, void *data) { doubleClickAction = action; doubleClickActionData = data; } void OnFocus(wxFocusEvent& event) { GetParent()->SetFocus(); event.Skip(); } void OnSize(wxSizeEvent& event) { // resize the child to fill the popup wxSize sz = GetClientSize(); lv->SetSize(0, 0, sz.x, sz.y); // reset the column widths lv->SetColumnWidth(0, IconWidth()+4); lv->SetColumnWidth(1, sz.x - 2 - lv->GetColumnWidth(0) - wxSystemSettings::GetMetric(wxSYS_VSCROLL_X)); event.Skip(); } void OnActivate(wxListEvent& WXUNUSED(event)) { doubleClickAction(doubleClickActionData); } wxListView* GetLB() { return lv; } private: DECLARE_EVENT_TABLE() }; BEGIN_EVENT_TABLE(wxSTCListBoxWin, wxPopupWindow) EVT_SET_FOCUS ( wxSTCListBoxWin::OnFocus) EVT_SIZE ( wxSTCListBoxWin::OnSize) EVT_LIST_ITEM_ACTIVATED(wxID_ANY, wxSTCListBoxWin::OnActivate) END_EVENT_TABLE() #else // !wxUSE_POPUPWIN ----------------------------------- #include "wx/frame.h" // A normal window to place the wxSTCListBox upon, but make it behave as much // like a wxPopupWindow as possible class wxSTCListBoxWin : public wxFrame { private: wxListView* lv; CallBackAction doubleClickAction; void* doubleClickActionData; public: wxSTCListBoxWin(wxWindow* parent, wxWindowID id, Point location) : wxFrame(parent, id, wxEmptyString, wxPoint(location.x, location.y), wxSize(0,0), wxFRAME_NO_TASKBAR | wxFRAME_FLOAT_ON_PARENT #ifdef __WXMAC__ | wxPOPUP_WINDOW | wxNO_BORDER #else | wxSIMPLE_BORDER #endif ) { lv = new wxSTCListBox(this, id, wxDefaultPosition, wxDefaultSize, wxLC_REPORT | wxLC_SINGLE_SEL | wxLC_NO_HEADER | wxNO_BORDER); lv->SetCursor(wxCursor(wxCURSOR_ARROW)); lv->InsertColumn(0, wxEmptyString); lv->InsertColumn(1, wxEmptyString); // Eventhough we immediately reset the focus to the parent, this helps // things to look right... lv->SetFocus(); Hide(); } // On OSX and (possibly others) there can still be pending // messages/events for the list control when Scintilla wants to // close it, so do a pending delete of it instead of destroying // immediately. bool Destroy() { #ifdef __WXMAC__ // The bottom edge of this window is not getting properly // refreshed upon deletion, so help it out... wxWindow* p = GetParent(); wxRect r(GetPosition(), GetSize()); r.SetHeight(r.GetHeight()+1); p->Refresh(false, &r); #endif if ( !wxPendingDelete.Member(this) ) wxPendingDelete.Append(this); return true; } int IconWidth() { wxImageList* il = lv->GetImageList(wxIMAGE_LIST_SMALL); if (il != NULL) { int w, h; il->GetSize(0, w, h); return w; } return 0; } void SetDoubleClickAction(CallBackAction action, void *data) { doubleClickAction = action; doubleClickActionData = data; } void OnFocus(wxFocusEvent& event) { ActivateParent(); GetParent()->SetFocus(); event.Skip(); } void OnSize(wxSizeEvent& event) { // resize the child wxSize sz = GetClientSize(); lv->SetSize(sz); // reset the column widths lv->SetColumnWidth(0, IconWidth()+4); lv->SetColumnWidth(1, sz.x - 2 - lv->GetColumnWidth(0) - wxSystemSettings::GetMetric(wxSYS_VSCROLL_X)); event.Skip(); } void ActivateParent() { // Although we're a frame, we always want the parent to be active, so // raise it whenever we get shown, focused, etc. wxTopLevelWindow *frame = wxDynamicCast( wxGetTopLevelParent(GetParent()), wxTopLevelWindow); if (frame) frame->Raise(); } virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO) { // convert coords to screen coords since we're a top-level window if (x != wxDefaultCoord) { GetParent()->ClientToScreen(&x, NULL); } if (y != wxDefaultCoord) { GetParent()->ClientToScreen(NULL, &y); } wxFrame::DoSetSize(x, y, width, height, sizeFlags); } virtual bool Show(bool show = true) { bool rv = wxFrame::Show(show); if (rv && show) ActivateParent(); #ifdef __WXMAC__ GetParent()->Refresh(false); #endif return rv; } void OnActivate(wxListEvent& WXUNUSED(event)) { doubleClickAction(doubleClickActionData); } wxListView* GetLB() { return lv; } private: DECLARE_EVENT_TABLE() }; BEGIN_EVENT_TABLE(wxSTCListBoxWin, wxWindow) EVT_SET_FOCUS ( wxSTCListBoxWin::OnFocus) EVT_SIZE ( wxSTCListBoxWin::OnSize) EVT_LIST_ITEM_ACTIVATED(wxID_ANY, wxSTCListBoxWin::OnActivate) END_EVENT_TABLE() #endif // wxUSE_POPUPWIN ----------------------------------- inline wxSTCListBoxWin* GETLBW(WindowID win) { return ((wxSTCListBoxWin*)win); } inline wxListView* GETLB(WindowID win) { return GETLBW(win)->GetLB(); } //---------------------------------------------------------------------- class ListBoxImpl : public ListBox { private: int lineHeight; bool unicodeMode; int desiredVisibleRows; int aveCharWidth; size_t maxStrWidth; Point location; // Caret location at which the list is opened wxImageList* imgList; wxArrayInt* imgTypeMap; public: ListBoxImpl(); ~ListBoxImpl(); virtual void SetFont(Font &font); virtual void Create(Window &parent, int ctrlID, Point location_, int lineHeight_, bool unicodeMode_, int technology_); virtual void SetAverageCharWidth(int width); virtual void SetVisibleRows(int rows); virtual int GetVisibleRows() const; virtual PRectangle GetDesiredRect(); virtual int CaretFromEdge(); virtual void Clear(); virtual void Append(char *s, int type = -1); void Append(const wxString& text, int type); virtual int Length(); virtual void Select(int n); virtual int GetSelection(); virtual int Find(const char *prefix); virtual void GetValue(int n, char *value, int len); virtual void RegisterImage(int type, const char *xpm_data); virtual void RegisterRGBAImage(int type, int width, int height, const unsigned char *pixelsImage); virtual void ClearRegisteredImages(); virtual void SetDoubleClickAction(CallBackAction, void *); virtual void SetList(const char* list, char separator, char typesep); }; ListBoxImpl::ListBoxImpl() : lineHeight(10), unicodeMode(false), desiredVisibleRows(5), aveCharWidth(8), maxStrWidth(0), imgList(NULL), imgTypeMap(NULL) { } ListBoxImpl::~ListBoxImpl() { wxDELETE(imgList); wxDELETE(imgTypeMap); } void ListBoxImpl::SetFont(Font &font) { GETLB(wid)->SetFont(*((wxFont*)font.GetID())); } void ListBoxImpl::Create(Window &parent, int ctrlID, Point location_, int lineHeight_, bool unicodeMode_, int technology_) { location = location_; lineHeight = lineHeight_; unicodeMode = unicodeMode_; maxStrWidth = 0; wid = new wxSTCListBoxWin(GETWIN(parent.GetID()), ctrlID, location); if (imgList != NULL) GETLB(wid)->SetImageList(imgList, wxIMAGE_LIST_SMALL); } void ListBoxImpl::SetAverageCharWidth(int width) { aveCharWidth = width; } void ListBoxImpl::SetVisibleRows(int rows) { desiredVisibleRows = rows; } int ListBoxImpl::GetVisibleRows() const { return desiredVisibleRows; } PRectangle ListBoxImpl::GetDesiredRect() { // wxListCtrl doesn't have a DoGetBestSize, so instead we kept track of // the max size in Append and calculate it here... int maxw = maxStrWidth * aveCharWidth; int maxh ; // give it a default if there are no lines, and/or add a bit more if (maxw == 0) maxw = 100; maxw += aveCharWidth * 3 + GETLBW(wid)->IconWidth() + wxSystemSettings::GetMetric(wxSYS_VSCROLL_X); if (maxw > 350) maxw = 350; // estimate a desired height int count = GETLB(wid)->GetItemCount(); if (count) { wxRect rect; GETLB(wid)->GetItemRect(0, rect); maxh = count * rect.GetHeight(); if (maxh > 140) // TODO: Use desiredVisibleRows?? maxh = 140; // Try to make the size an exact multiple of some number of lines int lines = maxh / rect.GetHeight(); maxh = (lines + 1) * rect.GetHeight() + 2; } else maxh = 100; PRectangle rc; rc.top = 0; rc.left = 0; rc.right = maxw; rc.bottom = maxh; return rc; } int ListBoxImpl::CaretFromEdge() { return 4 + GETLBW(wid)->IconWidth(); } void ListBoxImpl::Clear() { GETLB(wid)->DeleteAllItems(); } void ListBoxImpl::Append(char *s, int type) { Append(stc2wx(s), type); } void ListBoxImpl::Append(const wxString& text, int type) { long count = GETLB(wid)->GetItemCount(); long itemID = GETLB(wid)->InsertItem(count, wxEmptyString); long idx = -1; GETLB(wid)->SetItem(itemID, 1, text); maxStrWidth = wxMax(maxStrWidth, text.length()); if (type != -1) { wxCHECK_RET(imgTypeMap, wxT("Unexpected NULL imgTypeMap")); idx = imgTypeMap->Item(type); } GETLB(wid)->SetItemImage(itemID, idx, idx); } void ListBoxImpl::SetList(const char* list, char separator, char typesep) { GETLB(wid)->Freeze(); Clear(); wxStringTokenizer tkzr(stc2wx(list), (wxChar)separator); while ( tkzr.HasMoreTokens() ) { wxString token = tkzr.GetNextToken(); long type = -1; int pos = token.Find(typesep); if (pos != -1) { token.Mid(pos+1).ToLong(&type); token.Truncate(pos); } Append(token, (int)type); } GETLB(wid)->Thaw(); } int ListBoxImpl::Length() { return GETLB(wid)->GetItemCount(); } void ListBoxImpl::Select(int n) { bool select = true; if (n == -1) { n = 0; select = false; } GETLB(wid)->EnsureVisible(n); GETLB(wid)->Select(n, select); } int ListBoxImpl::GetSelection() { return GETLB(wid)->GetFirstSelected(); } int ListBoxImpl::Find(const char *WXUNUSED(prefix)) { // No longer used return wxNOT_FOUND; } void ListBoxImpl::GetValue(int n, char *value, int len) { wxListItem item; item.SetId(n); item.SetColumn(1); item.SetMask(wxLIST_MASK_TEXT); GETLB(wid)->GetItem(item); strncpy(value, wx2stc(item.GetText()), len); value[len-1] = '\0'; } void ListBoxImpl::RegisterImage(int type, const char *xpm_data) { wxMemoryInputStream stream(xpm_data, strlen(xpm_data)+1); wxImage img(stream, wxBITMAP_TYPE_XPM); wxBitmap bmp(img); if (! imgList) { // assumes all images are the same size imgList = new wxImageList(bmp.GetWidth(), bmp.GetHeight(), true); imgTypeMap = new wxArrayInt; } int idx = imgList->Add(bmp); // do we need to extend the mapping array? wxArrayInt& itm = *imgTypeMap; if ( itm.GetCount() < (size_t)type+1) itm.Add(-1, type - itm.GetCount() + 1); // Add an item that maps type to the image index itm[type] = idx; } //TODO implement ListBoxImpl::RegisterRGBAImage void ListBoxImpl::RegisterRGBAImage(int type, int width, int height, const unsigned char *pixelsImage) { printf("RegisterRGBAImage is not implemented! Please contact the author\n"); } void ListBoxImpl::ClearRegisteredImages() { wxDELETE(imgList); wxDELETE(imgTypeMap); if (wid) GETLB(wid)->SetImageList(NULL, wxIMAGE_LIST_SMALL); } void ListBoxImpl::SetDoubleClickAction(CallBackAction action, void *data) { GETLBW(wid)->SetDoubleClickAction(action, data); } ListBox::ListBox() { } ListBox::~ListBox() { } ListBox *ListBox::Allocate() { return new ListBoxImpl(); } //---------------------------------------------------------------------- Menu::Menu() : mid(0) { } void Menu::CreatePopUp() { Destroy(); mid = new wxMenu(); } void Menu::Destroy() { if (mid) delete (wxMenu*)mid; mid = 0; } void Menu::Show(Point pt, Window &w) { GETWIN(w.GetID())->PopupMenu((wxMenu*)mid, pt.x - 4, pt.y); Destroy(); } //---------------------------------------------------------------------- DynamicLibrary *DynamicLibrary::Load(const char *WXUNUSED(modulePath)) { wxFAIL_MSG(wxT("Dynamic lexer loading not implemented yet")); return NULL; } //---------------------------------------------------------------------- ColourDesired Platform::Chrome() { wxColour c; c = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE); return ColourDesired(c.Red(), c.Green(), c.Blue()); } ColourDesired Platform::ChromeHighlight() { wxColour c; c = wxSystemSettings::GetColour(wxSYS_COLOUR_3DHIGHLIGHT); return ColourDesired(c.Red(), c.Green(), c.Blue()); } const char *Platform::DefaultFont() { static char buf[128]; strcpy(buf, wxNORMAL_FONT->GetFaceName().mbc_str()); return buf; } int Platform::DefaultFontSize() { return wxNORMAL_FONT->GetPointSize(); } unsigned int Platform::DoubleClickTime() { return 500; // **** ::GetDoubleClickTime(); } bool Platform::MouseButtonBounce() { return false; } bool Platform::IsKeyDown(int WXUNUSED(key)) { return false; // I don't think we'll need this. } long Platform::SendScintilla(WindowID w, unsigned int msg, unsigned long wParam, long lParam) { wxScintillaTextCtrl* stc = (wxScintillaTextCtrl*)w; return stc->SendMsg(msg, wParam, lParam); } long Platform::SendScintillaPointer(WindowID w, unsigned int msg, unsigned long wParam, void *lParam) { wxScintillaTextCtrl* stc = (wxScintillaTextCtrl*)w; return stc->SendMsg(msg, wParam, (wxIntPtr)lParam); } // These are utility functions not really tied to a platform int Platform::Minimum(int a, int b) { if (a < b) return a; else return b; } int Platform::Maximum(int a, int b) { if (a > b) return a; else return b; } //#define TRACE void Platform::DebugDisplay(const char *s) { #ifdef TRACE wxLogDebug(stc2wx(s)); #else wxUnusedVar(s); #endif } void Platform::DebugPrintf(const char *format, ...) { #ifdef TRACE char buffer[2000]; va_list pArguments; va_start(pArguments, format); vsprintf(buffer,format,pArguments); va_end(pArguments); Platform::DebugDisplay(buffer); #else wxUnusedVar(format); #endif } static bool assertionPopUps = true; bool Platform::ShowAssertionPopUps(bool assertionPopUps_) { bool ret = assertionPopUps; assertionPopUps = assertionPopUps_; return ret; } void Platform::Assert(const char *c, const char *file, int line) { #ifdef TRACE char buffer[2000]; sprintf(buffer, "Assertion [%s] failed at %s %d", c, file, line); if (assertionPopUps) { /*int idButton = */ wxMessageBox(stc2wx(buffer), wxT("Assertion failure"), wxICON_HAND | wxOK); } else { strcat(buffer, "\r\n"); Platform::DebugDisplay(buffer); abort(); } #else wxUnusedVar(c); wxUnusedVar(file); wxUnusedVar(line); #endif } int Platform::Clamp(int val, int minVal, int maxVal) { if (val > maxVal) val = maxVal; if (val < minVal) val = minVal; return val; } bool Platform::IsDBCSLeadByte(int WXUNUSED(codePage), char WXUNUSED(ch)) { return false; } int Platform::DBCSCharLength(int WXUNUSED(codePage), const char *WXUNUSED(s)) { return 1; } int Platform::DBCSCharMaxLength() { return 1; } //---------------------------------------------------------------------- ElapsedTime::ElapsedTime() { wxLongLong localTime = wxGetLocalTimeMillis(); littleBit = localTime.GetLo(); bigBit = localTime.GetHi(); } double ElapsedTime::Duration(bool reset) { wxLongLong prevTime(bigBit, littleBit); wxLongLong localTime = wxGetLocalTimeMillis(); if(reset) { littleBit = localTime.GetLo(); bigBit = localTime.GetHi(); } wxLongLong duration = localTime - prevTime; double result = duration.ToDouble(); result /= 1000.0; return result; } //---------------------------------------------------------------------- #if wxUSE_UNICODE #include "UniConversion.h" // Convert using Scintilla's functions instead of wx's, Scintilla's are more // forgiving and won't assert... wxString stc2wx(const char* str, size_t len) { if (!len) return wxEmptyString; size_t wclen = UTF16Length(str, len); wxWCharBuffer buffer(wclen+1); size_t actualLen = UTF16FromUTF8(str, len, buffer.data(), wclen+1); return wxString(buffer.data(), actualLen); } wxString stc2wx(const char* str) { return stc2wx(str, strlen(str)); } const wxWX2MBbuf wx2stc(const wxString& str) { const wchar_t* wcstr = str.c_str(); size_t wclen = str.length(); size_t len = UTF8Length(wcstr, wclen); wxCharBuffer buffer(len+1); UTF8FromUTF16(wcstr, wclen, buffer.data(), len); // TODO check NULL termination!! return buffer; } #endif Wx-Scintilla-0.38/wx-scintilla/src/PlatWX.h000444001750001750 133411727344243 21155 0ustar00azawawiazawawi000000000000 /* Versions before 2.8.11 dont' have wxIntPtr defined */ #ifndef wxIntPtr #if SIZEOF_LONG >= SIZEOF_VOID_P && SIZEOF_LONG >= SIZEOF_SIZE_T /* normal case */ typedef unsigned long wxUIntPtr; typedef long wxIntPtr; #elif SIZEOF_SIZE_T >= SIZEOF_VOID_P /* Win64 case */ typedef size_t wxUIntPtr; #define wxIntPtr ssize_t #else /* This should never happen for the current architectures but if you're using one where it does, please contact wx-dev@lists.wxwidgets.org. */ #error "Pointers can't be stored inside integer types." #endif #endif wxRect wxRectFromPRectangle(PRectangle prc); PRectangle PRectangleFromwxRect(wxRect rc); wxColour wxColourFromCA(const ColourDesired& ca); Wx-Scintilla-0.38/wx-scintilla/src/scintilla_cw.h000444001750001750 11211727344243 22422 0ustar00azawawiazawawi000000000000#define __WX__ #define SCI_LEXER #define LINK_LEXERS #include "wx/wx_cw.h"Wx-Scintilla-0.38/wx-scintilla/src/ScintillaWX.h000444001750001750 1517611727344243 22230 0ustar00azawawiazawawi000000000000//////////////////////////////////////////////////////////////////////////// // Name: ScintillaWX.h // Purpose: A wxWidgets implementation of Scintilla. A class derived // from ScintillaBase that uses the "wx platform" defined in // PlatWX.cpp. This class is one end of a bridge between // the wx world and the Scintilla world. It needs a peer // object of type wxScintillaTextCtrl to function. // // Author: Robin Dunn // // Created: 13-Jan-2000 // RCS-ID: $Id$ // Copyright: (c) 2000 by Total Control Software // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef __ScintillaWX_h__ #define __ScintillaWX_h__ #include "wx/defs.h" //---------------------------------------------------------------------- #include #include #include #include #include #include #include #include "Platform.h" #include "SplitVector.h" #include "Partitioning.h" #include "RunStyles.h" #include "Scintilla.h" #include "ScintillaWidget.h" #ifdef SCI_LEXER #include "ILexer.h" #include "SciLexer.h" #include "LexAccessor.h" #include "Accessor.h" #include "WordList.h" #endif #include "ContractionState.h" #include "SVector.h" #include "CellBuffer.h" #include "CallTip.h" #include "KeyMap.h" #include "Indicator.h" #include "XPM.h" #include "LineMarker.h" #include "Style.h" #include "AutoComplete.h" #include "ViewStyle.h" #include "CharClassify.h" #include "Decoration.h" #include "Document.h" #include "Selection.h" #include "PositionCache.h" #include "Editor.h" #include "ScintillaBase.h" #ifdef __WXMSW__ #include "wx/msw/wrapwin.h" // HBITMAP #endif #if wxUSE_DRAG_AND_DROP #include "wx/timer.h" #endif //---------------------------------------------------------------------- /* Versions before 2.8.11 dont' have wxIntPtr defined */ #ifndef wxIntPtr #if SIZEOF_LONG >= SIZEOF_VOID_P && SIZEOF_LONG >= SIZEOF_SIZE_T /* normal case */ typedef unsigned long wxUIntPtr; typedef long wxIntPtr; #elif SIZEOF_SIZE_T >= SIZEOF_VOID_P /* Win64 case */ typedef size_t wxUIntPtr; #define wxIntPtr ssize_t #else /* This should never happen for the current architectures but if you're using one where it does, please contact wx-dev@lists.wxwidgets.org. */ #error "Pointers can't be stored inside integer types." #endif #endif //---------------------------------------------------------------------- #ifdef WXMAKINGDLL_STC #define WXDLLIMPEXP_STC WXEXPORT #elif defined(WXUSINGDLL) #define WXDLLIMPEXP_STC WXIMPORT #else // not making nor using DLL #define WXDLLIMPEXP_STC #endif class WXDLLIMPEXP_FWD_CORE wxDC; class WXDLLIMPEXP_FWD_STC wxScintillaTextCtrl; // forward class ScintillaWX; //---------------------------------------------------------------------- // Helper classes #if wxUSE_DRAG_AND_DROP class wxSTCDropTarget : public wxTextDropTarget { public: void SetScintilla(ScintillaWX* swx) { m_swx = swx; } bool OnDropText(wxCoord x, wxCoord y, const wxString& data); wxDragResult OnEnter(wxCoord x, wxCoord y, wxDragResult def); wxDragResult OnDragOver(wxCoord x, wxCoord y, wxDragResult def); void OnLeave(); private: ScintillaWX* m_swx; }; #endif //---------------------------------------------------------------------- class ScintillaWX : public ScintillaBase { public: ScintillaWX(wxScintillaTextCtrl* win); ~ScintillaWX(); // base class virtuals virtual void Initialise(); virtual void Finalise(); virtual void StartDrag(); virtual bool SetIdle(bool on); virtual void SetTicking(bool on); virtual void SetMouseCapture(bool on); virtual bool HaveMouseCapture(); virtual void ScrollText(int linesToMove); virtual void SetVerticalScrollPos(); virtual void SetHorizontalScrollPos(); virtual bool ModifyScrollBars(int nMax, int nPage); virtual void Copy(); virtual void Paste(); virtual void CopyToClipboard(const SelectionText &selectedText); virtual void CreateCallTipWindow(PRectangle rc); virtual void AddToPopUp(const char *label, int cmd = 0, bool enabled = true); virtual void ClaimSelection(); virtual sptr_t DefWndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam); virtual sptr_t WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam); virtual void NotifyChange(); virtual void NotifyParent(SCNotification scn); virtual void CancelModes(); virtual void UpdateSystemCaret(); // Event delegates void DoPaint(wxDC* dc, wxRect rect); void DoHScroll(int type, int pos); void DoVScroll(int type, int pos); void DoSize(int width, int height); void DoLoseFocus(); void DoGainFocus(); void DoSysColourChange(); void DoLeftButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt); void DoLeftButtonUp(Point pt, unsigned int curTime, bool ctrl); void DoLeftButtonMove(Point pt); void DoMiddleButtonUp(Point pt); void DoMouseWheel(int rotation, int delta, int linesPerAction, int ctrlDown, bool isPageScroll); void DoAddChar(int key); int DoKeyDown(const wxKeyEvent& event, bool* consumed); void DoTick() { Tick(); } void DoOnIdle(wxIdleEvent& evt); #if wxUSE_DRAG_AND_DROP bool DoDropText(long x, long y, const wxString& data); wxDragResult DoDragEnter(wxCoord x, wxCoord y, wxDragResult def); wxDragResult DoDragOver(wxCoord x, wxCoord y, wxDragResult def); void DoDragLeave(); #endif void DoCommand(int ID); void DoContextMenu(Point pt); void DoOnListBox(); // helpers void FullPaint(); bool CanPaste(); bool GetHideSelection() { return hideSelection; } void DoScrollToLine(int line); void DoScrollToColumn(int column); void ClipChildren(wxDC& dc, PRectangle rect); void SetUseAntiAliasing(bool useAA); bool GetUseAntiAliasing(); private: bool capturedMouse; bool focusEvent; wxScintillaTextCtrl* stc; #if wxUSE_DRAG_AND_DROP wxSTCDropTarget* dropTarget; wxDragResult dragResult; #endif int wheelRotation; // For use in creating a system caret bool HasCaretSizeChanged(); bool CreateSystemCaret(); bool DestroySystemCaret(); #ifdef __WXMSW__ HBITMAP sysCaretBitmap; int sysCaretWidth; int sysCaretHeight; #endif friend class wxSTCCallTip; }; //---------------------------------------------------------------------- #endif Wx-Scintilla-0.38/wx-scintilla/src/scintilla_i18n.cpp000444001750001750 145011727344243 23151 0ustar00azawawiazawawi000000000000/////////////////////////////////////////////////////////////////////////////// // Name: src/stc/stc_i18n.cpp // Purpose: Dummy file containing translatable strings from Scintilla // Author: Vadim Zeitlin // Created: 2010-06-09 // RCS-ID: $Id: $ // Copyright: (c) 2010 Vadim Zeitlin // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// // This is just a collection of translatable strings defined in Scintilla // sources. It is used by locale/Makefile only and not supposed to be compiled. #error "This file is not supposed to be compiled." // These strings were manually extracted from ScintillaBase::ContextMenu(). _("Undo") _("Redo") _("Cut") _("Copy") _("Paste") _("Delete") _("Select All") Wx-Scintilla-0.38/wx-scintilla/src/scintilla.cpp000444001750001750 36347111727344243 22370 0ustar00azawawiazawawi000000000000//////////////////////////////////////////////////////////////////////////// // Name: stc.cpp // Purpose: A wxWidgets implementation of Scintilla. This class is the // one meant to be used directly by wx applications. It does not // derive directly from the Scintilla classes, but instead // delegates most things to the real Scintilla class. // This allows the use of Scintilla without polluting the // namespace with all the classes and identifiers from Scintilla. // // Author: Robin Dunn // // Created: 13-Jan-2000 // RCS-ID: $Id$ // Copyright: (c) 2000 by Total Control Software // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /* IMPORTANT: src/stc/stc.cpp is generated by src/stc/gen_iface.py from src/stc/stc.cpp.in, don't edit stc.cpp file as your changes will be lost after the next regeneration, edit stc.cpp.in and rerun the gen_iface.py script instead! Parts of this file generated by the script are found in between the special "{{{" and "}}}" markers, the rest of it is copied verbatim from src.h.in. */ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" #ifdef __BORLANDC__ #pragma hdrstop #endif #include "WxScintilla.h" #include "private.h" #ifndef WX_PRECOMP #include "wx/wx.h" #endif // WX_PRECOMP #include #include "wx/tokenzr.h" #include "wx/mstream.h" #include "wx/image.h" #include "wx/ffile.h" #include "ScintillaWX.h" //---------------------------------------------------------------------- const wxChar* wxSTCNameStr = wxT("stcwindow"); #ifdef MAKELONG #undef MAKELONG #endif #define MAKELONG(a, b) ((a) | ((b) << 16)) static long wxColourAsLong(const wxColour& co) { return (((long)co.Blue() << 16) | ((long)co.Green() << 8) | ((long)co.Red())); } static wxColour wxColourFromLong(long c) { wxColour clr; clr.Set((unsigned char)(c & 0xff), (unsigned char)((c >> 8) & 0xff), (unsigned char)((c >> 16) & 0xff)); return clr; } static wxColour wxColourFromSpec(const wxString& spec) { // spec should be a colour name or "#RRGGBB" if (spec.GetChar(0) == wxT('#')) { long red, green, blue; red = green = blue = 0; spec.Mid(1,2).ToLong(&red, 16); spec.Mid(3,2).ToLong(&green, 16); spec.Mid(5,2).ToLong(&blue, 16); return wxColour((unsigned char)red, (unsigned char)green, (unsigned char)blue); } else return wxColour(spec); } //---------------------------------------------------------------------- DEFINE_EVENT_TYPE( wxEVT_STC_CHANGE ); DEFINE_EVENT_TYPE( wxEVT_STC_STYLENEEDED ); DEFINE_EVENT_TYPE( wxEVT_STC_CHARADDED ); DEFINE_EVENT_TYPE( wxEVT_STC_SAVEPOINTREACHED ); DEFINE_EVENT_TYPE( wxEVT_STC_SAVEPOINTLEFT ); DEFINE_EVENT_TYPE( wxEVT_STC_ROMODIFYATTEMPT ); DEFINE_EVENT_TYPE( wxEVT_STC_KEY ); DEFINE_EVENT_TYPE( wxEVT_STC_DOUBLECLICK ); DEFINE_EVENT_TYPE( wxEVT_STC_UPDATEUI ); DEFINE_EVENT_TYPE( wxEVT_STC_MODIFIED ); DEFINE_EVENT_TYPE( wxEVT_STC_MACRORECORD ); DEFINE_EVENT_TYPE( wxEVT_STC_MARGINCLICK ); DEFINE_EVENT_TYPE( wxEVT_STC_NEEDSHOWN ); DEFINE_EVENT_TYPE( wxEVT_STC_PAINTED ); DEFINE_EVENT_TYPE( wxEVT_STC_USERLISTSELECTION ); DEFINE_EVENT_TYPE( wxEVT_STC_URIDROPPED ); DEFINE_EVENT_TYPE( wxEVT_STC_DWELLSTART ); DEFINE_EVENT_TYPE( wxEVT_STC_DWELLEND ); DEFINE_EVENT_TYPE( wxEVT_STC_START_DRAG ); DEFINE_EVENT_TYPE( wxEVT_STC_DRAG_OVER ); DEFINE_EVENT_TYPE( wxEVT_STC_DO_DROP ); DEFINE_EVENT_TYPE( wxEVT_STC_ZOOM ); DEFINE_EVENT_TYPE( wxEVT_STC_HOTSPOT_CLICK ); DEFINE_EVENT_TYPE( wxEVT_STC_HOTSPOT_DCLICK ); DEFINE_EVENT_TYPE( wxEVT_STC_CALLTIP_CLICK ); DEFINE_EVENT_TYPE( wxEVT_STC_AUTOCOMP_SELECTION ); DEFINE_EVENT_TYPE( wxEVT_STC_INDICATOR_CLICK ); DEFINE_EVENT_TYPE( wxEVT_STC_INDICATOR_RELEASE ); DEFINE_EVENT_TYPE( wxEVT_STC_AUTOCOMP_CANCELLED ); DEFINE_EVENT_TYPE( wxEVT_STC_AUTOCOMP_CHAR_DELETED ); BEGIN_EVENT_TABLE(wxScintillaTextCtrl, wxControl) EVT_PAINT (wxScintillaTextCtrl::OnPaint) EVT_SCROLLWIN (wxScintillaTextCtrl::OnScrollWin) EVT_SCROLL (wxScintillaTextCtrl::OnScroll) EVT_SIZE (wxScintillaTextCtrl::OnSize) EVT_LEFT_DOWN (wxScintillaTextCtrl::OnMouseLeftDown) // Let Scintilla see the double click as a second click EVT_LEFT_DCLICK (wxScintillaTextCtrl::OnMouseLeftDown) EVT_MOTION (wxScintillaTextCtrl::OnMouseMove) EVT_LEFT_UP (wxScintillaTextCtrl::OnMouseLeftUp) #if defined(__WXGTK__) || defined(__WXMAC__) EVT_RIGHT_UP (wxScintillaTextCtrl::OnMouseRightUp) #else EVT_CONTEXT_MENU (wxScintillaTextCtrl::OnContextMenu) #endif EVT_MOUSEWHEEL (wxScintillaTextCtrl::OnMouseWheel) EVT_MIDDLE_UP (wxScintillaTextCtrl::OnMouseMiddleUp) EVT_CHAR (wxScintillaTextCtrl::OnChar) EVT_KEY_DOWN (wxScintillaTextCtrl::OnKeyDown) EVT_KILL_FOCUS (wxScintillaTextCtrl::OnLoseFocus) EVT_SET_FOCUS (wxScintillaTextCtrl::OnGainFocus) EVT_SYS_COLOUR_CHANGED (wxScintillaTextCtrl::OnSysColourChanged) EVT_ERASE_BACKGROUND (wxScintillaTextCtrl::OnEraseBackground) EVT_MENU_RANGE (10, 16, wxScintillaTextCtrl::OnMenu) EVT_LISTBOX_DCLICK (wxID_ANY, wxScintillaTextCtrl::OnListBox) END_EVENT_TABLE() IMPLEMENT_CLASS(wxScintillaTextCtrl, wxControl) IMPLEMENT_DYNAMIC_CLASS(wxScintillaTextEvent, wxCommandEvent) #ifdef LINK_LEXERS // forces the linking of the lexer modules int Scintilla_LinkLexers(); #endif //---------------------------------------------------------------------- // Constructor and Destructor wxScintillaTextCtrl::wxScintillaTextCtrl(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name) { m_swx = NULL; Create(parent, id, pos, size, style, name); } bool wxScintillaTextCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name) { style |= wxVSCROLL | wxHSCROLL; if (!wxControl::Create(parent, id, pos, size, style | wxWANTS_CHARS | wxCLIP_CHILDREN, wxDefaultValidator, name)) return false; #ifdef LINK_LEXERS Scintilla_LinkLexers(); #endif m_swx = new ScintillaWX(this); m_stopWatch.Start(); m_lastKeyDownConsumed = false; m_lastWheelTimestamp = 0; m_vScrollBar = NULL; m_hScrollBar = NULL; #if wxUSE_UNICODE // Put Scintilla into unicode (UTF-8) mode SetCodePage(wxSTC_CP_UTF8); #endif SetInitialSize(size); // Reduces flicker on GTK+/X11 SetBackgroundStyle(wxBG_STYLE_CUSTOM); return true; } wxScintillaTextCtrl::~wxScintillaTextCtrl() { delete m_swx; } //---------------------------------------------------------------------- wxIntPtr wxScintillaTextCtrl::SendMsg(int msg, wxUIntPtr wp, wxIntPtr lp) { return m_swx->WndProc(msg, wp, lp); } //---------------------------------------------------------------------- // Set the vertical scrollbar to use instead of the ont that's built-in. void wxScintillaTextCtrl::SetVScrollBar(wxScrollBar* bar) { m_vScrollBar = bar; if (bar != NULL) { // ensure that the built-in scrollbar is not visible SetScrollbar(wxVERTICAL, 0, 0, 0); } } // Set the horizontal scrollbar to use instead of the ont that's built-in. void wxScintillaTextCtrl::SetHScrollBar(wxScrollBar* bar) { m_hScrollBar = bar; if (bar != NULL) { // ensure that the built-in scrollbar is not visible SetScrollbar(wxHORIZONTAL, 0, 0, 0); } } //---------------------------------------------------------------------- // Generated methods implementation section {{{ // Add text to the document at current position. void wxScintillaTextCtrl::AddText(const wxString& text) { wxWX2MBbuf buf = (wxWX2MBbuf)wx2stc(text); SendMsg(2001, strlen(buf), (sptr_t)(const char*)buf); } // Add array of cells to document. void wxScintillaTextCtrl::AddStyledText(const wxMemoryBuffer& data) { SendMsg(2002, data.GetDataLen(), (sptr_t)data.GetData()); } // Insert string at a position. void wxScintillaTextCtrl::InsertText(int pos, const wxString& text) { SendMsg(2003, pos, (sptr_t)(const char*)wx2stc(text)); } // Delete all text in the document. void wxScintillaTextCtrl::ClearAll() { SendMsg(2004, 0, 0); } // Set all style bytes to 0, remove all folding information. void wxScintillaTextCtrl::ClearDocumentStyle() { SendMsg(2005, 0, 0); } // Returns the number of bytes in the document. int wxScintillaTextCtrl::GetLength() { return SendMsg(2006, 0, 0); } // Returns the character byte at the position. int wxScintillaTextCtrl::GetCharAt(int pos) { return (unsigned char)SendMsg(2007, pos, 0); } // Returns the position of the caret. int wxScintillaTextCtrl::GetCurrentPos() { return SendMsg(2008, 0, 0); } // Returns the position of the opposite end of the selection to the caret. int wxScintillaTextCtrl::GetAnchor() { return SendMsg(2009, 0, 0); } // Returns the style byte at the position. int wxScintillaTextCtrl::GetStyleAt(int pos) { return (unsigned char)SendMsg(2010, pos, 0); } // Redoes the next action on the undo history. void wxScintillaTextCtrl::Redo() { SendMsg(2011, 0, 0); } // Choose between collecting actions into the undo // history and discarding them. void wxScintillaTextCtrl::SetUndoCollection(bool collectUndo) { SendMsg(2012, collectUndo, 0); } // Select all the text in the document. void wxScintillaTextCtrl::SelectAll() { SendMsg(2013, 0, 0); } // Remember the current position in the undo history as the position // at which the document was saved. void wxScintillaTextCtrl::SetSavePoint() { SendMsg(2014, 0, 0); } // Retrieve a buffer of cells. wxMemoryBuffer wxScintillaTextCtrl::GetStyledText(int startPos, int endPos) { wxMemoryBuffer buf; if (endPos < startPos) { int temp = startPos; startPos = endPos; endPos = temp; } int len = endPos - startPos; if (!len) return buf; TextRange tr; tr.lpstrText = (char*)buf.GetWriteBuf(len*2+1); tr.chrg.cpMin = startPos; tr.chrg.cpMax = endPos; len = SendMsg(2015, 0, (sptr_t)&tr); buf.UngetWriteBuf(len); return buf; } // Are there any redoable actions in the undo history? bool wxScintillaTextCtrl::CanRedo() { return SendMsg(2016, 0, 0) != 0; } // Retrieve the line number at which a particular marker is located. int wxScintillaTextCtrl::MarkerLineFromHandle(int handle) { return SendMsg(2017, handle, 0); } // Delete a marker. void wxScintillaTextCtrl::MarkerDeleteHandle(int handle) { SendMsg(2018, handle, 0); } // Is undo history being collected? bool wxScintillaTextCtrl::GetUndoCollection() { return SendMsg(2019, 0, 0) != 0; } // Are white space characters currently visible? // Returns one of SCWS_* constants. int wxScintillaTextCtrl::GetViewWhiteSpace() { return SendMsg(2020, 0, 0); } // Make white space characters invisible, always visible or visible outside indentation. void wxScintillaTextCtrl::SetViewWhiteSpace(int viewWS) { SendMsg(2021, viewWS, 0); } // Find the position from a point within the window. int wxScintillaTextCtrl::PositionFromPoint(wxPoint pt) { return SendMsg(2022, pt.x, pt.y); } // Find the position from a point within the window but return // INVALID_POSITION if not close to text. int wxScintillaTextCtrl::PositionFromPointClose(int x, int y) { return SendMsg(2023, x, y); } // Set caret to start of a line and ensure it is visible. void wxScintillaTextCtrl::GotoLine(int line) { SendMsg(2024, line, 0); } // Set caret to a position and ensure it is visible. void wxScintillaTextCtrl::GotoPos(int pos) { SendMsg(2025, pos, 0); } // Set the selection anchor to a position. The anchor is the opposite // end of the selection from the caret. void wxScintillaTextCtrl::SetAnchor(int posAnchor) { SendMsg(2026, posAnchor, 0); } // Retrieve the text of the line containing the caret. // Returns the index of the caret on the line. wxString wxScintillaTextCtrl::GetCurLine(int* linePos) { int len = LineLength(GetCurrentLine()); if (!len) { if (linePos) *linePos = 0; return wxEmptyString; } wxMemoryBuffer mbuf(len+1); char* buf = (char*)mbuf.GetWriteBuf(len+1); int pos = SendMsg(2027, len+1, (sptr_t)buf); mbuf.UngetWriteBuf(len); mbuf.AppendByte(0); if (linePos) *linePos = pos; return stc2wx(buf); } // Retrieve the position of the last correctly styled character. int wxScintillaTextCtrl::GetEndStyled() { return SendMsg(2028, 0, 0); } // Convert all line endings in the document to one mode. void wxScintillaTextCtrl::ConvertEOLs(int eolMode) { SendMsg(2029, eolMode, 0); } // Retrieve the current end of line mode - one of CRLF, CR, or LF. int wxScintillaTextCtrl::GetEOLMode() { return SendMsg(2030, 0, 0); } // Set the current end of line mode. void wxScintillaTextCtrl::SetEOLMode(int eolMode) { SendMsg(2031, eolMode, 0); } // Set the current styling position to pos and the styling mask to mask. // The styling mask can be used to protect some bits in each styling byte from modification. void wxScintillaTextCtrl::StartStyling(int pos, int mask) { SendMsg(2032, pos, mask); } // Change style from current styling position for length characters to a style // and move the current styling position to after this newly styled segment. void wxScintillaTextCtrl::SetStyling(int length, int style) { SendMsg(2033, length, style); } // Is drawing done first into a buffer or direct to the screen? bool wxScintillaTextCtrl::GetBufferedDraw() { return SendMsg(2034, 0, 0) != 0; } // If drawing is buffered then each line of text is drawn into a bitmap buffer // before drawing it to the screen to avoid flicker. void wxScintillaTextCtrl::SetBufferedDraw(bool buffered) { SendMsg(2035, buffered, 0); } // Change the visible size of a tab to be a multiple of the width of a space character. void wxScintillaTextCtrl::SetTabWidth(int tabWidth) { SendMsg(2036, tabWidth, 0); } // Retrieve the visible size of a tab. int wxScintillaTextCtrl::GetTabWidth() { return SendMsg(2121, 0, 0); } // Set the code page used to interpret the bytes of the document as characters. void wxScintillaTextCtrl::SetCodePage(int codePage) { #if wxUSE_UNICODE wxASSERT_MSG(codePage == wxSTC_CP_UTF8, wxT("Only wxSTC_CP_UTF8 may be used when wxUSE_UNICODE is on.")); #else wxASSERT_MSG(codePage != wxSTC_CP_UTF8, wxT("wxSTC_CP_UTF8 may not be used when wxUSE_UNICODE is off.")); #endif SendMsg(2037, codePage); } // Set the symbol used for a particular marker number, // and optionally the fore and background colours. void wxScintillaTextCtrl::MarkerDefine(int markerNumber, int markerSymbol, const wxColour& foreground, const wxColour& background) { SendMsg(2040, markerNumber, markerSymbol); if (foreground.Ok()) MarkerSetForeground(markerNumber, foreground); if (background.Ok()) MarkerSetBackground(markerNumber, background); } // Set the foreground colour used for a particular marker number. void wxScintillaTextCtrl::MarkerSetForeground(int markerNumber, const wxColour& fore) { SendMsg(2041, markerNumber, wxColourAsLong(fore)); } // Set the background colour used for a particular marker number. void wxScintillaTextCtrl::MarkerSetBackground(int markerNumber, const wxColour& back) { SendMsg(2042, markerNumber, wxColourAsLong(back)); } // Add a marker to a line, returning an ID which can be used to find or delete the marker. int wxScintillaTextCtrl::MarkerAdd(int line, int markerNumber) { return SendMsg(2043, line, markerNumber); } // Delete a marker from a line. void wxScintillaTextCtrl::MarkerDelete(int line, int markerNumber) { SendMsg(2044, line, markerNumber); } // Delete all markers with a particular number from all lines. void wxScintillaTextCtrl::MarkerDeleteAll(int markerNumber) { SendMsg(2045, markerNumber, 0); } // Get a bit mask of all the markers set on a line. int wxScintillaTextCtrl::MarkerGet(int line) { return SendMsg(2046, line, 0); } // Find the next line after lineStart that includes a marker in mask. int wxScintillaTextCtrl::MarkerNext(int lineStart, int markerMask) { return SendMsg(2047, lineStart, markerMask); } // Find the previous line before lineStart that includes a marker in mask. int wxScintillaTextCtrl::MarkerPrevious(int lineStart, int markerMask) { return SendMsg(2048, lineStart, markerMask); } // Define a marker from a bitmap void wxScintillaTextCtrl::MarkerDefineBitmap(int markerNumber, const wxBitmap& bmp) { // convert bmp to a xpm in a string wxMemoryOutputStream strm; wxImage img = bmp.ConvertToImage(); if (img.HasAlpha()) img.ConvertAlphaToMask(); img.SaveFile(strm, wxBITMAP_TYPE_XPM); size_t len = strm.GetSize(); char* buff = new char[len+1]; strm.CopyTo(buff, len); buff[len] = 0; SendMsg(2049, markerNumber, (sptr_t)buff); delete [] buff; } // Add a set of markers to a line. void wxScintillaTextCtrl::MarkerAddSet(int line, int set) { SendMsg(2466, line, set); } // Set the alpha used for a marker that is drawn in the text area, not the margin. void wxScintillaTextCtrl::MarkerSetAlpha(int markerNumber, int alpha) { SendMsg(2476, markerNumber, alpha); } // Set a margin to be either numeric or symbolic. void wxScintillaTextCtrl::SetMarginType(int margin, int marginType) { SendMsg(2240, margin, marginType); } // Retrieve the type of a margin. int wxScintillaTextCtrl::GetMarginType(int margin) { return SendMsg(2241, margin, 0); } // Set the width of a margin to a width expressed in pixels. void wxScintillaTextCtrl::SetMarginWidth(int margin, int pixelWidth) { SendMsg(2242, margin, pixelWidth); } // Retrieve the width of a margin in pixels. int wxScintillaTextCtrl::GetMarginWidth(int margin) { return SendMsg(2243, margin, 0); } // Set a mask that determines which markers are displayed in a margin. void wxScintillaTextCtrl::SetMarginMask(int margin, int mask) { SendMsg(2244, margin, mask); } // Retrieve the marker mask of a margin. int wxScintillaTextCtrl::GetMarginMask(int margin) { return SendMsg(2245, margin, 0); } // Make a margin sensitive or insensitive to mouse clicks. void wxScintillaTextCtrl::SetMarginSensitive(int margin, bool sensitive) { SendMsg(2246, margin, sensitive); } // Retrieve the mouse click sensitivity of a margin. bool wxScintillaTextCtrl::GetMarginSensitive(int margin) { return SendMsg(2247, margin, 0) != 0; } // Clear all the styles and make equivalent to the global default style. void wxScintillaTextCtrl::StyleClearAll() { SendMsg(2050, 0, 0); } // Set the foreground colour of a style. void wxScintillaTextCtrl::StyleSetForeground(int style, const wxColour& fore) { SendMsg(2051, style, wxColourAsLong(fore)); } // Set the background colour of a style. void wxScintillaTextCtrl::StyleSetBackground(int style, const wxColour& back) { SendMsg(2052, style, wxColourAsLong(back)); } // Set a style to be bold or not. void wxScintillaTextCtrl::StyleSetBold(int style, bool bold) { SendMsg(2053, style, bold); } // Set a style to be italic or not. void wxScintillaTextCtrl::StyleSetItalic(int style, bool italic) { SendMsg(2054, style, italic); } // Set the size of characters of a style. void wxScintillaTextCtrl::StyleSetSize(int style, int sizePoints) { SendMsg(2055, style, sizePoints); } // Set the font of a style. void wxScintillaTextCtrl::StyleSetFaceName(int style, const wxString& fontName) { SendMsg(2056, style, (sptr_t)(const char*)wx2stc(fontName)); } // Set a style to have its end of line filled or not. void wxScintillaTextCtrl::StyleSetEOLFilled(int style, bool filled) { SendMsg(2057, style, filled); } // Reset the default style to its state at startup void wxScintillaTextCtrl::StyleResetDefault() { SendMsg(2058, 0, 0); } // Set a style to be underlined or not. void wxScintillaTextCtrl::StyleSetUnderline(int style, bool underline) { SendMsg(2059, style, underline); } // Get the foreground colour of a style. wxColour wxScintillaTextCtrl::StyleGetForeground(int style) { long c = SendMsg(2481, style, 0); return wxColourFromLong(c); } // Get the background colour of a style. wxColour wxScintillaTextCtrl::StyleGetBackground(int style) { long c = SendMsg(2482, style, 0); return wxColourFromLong(c); } // Get is a style bold or not. bool wxScintillaTextCtrl::StyleGetBold(int style) { return SendMsg(2483, style, 0) != 0; } // Get is a style italic or not. bool wxScintillaTextCtrl::StyleGetItalic(int style) { return SendMsg(2484, style, 0) != 0; } // Get the size of characters of a style. int wxScintillaTextCtrl::StyleGetSize(int style) { return SendMsg(2485, style, 0); } // Get the font facename of a style wxString wxScintillaTextCtrl::StyleGetFaceName(int style) { long msg = 2486; long len = SendMsg(msg, style, 0); wxMemoryBuffer mbuf(len+1); char* buf = (char*)mbuf.GetWriteBuf(len+1); SendMsg(msg, style, (sptr_t)buf); mbuf.UngetWriteBuf(len); mbuf.AppendByte(0); return stc2wx(buf); } // Get is a style to have its end of line filled or not. bool wxScintillaTextCtrl::StyleGetEOLFilled(int style) { return SendMsg(2487, style, 0) != 0; } // Get is a style underlined or not. bool wxScintillaTextCtrl::StyleGetUnderline(int style) { return SendMsg(2488, style, 0) != 0; } // Get is a style mixed case, or to force upper or lower case. int wxScintillaTextCtrl::StyleGetCase(int style) { return SendMsg(2489, style, 0); } // Get the character set of the font in a style. int wxScintillaTextCtrl::StyleGetCharacterSet(int style) { return SendMsg(2490, style, 0); } // Get is a style visible or not. bool wxScintillaTextCtrl::StyleGetVisible(int style) { return SendMsg(2491, style, 0) != 0; } // Get is a style changeable or not (read only). // Experimental feature, currently buggy. bool wxScintillaTextCtrl::StyleGetChangeable(int style) { return SendMsg(2492, style, 0) != 0; } // Get is a style a hotspot or not. bool wxScintillaTextCtrl::StyleGetHotSpot(int style) { return SendMsg(2493, style, 0) != 0; } // Set a style to be mixed case, or to force upper or lower case. void wxScintillaTextCtrl::StyleSetCase(int style, int caseForce) { SendMsg(2060, style, caseForce); } // Set a style to be a hotspot or not. void wxScintillaTextCtrl::StyleSetHotSpot(int style, bool hotspot) { SendMsg(2409, style, hotspot); } // Set the foreground colour of the main and additional selections and whether to use this setting. void wxScintillaTextCtrl::SetSelForeground(bool useSetting, const wxColour& fore) { SendMsg(2067, useSetting, wxColourAsLong(fore)); } // Set the background colour of the main and additional selections and whether to use this setting. void wxScintillaTextCtrl::SetSelBackground(bool useSetting, const wxColour& back) { SendMsg(2068, useSetting, wxColourAsLong(back)); } // Get the alpha of the selection. int wxScintillaTextCtrl::GetSelAlpha() { return SendMsg(2477, 0, 0); } // Set the alpha of the selection. void wxScintillaTextCtrl::SetSelAlpha(int alpha) { SendMsg(2478, alpha, 0); } // Is the selection end of line filled? bool wxScintillaTextCtrl::GetSelEOLFilled() { return SendMsg(2479, 0, 0) != 0; } // Set the selection to have its end of line filled or not. void wxScintillaTextCtrl::SetSelEOLFilled(bool filled) { SendMsg(2480, filled, 0); } // Set the foreground colour of the caret. void wxScintillaTextCtrl::SetCaretForeground(const wxColour& fore) { SendMsg(2069, wxColourAsLong(fore), 0); } // When key+modifier combination km is pressed perform msg. void wxScintillaTextCtrl::CmdKeyAssign(int key, int modifiers, int cmd) { SendMsg(2070, MAKELONG(key, modifiers), cmd); } // When key+modifier combination km is pressed do nothing. void wxScintillaTextCtrl::CmdKeyClear(int key, int modifiers) { SendMsg(2071, MAKELONG(key, modifiers)); } // Drop all key mappings. void wxScintillaTextCtrl::CmdKeyClearAll() { SendMsg(2072, 0, 0); } // Set the styles for a segment of the document. void wxScintillaTextCtrl::SetStyleBytes(int length, char* styleBytes) { SendMsg(2073, length, (sptr_t)styleBytes); } // Set a style to be visible or not. void wxScintillaTextCtrl::StyleSetVisible(int style, bool visible) { SendMsg(2074, style, visible); } // Get the time in milliseconds that the caret is on and off. int wxScintillaTextCtrl::GetCaretPeriod() { return SendMsg(2075, 0, 0); } // Get the time in milliseconds that the caret is on and off. 0 = steady on. void wxScintillaTextCtrl::SetCaretPeriod(int periodMilliseconds) { SendMsg(2076, periodMilliseconds, 0); } // Set the set of characters making up words for when moving or selecting by word. // First sets defaults like SetCharsDefault. void wxScintillaTextCtrl::SetWordChars(const wxString& characters) { SendMsg(2077, 0, (sptr_t)(const char*)wx2stc(characters)); } // Start a sequence of actions that is undone and redone as a unit. // May be nested. void wxScintillaTextCtrl::BeginUndoAction() { SendMsg(2078, 0, 0); } // End a sequence of actions that is undone and redone as a unit. void wxScintillaTextCtrl::EndUndoAction() { SendMsg(2079, 0, 0); } // Set an indicator to plain, squiggle or TT. void wxScintillaTextCtrl::IndicatorSetStyle(int indic, int style) { SendMsg(2080, indic, style); } // Retrieve the style of an indicator. int wxScintillaTextCtrl::IndicatorGetStyle(int indic) { return SendMsg(2081, indic, 0); } // Set the foreground colour of an indicator. void wxScintillaTextCtrl::IndicatorSetForeground(int indic, const wxColour& fore) { SendMsg(2082, indic, wxColourAsLong(fore)); } // Retrieve the foreground colour of an indicator. wxColour wxScintillaTextCtrl::IndicatorGetForeground(int indic) { long c = SendMsg(2083, indic, 0); return wxColourFromLong(c); } // Set an indicator to draw under text or over(default). void wxScintillaTextCtrl::IndicatorSetUnder(int indic, bool under) { SendMsg(2510, indic, under); } // Retrieve whether indicator drawn under or over text. bool wxScintillaTextCtrl::IndicatorGetUnder(int indic) { return SendMsg(2511, indic, 0) != 0; } // Set the foreground colour of all whitespace and whether to use this setting. void wxScintillaTextCtrl::SetWhitespaceForeground(bool useSetting, const wxColour& fore) { SendMsg(2084, useSetting, wxColourAsLong(fore)); } // Set the background colour of all whitespace and whether to use this setting. void wxScintillaTextCtrl::SetWhitespaceBackground(bool useSetting, const wxColour& back) { SendMsg(2085, useSetting, wxColourAsLong(back)); } // Set the size of the dots used to mark space characters. void wxScintillaTextCtrl::SetWhitespaceSize(int size) { SendMsg(2086, size, 0); } // Get the size of the dots used to mark space characters. int wxScintillaTextCtrl::GetWhitespaceSize() { return SendMsg(2087, 0, 0); } // Divide each styling byte into lexical class bits (default: 5) and indicator // bits (default: 3). If a lexer requires more than 32 lexical states, then this // is used to expand the possible states. void wxScintillaTextCtrl::SetStyleBits(int bits) { SendMsg(2090, bits, 0); } // Retrieve number of bits in style bytes used to hold the lexical state. int wxScintillaTextCtrl::GetStyleBits() { return SendMsg(2091, 0, 0); } // Used to hold extra styling information for each line. void wxScintillaTextCtrl::SetLineState(int line, int state) { SendMsg(2092, line, state); } // Retrieve the extra styling information for a line. int wxScintillaTextCtrl::GetLineState(int line) { return SendMsg(2093, line, 0); } // Retrieve the last line number that has line state. int wxScintillaTextCtrl::GetMaxLineState() { return SendMsg(2094, 0, 0); } // Is the background of the line containing the caret in a different colour? bool wxScintillaTextCtrl::GetCaretLineVisible() { return SendMsg(2095, 0, 0) != 0; } // Display the background of the line containing the caret in a different colour. void wxScintillaTextCtrl::SetCaretLineVisible(bool show) { SendMsg(2096, show, 0); } // Get the colour of the background of the line containing the caret. wxColour wxScintillaTextCtrl::GetCaretLineBackground() { long c = SendMsg(2097, 0, 0); return wxColourFromLong(c); } // Set the colour of the background of the line containing the caret. void wxScintillaTextCtrl::SetCaretLineBackground(const wxColour& back) { SendMsg(2098, wxColourAsLong(back), 0); } // Set a style to be changeable or not (read only). // Experimental feature, currently buggy. void wxScintillaTextCtrl::StyleSetChangeable(int style, bool changeable) { SendMsg(2099, style, changeable); } // Display a auto-completion list. // The lenEntered parameter indicates how many characters before // the caret should be used to provide context. void wxScintillaTextCtrl::AutoCompShow(int lenEntered, const wxString& itemList) { SendMsg(2100, lenEntered, (sptr_t)(const char*)wx2stc(itemList)); } // Remove the auto-completion list from the screen. void wxScintillaTextCtrl::AutoCompCancel() { SendMsg(2101, 0, 0); } // Is there an auto-completion list visible? bool wxScintillaTextCtrl::AutoCompActive() { return SendMsg(2102, 0, 0) != 0; } // Retrieve the position of the caret when the auto-completion list was displayed. int wxScintillaTextCtrl::AutoCompPosStart() { return SendMsg(2103, 0, 0); } // User has selected an item so remove the list and insert the selection. void wxScintillaTextCtrl::AutoCompComplete() { SendMsg(2104, 0, 0); } // Define a set of character that when typed cancel the auto-completion list. void wxScintillaTextCtrl::AutoCompStops(const wxString& characterSet) { SendMsg(2105, 0, (sptr_t)(const char*)wx2stc(characterSet)); } // Change the separator character in the string setting up an auto-completion list. // Default is space but can be changed if items contain space. void wxScintillaTextCtrl::AutoCompSetSeparator(int separatorCharacter) { SendMsg(2106, separatorCharacter, 0); } // Retrieve the auto-completion list separator character. int wxScintillaTextCtrl::AutoCompGetSeparator() { return SendMsg(2107, 0, 0); } // Select the item in the auto-completion list that starts with a string. void wxScintillaTextCtrl::AutoCompSelect(const wxString& text) { SendMsg(2108, 0, (sptr_t)(const char*)wx2stc(text)); } // Should the auto-completion list be cancelled if the user backspaces to a // position before where the box was created. void wxScintillaTextCtrl::AutoCompSetCancelAtStart(bool cancel) { SendMsg(2110, cancel, 0); } // Retrieve whether auto-completion cancelled by backspacing before start. bool wxScintillaTextCtrl::AutoCompGetCancelAtStart() { return SendMsg(2111, 0, 0) != 0; } // Define a set of characters that when typed will cause the autocompletion to // choose the selected item. void wxScintillaTextCtrl::AutoCompSetFillUps(const wxString& characterSet) { SendMsg(2112, 0, (sptr_t)(const char*)wx2stc(characterSet)); } // Should a single item auto-completion list automatically choose the item. void wxScintillaTextCtrl::AutoCompSetChooseSingle(bool chooseSingle) { SendMsg(2113, chooseSingle, 0); } // Retrieve whether a single item auto-completion list automatically choose the item. bool wxScintillaTextCtrl::AutoCompGetChooseSingle() { return SendMsg(2114, 0, 0) != 0; } // Set whether case is significant when performing auto-completion searches. void wxScintillaTextCtrl::AutoCompSetIgnoreCase(bool ignoreCase) { SendMsg(2115, ignoreCase, 0); } // Retrieve state of ignore case flag. bool wxScintillaTextCtrl::AutoCompGetIgnoreCase() { return SendMsg(2116, 0, 0) != 0; } // Display a list of strings and send notification when user chooses one. void wxScintillaTextCtrl::UserListShow(int listType, const wxString& itemList) { SendMsg(2117, listType, (sptr_t)(const char*)wx2stc(itemList)); } // Set whether or not autocompletion is hidden automatically when nothing matches. void wxScintillaTextCtrl::AutoCompSetAutoHide(bool autoHide) { SendMsg(2118, autoHide, 0); } // Retrieve whether or not autocompletion is hidden automatically when nothing matches. bool wxScintillaTextCtrl::AutoCompGetAutoHide() { return SendMsg(2119, 0, 0) != 0; } // Set whether or not autocompletion deletes any word characters // after the inserted text upon completion. void wxScintillaTextCtrl::AutoCompSetDropRestOfWord(bool dropRestOfWord) { SendMsg(2270, dropRestOfWord, 0); } // Retrieve whether or not autocompletion deletes any word characters // after the inserted text upon completion. bool wxScintillaTextCtrl::AutoCompGetDropRestOfWord() { return SendMsg(2271, 0, 0) != 0; } // Register an image for use in autocompletion lists. void wxScintillaTextCtrl::RegisterImage(int type, const wxBitmap& bmp) { // convert bmp to a xpm in a string wxMemoryOutputStream strm; wxImage img = bmp.ConvertToImage(); if (img.HasAlpha()) img.ConvertAlphaToMask(); img.SaveFile(strm, wxBITMAP_TYPE_XPM); size_t len = strm.GetSize(); char* buff = new char[len+1]; strm.CopyTo(buff, len); buff[len] = 0; SendMsg(2405, type, (sptr_t)buff); delete [] buff; } // Clear all the registered images. void wxScintillaTextCtrl::ClearRegisteredImages() { SendMsg(2408, 0, 0); } // Retrieve the auto-completion list type-separator character. int wxScintillaTextCtrl::AutoCompGetTypeSeparator() { return SendMsg(2285, 0, 0); } // Change the type-separator character in the string setting up an auto-completion list. // Default is '?' but can be changed if items contain '?'. void wxScintillaTextCtrl::AutoCompSetTypeSeparator(int separatorCharacter) { SendMsg(2286, separatorCharacter, 0); } // Set the maximum width, in characters, of auto-completion and user lists. // Set to 0 to autosize to fit longest item, which is the default. void wxScintillaTextCtrl::AutoCompSetMaxWidth(int characterCount) { SendMsg(2208, characterCount, 0); } // Get the maximum width, in characters, of auto-completion and user lists. int wxScintillaTextCtrl::AutoCompGetMaxWidth() { return SendMsg(2209, 0, 0); } // Set the maximum height, in rows, of auto-completion and user lists. // The default is 5 rows. void wxScintillaTextCtrl::AutoCompSetMaxHeight(int rowCount) { SendMsg(2210, rowCount, 0); } // Set the maximum height, in rows, of auto-completion and user lists. int wxScintillaTextCtrl::AutoCompGetMaxHeight() { return SendMsg(2211, 0, 0); } // Set the number of spaces used for one level of indentation. void wxScintillaTextCtrl::SetIndent(int indentSize) { SendMsg(2122, indentSize, 0); } // Retrieve indentation size. int wxScintillaTextCtrl::GetIndent() { return SendMsg(2123, 0, 0); } // Indentation will only use space characters if useTabs is false, otherwise // it will use a combination of tabs and spaces. void wxScintillaTextCtrl::SetUseTabs(bool useTabs) { SendMsg(2124, useTabs, 0); } // Retrieve whether tabs will be used in indentation. bool wxScintillaTextCtrl::GetUseTabs() { return SendMsg(2125, 0, 0) != 0; } // Change the indentation of a line to a number of columns. void wxScintillaTextCtrl::SetLineIndentation(int line, int indentSize) { SendMsg(2126, line, indentSize); } // Retrieve the number of columns that a line is indented. int wxScintillaTextCtrl::GetLineIndentation(int line) { return SendMsg(2127, line, 0); } // Retrieve the position before the first non indentation character on a line. int wxScintillaTextCtrl::GetLineIndentPosition(int line) { return SendMsg(2128, line, 0); } // Retrieve the column number of a position, taking tab width into account. int wxScintillaTextCtrl::GetColumn(int pos) { return SendMsg(2129, pos, 0); } // Show or hide the horizontal scroll bar. void wxScintillaTextCtrl::SetUseHorizontalScrollBar(bool show) { SendMsg(2130, show, 0); } // Is the horizontal scroll bar visible? bool wxScintillaTextCtrl::GetUseHorizontalScrollBar() { return SendMsg(2131, 0, 0) != 0; } // Show or hide indentation guides. void wxScintillaTextCtrl::SetIndentationGuides(int indentView) { SendMsg(2132, indentView, 0); } // Are the indentation guides visible? int wxScintillaTextCtrl::GetIndentationGuides() { return SendMsg(2133, 0, 0); } // Set the highlighted indentation guide column. // 0 = no highlighted guide. void wxScintillaTextCtrl::SetHighlightGuide(int column) { SendMsg(2134, column, 0); } // Get the highlighted indentation guide column. int wxScintillaTextCtrl::GetHighlightGuide() { return SendMsg(2135, 0, 0); } // Get the position after the last visible characters on a line. int wxScintillaTextCtrl::GetLineEndPosition(int line) { return SendMsg(2136, line, 0); } // Get the code page used to interpret the bytes of the document as characters. int wxScintillaTextCtrl::GetCodePage() { return SendMsg(2137, 0, 0); } // Get the foreground colour of the caret. wxColour wxScintillaTextCtrl::GetCaretForeground() { long c = SendMsg(2138, 0, 0); return wxColourFromLong(c); } // In read-only mode? bool wxScintillaTextCtrl::GetReadOnly() { return SendMsg(2140, 0, 0) != 0; } // Sets the position of the caret. void wxScintillaTextCtrl::SetCurrentPos(int pos) { SendMsg(2141, pos, 0); } // Sets the position that starts the selection - this becomes the anchor. void wxScintillaTextCtrl::SetSelectionStart(int pos) { SendMsg(2142, pos, 0); } // Returns the position at the start of the selection. int wxScintillaTextCtrl::GetSelectionStart() { return SendMsg(2143, 0, 0); } // Sets the position that ends the selection - this becomes the currentPosition. void wxScintillaTextCtrl::SetSelectionEnd(int pos) { SendMsg(2144, pos, 0); } // Returns the position at the end of the selection. int wxScintillaTextCtrl::GetSelectionEnd() { return SendMsg(2145, 0, 0); } // Sets the print magnification added to the point size of each style for printing. void wxScintillaTextCtrl::SetPrintMagnification(int magnification) { SendMsg(2146, magnification, 0); } // Returns the print magnification. int wxScintillaTextCtrl::GetPrintMagnification() { return SendMsg(2147, 0, 0); } // Modify colours when printing for clearer printed text. void wxScintillaTextCtrl::SetPrintColourMode(int mode) { SendMsg(2148, mode, 0); } // Returns the print colour mode. int wxScintillaTextCtrl::GetPrintColourMode() { return SendMsg(2149, 0, 0); } // Find some text in the document. int wxScintillaTextCtrl::FindText(int minPos, int maxPos, const wxString& text, int flags) { TextToFind ft; ft.chrg.cpMin = minPos; ft.chrg.cpMax = maxPos; wxWX2MBbuf buf = (wxWX2MBbuf)wx2stc(text); ft.lpstrText = (char*)(const char*)buf; return SendMsg(2150, flags, (sptr_t)&ft); } // On Windows, will draw the document into a display context such as a printer. int wxScintillaTextCtrl::FormatRange(bool doDraw, int startPos, int endPos, wxDC* draw, wxDC* target, wxRect renderRect, wxRect pageRect) { RangeToFormat fr; if (endPos < startPos) { int temp = startPos; startPos = endPos; endPos = temp; } fr.hdc = draw; fr.hdcTarget = target; fr.rc.top = renderRect.GetTop(); fr.rc.left = renderRect.GetLeft(); fr.rc.right = renderRect.GetRight(); fr.rc.bottom = renderRect.GetBottom(); fr.rcPage.top = pageRect.GetTop(); fr.rcPage.left = pageRect.GetLeft(); fr.rcPage.right = pageRect.GetRight(); fr.rcPage.bottom = pageRect.GetBottom(); fr.chrg.cpMin = startPos; fr.chrg.cpMax = endPos; return SendMsg(2151, doDraw, (sptr_t)&fr); } // Retrieve the display line at the top of the display. int wxScintillaTextCtrl::GetFirstVisibleLine() { return SendMsg(2152, 0, 0); } // Retrieve the contents of a line. wxString wxScintillaTextCtrl::GetLine(int line) { int len = LineLength(line); if (!len) return wxEmptyString; wxMemoryBuffer mbuf(len+1); char* buf = (char*)mbuf.GetWriteBuf(len+1); SendMsg(2153, line, (sptr_t)buf); mbuf.UngetWriteBuf(len); mbuf.AppendByte(0); return stc2wx(buf); } // Returns the number of lines in the document. There is always at least one. int wxScintillaTextCtrl::GetLineCount() { return SendMsg(2154, 0, 0); } // Sets the size in pixels of the left margin. void wxScintillaTextCtrl::SetMarginLeft(int pixelWidth) { SendMsg(2155, 0, pixelWidth); } // Returns the size in pixels of the left margin. int wxScintillaTextCtrl::GetMarginLeft() { return SendMsg(2156, 0, 0); } // Sets the size in pixels of the right margin. void wxScintillaTextCtrl::SetMarginRight(int pixelWidth) { SendMsg(2157, 0, pixelWidth); } // Returns the size in pixels of the right margin. int wxScintillaTextCtrl::GetMarginRight() { return SendMsg(2158, 0, 0); } // Is the document different from when it was last saved? bool wxScintillaTextCtrl::GetModify() { return SendMsg(2159, 0, 0) != 0; } // Retrieve the selected text. wxString wxScintillaTextCtrl::GetSelectedText() { long start; long end; GetSelection(&start, &end); int len = end - start; if (!len) return wxEmptyString; wxMemoryBuffer mbuf(len+2); char* buf = (char*)mbuf.GetWriteBuf(len+1); SendMsg(2161, 0, (sptr_t)buf); mbuf.UngetWriteBuf(len); mbuf.AppendByte(0); return stc2wx(buf); } // Retrieve a range of text. wxString wxScintillaTextCtrl::GetTextRange(int startPos, int endPos) { if (endPos < startPos) { int temp = startPos; startPos = endPos; endPos = temp; } int len = endPos - startPos; if (!len) return wxEmptyString; wxMemoryBuffer mbuf(len+1); char* buf = (char*)mbuf.GetWriteBuf(len); TextRange tr; tr.lpstrText = buf; tr.chrg.cpMin = startPos; tr.chrg.cpMax = endPos; SendMsg(2162, 0, (sptr_t)&tr); mbuf.UngetWriteBuf(len); mbuf.AppendByte(0); return stc2wx(buf); } // Draw the selection in normal style or with selection highlighted. void wxScintillaTextCtrl::HideSelection(bool normal) { SendMsg(2163, normal, 0); } // Retrieve the line containing a position. int wxScintillaTextCtrl::LineFromPosition(int pos) { return SendMsg(2166, pos, 0); } // Retrieve the position at the start of a line. int wxScintillaTextCtrl::PositionFromLine(int line) { return SendMsg(2167, line, 0); } // Scroll horizontally and vertically. void wxScintillaTextCtrl::LineScroll(int columns, int lines) { SendMsg(2168, columns, lines); } // Ensure the caret is visible. void wxScintillaTextCtrl::EnsureCaretVisible() { SendMsg(2169, 0, 0); } // Replace the selected text with the argument text. void wxScintillaTextCtrl::ReplaceSelection(const wxString& text) { SendMsg(2170, 0, (sptr_t)(const char*)wx2stc(text)); } // Set to read only or read write. void wxScintillaTextCtrl::SetReadOnly(bool readOnly) { SendMsg(2171, readOnly, 0); } // Will a paste succeed? bool wxScintillaTextCtrl::CanPaste() { return SendMsg(2173, 0, 0) != 0; } // Are there any undoable actions in the undo history? bool wxScintillaTextCtrl::CanUndo() { return SendMsg(2174, 0, 0) != 0; } // Delete the undo history. void wxScintillaTextCtrl::EmptyUndoBuffer() { SendMsg(2175, 0, 0); } // Undo one action in the undo history. void wxScintillaTextCtrl::Undo() { SendMsg(2176, 0, 0); } // Cut the selection to the clipboard. void wxScintillaTextCtrl::Cut() { SendMsg(2177, 0, 0); } // Copy the selection to the clipboard. void wxScintillaTextCtrl::Copy() { SendMsg(2178, 0, 0); } // Paste the contents of the clipboard into the document replacing the selection. void wxScintillaTextCtrl::Paste() { SendMsg(2179, 0, 0); } // Clear the selection. void wxScintillaTextCtrl::Clear() { SendMsg(2180, 0, 0); } // Replace the contents of the document with the argument text. void wxScintillaTextCtrl::SetText(const wxString& text) { SendMsg(2181, 0, (sptr_t)(const char*)wx2stc(text)); } // Retrieve all the text in the document. wxString wxScintillaTextCtrl::GetText() { int len = GetTextLength(); wxMemoryBuffer mbuf(len+1); // leave room for the null... char* buf = (char*)mbuf.GetWriteBuf(len+1); SendMsg(2182, len+1, (sptr_t)buf); mbuf.UngetWriteBuf(len); mbuf.AppendByte(0); return stc2wx(buf); } // Retrieve the number of characters in the document. int wxScintillaTextCtrl::GetTextLength() { return SendMsg(2183, 0, 0); } // Set to overtype (true) or insert mode. void wxScintillaTextCtrl::SetOvertype(bool overtype) { SendMsg(2186, overtype, 0); } // Returns true if overtype mode is active otherwise false is returned. bool wxScintillaTextCtrl::GetOvertype() { return SendMsg(2187, 0, 0) != 0; } // Set the width of the insert mode caret. void wxScintillaTextCtrl::SetCaretWidth(int pixelWidth) { SendMsg(2188, pixelWidth, 0); } // Returns the width of the insert mode caret. int wxScintillaTextCtrl::GetCaretWidth() { return SendMsg(2189, 0, 0); } // Sets the position that starts the target which is used for updating the // document without affecting the scroll position. void wxScintillaTextCtrl::SetTargetStart(int pos) { SendMsg(2190, pos, 0); } // Get the position that starts the target. int wxScintillaTextCtrl::GetTargetStart() { return SendMsg(2191, 0, 0); } // Sets the position that ends the target which is used for updating the // document without affecting the scroll position. void wxScintillaTextCtrl::SetTargetEnd(int pos) { SendMsg(2192, pos, 0); } // Get the position that ends the target. int wxScintillaTextCtrl::GetTargetEnd() { return SendMsg(2193, 0, 0); } // Replace the target text with the argument text. // Text is counted so it can contain NULs. // Returns the length of the replacement text. int wxScintillaTextCtrl::ReplaceTarget(const wxString& text) { wxWX2MBbuf buf = (wxWX2MBbuf)wx2stc(text); return SendMsg(2194, strlen(buf), (sptr_t)(const char*)buf); } // Replace the target text with the argument text after \d processing. // Text is counted so it can contain NULs. // Looks for \d where d is between 1 and 9 and replaces these with the strings // matched in the last search operation which were surrounded by \( and \). // Returns the length of the replacement text including any change // caused by processing the \d patterns. int wxScintillaTextCtrl::ReplaceTargetRE(const wxString& text) { wxWX2MBbuf buf = (wxWX2MBbuf)wx2stc(text); return SendMsg(2195, strlen(buf), (sptr_t)(const char*)buf); } // Search for a counted string in the target and set the target to the found // range. Text is counted so it can contain NULs. // Returns length of range or -1 for failure in which case target is not moved. int wxScintillaTextCtrl::SearchInTarget(const wxString& text) { wxWX2MBbuf buf = (wxWX2MBbuf)wx2stc(text); return SendMsg(2197, strlen(buf), (sptr_t)(const char*)buf); } // Set the search flags used by SearchInTarget. void wxScintillaTextCtrl::SetSearchFlags(int flags) { SendMsg(2198, flags, 0); } // Get the search flags used by SearchInTarget. int wxScintillaTextCtrl::GetSearchFlags() { return SendMsg(2199, 0, 0); } // Show a call tip containing a definition near position pos. void wxScintillaTextCtrl::CallTipShow(int pos, const wxString& definition) { SendMsg(2200, pos, (sptr_t)(const char*)wx2stc(definition)); } // Remove the call tip from the screen. void wxScintillaTextCtrl::CallTipCancel() { SendMsg(2201, 0, 0); } // Is there an active call tip? bool wxScintillaTextCtrl::CallTipActive() { return SendMsg(2202, 0, 0) != 0; } // Retrieve the position where the caret was before displaying the call tip. int wxScintillaTextCtrl::CallTipPosAtStart() { return SendMsg(2203, 0, 0); } // Highlight a segment of the definition. void wxScintillaTextCtrl::CallTipSetHighlight(int start, int end) { SendMsg(2204, start, end); } // Set the background colour for the call tip. void wxScintillaTextCtrl::CallTipSetBackground(const wxColour& back) { SendMsg(2205, wxColourAsLong(back), 0); } // Set the foreground colour for the call tip. void wxScintillaTextCtrl::CallTipSetForeground(const wxColour& fore) { SendMsg(2206, wxColourAsLong(fore), 0); } // Set the foreground colour for the highlighted part of the call tip. void wxScintillaTextCtrl::CallTipSetForegroundHighlight(const wxColour& fore) { SendMsg(2207, wxColourAsLong(fore), 0); } // Enable use of STYLE_CALLTIP and set call tip tab size in pixels. void wxScintillaTextCtrl::CallTipUseStyle(int tabSize) { SendMsg(2212, tabSize, 0); } // Find the display line of a document line taking hidden lines into account. int wxScintillaTextCtrl::VisibleFromDocLine(int line) { return SendMsg(2220, line, 0); } // Find the document line of a display line taking hidden lines into account. int wxScintillaTextCtrl::DocLineFromVisible(int lineDisplay) { return SendMsg(2221, lineDisplay, 0); } // The number of display lines needed to wrap a document line int wxScintillaTextCtrl::WrapCount(int line) { return SendMsg(2235, line, 0); } // Set the fold level of a line. // This encodes an integer level along with flags indicating whether the // line is a header and whether it is effectively white space. void wxScintillaTextCtrl::SetFoldLevel(int line, int level) { SendMsg(2222, line, level); } // Retrieve the fold level of a line. int wxScintillaTextCtrl::GetFoldLevel(int line) { return SendMsg(2223, line, 0); } // Find the last child line of a header line. int wxScintillaTextCtrl::GetLastChild(int line, int level) { return SendMsg(2224, line, level); } // Find the parent line of a child line. int wxScintillaTextCtrl::GetFoldParent(int line) { return SendMsg(2225, line, 0); } // Make a range of lines visible. void wxScintillaTextCtrl::ShowLines(int lineStart, int lineEnd) { SendMsg(2226, lineStart, lineEnd); } // Make a range of lines invisible. void wxScintillaTextCtrl::HideLines(int lineStart, int lineEnd) { SendMsg(2227, lineStart, lineEnd); } // Is a line visible? bool wxScintillaTextCtrl::GetLineVisible(int line) { return SendMsg(2228, line, 0) != 0; } // Show the children of a header line. void wxScintillaTextCtrl::SetFoldExpanded(int line, bool expanded) { SendMsg(2229, line, expanded); } // Is a header line expanded? bool wxScintillaTextCtrl::GetFoldExpanded(int line) { return SendMsg(2230, line, 0) != 0; } // Switch a header line between expanded and contracted. void wxScintillaTextCtrl::ToggleFold(int line) { SendMsg(2231, line, 0); } // Ensure a particular line is visible by expanding any header line hiding it. void wxScintillaTextCtrl::EnsureVisible(int line) { SendMsg(2232, line, 0); } // Set some style options for folding. void wxScintillaTextCtrl::SetFoldFlags(int flags) { SendMsg(2233, flags, 0); } // Ensure a particular line is visible by expanding any header line hiding it. // Use the currently set visibility policy to determine which range to display. void wxScintillaTextCtrl::EnsureVisibleEnforcePolicy(int line) { SendMsg(2234, line, 0); } // Sets whether a tab pressed when caret is within indentation indents. void wxScintillaTextCtrl::SetTabIndents(bool tabIndents) { SendMsg(2260, tabIndents, 0); } // Does a tab pressed when caret is within indentation indent? bool wxScintillaTextCtrl::GetTabIndents() { return SendMsg(2261, 0, 0) != 0; } // Sets whether a backspace pressed when caret is within indentation unindents. void wxScintillaTextCtrl::SetBackSpaceUnIndents(bool bsUnIndents) { SendMsg(2262, bsUnIndents, 0); } // Does a backspace pressed when caret is within indentation unindent? bool wxScintillaTextCtrl::GetBackSpaceUnIndents() { return SendMsg(2263, 0, 0) != 0; } // Sets the time the mouse must sit still to generate a mouse dwell event. void wxScintillaTextCtrl::SetMouseDwellTime(int periodMilliseconds) { SendMsg(2264, periodMilliseconds, 0); } // Retrieve the time the mouse must sit still to generate a mouse dwell event. int wxScintillaTextCtrl::GetMouseDwellTime() { return SendMsg(2265, 0, 0); } // Get position of start of word. int wxScintillaTextCtrl::WordStartPosition(int pos, bool onlyWordCharacters) { return SendMsg(2266, pos, onlyWordCharacters); } // Get position of end of word. int wxScintillaTextCtrl::WordEndPosition(int pos, bool onlyWordCharacters) { return SendMsg(2267, pos, onlyWordCharacters); } // Sets whether text is word wrapped. void wxScintillaTextCtrl::SetWrapMode(int mode) { SendMsg(2268, mode, 0); } // Retrieve whether text is word wrapped. int wxScintillaTextCtrl::GetWrapMode() { return SendMsg(2269, 0, 0); } // Set the display mode of visual flags for wrapped lines. void wxScintillaTextCtrl::SetWrapVisualFlags(int wrapVisualFlags) { SendMsg(2460, wrapVisualFlags, 0); } // Retrive the display mode of visual flags for wrapped lines. int wxScintillaTextCtrl::GetWrapVisualFlags() { return SendMsg(2461, 0, 0); } // Set the location of visual flags for wrapped lines. void wxScintillaTextCtrl::SetWrapVisualFlagsLocation(int wrapVisualFlagsLocation) { SendMsg(2462, wrapVisualFlagsLocation, 0); } // Retrive the location of visual flags for wrapped lines. int wxScintillaTextCtrl::GetWrapVisualFlagsLocation() { return SendMsg(2463, 0, 0); } // Set the start indent for wrapped lines. void wxScintillaTextCtrl::SetWrapStartIndent(int indent) { SendMsg(2464, indent, 0); } // Retrive the start indent for wrapped lines. int wxScintillaTextCtrl::GetWrapStartIndent() { return SendMsg(2465, 0, 0); } // Sets how wrapped sublines are placed. Default is fixed. void wxScintillaTextCtrl::SetWrapIndentMode(int mode) { SendMsg(2472, mode, 0); } // Retrieve how wrapped sublines are placed. Default is fixed. int wxScintillaTextCtrl::GetWrapIndentMode() { return SendMsg(2473, 0, 0); } // Sets the degree of caching of layout information. void wxScintillaTextCtrl::SetLayoutCache(int mode) { SendMsg(2272, mode, 0); } // Retrieve the degree of caching of layout information. int wxScintillaTextCtrl::GetLayoutCache() { return SendMsg(2273, 0, 0); } // Sets the document width assumed for scrolling. void wxScintillaTextCtrl::SetScrollWidth(int pixelWidth) { SendMsg(2274, pixelWidth, 0); } // Retrieve the document width assumed for scrolling. int wxScintillaTextCtrl::GetScrollWidth() { return SendMsg(2275, 0, 0); } // Sets whether the maximum width line displayed is used to set scroll width. void wxScintillaTextCtrl::SetScrollWidthTracking(bool tracking) { SendMsg(2516, tracking, 0); } // Retrieve whether the scroll width tracks wide lines. bool wxScintillaTextCtrl::GetScrollWidthTracking() { return SendMsg(2517, 0, 0) != 0; } // Measure the pixel width of some text in a particular style. // NUL terminated text argument. // Does not handle tab or control characters. int wxScintillaTextCtrl::TextWidth(int style, const wxString& text) { return SendMsg(2276, style, (sptr_t)(const char*)wx2stc(text)); } // Sets the scroll range so that maximum scroll position has // the last line at the bottom of the view (default). // Setting this to false allows scrolling one page below the last line. void wxScintillaTextCtrl::SetEndAtLastLine(bool endAtLastLine) { SendMsg(2277, endAtLastLine, 0); } // Retrieve whether the maximum scroll position has the last // line at the bottom of the view. bool wxScintillaTextCtrl::GetEndAtLastLine() { return SendMsg(2278, 0, 0) != 0; } // Retrieve the height of a particular line of text in pixels. int wxScintillaTextCtrl::TextHeight(int line) { return SendMsg(2279, line, 0); } // Show or hide the vertical scroll bar. void wxScintillaTextCtrl::SetUseVerticalScrollBar(bool show) { SendMsg(2280, show, 0); } // Is the vertical scroll bar visible? bool wxScintillaTextCtrl::GetUseVerticalScrollBar() { return SendMsg(2281, 0, 0) != 0; } // Append a string to the end of the document without changing the selection. void wxScintillaTextCtrl::AppendText(const wxString& text) { wxWX2MBbuf buf = (wxWX2MBbuf)wx2stc(text); SendMsg(2282, strlen(buf), (sptr_t)(const char*)buf); } // Is drawing done in two phases with backgrounds drawn before foregrounds? bool wxScintillaTextCtrl::GetTwoPhaseDraw() { return SendMsg(2283, 0, 0) != 0; } // In twoPhaseDraw mode, drawing is performed in two phases, first the background // and then the foreground. This avoids chopping off characters that overlap the next run. void wxScintillaTextCtrl::SetTwoPhaseDraw(bool twoPhase) { SendMsg(2284, twoPhase, 0); } // Scroll so that a display line is at the top of the display. void wxScintillaTextCtrl::SetFirstVisibleLine(int lineDisplay) { SendMsg(2613, lineDisplay, 0); } // Make the target range start and end be the same as the selection range start and end. void wxScintillaTextCtrl::TargetFromSelection() { SendMsg(2287, 0, 0); } // Join the lines in the target. void wxScintillaTextCtrl::LinesJoin() { SendMsg(2288, 0, 0); } // Split the lines in the target into lines that are less wide than pixelWidth // where possible. void wxScintillaTextCtrl::LinesSplit(int pixelWidth) { SendMsg(2289, pixelWidth, 0); } // Set the colours used as a chequerboard pattern in the fold margin void wxScintillaTextCtrl::SetFoldMarginColour(bool useSetting, const wxColour& back) { SendMsg(2290, useSetting, wxColourAsLong(back)); } void wxScintillaTextCtrl::SetFoldMarginHiColour(bool useSetting, const wxColour& fore) { SendMsg(2291, useSetting, wxColourAsLong(fore)); } // Move caret down one line. void wxScintillaTextCtrl::LineDown() { SendMsg(2300, 0, 0); } // Move caret down one line extending selection to new caret position. void wxScintillaTextCtrl::LineDownExtend() { SendMsg(2301, 0, 0); } // Move caret up one line. void wxScintillaTextCtrl::LineUp() { SendMsg(2302, 0, 0); } // Move caret up one line extending selection to new caret position. void wxScintillaTextCtrl::LineUpExtend() { SendMsg(2303, 0, 0); } // Move caret left one character. void wxScintillaTextCtrl::CharLeft() { SendMsg(2304, 0, 0); } // Move caret left one character extending selection to new caret position. void wxScintillaTextCtrl::CharLeftExtend() { SendMsg(2305, 0, 0); } // Move caret right one character. void wxScintillaTextCtrl::CharRight() { SendMsg(2306, 0, 0); } // Move caret right one character extending selection to new caret position. void wxScintillaTextCtrl::CharRightExtend() { SendMsg(2307, 0, 0); } // Move caret left one word. void wxScintillaTextCtrl::WordLeft() { SendMsg(2308, 0, 0); } // Move caret left one word extending selection to new caret position. void wxScintillaTextCtrl::WordLeftExtend() { SendMsg(2309, 0, 0); } // Move caret right one word. void wxScintillaTextCtrl::WordRight() { SendMsg(2310, 0, 0); } // Move caret right one word extending selection to new caret position. void wxScintillaTextCtrl::WordRightExtend() { SendMsg(2311, 0, 0); } // Move caret to first position on line. void wxScintillaTextCtrl::Home() { SendMsg(2312, 0, 0); } // Move caret to first position on line extending selection to new caret position. void wxScintillaTextCtrl::HomeExtend() { SendMsg(2313, 0, 0); } // Move caret to last position on line. void wxScintillaTextCtrl::LineEnd() { SendMsg(2314, 0, 0); } // Move caret to last position on line extending selection to new caret position. void wxScintillaTextCtrl::LineEndExtend() { SendMsg(2315, 0, 0); } // Move caret to first position in document. void wxScintillaTextCtrl::DocumentStart() { SendMsg(2316, 0, 0); } // Move caret to first position in document extending selection to new caret position. void wxScintillaTextCtrl::DocumentStartExtend() { SendMsg(2317, 0, 0); } // Move caret to last position in document. void wxScintillaTextCtrl::DocumentEnd() { SendMsg(2318, 0, 0); } // Move caret to last position in document extending selection to new caret position. void wxScintillaTextCtrl::DocumentEndExtend() { SendMsg(2319, 0, 0); } // Move caret one page up. void wxScintillaTextCtrl::PageUp() { SendMsg(2320, 0, 0); } // Move caret one page up extending selection to new caret position. void wxScintillaTextCtrl::PageUpExtend() { SendMsg(2321, 0, 0); } // Move caret one page down. void wxScintillaTextCtrl::PageDown() { SendMsg(2322, 0, 0); } // Move caret one page down extending selection to new caret position. void wxScintillaTextCtrl::PageDownExtend() { SendMsg(2323, 0, 0); } // Switch from insert to overtype mode or the reverse. void wxScintillaTextCtrl::EditToggleOvertype() { SendMsg(2324, 0, 0); } // Cancel any modes such as call tip or auto-completion list display. void wxScintillaTextCtrl::Cancel() { SendMsg(2325, 0, 0); } // Delete the selection or if no selection, the character before the caret. void wxScintillaTextCtrl::DeleteBack() { SendMsg(2326, 0, 0); } // If selection is empty or all on one line replace the selection with a tab character. // If more than one line selected, indent the lines. void wxScintillaTextCtrl::Tab() { SendMsg(2327, 0, 0); } // Dedent the selected lines. void wxScintillaTextCtrl::BackTab() { SendMsg(2328, 0, 0); } // Insert a new line, may use a CRLF, CR or LF depending on EOL mode. void wxScintillaTextCtrl::NewLine() { SendMsg(2329, 0, 0); } // Insert a Form Feed character. void wxScintillaTextCtrl::FormFeed() { SendMsg(2330, 0, 0); } // Move caret to before first visible character on line. // If already there move to first character on line. void wxScintillaTextCtrl::VCHome() { SendMsg(2331, 0, 0); } // Like VCHome but extending selection to new caret position. void wxScintillaTextCtrl::VCHomeExtend() { SendMsg(2332, 0, 0); } // Magnify the displayed text by increasing the sizes by 1 point. void wxScintillaTextCtrl::ZoomIn() { SendMsg(2333, 0, 0); } // Make the displayed text smaller by decreasing the sizes by 1 point. void wxScintillaTextCtrl::ZoomOut() { SendMsg(2334, 0, 0); } // Delete the word to the left of the caret. void wxScintillaTextCtrl::DelWordLeft() { SendMsg(2335, 0, 0); } // Delete the word to the right of the caret. void wxScintillaTextCtrl::DelWordRight() { SendMsg(2336, 0, 0); } // Delete the word to the right of the caret, but not the trailing non-word characters. void wxScintillaTextCtrl::DelWordRightEnd() { SendMsg(2518, 0, 0); } // Cut the line containing the caret. void wxScintillaTextCtrl::LineCut() { SendMsg(2337, 0, 0); } // Delete the line containing the caret. void wxScintillaTextCtrl::LineDelete() { SendMsg(2338, 0, 0); } // Switch the current line with the previous. void wxScintillaTextCtrl::LineTranspose() { SendMsg(2339, 0, 0); } // Duplicate the current line. void wxScintillaTextCtrl::LineDuplicate() { SendMsg(2404, 0, 0); } // Transform the selection to lower case. void wxScintillaTextCtrl::LowerCase() { SendMsg(2340, 0, 0); } // Transform the selection to upper case. void wxScintillaTextCtrl::UpperCase() { SendMsg(2341, 0, 0); } // Scroll the document down, keeping the caret visible. void wxScintillaTextCtrl::LineScrollDown() { SendMsg(2342, 0, 0); } // Scroll the document up, keeping the caret visible. void wxScintillaTextCtrl::LineScrollUp() { SendMsg(2343, 0, 0); } // Delete the selection or if no selection, the character before the caret. // Will not delete the character before at the start of a line. void wxScintillaTextCtrl::DeleteBackNotLine() { SendMsg(2344, 0, 0); } // Move caret to first position on display line. void wxScintillaTextCtrl::HomeDisplay() { SendMsg(2345, 0, 0); } // Move caret to first position on display line extending selection to // new caret position. void wxScintillaTextCtrl::HomeDisplayExtend() { SendMsg(2346, 0, 0); } // Move caret to last position on display line. void wxScintillaTextCtrl::LineEndDisplay() { SendMsg(2347, 0, 0); } // Move caret to last position on display line extending selection to new // caret position. void wxScintillaTextCtrl::LineEndDisplayExtend() { SendMsg(2348, 0, 0); } // These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)? // except they behave differently when word-wrap is enabled: // They go first to the start / end of the display line, like (Home|LineEnd)Display // The difference is that, the cursor is already at the point, it goes on to the start // or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?. void wxScintillaTextCtrl::HomeWrap() { SendMsg(2349, 0, 0); } void wxScintillaTextCtrl::HomeWrapExtend() { SendMsg(2450, 0, 0); } void wxScintillaTextCtrl::LineEndWrap() { SendMsg(2451, 0, 0); } void wxScintillaTextCtrl::LineEndWrapExtend() { SendMsg(2452, 0, 0); } void wxScintillaTextCtrl::VCHomeWrap() { SendMsg(2453, 0, 0); } void wxScintillaTextCtrl::VCHomeWrapExtend() { SendMsg(2454, 0, 0); } // Copy the line containing the caret. void wxScintillaTextCtrl::LineCopy() { SendMsg(2455, 0, 0); } // Move the caret inside current view if it's not there already. void wxScintillaTextCtrl::MoveCaretInsideView() { SendMsg(2401, 0, 0); } // How many characters are on a line, including end of line characters? int wxScintillaTextCtrl::LineLength(int line) { return SendMsg(2350, line, 0); } // Highlight the characters at two positions. void wxScintillaTextCtrl::BraceHighlight(int pos1, int pos2) { SendMsg(2351, pos1, pos2); } // Highlight the character at a position indicating there is no matching brace. void wxScintillaTextCtrl::BraceBadLight(int pos) { SendMsg(2352, pos, 0); } // Find the position of a matching brace or INVALID_POSITION if no match. int wxScintillaTextCtrl::BraceMatch(int pos) { return SendMsg(2353, pos, 0); } // Are the end of line characters visible? bool wxScintillaTextCtrl::GetViewEOL() { return SendMsg(2355, 0, 0) != 0; } // Make the end of line characters visible or invisible. void wxScintillaTextCtrl::SetViewEOL(bool visible) { SendMsg(2356, visible, 0); } // Retrieve a pointer to the document object. void* wxScintillaTextCtrl::GetDocPointer() { return (void*)SendMsg(2357); } // Change the document object used. void wxScintillaTextCtrl::SetDocPointer(void* docPointer) { SendMsg(2358, 0, (sptr_t)docPointer); } // Set which document modification events are sent to the container. void wxScintillaTextCtrl::SetModEventMask(int mask) { SendMsg(2359, mask, 0); } // Retrieve the column number which text should be kept within. int wxScintillaTextCtrl::GetEdgeColumn() { return SendMsg(2360, 0, 0); } // Set the column number of the edge. // If text goes past the edge then it is highlighted. void wxScintillaTextCtrl::SetEdgeColumn(int column) { SendMsg(2361, column, 0); } // Retrieve the edge highlight mode. int wxScintillaTextCtrl::GetEdgeMode() { return SendMsg(2362, 0, 0); } // The edge may be displayed by a line (EDGE_LINE) or by highlighting text that // goes beyond it (EDGE_BACKGROUND) or not displayed at all (EDGE_NONE). void wxScintillaTextCtrl::SetEdgeMode(int mode) { SendMsg(2363, mode, 0); } // Retrieve the colour used in edge indication. wxColour wxScintillaTextCtrl::GetEdgeColour() { long c = SendMsg(2364, 0, 0); return wxColourFromLong(c); } // Change the colour used in edge indication. void wxScintillaTextCtrl::SetEdgeColour(const wxColour& edgeColour) { SendMsg(2365, wxColourAsLong(edgeColour), 0); } // Sets the current caret position to be the search anchor. void wxScintillaTextCtrl::SearchAnchor() { SendMsg(2366, 0, 0); } // Find some text starting at the search anchor. // Does not ensure the selection is visible. int wxScintillaTextCtrl::SearchNext(int flags, const wxString& text) { return SendMsg(2367, flags, (sptr_t)(const char*)wx2stc(text)); } // Find some text starting at the search anchor and moving backwards. // Does not ensure the selection is visible. int wxScintillaTextCtrl::SearchPrev(int flags, const wxString& text) { return SendMsg(2368, flags, (sptr_t)(const char*)wx2stc(text)); } // Retrieves the number of lines completely visible. int wxScintillaTextCtrl::LinesOnScreen() { return SendMsg(2370, 0, 0); } // Set whether a pop up menu is displayed automatically when the user presses // the wrong mouse button. void wxScintillaTextCtrl::UsePopUp(bool allowPopUp) { SendMsg(2371, allowPopUp, 0); } // Is the selection rectangular? The alternative is the more common stream selection. bool wxScintillaTextCtrl::SelectionIsRectangle() { return SendMsg(2372, 0, 0) != 0; } // Set the zoom level. This number of points is added to the size of all fonts. // It may be positive to magnify or negative to reduce. void wxScintillaTextCtrl::SetZoom(int zoom) { SendMsg(2373, zoom, 0); } // Retrieve the zoom level. int wxScintillaTextCtrl::GetZoom() { return SendMsg(2374, 0, 0); } // Create a new document object. // Starts with reference count of 1 and not selected into editor. void* wxScintillaTextCtrl::CreateDocument() { return (void*)SendMsg(2375); } // Extend life of document. void wxScintillaTextCtrl::AddRefDocument(void* docPointer) { SendMsg(2376, 0, (sptr_t)docPointer); } // Release a reference to the document, deleting document if it fades to black. void wxScintillaTextCtrl::ReleaseDocument(void* docPointer) { SendMsg(2377, 0, (sptr_t)docPointer); } // Get which document modification events are sent to the container. int wxScintillaTextCtrl::GetModEventMask() { return SendMsg(2378, 0, 0); } // Change internal focus flag. void wxScintillaTextCtrl::SetSTCFocus(bool focus) { SendMsg(2380, focus, 0); } // Get internal focus flag. bool wxScintillaTextCtrl::GetSTCFocus() { return SendMsg(2381, 0, 0) != 0; } // Change error status - 0 = OK. void wxScintillaTextCtrl::SetStatus(int statusCode) { SendMsg(2382, statusCode, 0); } // Get error status. int wxScintillaTextCtrl::GetStatus() { return SendMsg(2383, 0, 0); } // Set whether the mouse is captured when its button is pressed. void wxScintillaTextCtrl::SetMouseDownCaptures(bool captures) { SendMsg(2384, captures, 0); } // Get whether mouse gets captured. bool wxScintillaTextCtrl::GetMouseDownCaptures() { return SendMsg(2385, 0, 0) != 0; } // Sets the cursor to one of the SC_CURSOR* values. void wxScintillaTextCtrl::SetSTCCursor(int cursorType) { SendMsg(2386, cursorType, 0); } // Get cursor type. int wxScintillaTextCtrl::GetSTCCursor() { return SendMsg(2387, 0, 0); } // Change the way control characters are displayed: // If symbol is < 32, keep the drawn way, else, use the given character. void wxScintillaTextCtrl::SetControlCharSymbol(int symbol) { SendMsg(2388, symbol, 0); } // Get the way control characters are displayed. int wxScintillaTextCtrl::GetControlCharSymbol() { return SendMsg(2389, 0, 0); } // Move to the previous change in capitalisation. void wxScintillaTextCtrl::WordPartLeft() { SendMsg(2390, 0, 0); } // Move to the previous change in capitalisation extending selection // to new caret position. void wxScintillaTextCtrl::WordPartLeftExtend() { SendMsg(2391, 0, 0); } // Move to the change next in capitalisation. void wxScintillaTextCtrl::WordPartRight() { SendMsg(2392, 0, 0); } // Move to the next change in capitalisation extending selection // to new caret position. void wxScintillaTextCtrl::WordPartRightExtend() { SendMsg(2393, 0, 0); } // Set the way the display area is determined when a particular line // is to be moved to by Find, FindNext, GotoLine, etc. void wxScintillaTextCtrl::SetVisiblePolicy(int visiblePolicy, int visibleSlop) { SendMsg(2394, visiblePolicy, visibleSlop); } // Delete back from the current position to the start of the line. void wxScintillaTextCtrl::DelLineLeft() { SendMsg(2395, 0, 0); } // Delete forwards from the current position to the end of the line. void wxScintillaTextCtrl::DelLineRight() { SendMsg(2396, 0, 0); } // Get and Set the xOffset (ie, horizonal scroll position). void wxScintillaTextCtrl::SetXOffset(int newOffset) { SendMsg(2397, newOffset, 0); } int wxScintillaTextCtrl::GetXOffset() { return SendMsg(2398, 0, 0); } // Set the last x chosen value to be the caret x position. void wxScintillaTextCtrl::ChooseCaretX() { SendMsg(2399, 0, 0); } // Set the way the caret is kept visible when going sideway. // The exclusion zone is given in pixels. void wxScintillaTextCtrl::SetXCaretPolicy(int caretPolicy, int caretSlop) { SendMsg(2402, caretPolicy, caretSlop); } // Set the way the line the caret is on is kept visible. // The exclusion zone is given in lines. void wxScintillaTextCtrl::SetYCaretPolicy(int caretPolicy, int caretSlop) { SendMsg(2403, caretPolicy, caretSlop); } // Set printing to line wrapped (SC_WRAP_WORD) or not line wrapped (SC_WRAP_NONE). void wxScintillaTextCtrl::SetPrintWrapMode(int mode) { SendMsg(2406, mode, 0); } // Is printing line wrapped? int wxScintillaTextCtrl::GetPrintWrapMode() { return SendMsg(2407, 0, 0); } // Set a fore colour for active hotspots. void wxScintillaTextCtrl::SetHotspotActiveForeground(bool useSetting, const wxColour& fore) { SendMsg(2410, useSetting, wxColourAsLong(fore)); } // Get the fore colour for active hotspots. wxColour wxScintillaTextCtrl::GetHotspotActiveForeground() { long c = SendMsg(2494, 0, 0); return wxColourFromLong(c); } // Set a back colour for active hotspots. void wxScintillaTextCtrl::SetHotspotActiveBackground(bool useSetting, const wxColour& back) { SendMsg(2411, useSetting, wxColourAsLong(back)); } // Get the back colour for active hotspots. wxColour wxScintillaTextCtrl::GetHotspotActiveBackground() { long c = SendMsg(2495, 0, 0); return wxColourFromLong(c); } // Enable / Disable underlining active hotspots. void wxScintillaTextCtrl::SetHotspotActiveUnderline(bool underline) { SendMsg(2412, underline, 0); } // Get whether underlining for active hotspots. bool wxScintillaTextCtrl::GetHotspotActiveUnderline() { return SendMsg(2496, 0, 0) != 0; } // Limit hotspots to single line so hotspots on two lines don't merge. void wxScintillaTextCtrl::SetHotspotSingleLine(bool singleLine) { SendMsg(2421, singleLine, 0); } // Get the HotspotSingleLine property bool wxScintillaTextCtrl::GetHotspotSingleLine() { return SendMsg(2497, 0, 0) != 0; } // Move caret between paragraphs (delimited by empty lines). void wxScintillaTextCtrl::ParaDown() { SendMsg(2413, 0, 0); } void wxScintillaTextCtrl::ParaDownExtend() { SendMsg(2414, 0, 0); } void wxScintillaTextCtrl::ParaUp() { SendMsg(2415, 0, 0); } void wxScintillaTextCtrl::ParaUpExtend() { SendMsg(2416, 0, 0); } // Given a valid document position, return the previous position taking code // page into account. Returns 0 if passed 0. int wxScintillaTextCtrl::PositionBefore(int pos) { return SendMsg(2417, pos, 0); } // Given a valid document position, return the next position taking code // page into account. Maximum value returned is the last position in the document. int wxScintillaTextCtrl::PositionAfter(int pos) { return SendMsg(2418, pos, 0); } // Copy a range of text to the clipboard. Positions are clipped into the document. void wxScintillaTextCtrl::CopyRange(int start, int end) { SendMsg(2419, start, end); } // Copy argument text to the clipboard. void wxScintillaTextCtrl::CopyText(int length, const wxString& text) { SendMsg(2420, length, (sptr_t)(const char*)wx2stc(text)); } // Set the selection mode to stream (SC_SEL_STREAM) or rectangular (SC_SEL_RECTANGLE/SC_SEL_THIN) or // by lines (SC_SEL_LINES). void wxScintillaTextCtrl::SetSelectionMode(int mode) { SendMsg(2422, mode, 0); } // Get the mode of the current selection. int wxScintillaTextCtrl::GetSelectionMode() { return SendMsg(2423, 0, 0); } // Retrieve the position of the start of the selection at the given line (INVALID_POSITION if no selection on this line). int wxScintillaTextCtrl::GetLineSelStartPosition(int line) { return SendMsg(2424, line, 0); } // Retrieve the position of the end of the selection at the given line (INVALID_POSITION if no selection on this line). int wxScintillaTextCtrl::GetLineSelEndPosition(int line) { return SendMsg(2425, line, 0); } // Move caret down one line, extending rectangular selection to new caret position. void wxScintillaTextCtrl::LineDownRectExtend() { SendMsg(2426, 0, 0); } // Move caret up one line, extending rectangular selection to new caret position. void wxScintillaTextCtrl::LineUpRectExtend() { SendMsg(2427, 0, 0); } // Move caret left one character, extending rectangular selection to new caret position. void wxScintillaTextCtrl::CharLeftRectExtend() { SendMsg(2428, 0, 0); } // Move caret right one character, extending rectangular selection to new caret position. void wxScintillaTextCtrl::CharRightRectExtend() { SendMsg(2429, 0, 0); } // Move caret to first position on line, extending rectangular selection to new caret position. void wxScintillaTextCtrl::HomeRectExtend() { SendMsg(2430, 0, 0); } // Move caret to before first visible character on line. // If already there move to first character on line. // In either case, extend rectangular selection to new caret position. void wxScintillaTextCtrl::VCHomeRectExtend() { SendMsg(2431, 0, 0); } // Move caret to last position on line, extending rectangular selection to new caret position. void wxScintillaTextCtrl::LineEndRectExtend() { SendMsg(2432, 0, 0); } // Move caret one page up, extending rectangular selection to new caret position. void wxScintillaTextCtrl::PageUpRectExtend() { SendMsg(2433, 0, 0); } // Move caret one page down, extending rectangular selection to new caret position. void wxScintillaTextCtrl::PageDownRectExtend() { SendMsg(2434, 0, 0); } // Move caret to top of page, or one page up if already at top of page. void wxScintillaTextCtrl::StutteredPageUp() { SendMsg(2435, 0, 0); } // Move caret to top of page, or one page up if already at top of page, extending selection to new caret position. void wxScintillaTextCtrl::StutteredPageUpExtend() { SendMsg(2436, 0, 0); } // Move caret to bottom of page, or one page down if already at bottom of page. void wxScintillaTextCtrl::StutteredPageDown() { SendMsg(2437, 0, 0); } // Move caret to bottom of page, or one page down if already at bottom of page, extending selection to new caret position. void wxScintillaTextCtrl::StutteredPageDownExtend() { SendMsg(2438, 0, 0); } // Move caret left one word, position cursor at end of word. void wxScintillaTextCtrl::WordLeftEnd() { SendMsg(2439, 0, 0); } // Move caret left one word, position cursor at end of word, extending selection to new caret position. void wxScintillaTextCtrl::WordLeftEndExtend() { SendMsg(2440, 0, 0); } // Move caret right one word, position cursor at end of word. void wxScintillaTextCtrl::WordRightEnd() { SendMsg(2441, 0, 0); } // Move caret right one word, position cursor at end of word, extending selection to new caret position. void wxScintillaTextCtrl::WordRightEndExtend() { SendMsg(2442, 0, 0); } // Set the set of characters making up whitespace for when moving or selecting by word. // Should be called after SetWordChars. void wxScintillaTextCtrl::SetWhitespaceChars(const wxString& characters) { SendMsg(2443, 0, (sptr_t)(const char*)wx2stc(characters)); } // Reset the set of characters for whitespace and word characters to the defaults. void wxScintillaTextCtrl::SetCharsDefault() { SendMsg(2444, 0, 0); } // Get currently selected item position in the auto-completion list int wxScintillaTextCtrl::AutoCompGetCurrent() { return SendMsg(2445, 0, 0); } // Enlarge the document to a particular size of text bytes. void wxScintillaTextCtrl::Allocate(int bytes) { SendMsg(2446, bytes, 0); } // Find the position of a column on a line taking into account tabs and // multi-byte characters. If beyond end of line, return line end position. int wxScintillaTextCtrl::FindColumn(int line, int column) { return SendMsg(2456, line, column); } // Can the caret preferred x position only be changed by explicit movement commands? bool wxScintillaTextCtrl::GetCaretSticky() { return SendMsg(2457, 0, 0) != 0; } // Stop the caret preferred x position changing when the user types. void wxScintillaTextCtrl::SetCaretSticky(bool useCaretStickyBehaviour) { SendMsg(2458, useCaretStickyBehaviour, 0); } // Switch between sticky and non-sticky: meant to be bound to a key. void wxScintillaTextCtrl::ToggleCaretSticky() { SendMsg(2459, 0, 0); } // Enable/Disable convert-on-paste for line endings void wxScintillaTextCtrl::SetPasteConvertEndings(bool convert) { SendMsg(2467, convert, 0); } // Get convert-on-paste setting bool wxScintillaTextCtrl::GetPasteConvertEndings() { return SendMsg(2468, 0, 0) != 0; } // Duplicate the selection. If selection empty duplicate the line containing the caret. void wxScintillaTextCtrl::SelectionDuplicate() { SendMsg(2469, 0, 0); } // Set background alpha of the caret line. void wxScintillaTextCtrl::SetCaretLineBackAlpha(int alpha) { SendMsg(2470, alpha, 0); } // Get the background alpha of the caret line. int wxScintillaTextCtrl::GetCaretLineBackAlpha() { return SendMsg(2471, 0, 0); } // Set the style of the caret to be drawn. void wxScintillaTextCtrl::SetCaretStyle(int caretStyle) { SendMsg(2512, caretStyle, 0); } // Returns the current style of the caret. int wxScintillaTextCtrl::GetCaretStyle() { return SendMsg(2513, 0, 0); } // Set the indicator used for IndicatorFillRange and IndicatorClearRange void wxScintillaTextCtrl::SetIndicatorCurrent(int indicator) { SendMsg(2500, indicator, 0); } // Get the current indicator int wxScintillaTextCtrl::GetIndicatorCurrent() { return SendMsg(2501, 0, 0); } // Set the value used for IndicatorFillRange void wxScintillaTextCtrl::SetIndicatorValue(int value) { SendMsg(2502, value, 0); } // Get the current indicator vaue int wxScintillaTextCtrl::GetIndicatorValue() { return SendMsg(2503, 0, 0); } // Turn a indicator on over a range. void wxScintillaTextCtrl::IndicatorFillRange(int position, int fillLength) { SendMsg(2504, position, fillLength); } // Turn a indicator off over a range. void wxScintillaTextCtrl::IndicatorClearRange(int position, int clearLength) { SendMsg(2505, position, clearLength); } // Are any indicators present at position? int wxScintillaTextCtrl::IndicatorAllOnFor(int position) { return SendMsg(2506, position, 0); } // What value does a particular indicator have at at a position? int wxScintillaTextCtrl::IndicatorValueAt(int indicator, int position) { return SendMsg(2507, indicator, position); } // Where does a particular indicator start? int wxScintillaTextCtrl::IndicatorStart(int indicator, int position) { return SendMsg(2508, indicator, position); } // Where does a particular indicator end? int wxScintillaTextCtrl::IndicatorEnd(int indicator, int position) { return SendMsg(2509, indicator, position); } // Set number of entries in position cache void wxScintillaTextCtrl::SetPositionCacheSize(int size) { SendMsg(2514, size, 0); } // How many entries are allocated to the position cache? int wxScintillaTextCtrl::GetPositionCacheSize() { return SendMsg(2515, 0, 0); } // Copy the selection, if selection empty copy the line with the caret void wxScintillaTextCtrl::CopyAllowLine() { SendMsg(2519, 0, 0); } // Compact the document buffer and return a read-only pointer to the // characters in the document. const char* wxScintillaTextCtrl::GetCharacterPointer() { return (const char*)SendMsg(2520, 0, 0); } // Always interpret keyboard input as Unicode void wxScintillaTextCtrl::SetKeysUnicode(bool keysUnicode) { SendMsg(2521, keysUnicode, 0); } // Are keys always interpreted as Unicode? bool wxScintillaTextCtrl::GetKeysUnicode() { return SendMsg(2522, 0, 0) != 0; } // Set the alpha fill colour of the given indicator. void wxScintillaTextCtrl::IndicatorSetAlpha(int indicator, int alpha) { SendMsg(2523, indicator, alpha); } // Get the alpha fill colour of the given indicator. int wxScintillaTextCtrl::IndicatorGetAlpha(int indicator) { return SendMsg(2524, indicator, 0); } // Set extra ascent for each line void wxScintillaTextCtrl::SetExtraAscent(int extraAscent) { SendMsg(2525, extraAscent, 0); } // Get extra ascent for each line int wxScintillaTextCtrl::GetExtraAscent() { return SendMsg(2526, 0, 0); } // Set extra descent for each line void wxScintillaTextCtrl::SetExtraDescent(int extraDescent) { SendMsg(2527, extraDescent, 0); } // Get extra descent for each line int wxScintillaTextCtrl::GetExtraDescent() { return SendMsg(2528, 0, 0); } // Which symbol was defined for markerNumber with MarkerDefine int wxScintillaTextCtrl::GetMarkerSymbolDefined(int markerNumber) { return SendMsg(2529, markerNumber, 0); } // Set the text in the text margin for a line void wxScintillaTextCtrl::MarginSetText(int line, const wxString& text) { SendMsg(2530, line, (sptr_t)(const char*)wx2stc(text)); } // Get the text in the text margin for a line wxString wxScintillaTextCtrl::MarginGetText(int line) { long msg = 2531; long len = SendMsg(msg, line, 0); wxMemoryBuffer mbuf(len+1); char* buf = (char*)mbuf.GetWriteBuf(len+1); SendMsg(msg, line, (sptr_t)buf); mbuf.UngetWriteBuf(len); mbuf.AppendByte(0); return stc2wx(buf); } // Set the style number for the text margin for a line void wxScintillaTextCtrl::MarginSetStyle(int line, int style) { SendMsg(2532, line, style); } // Get the style number for the text margin for a line int wxScintillaTextCtrl::MarginGetStyle(int line) { return SendMsg(2533, line, 0); } // Set the style in the text margin for a line void wxScintillaTextCtrl::MarginSetStyles(int line, const wxString& styles) { SendMsg(2534, line, (sptr_t)(const char*)wx2stc(styles)); } // Get the styles in the text margin for a line wxString wxScintillaTextCtrl::MarginGetStyles(int line) { long msg = 2535; long len = SendMsg(msg, line, 0); wxMemoryBuffer mbuf(len+1); char* buf = (char*)mbuf.GetWriteBuf(len+1); SendMsg(msg, line, (sptr_t)buf); mbuf.UngetWriteBuf(len); mbuf.AppendByte(0); return stc2wx(buf); } // Clear the margin text on all lines void wxScintillaTextCtrl::MarginTextClearAll() { SendMsg(2536, 0, 0); } // Get the start of the range of style numbers used for margin text void wxScintillaTextCtrl::MarginSetStyleOffset(int style) { SendMsg(2537, style, 0); } // Get the start of the range of style numbers used for margin text int wxScintillaTextCtrl::MarginGetStyleOffset() { return SendMsg(2538, 0, 0); } // Set the annotation text for a line void wxScintillaTextCtrl::AnnotationSetText(int line, const wxString& text) { SendMsg(2540, line, (sptr_t)(const char*)wx2stc(text)); } // Get the annotation text for a line wxString wxScintillaTextCtrl::AnnotationGetText(int line) { long msg = 2541; long len = SendMsg(msg, line, 0); wxMemoryBuffer mbuf(len+1); char* buf = (char*)mbuf.GetWriteBuf(len+1); SendMsg(msg, line, (sptr_t)buf); mbuf.UngetWriteBuf(len); mbuf.AppendByte(0); return stc2wx(buf); } // Set the style number for the annotations for a line void wxScintillaTextCtrl::AnnotationSetStyle(int line, int style) { SendMsg(2542, line, style); } // Get the style number for the annotations for a line int wxScintillaTextCtrl::AnnotationGetStyle(int line) { return SendMsg(2543, line, 0); } // Set the annotation styles for a line void wxScintillaTextCtrl::AnnotationSetStyles(int line, const wxString& styles) { SendMsg(2544, line, (sptr_t)(const char*)wx2stc(styles)); } // Get the annotation styles for a line wxString wxScintillaTextCtrl::AnnotationGetStyles(int line) { long msg = 2545; long len = SendMsg(msg, line, 0); wxMemoryBuffer mbuf(len+1); char* buf = (char*)mbuf.GetWriteBuf(len+1); SendMsg(msg, line, (sptr_t)buf); mbuf.UngetWriteBuf(len); mbuf.AppendByte(0); return stc2wx(buf); } // Get the number of annotation lines for a line int wxScintillaTextCtrl::AnnotationGetLines(int line) { return SendMsg(2546, line, 0); } // Clear the annotations from all lines void wxScintillaTextCtrl::AnnotationClearAll() { SendMsg(2547, 0, 0); } // Set the visibility for the annotations for a view void wxScintillaTextCtrl::AnnotationSetVisible(int visible) { SendMsg(2548, visible, 0); } // Get the visibility for the annotations for a view int wxScintillaTextCtrl::AnnotationGetVisible() { return SendMsg(2549, 0, 0); } // Get the start of the range of style numbers used for annotations void wxScintillaTextCtrl::AnnotationSetStyleOffset(int style) { SendMsg(2550, style, 0); } // Get the start of the range of style numbers used for annotations int wxScintillaTextCtrl::AnnotationGetStyleOffset() { return SendMsg(2551, 0, 0); } // Add a container action to the undo stack void wxScintillaTextCtrl::AddUndoAction(int token, int flags) { SendMsg(2560, token, flags); } // Find the position of a character from a point within the window. int wxScintillaTextCtrl::CharPositionFromPoint(int x, int y) { return SendMsg(2561, x, y); } // Find the position of a character from a point within the window. // Return INVALID_POSITION if not close to text. int wxScintillaTextCtrl::CharPositionFromPointClose(int x, int y) { return SendMsg(2562, x, y); } // Set whether multiple selections can be made void wxScintillaTextCtrl::SetMultipleSelection(bool multipleSelection) { SendMsg(2563, multipleSelection, 0); } // Whether multiple selections can be made bool wxScintillaTextCtrl::GetMultipleSelection() { return SendMsg(2564, 0, 0) != 0; } // Set whether typing can be performed into multiple selections void wxScintillaTextCtrl::SetAdditionalSelectionTyping(bool additionalSelectionTyping) { SendMsg(2565, additionalSelectionTyping, 0); } // Whether typing can be performed into multiple selections bool wxScintillaTextCtrl::GetAdditionalSelectionTyping() { return SendMsg(2566, 0, 0) != 0; } // Set whether additional carets will blink void wxScintillaTextCtrl::SetAdditionalCaretsBlink(bool additionalCaretsBlink) { SendMsg(2567, additionalCaretsBlink, 0); } // Whether additional carets will blink bool wxScintillaTextCtrl::GetAdditionalCaretsBlink() { return SendMsg(2568, 0, 0) != 0; } // Set whether additional carets are visible void wxScintillaTextCtrl::SetAdditionalCaretsVisible(bool additionalCaretsBlink) { SendMsg(2608, additionalCaretsBlink, 0); } // Whether additional carets are visible bool wxScintillaTextCtrl::GetAdditionalCaretsVisible() { return SendMsg(2609, 0, 0) != 0; } // How many selections are there? int wxScintillaTextCtrl::GetSelections() { return SendMsg(2570, 0, 0); } // Clear selections to a single empty stream selection void wxScintillaTextCtrl::ClearSelections() { SendMsg(2571, 0, 0); } // Add a selection int wxScintillaTextCtrl::AddSelection(int caret, int anchor) { return SendMsg(2573, caret, anchor); } // Set the main selection void wxScintillaTextCtrl::SetMainSelection(int selection) { SendMsg(2574, selection, 0); } // Which selection is the main selection int wxScintillaTextCtrl::GetMainSelection() { return SendMsg(2575, 0, 0); } void wxScintillaTextCtrl::SetSelectionNCaret(int selection, int pos) { SendMsg(2576, selection, pos); } int wxScintillaTextCtrl::GetSelectionNCaret(int selection) { return SendMsg(2577, selection, 0); } void wxScintillaTextCtrl::SetSelectionNAnchor(int selection, int posAnchor) { SendMsg(2578, selection, posAnchor); } int wxScintillaTextCtrl::GetSelectionNAnchor(int selection) { return SendMsg(2579, selection, 0); } void wxScintillaTextCtrl::SetSelectionNCaretVirtualSpace(int selection, int space) { SendMsg(2580, selection, space); } int wxScintillaTextCtrl::GetSelectionNCaretVirtualSpace(int selection) { return SendMsg(2581, selection, 0); } void wxScintillaTextCtrl::SetSelectionNAnchorVirtualSpace(int selection, int space) { SendMsg(2582, selection, space); } int wxScintillaTextCtrl::GetSelectionNAnchorVirtualSpace(int selection) { return SendMsg(2583, selection, 0); } // Sets the position that starts the selection - this becomes the anchor. void wxScintillaTextCtrl::SetSelectionNStart(int selection, int pos) { SendMsg(2584, selection, pos); } // Returns the position at the start of the selection. int wxScintillaTextCtrl::GetSelectionNStart(int selection) { return SendMsg(2585, selection, 0); } // Sets the position that ends the selection - this becomes the currentPosition. void wxScintillaTextCtrl::SetSelectionNEnd(int selection, int pos) { SendMsg(2586, selection, pos); } // Returns the position at the end of the selection. int wxScintillaTextCtrl::GetSelectionNEnd(int selection) { return SendMsg(2587, selection, 0); } void wxScintillaTextCtrl::SetRectangularSelectionCaret(int pos) { SendMsg(2588, pos, 0); } int wxScintillaTextCtrl::GetRectangularSelectionCaret() { return SendMsg(2589, 0, 0); } void wxScintillaTextCtrl::SetRectangularSelectionAnchor(int posAnchor) { SendMsg(2590, posAnchor, 0); } int wxScintillaTextCtrl::GetRectangularSelectionAnchor() { return SendMsg(2591, 0, 0); } void wxScintillaTextCtrl::SetRectangularSelectionCaretVirtualSpace(int space) { SendMsg(2592, space, 0); } int wxScintillaTextCtrl::GetRectangularSelectionCaretVirtualSpace() { return SendMsg(2593, 0, 0); } void wxScintillaTextCtrl::SetRectangularSelectionAnchorVirtualSpace(int space) { SendMsg(2594, space, 0); } int wxScintillaTextCtrl::GetRectangularSelectionAnchorVirtualSpace() { return SendMsg(2595, 0, 0); } void wxScintillaTextCtrl::SetVirtualSpaceOptions(int virtualSpaceOptions) { SendMsg(2596, virtualSpaceOptions, 0); } int wxScintillaTextCtrl::GetVirtualSpaceOptions() { return SendMsg(2597, 0, 0); } // On GTK+, allow selecting the modifier key to use for mouse-based // rectangular selection. Often the window manager requires Alt+Mouse Drag // for moving windows. // Valid values are SCMOD_CTRL(default), SCMOD_ALT, or SCMOD_SUPER. void wxScintillaTextCtrl::SetRectangularSelectionModifier(int modifier) { SendMsg(2598, modifier, 0); } // Get the modifier key used for rectangular selection. int wxScintillaTextCtrl::GetRectangularSelectionModifier() { return SendMsg(2599, 0, 0); } // Set the foreground colour of additional selections. // Must have previously called SetSelFore with non-zero first argument for this to have an effect. void wxScintillaTextCtrl::SetAdditionalSelForeground(const wxColour& fore) { SendMsg(2600, wxColourAsLong(fore), 0); } // Set the background colour of additional selections. // Must have previously called SetSelBack with non-zero first argument for this to have an effect. void wxScintillaTextCtrl::SetAdditionalSelBackground(const wxColour& back) { SendMsg(2601, wxColourAsLong(back), 0); } // Set the alpha of the selection. void wxScintillaTextCtrl::SetAdditionalSelAlpha(int alpha) { SendMsg(2602, alpha, 0); } // Get the alpha of the selection. int wxScintillaTextCtrl::GetAdditionalSelAlpha() { return SendMsg(2603, 0, 0); } // Set the foreground colour of additional carets. void wxScintillaTextCtrl::SetAdditionalCaretForeground(const wxColour& fore) { SendMsg(2604, wxColourAsLong(fore), 0); } // Get the foreground colour of additional carets. wxColour wxScintillaTextCtrl::GetAdditionalCaretForeground() { long c = SendMsg(2605, 0, 0); return wxColourFromLong(c); } // Set the main selection to the next selection. void wxScintillaTextCtrl::RotateSelection() { SendMsg(2606, 0, 0); } // Swap that caret and anchor of the main selection. void wxScintillaTextCtrl::SwapMainAnchorCaret() { SendMsg(2607, 0, 0); } // Start notifying the container of all key presses and commands. void wxScintillaTextCtrl::StartRecord() { SendMsg(3001, 0, 0); } // Stop notifying the container of all key presses and commands. void wxScintillaTextCtrl::StopRecord() { SendMsg(3002, 0, 0); } // Set the lexing language of the document. void wxScintillaTextCtrl::SetLexer(int lexer) { SendMsg(4001, lexer, 0); } // Retrieve the lexing language of the document. int wxScintillaTextCtrl::GetLexer() { return SendMsg(4002, 0, 0); } // Colourise a segment of the document using the current lexing language. void wxScintillaTextCtrl::Colourise(int start, int end) { SendMsg(4003, start, end); } // Set up a value that may be used by a lexer for some optional feature. void wxScintillaTextCtrl::SetProperty(const wxString& key, const wxString& value) { SendMsg(4004, (sptr_t)(const char*)wx2stc(key), (sptr_t)(const char*)wx2stc(value)); } // Set up the key words used by the lexer. void wxScintillaTextCtrl::SetKeyWords(int keywordSet, const wxString& keyWords) { SendMsg(4005, keywordSet, (sptr_t)(const char*)wx2stc(keyWords)); } // Set the lexing language of the document based on string name. void wxScintillaTextCtrl::SetLexerLanguage(const wxString& language) { SendMsg(4006, 0, (sptr_t)(const char*)wx2stc(language)); } // Retrieve a 'property' value previously set with SetProperty. wxString wxScintillaTextCtrl::GetProperty(const wxString& key) { int len = SendMsg(SCI_GETPROPERTY, (sptr_t)(const char*)wx2stc(key), 0); if (!len) return wxEmptyString; wxMemoryBuffer mbuf(len+1); char* buf = (char*)mbuf.GetWriteBuf(len+1); SendMsg(4008, (uptr_t)(const char*)wx2stc(key), (sptr_t)buf); mbuf.UngetWriteBuf(len); mbuf.AppendByte(0); return stc2wx(buf); } // Retrieve a 'property' value previously set with SetProperty, // with '$()' variable replacement on returned buffer. wxString wxScintillaTextCtrl::GetPropertyExpanded(const wxString& key) { int len = SendMsg(SCI_GETPROPERTYEXPANDED, (uptr_t)(const char*)wx2stc(key), 0); if (!len) return wxEmptyString; wxMemoryBuffer mbuf(len+1); char* buf = (char*)mbuf.GetWriteBuf(len+1); SendMsg(4009, (uptr_t)(const char*)wx2stc(key), (sptr_t)buf); mbuf.UngetWriteBuf(len); mbuf.AppendByte(0); return stc2wx(buf); } // Retrieve a 'property' value previously set with SetProperty, // interpreted as an int AFTER any '$()' variable replacement. int wxScintillaTextCtrl::GetPropertyInt(const wxString& key) { return SendMsg(4010, (sptr_t)(const char*)wx2stc(key), 0); } // Retrieve the number of bits the current lexer needs for styling. int wxScintillaTextCtrl::GetStyleBitsNeeded() { return SendMsg(4011, 0, 0); } //}}} //---------------------------------------------------------------------- // Returns the line number of the line with the caret. int wxScintillaTextCtrl::GetCurrentLine() { int line = LineFromPosition(GetCurrentPos()); return line; } // Extract style settings from a spec-string which is composed of one or // more of the following comma separated elements: // // bold turns on bold // italic turns on italics // fore:[name or #RRGGBB] sets the foreground colour // back:[name or #RRGGBB] sets the background colour // face:[facename] sets the font face name to use // size:[num] sets the font size in points // eol turns on eol filling // underline turns on underlining // void wxScintillaTextCtrl::StyleSetSpec(int styleNum, const wxString& spec) { wxStringTokenizer tkz(spec, wxT(",")); while (tkz.HasMoreTokens()) { wxString token = tkz.GetNextToken(); wxString option = token.BeforeFirst(':'); wxString val = token.AfterFirst(':'); if (option == wxT("bold")) StyleSetBold(styleNum, true); else if (option == wxT("italic")) StyleSetItalic(styleNum, true); else if (option == wxT("underline")) StyleSetUnderline(styleNum, true); else if (option == wxT("eol")) StyleSetEOLFilled(styleNum, true); else if (option == wxT("size")) { long points; if (val.ToLong(&points)) StyleSetSize(styleNum, points); } else if (option == wxT("face")) StyleSetFaceName(styleNum, val); else if (option == wxT("fore")) StyleSetForeground(styleNum, wxColourFromSpec(val)); else if (option == wxT("back")) StyleSetBackground(styleNum, wxColourFromSpec(val)); } } // Get the font of a style wxFont wxScintillaTextCtrl::StyleGetFont(int style) { wxFont font; font.SetPointSize(StyleGetSize(style)); font.SetFaceName(StyleGetFaceName(style)); if( StyleGetBold(style) ) font.SetWeight(wxFONTWEIGHT_BOLD); else font.SetWeight(wxFONTWEIGHT_NORMAL); if( StyleGetItalic(style) ) font.SetStyle(wxFONTSTYLE_ITALIC); else font.SetStyle(wxFONTSTYLE_NORMAL); return font; } // Set style size, face, bold, italic, and underline attributes from // a wxFont's attributes. void wxScintillaTextCtrl::StyleSetFont(int styleNum, wxFont& font) { #ifdef __WXGTK__ // Ensure that the native font is initialized int x, y; GetTextExtent(wxT("X"), &x, &y, NULL, NULL, &font); #endif int size = font.GetPointSize(); wxString faceName = font.GetFaceName(); bool bold = font.GetWeight() == wxBOLD; bool italic = font.GetStyle() != wxNORMAL; bool under = font.GetUnderlined(); wxFontEncoding encoding = font.GetEncoding(); StyleSetFontAttr(styleNum, size, faceName, bold, italic, under, encoding); } // Set all font style attributes at once. void wxScintillaTextCtrl::StyleSetFontAttr(int styleNum, int size, const wxString& faceName, bool bold, bool italic, bool underline, wxFontEncoding encoding) { StyleSetSize(styleNum, size); StyleSetFaceName(styleNum, faceName); StyleSetBold(styleNum, bold); StyleSetItalic(styleNum, italic); StyleSetUnderline(styleNum, underline); StyleSetFontEncoding(styleNum, encoding); } // Set the character set of the font in a style. Converts the Scintilla // character set values to a wxFontEncoding. void wxScintillaTextCtrl::StyleSetCharacterSet(int style, int characterSet) { wxFontEncoding encoding; // Translate the Scintilla characterSet to a wxFontEncoding switch (characterSet) { default: case wxSTC_CHARSET_ANSI: case wxSTC_CHARSET_DEFAULT: encoding = wxFONTENCODING_DEFAULT; break; case wxSTC_CHARSET_BALTIC: encoding = wxFONTENCODING_ISO8859_13; break; case wxSTC_CHARSET_CHINESEBIG5: encoding = wxFONTENCODING_CP950; break; case wxSTC_CHARSET_EASTEUROPE: encoding = wxFONTENCODING_ISO8859_2; break; case wxSTC_CHARSET_GB2312: encoding = wxFONTENCODING_CP936; break; case wxSTC_CHARSET_GREEK: encoding = wxFONTENCODING_ISO8859_7; break; case wxSTC_CHARSET_HANGUL: encoding = wxFONTENCODING_CP949; break; case wxSTC_CHARSET_MAC: encoding = wxFONTENCODING_DEFAULT; break; case wxSTC_CHARSET_OEM: encoding = wxFONTENCODING_DEFAULT; break; case wxSTC_CHARSET_RUSSIAN: encoding = wxFONTENCODING_KOI8; break; case wxSTC_CHARSET_SHIFTJIS: encoding = wxFONTENCODING_CP932; break; case wxSTC_CHARSET_SYMBOL: encoding = wxFONTENCODING_DEFAULT; break; case wxSTC_CHARSET_TURKISH: encoding = wxFONTENCODING_ISO8859_9; break; case wxSTC_CHARSET_JOHAB: encoding = wxFONTENCODING_DEFAULT; break; case wxSTC_CHARSET_HEBREW: encoding = wxFONTENCODING_ISO8859_8; break; case wxSTC_CHARSET_ARABIC: encoding = wxFONTENCODING_ISO8859_6; break; case wxSTC_CHARSET_VIETNAMESE: encoding = wxFONTENCODING_DEFAULT; break; case wxSTC_CHARSET_THAI: encoding = wxFONTENCODING_ISO8859_11; break; case wxSTC_CHARSET_CYRILLIC: encoding = wxFONTENCODING_ISO8859_5; break; case wxSTC_CHARSET_8859_15: encoding = wxFONTENCODING_ISO8859_15;; break; } // We just have Scintilla track the wxFontEncoding for us. It gets used // in Font::Create in PlatWX.cpp. We add one to the value so that the // effective wxFONENCODING_DEFAULT == SC_SHARSET_DEFAULT and so when // Scintilla internally uses SC_CHARSET_DEFAULT we will translate it back // to wxFONENCODING_DEFAULT in Font::Create. SendMsg(SCI_STYLESETCHARACTERSET, style, encoding+1); } // Set the font encoding to be used by a style. void wxScintillaTextCtrl::StyleSetFontEncoding(int style, wxFontEncoding encoding) { SendMsg(SCI_STYLESETCHARACTERSET, style, encoding+1); } // Set the left and right margin in the edit area, measured in pixels. void wxScintillaTextCtrl::SetMargins(int left, int right) { SetMarginLeft(left); SetMarginRight(right); } // Retrieve the point in the window where a position is displayed. wxPoint wxScintillaTextCtrl::PointFromPosition(int pos) { int x = SendMsg(SCI_POINTXFROMPOSITION, 0, pos); int y = SendMsg(SCI_POINTYFROMPOSITION, 0, pos); return wxPoint(x, y); } // Remove any selection and sets the caret at position. The caret is not scrolled into view. void wxScintillaTextCtrl::SetEmptySelection(int pos) { SendMsg(SCI_SETEMPTYSELECTION, 0, pos); } // Scroll enough to make the given line visible void wxScintillaTextCtrl::ScrollToLine(int line) { m_swx->DoScrollToLine(line); } // Scroll enough to make the given column visible void wxScintillaTextCtrl::ScrollToColumn(int column) { m_swx->DoScrollToColumn(column); } bool wxScintillaTextCtrl::SaveFile(const wxString& filename) { #if wxUSE_FFILE wxFFile file(filename, wxT("w")); bool ok = file.IsOpened() && file.Write(GetText(), *wxConvCurrent); #else bool ok = false; #endif // wxUSE_FFILE if (ok) { SetSavePoint(); } return ok; } bool wxScintillaTextCtrl::LoadFile(const wxString& filename) { #if wxUSE_FFILE wxFFile file(filename); bool ok = file.IsOpened(); if (ok) { wxString text; ok = file.ReadAll(&text, *wxConvCurrent); if (ok) { SetText(text); } } #else bool ok = false; #endif // wxUSE_FFILE if (ok) { EmptyUndoBuffer(); SetSavePoint(); } return ok; } #if wxUSE_DRAG_AND_DROP wxDragResult wxScintillaTextCtrl::DoDragOver(wxCoord x, wxCoord y, wxDragResult def) { return m_swx->DoDragOver(x, y, def); } bool wxScintillaTextCtrl::DoDropText(long x, long y, const wxString& data) { return m_swx->DoDropText(x, y, data); } #endif void wxScintillaTextCtrl::SetUseAntiAliasing(bool useAA) { m_swx->SetUseAntiAliasing(useAA); } bool wxScintillaTextCtrl::GetUseAntiAliasing() { return m_swx->GetUseAntiAliasing(); } void wxScintillaTextCtrl::AddTextRaw(const char* text) { SendMsg(SCI_ADDTEXT, strlen(text), (sptr_t)text); } void wxScintillaTextCtrl::InsertTextRaw(int pos, const char* text) { SendMsg(SCI_INSERTTEXT, pos, (sptr_t)text); } wxCharBuffer wxScintillaTextCtrl::GetCurLineRaw(int* linePos) { int len = LineLength(GetCurrentLine()); if (!len) { if (linePos) *linePos = 0; wxCharBuffer empty; return empty; } wxCharBuffer buf(len); int pos = SendMsg(SCI_GETCURLINE, len, (sptr_t)buf.data()); if (linePos) *linePos = pos; return buf; } wxCharBuffer wxScintillaTextCtrl::GetLineRaw(int line) { int len = LineLength(line); if (!len) { wxCharBuffer empty; return empty; } wxCharBuffer buf(len); SendMsg(SCI_GETLINE, line, (sptr_t)buf.data()); return buf; } wxCharBuffer wxScintillaTextCtrl::GetSelectedTextRaw() { long start; long end; GetSelection(&start, &end); int len = end - start; if (!len) { wxCharBuffer empty; return empty; } wxCharBuffer buf(len); SendMsg(SCI_GETSELTEXT, 0, (sptr_t)buf.data()); return buf; } wxCharBuffer wxScintillaTextCtrl::GetTextRangeRaw(int startPos, int endPos) { if (endPos < startPos) { int temp = startPos; startPos = endPos; endPos = temp; } int len = endPos - startPos; if (!len) { wxCharBuffer empty; return empty; } wxCharBuffer buf(len); TextRange tr; tr.lpstrText = buf.data(); tr.chrg.cpMin = startPos; tr.chrg.cpMax = endPos; SendMsg(SCI_GETTEXTRANGE, 0, (sptr_t)&tr); return buf; } void wxScintillaTextCtrl::SetTextRaw(const char* text) { SendMsg(SCI_SETTEXT, 0, (sptr_t)text); } wxCharBuffer wxScintillaTextCtrl::GetTextRaw() { int len = GetTextLength(); wxCharBuffer buf(len); // adds 1 for NUL automatically SendMsg(SCI_GETTEXT, len + 1, (sptr_t)buf.data()); return buf; } void wxScintillaTextCtrl::AppendTextRaw(const char* text) { SendMsg(SCI_APPENDTEXT, strlen(text), (sptr_t)text); } //---------------------------------------------------------------------- // Event handlers void wxScintillaTextCtrl::OnPaint(wxPaintEvent& WXUNUSED(evt)) { wxPaintDC dc(this); m_swx->DoPaint(&dc, GetUpdateRegion().GetBox()); } void wxScintillaTextCtrl::OnScrollWin(wxScrollWinEvent& evt) { if (evt.GetOrientation() == wxHORIZONTAL) m_swx->DoHScroll(evt.GetEventType(), evt.GetPosition()); else m_swx->DoVScroll(evt.GetEventType(), evt.GetPosition()); } void wxScintillaTextCtrl::OnScroll(wxScrollEvent& evt) { wxScrollBar* sb = wxDynamicCast(evt.GetEventObject(), wxScrollBar); if (sb) { if (sb->IsVertical()) m_swx->DoVScroll(evt.GetEventType(), evt.GetPosition()); else m_swx->DoHScroll(evt.GetEventType(), evt.GetPosition()); } } void wxScintillaTextCtrl::OnSize(wxSizeEvent& WXUNUSED(evt)) { if (m_swx) { wxSize sz = GetClientSize(); m_swx->DoSize(sz.x, sz.y); } } void wxScintillaTextCtrl::OnMouseLeftDown(wxMouseEvent& evt) { SetFocus(); wxPoint pt = evt.GetPosition(); m_swx->DoLeftButtonDown(Point(pt.x, pt.y), m_stopWatch.Time(), evt.ShiftDown(), evt.ControlDown(), evt.AltDown()); } void wxScintillaTextCtrl::OnMouseMove(wxMouseEvent& evt) { wxPoint pt = evt.GetPosition(); m_swx->DoLeftButtonMove(Point(pt.x, pt.y)); } void wxScintillaTextCtrl::OnMouseLeftUp(wxMouseEvent& evt) { wxPoint pt = evt.GetPosition(); m_swx->DoLeftButtonUp(Point(pt.x, pt.y), m_stopWatch.Time(), evt.ControlDown()); } void wxScintillaTextCtrl::OnMouseRightUp(wxMouseEvent& evt) { wxPoint pt = evt.GetPosition(); m_swx->DoContextMenu(Point(pt.x, pt.y)); } void wxScintillaTextCtrl::OnMouseMiddleUp(wxMouseEvent& evt) { wxPoint pt = evt.GetPosition(); m_swx->DoMiddleButtonUp(Point(pt.x, pt.y)); } void wxScintillaTextCtrl::OnContextMenu(wxContextMenuEvent& evt) { wxPoint pt = evt.GetPosition(); ScreenToClient(&pt.x, &pt.y); /* Show context menu at event point if it's within the window, or at caret location if not */ wxHitTest ht = this->HitTest(pt); if (ht != wxHT_WINDOW_INSIDE) { pt = this->PointFromPosition(this->GetCurrentPos()); } m_swx->DoContextMenu(Point(pt.x, pt.y)); } void wxScintillaTextCtrl::OnMouseWheel(wxMouseEvent& evt) { // prevent having an event queue with wheel events that cannot be processed // reasonably fast (see ticket #9057) if ( m_lastWheelTimestamp <= evt.GetTimestamp() ) { m_lastWheelTimestamp = m_stopWatch.Time(); m_swx->DoMouseWheel(evt.GetWheelRotation(), evt.GetWheelDelta(), evt.GetLinesPerAction(), evt.ControlDown(), evt.IsPageScroll()); m_lastWheelTimestamp = m_stopWatch.Time() - m_lastWheelTimestamp; m_lastWheelTimestamp += evt.GetTimestamp(); } } void wxScintillaTextCtrl::OnChar(wxKeyEvent& evt) { // On (some?) non-US PC keyboards the AltGr key is required to enter some // common characters. It comes to us as both Alt and Ctrl down so we need // to let the char through in that case, otherwise if only ctrl or only // alt let's skip it. bool ctrl = evt.ControlDown(); #ifdef __WXMAC__ // On the Mac the Alt key is just a modifier key (like Shift) so we need // to allow the char events to be processed when Alt is pressed. // TODO: Should we check MetaDown instead in this case? bool alt = false; #else bool alt = evt.AltDown(); #endif bool skip = ((ctrl || alt) && ! (ctrl && alt)); #if wxUSE_UNICODE // apparently if we don't do this, Unicode keys pressed after non-char // ASCII ones (e.g. Enter, Tab) are not taken into account (patch 1615989) if (m_lastKeyDownConsumed && evt.GetUnicodeKey() > 255) m_lastKeyDownConsumed = false; #endif if (!m_lastKeyDownConsumed && !skip) { #if wxUSE_UNICODE int key = evt.GetUnicodeKey(); bool keyOk = true; // if the unicode key code is not really a unicode character (it may // be a function key or etc., the platforms appear to always give us a // small value in this case) then fallback to the ascii key code but // don't do anything for function keys or etc. if (key <= 127) { key = evt.GetKeyCode(); keyOk = (key <= 127); } if (keyOk) { m_swx->DoAddChar(key); return; } #else int key = evt.GetKeyCode(); if (key <= WXK_START || key > WXK_COMMAND) { m_swx->DoAddChar(key); return; } #endif } evt.Skip(); } void wxScintillaTextCtrl::OnKeyDown(wxKeyEvent& evt) { int processed = m_swx->DoKeyDown(evt, &m_lastKeyDownConsumed); if (!processed && !m_lastKeyDownConsumed) evt.Skip(); } void wxScintillaTextCtrl::OnLoseFocus(wxFocusEvent& evt) { m_swx->DoLoseFocus(); evt.Skip(); } void wxScintillaTextCtrl::OnGainFocus(wxFocusEvent& evt) { m_swx->DoGainFocus(); evt.Skip(); } void wxScintillaTextCtrl::OnSysColourChanged(wxSysColourChangedEvent& WXUNUSED(evt)) { m_swx->DoSysColourChange(); } void wxScintillaTextCtrl::OnEraseBackground(wxEraseEvent& WXUNUSED(evt)) { // do nothing to help avoid flashing } void wxScintillaTextCtrl::OnMenu(wxCommandEvent& evt) { m_swx->DoCommand(evt.GetId()); } void wxScintillaTextCtrl::OnListBox(wxCommandEvent& WXUNUSED(evt)) { m_swx->DoOnListBox(); } void wxScintillaTextCtrl::OnIdle(wxIdleEvent& evt) { m_swx->DoOnIdle(evt); } wxSize wxScintillaTextCtrl::DoGetBestSize() { // What would be the best size for a wxSTC? // Just give a reasonable minimum until something else can be figured out. return wxSize(200,100); } //---------------------------------------------------------------------- // Turn notifications from Scintilla into events void wxScintillaTextCtrl::NotifyChange() { wxScintillaTextEvent evt(wxEVT_STC_CHANGE, GetId()); evt.SetEventObject(this); GetEventHandler()->ProcessEvent(evt); } static void SetEventText(wxScintillaTextEvent& evt, const char* text, size_t length) { if(!text) return; evt.SetText(stc2wx(text, length)); } void wxScintillaTextCtrl::NotifyParent(SCNotification* _scn) { SCNotification& scn = *_scn; wxScintillaTextEvent evt(0, GetId()); evt.SetEventObject(this); evt.SetPosition(scn.position); evt.SetKey(scn.ch); evt.SetModifiers(scn.modifiers); switch (scn.nmhdr.code) { case SCN_STYLENEEDED: evt.SetEventType(wxEVT_STC_STYLENEEDED); break; case SCN_CHARADDED: evt.SetEventType(wxEVT_STC_CHARADDED); break; case SCN_SAVEPOINTREACHED: evt.SetEventType(wxEVT_STC_SAVEPOINTREACHED); break; case SCN_SAVEPOINTLEFT: evt.SetEventType(wxEVT_STC_SAVEPOINTLEFT); break; case SCN_MODIFYATTEMPTRO: evt.SetEventType(wxEVT_STC_ROMODIFYATTEMPT); break; case SCN_KEY: evt.SetEventType(wxEVT_STC_KEY); break; case SCN_DOUBLECLICK: evt.SetEventType(wxEVT_STC_DOUBLECLICK); break; case SCN_UPDATEUI: evt.SetEventType(wxEVT_STC_UPDATEUI); break; case SCN_MODIFIED: evt.SetEventType(wxEVT_STC_MODIFIED); evt.SetModificationType(scn.modificationType); SetEventText(evt, scn.text, scn.length); evt.SetLength(scn.length); evt.SetLinesAdded(scn.linesAdded); evt.SetLine(scn.line); evt.SetFoldLevelNow(scn.foldLevelNow); evt.SetFoldLevelPrev(scn.foldLevelPrev); break; case SCN_MACRORECORD: evt.SetEventType(wxEVT_STC_MACRORECORD); evt.SetMessage(scn.message); evt.SetWParam(scn.wParam); evt.SetLParam(scn.lParam); break; case SCN_MARGINCLICK: evt.SetEventType(wxEVT_STC_MARGINCLICK); evt.SetMargin(scn.margin); break; case SCN_NEEDSHOWN: evt.SetEventType(wxEVT_STC_NEEDSHOWN); evt.SetLength(scn.length); break; case SCN_PAINTED: evt.SetEventType(wxEVT_STC_PAINTED); break; case SCN_AUTOCSELECTION: evt.SetEventType(wxEVT_STC_AUTOCOMP_SELECTION); evt.SetListType(scn.listType); SetEventText(evt, scn.text, strlen(scn.text)); evt.SetPosition(scn.lParam); break; case SCN_USERLISTSELECTION: evt.SetEventType(wxEVT_STC_USERLISTSELECTION); evt.SetListType(scn.listType); SetEventText(evt, scn.text, strlen(scn.text)); evt.SetPosition(scn.lParam); break; case SCN_URIDROPPED: evt.SetEventType(wxEVT_STC_URIDROPPED); SetEventText(evt, scn.text, strlen(scn.text)); break; case SCN_DWELLSTART: evt.SetEventType(wxEVT_STC_DWELLSTART); evt.SetX(scn.x); evt.SetY(scn.y); break; case SCN_DWELLEND: evt.SetEventType(wxEVT_STC_DWELLEND); evt.SetX(scn.x); evt.SetY(scn.y); break; case SCN_ZOOM: evt.SetEventType(wxEVT_STC_ZOOM); break; case SCN_HOTSPOTCLICK: evt.SetEventType(wxEVT_STC_HOTSPOT_CLICK); break; case SCN_HOTSPOTDOUBLECLICK: evt.SetEventType(wxEVT_STC_HOTSPOT_DCLICK); break; case SCN_CALLTIPCLICK: evt.SetEventType(wxEVT_STC_CALLTIP_CLICK); break; case SCN_INDICATORCLICK: evt.SetEventType(wxEVT_STC_INDICATOR_CLICK); break; case SCN_INDICATORRELEASE: evt.SetEventType(wxEVT_STC_INDICATOR_RELEASE); break; case SCN_AUTOCCANCELLED: evt.SetEventType(wxEVT_STC_AUTOCOMP_CANCELLED); break; case SCN_AUTOCCHARDELETED: evt.SetEventType(wxEVT_STC_AUTOCOMP_CHAR_DELETED); break; default: return; } GetEventHandler()->ProcessEvent(evt); } //---------------------------------------------------------------------- //---------------------------------------------------------------------- //---------------------------------------------------------------------- wxScintillaTextEvent::wxScintillaTextEvent(wxEventType commandType, int id) : wxCommandEvent(commandType, id) { m_position = 0; m_key = 0; m_modifiers = 0; m_modificationType = 0; m_length = 0; m_linesAdded = 0; m_line = 0; m_foldLevelNow = 0; m_foldLevelPrev = 0; m_margin = 0; m_message = 0; m_wParam = 0; m_lParam = 0; m_listType = 0; m_x = 0; m_y = 0; m_dragAllowMove = false; #if wxUSE_DRAG_AND_DROP m_dragResult = wxDragNone; #endif } bool wxScintillaTextEvent::GetShift() { return (m_modifiers & SCI_SHIFT) != 0; } bool wxScintillaTextEvent::GetControl() { return (m_modifiers & SCI_CTRL) != 0; } bool wxScintillaTextEvent::GetAlt() { return (m_modifiers & SCI_ALT) != 0; } wxScintillaTextEvent::wxScintillaTextEvent(const wxScintillaTextEvent& event): wxCommandEvent(event) { m_position = event.m_position; m_key = event.m_key; m_modifiers = event.m_modifiers; m_modificationType = event.m_modificationType; m_text = event.m_text; m_length = event.m_length; m_linesAdded = event.m_linesAdded; m_line = event.m_line; m_foldLevelNow = event.m_foldLevelNow; m_foldLevelPrev = event.m_foldLevelPrev; m_margin = event.m_margin; m_message = event.m_message; m_wParam = event.m_wParam; m_lParam = event.m_lParam; m_listType = event.m_listType; m_x = event.m_x; m_y = event.m_y; m_dragText = event.m_dragText; m_dragAllowMove =event.m_dragAllowMove; #if wxUSE_DRAG_AND_DROP m_dragResult = event.m_dragResult; #endif } //---------------------------------------------------------------------- //---------------------------------------------------------------------- Wx-Scintilla-0.38/wx-scintilla/src/scintilla000755001750001750 011727344243 21451 5ustar00azawawiazawawi000000000000Wx-Scintilla-0.38/wx-scintilla/src/scintilla/License.txt000444001750001750 154411727344243 23735 0ustar00azawawiazawawi000000000000License for Scintilla and SciTE Copyright 1998-2003 by Neil Hodgson All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. NEIL HODGSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NEIL HODGSON BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Wx-Scintilla-0.38/wx-scintilla/src/scintilla/README.txt000444001750001750 142011727344243 23301 0ustar00azawawiazawawi000000000000This folder contains copies of the scintilla/src, scintilla/lexers and scintilla/include folders from the Scintilla source distribution. The source distribution is located in http://prdownloads.sourceforge.net/scintilla/scite304.zip?download Please note that 'scintilla/lexers' is currently copied into the scintilla/src folder. Unneeded *.py was removed. Why? We love Python :) Unneeded *.properties files are also removed. We also have the experimental LexPerl6.cxx and a modified scintilla/src/SciLexer.h to include the Perl 6 syntax highlighter (i.e. lexer). Once it is stable, we will push it upstream again. wxWidgets-specific code to embed Scintilla as a wxWidgets editor component is located in the parent folder. The current version of the Scintilla code is 3.0.2.Wx-Scintilla-0.38/wx-scintilla/src/scintilla/include000755001750001750 011727344243 23074 5ustar00azawawiazawawi000000000000Wx-Scintilla-0.38/wx-scintilla/src/scintilla/include/Platform.h000444001750001750 3414211727344243 25212 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file Platform.h ** Interface to platform facilities. Also includes some basic utilities. ** Implemented in PlatGTK.cxx for GTK+/Linux, PlatWin.cxx for Windows, and PlatWX.cxx for wxWindows. **/ // Copyright 1998-2009 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #ifndef PLATFORM_H #define PLATFORM_H // PLAT_GTK = GTK+ on Linux or Win32 // PLAT_GTK_WIN32 is defined additionally when running PLAT_GTK under Win32 // PLAT_WIN = Win32 API on Win32 OS // PLAT_WX is wxWindows on any supported platform #define PLAT_GTK 0 #define PLAT_GTK_WIN32 0 #define PLAT_GTK_MACOSX 0 #define PLAT_MACOSX 0 #define PLAT_WIN 0 #define PLAT_WX 0 #define PLAT_FOX 0 #if defined(FOX) #undef PLAT_FOX #define PLAT_FOX 1 #elif defined(__WX__) #undef PLAT_WX #define PLAT_WX 1 #elif defined(GTK) #undef PLAT_GTK #define PLAT_GTK 1 #if defined(__WIN32__) || defined(_MSC_VER) #undef PLAT_GTK_WIN32 #define PLAT_GTK_WIN32 1 #endif #if defined(__APPLE__) #undef PLAT_GTK_MACOSX #define PLAT_GTK_MACOSX 1 #endif #elif defined(__APPLE__) #undef PLAT_MACOSX #define PLAT_MACOSX 1 #else #undef PLAT_WIN #define PLAT_WIN 1 #endif #ifdef SCI_NAMESPACE namespace Scintilla { #endif typedef float XYPOSITION; typedef double XYACCUMULATOR; //#define XYPOSITION int // Underlying the implementation of the platform classes are platform specific types. // Sometimes these need to be passed around by client code so they are defined here typedef void *FontID; typedef void *SurfaceID; typedef void *WindowID; typedef void *MenuID; typedef void *TickerID; typedef void *Function; typedef void *IdlerID; /** * A geometric point class. * Point is exactly the same as the Win32 POINT and GTK+ GdkPoint so can be used interchangeably. */ class Point { public: XYPOSITION x; XYPOSITION y; explicit Point(XYPOSITION x_=0, XYPOSITION y_=0) : x(x_), y(y_) { } // Other automatically defined methods (assignment, copy constructor, destructor) are fine static Point FromLong(long lpoint); }; /** * A geometric rectangle class. * PRectangle is exactly the same as the Win32 RECT so can be used interchangeably. * PRectangles contain their top and left sides, but not their right and bottom sides. */ class PRectangle { public: XYPOSITION left; XYPOSITION top; XYPOSITION right; XYPOSITION bottom; PRectangle(XYPOSITION left_=0, XYPOSITION top_=0, XYPOSITION right_=0, XYPOSITION bottom_ = 0) : left(left_), top(top_), right(right_), bottom(bottom_) { } // Other automatically defined methods (assignment, copy constructor, destructor) are fine bool operator==(PRectangle &rc) { return (rc.left == left) && (rc.right == right) && (rc.top == top) && (rc.bottom == bottom); } bool Contains(Point pt) { return (pt.x >= left) && (pt.x <= right) && (pt.y >= top) && (pt.y <= bottom); } bool Contains(PRectangle rc) { return (rc.left >= left) && (rc.right <= right) && (rc.top >= top) && (rc.bottom <= bottom); } bool Intersects(PRectangle other) { return (right > other.left) && (left < other.right) && (bottom > other.top) && (top < other.bottom); } void Move(XYPOSITION xDelta, XYPOSITION yDelta) { left += xDelta; top += yDelta; right += xDelta; bottom += yDelta; } XYPOSITION Width() { return right - left; } XYPOSITION Height() { return bottom - top; } bool Empty() { return (Height() <= 0) || (Width() <= 0); } }; /** * Holds a desired RGB colour. */ class ColourDesired { long co; public: ColourDesired(long lcol=0) { co = lcol; } ColourDesired(unsigned int red, unsigned int green, unsigned int blue) { Set(red, green, blue); } bool operator==(const ColourDesired &other) const { return co == other.co; } void Set(long lcol) { co = lcol; } void Set(unsigned int red, unsigned int green, unsigned int blue) { co = red | (green << 8) | (blue << 16); } static inline unsigned int ValueOfHex(const char ch) { if (ch >= '0' && ch <= '9') return ch - '0'; else if (ch >= 'A' && ch <= 'F') return ch - 'A' + 10; else if (ch >= 'a' && ch <= 'f') return ch - 'a' + 10; else return 0; } void Set(const char *val) { if (*val == '#') { val++; } unsigned int r = ValueOfHex(val[0]) * 16 + ValueOfHex(val[1]); unsigned int g = ValueOfHex(val[2]) * 16 + ValueOfHex(val[3]); unsigned int b = ValueOfHex(val[4]) * 16 + ValueOfHex(val[5]); Set(r, g, b); } long AsLong() const { return co; } unsigned int GetRed() { return co & 0xff; } unsigned int GetGreen() { return (co >> 8) & 0xff; } unsigned int GetBlue() { return (co >> 16) & 0xff; } }; /** * Font management. */ struct FontParameters { const char *faceName; float size; int weight; bool italic; int extraFontFlag; int technology; int characterSet; FontParameters( const char *faceName_, float size_=10, int weight_=400, bool italic_=false, int extraFontFlag_=0, int technology_=0, int characterSet_=0) : faceName(faceName_), size(size_), weight(weight_), italic(italic_), extraFontFlag(extraFontFlag_), technology(technology_), characterSet(characterSet_) { } }; class Font { protected: FontID fid; #if PLAT_WX int ascent; #endif // Private so Font objects can not be copied Font(const Font &); Font &operator=(const Font &); public: Font(); virtual ~Font(); virtual void Create(const FontParameters &fp); virtual void Release(); FontID GetID() { return fid; } // Alias another font - caller guarantees not to Release void SetID(FontID fid_) { fid = fid_; } #if PLAT_WX void SetAscent(int ascent_) { ascent = ascent_; } #endif friend class Surface; friend class SurfaceImpl; }; /** * A surface abstracts a place to draw. */ class Surface { private: // Private so Surface objects can not be copied Surface(const Surface &) {} Surface &operator=(const Surface &) { return *this; } public: Surface() {} virtual ~Surface() {} static Surface *Allocate(int technology); virtual void Init(WindowID wid)=0; virtual void Init(SurfaceID sid, WindowID wid)=0; virtual void InitPixMap(int width, int height, Surface *surface_, WindowID wid)=0; virtual void Release()=0; virtual bool Initialised()=0; virtual void PenColour(ColourDesired fore)=0; virtual int LogPixelsY()=0; virtual int DeviceHeightFont(int points)=0; virtual void MoveTo(int x_, int y_)=0; virtual void LineTo(int x_, int y_)=0; virtual void Polygon(Point *pts, int npts, ColourDesired fore, ColourDesired back)=0; virtual void RectangleDraw(PRectangle rc, ColourDesired fore, ColourDesired back)=0; virtual void FillRectangle(PRectangle rc, ColourDesired back)=0; virtual void FillRectangle(PRectangle rc, Surface &surfacePattern)=0; virtual void RoundedRectangle(PRectangle rc, ColourDesired fore, ColourDesired back)=0; virtual void AlphaRectangle(PRectangle rc, int cornerSize, ColourDesired fill, int alphaFill, ColourDesired outline, int alphaOutline, int flags)=0; virtual void DrawRGBAImage(PRectangle rc, int width, int height, const unsigned char *pixelsImage) = 0; virtual void Ellipse(PRectangle rc, ColourDesired fore, ColourDesired back)=0; virtual void Copy(PRectangle rc, Point from, Surface &surfaceSource)=0; virtual void DrawTextNoClip(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore, ColourDesired back)=0; virtual void DrawTextClipped(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore, ColourDesired back)=0; virtual void DrawTextTransparent(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore)=0; virtual void MeasureWidths(Font &font_, const char *s, int len, XYPOSITION *positions)=0; virtual XYPOSITION WidthText(Font &font_, const char *s, int len)=0; virtual XYPOSITION WidthChar(Font &font_, char ch)=0; virtual XYPOSITION Ascent(Font &font_)=0; virtual XYPOSITION Descent(Font &font_)=0; virtual XYPOSITION InternalLeading(Font &font_)=0; virtual XYPOSITION ExternalLeading(Font &font_)=0; virtual XYPOSITION Height(Font &font_)=0; virtual XYPOSITION AverageCharWidth(Font &font_)=0; virtual void SetClip(PRectangle rc)=0; virtual void FlushCachedState()=0; virtual void SetUnicodeMode(bool unicodeMode_)=0; virtual void SetDBCSMode(int codePage)=0; }; /** * A simple callback action passing one piece of untyped user data. */ typedef void (*CallBackAction)(void*); /** * Class to hide the details of window manipulation. * Does not own the window which will normally have a longer life than this object. */ class Window { protected: WindowID wid; #if PLAT_MACOSX void *windowRef; void *control; #endif public: Window() : wid(0), cursorLast(cursorInvalid) { #if PLAT_MACOSX windowRef = 0; control = 0; #endif } Window(const Window &source) : wid(source.wid), cursorLast(cursorInvalid) { #if PLAT_MACOSX windowRef = 0; control = 0; #endif } virtual ~Window(); Window &operator=(WindowID wid_) { wid = wid_; return *this; } WindowID GetID() const { return wid; } bool Created() const { return wid != 0; } void Destroy(); bool HasFocus(); PRectangle GetPosition(); void SetPosition(PRectangle rc); void SetPositionRelative(PRectangle rc, Window relativeTo); PRectangle GetClientPosition(); void Show(bool show=true); void InvalidateAll(); void InvalidateRectangle(PRectangle rc); virtual void SetFont(Font &font); enum Cursor { cursorInvalid, cursorText, cursorArrow, cursorUp, cursorWait, cursorHoriz, cursorVert, cursorReverseArrow, cursorHand }; void SetCursor(Cursor curs); void SetTitle(const char *s); PRectangle GetMonitorRect(Point pt); #if PLAT_MACOSX void SetWindow(void *ref) { windowRef = ref; } void SetControl(void *_control) { control = _control; } #endif private: Cursor cursorLast; }; /** * Listbox management. */ class ListBox : public Window { public: ListBox(); virtual ~ListBox(); static ListBox *Allocate(); virtual void SetFont(Font &font)=0; virtual void Create(Window &parent, int ctrlID, Point location, int lineHeight_, bool unicodeMode_, int technology_)=0; virtual void SetAverageCharWidth(int width)=0; virtual void SetVisibleRows(int rows)=0; virtual int GetVisibleRows() const=0; virtual PRectangle GetDesiredRect()=0; virtual int CaretFromEdge()=0; virtual void Clear()=0; virtual void Append(char *s, int type = -1)=0; virtual int Length()=0; virtual void Select(int n)=0; virtual int GetSelection()=0; virtual int Find(const char *prefix)=0; virtual void GetValue(int n, char *value, int len)=0; virtual void RegisterImage(int type, const char *xpm_data)=0; virtual void RegisterRGBAImage(int type, int width, int height, const unsigned char *pixelsImage) = 0; virtual void ClearRegisteredImages()=0; virtual void SetDoubleClickAction(CallBackAction, void *)=0; virtual void SetList(const char* list, char separator, char typesep)=0; }; /** * Menu management. */ class Menu { MenuID mid; public: Menu(); MenuID GetID() { return mid; } void CreatePopUp(); void Destroy(); void Show(Point pt, Window &w); }; class ElapsedTime { long bigBit; long littleBit; public: ElapsedTime(); double Duration(bool reset=false); }; /** * Dynamic Library (DLL/SO/...) loading */ class DynamicLibrary { public: virtual ~DynamicLibrary() {} /// @return Pointer to function "name", or NULL on failure. virtual Function FindFunction(const char *name) = 0; /// @return true if the library was loaded successfully. virtual bool IsValid() = 0; /// @return An instance of a DynamicLibrary subclass with "modulePath" loaded. static DynamicLibrary *Load(const char *modulePath); }; /** * Platform class used to retrieve system wide parameters such as double click speed * and chrome colour. Not a creatable object, more of a module with several functions. */ class Platform { // Private so Platform objects can not be copied Platform(const Platform &) {} Platform &operator=(const Platform &) { return *this; } public: // Should be private because no new Platforms are ever created // but gcc warns about this Platform() {} ~Platform() {} static ColourDesired Chrome(); static ColourDesired ChromeHighlight(); static const char *DefaultFont(); static int DefaultFontSize(); static unsigned int DoubleClickTime(); static bool MouseButtonBounce(); static void DebugDisplay(const char *s); static bool IsKeyDown(int key); static long SendScintilla( WindowID w, unsigned int msg, unsigned long wParam=0, long lParam=0); static long SendScintillaPointer( WindowID w, unsigned int msg, unsigned long wParam=0, void *lParam=0); static bool IsDBCSLeadByte(int codePage, char ch); static int DBCSCharLength(int codePage, const char *s); static int DBCSCharMaxLength(); // These are utility functions not really tied to a platform static int Minimum(int a, int b); static int Maximum(int a, int b); // Next three assume 16 bit shorts and 32 bit longs static long LongFromTwoShorts(short a,short b) { return (a) | ((b) << 16); } static short HighShortFromLong(long x) { return static_cast(x >> 16); } static short LowShortFromLong(long x) { return static_cast(x & 0xffff); } static void DebugPrintf(const char *format, ...); static bool ShowAssertionPopUps(bool assertionPopUps_); static void Assert(const char *c, const char *file, int line); static int Clamp(int val, int minVal, int maxVal); }; #ifdef NDEBUG #define PLATFORM_ASSERT(c) ((void)0) #else #ifdef SCI_NAMESPACE #define PLATFORM_ASSERT(c) ((c) ? (void)(0) : Scintilla::Platform::Assert(#c, __FILE__, __LINE__)) #else #define PLATFORM_ASSERT(c) ((c) ? (void)(0) : Platform::Assert(#c, __FILE__, __LINE__)) #endif #endif #ifdef SCI_NAMESPACE } #endif // Shut up annoying Visual C++ warnings: #ifdef _MSC_VER #pragma warning(disable: 4244 4309 4514 4710) #endif #endif Wx-Scintilla-0.38/wx-scintilla/src/scintilla/include/Scintilla.iface000444001750001750 37224711727344243 26223 0ustar00azawawiazawawi000000000000## First line may be used for shbang ## This file defines the interface to Scintilla ## Copyright 2000-2003 by Neil Hodgson ## The License.txt file describes the conditions under which this software may be distributed. ## A line starting with ## is a pure comment and should be stripped by readers. ## A line starting with #! is for future shbang use ## A line starting with # followed by a space is a documentation comment and refers ## to the next feature definition. ## Each feature is defined by a line starting with fun, get, set, val or evt. ## cat -> start a category ## fun -> a function ## get -> a property get function ## set -> a property set function ## val -> definition of a constant ## evt -> an event ## enu -> associate an enumeration with a set of vals with a prefix ## lex -> associate a lexer with the lexical classes it produces ## ## All other feature names should be ignored. They may be defined in the future. ## A property may have a set function, a get function or both. Each will have ## "Get" or "Set" in their names and the corresponding name will have the obvious switch. ## A property may be subscripted, in which case the first parameter is the subscript. ## fun, get, and set features have a strict syntax: ## [=,) ## where stands for white space. ## param may be empty (null value) or is [=] ## Additional white space is allowed between elements. ## The syntax for evt is [=[,]*]) ## Feature names that contain an underscore are defined by Windows, so in these ## cases, using the Windows definition is preferred where available. ## The feature numbers are stable so features will not be renumbered. ## Features may be removed but they will go through a period of deprecation ## before removal which is signalled by moving them into the Deprecated category. ## ## enu has the syntax enu=[]* where all the val ## features in this file starting with a given are considered part of the ## enumeration. ## ## lex has the syntax lex=[]* ## where name is a reasonably capitalised (Python, XML) identifier or UI name, ## lexerVal is the val used to specify the lexer, and the list of prefixes is similar ## to enu. The name may not be the same as that used within the lexer so the lexerVal ## should be used to tie these entities together. ## Types: ## void ## int ## bool -> integer, 1=true, 0=false ## position -> integer position in a document ## colour -> colour integer containing red, green and blue bytes. ## string -> pointer to const character ## stringresult -> pointer to character, NULL-> return size of result ## cells -> pointer to array of cells, each cell containing a style byte and character byte ## textrange -> range of a min and a max position with an output string ## findtext -> searchrange, text -> foundposition ## keymod -> integer containing key in low half and modifiers in high half ## formatrange ## Types no longer used: ## findtextex -> searchrange ## charrange -> range of a min and a max position ## charrangeresult -> like charrange, but output param ## countedstring ## point -> x,y ## pointresult -> like point, but output param ## rectangle -> left,top,right,bottom ## Client code should ignore definitions containing types it does not understand, except ## for possibly #defining the constants ## Line numbers and positions start at 0. ## String arguments may contain NUL ('\0') characters where the calls provide a length ## argument and retrieve NUL characters. All retrieved strings except for those retrieved ## by GetLine also have a NUL appended but client code should calculate the size that ## will be returned rather than relying upon the NUL whenever possible. Allow for the ## extra NUL character when allocating buffers. The size to allocate for a stringresult ## can be determined by calling with a NULL (0) pointer. cat Basics ################################################ ## For Scintilla.h val INVALID_POSITION=-1 # Define start of Scintilla messages to be greater than all Windows edit (EM_*) messages # as many EM_ messages can be used although that use is deprecated. val SCI_START=2000 val SCI_OPTIONAL_START=3000 val SCI_LEXER_START=4000 # Add text to the document at current position. fun void AddText=2001(int length, string text) # Add array of cells to document. fun void AddStyledText=2002(int length, cells c) # Insert string at a position. fun void InsertText=2003(position pos, string text) # Delete all text in the document. fun void ClearAll=2004(,) # Set all style bytes to 0, remove all folding information. fun void ClearDocumentStyle=2005(,) # Returns the number of bytes in the document. get int GetLength=2006(,) # Returns the character byte at the position. get int GetCharAt=2007(position pos,) # Returns the position of the caret. get position GetCurrentPos=2008(,) # Returns the position of the opposite end of the selection to the caret. get position GetAnchor=2009(,) # Returns the style byte at the position. get int GetStyleAt=2010(position pos,) # Redoes the next action on the undo history. fun void Redo=2011(,) # Choose between collecting actions into the undo # history and discarding them. set void SetUndoCollection=2012(bool collectUndo,) # Select all the text in the document. fun void SelectAll=2013(,) # Remember the current position in the undo history as the position # at which the document was saved. fun void SetSavePoint=2014(,) # Retrieve a buffer of cells. # Returns the number of bytes in the buffer not including terminating NULs. fun int GetStyledText=2015(, textrange tr) # Are there any redoable actions in the undo history? fun bool CanRedo=2016(,) # Retrieve the line number at which a particular marker is located. fun int MarkerLineFromHandle=2017(int handle,) # Delete a marker. fun void MarkerDeleteHandle=2018(int handle,) # Is undo history being collected? get bool GetUndoCollection=2019(,) enu WhiteSpace=SCWS_ val SCWS_INVISIBLE=0 val SCWS_VISIBLEALWAYS=1 val SCWS_VISIBLEAFTERINDENT=2 # Are white space characters currently visible? # Returns one of SCWS_* constants. get int GetViewWS=2020(,) # Make white space characters invisible, always visible or visible outside indentation. set void SetViewWS=2021(int viewWS,) # Find the position from a point within the window. fun position PositionFromPoint=2022(int x, int y) # Find the position from a point within the window but return # INVALID_POSITION if not close to text. fun position PositionFromPointClose=2023(int x, int y) # Set caret to start of a line and ensure it is visible. fun void GotoLine=2024(int line,) # Set caret to a position and ensure it is visible. fun void GotoPos=2025(position pos,) # Set the selection anchor to a position. The anchor is the opposite # end of the selection from the caret. set void SetAnchor=2026(position posAnchor,) # Retrieve the text of the line containing the caret. # Returns the index of the caret on the line. fun int GetCurLine=2027(int length, stringresult text) # Retrieve the position of the last correctly styled character. get position GetEndStyled=2028(,) enu EndOfLine=SC_EOL_ val SC_EOL_CRLF=0 val SC_EOL_CR=1 val SC_EOL_LF=2 # Convert all line endings in the document to one mode. fun void ConvertEOLs=2029(int eolMode,) # Retrieve the current end of line mode - one of CRLF, CR, or LF. get int GetEOLMode=2030(,) # Set the current end of line mode. set void SetEOLMode=2031(int eolMode,) # Set the current styling position to pos and the styling mask to mask. # The styling mask can be used to protect some bits in each styling byte from modification. fun void StartStyling=2032(position pos, int mask) # Change style from current styling position for length characters to a style # and move the current styling position to after this newly styled segment. fun void SetStyling=2033(int length, int style) # Is drawing done first into a buffer or direct to the screen? get bool GetBufferedDraw=2034(,) # If drawing is buffered then each line of text is drawn into a bitmap buffer # before drawing it to the screen to avoid flicker. set void SetBufferedDraw=2035(bool buffered,) # Change the visible size of a tab to be a multiple of the width of a space character. set void SetTabWidth=2036(int tabWidth,) # Retrieve the visible size of a tab. get int GetTabWidth=2121(,) # The SC_CP_UTF8 value can be used to enter Unicode mode. # This is the same value as CP_UTF8 in Windows val SC_CP_UTF8=65001 # Set the code page used to interpret the bytes of the document as characters. # The SC_CP_UTF8 value can be used to enter Unicode mode. set void SetCodePage=2037(int codePage,) enu MarkerSymbol=SC_MARK_ val MARKER_MAX=31 val SC_MARK_CIRCLE=0 val SC_MARK_ROUNDRECT=1 val SC_MARK_ARROW=2 val SC_MARK_SMALLRECT=3 val SC_MARK_SHORTARROW=4 val SC_MARK_EMPTY=5 val SC_MARK_ARROWDOWN=6 val SC_MARK_MINUS=7 val SC_MARK_PLUS=8 # Shapes used for outlining column. val SC_MARK_VLINE=9 val SC_MARK_LCORNER=10 val SC_MARK_TCORNER=11 val SC_MARK_BOXPLUS=12 val SC_MARK_BOXPLUSCONNECTED=13 val SC_MARK_BOXMINUS=14 val SC_MARK_BOXMINUSCONNECTED=15 val SC_MARK_LCORNERCURVE=16 val SC_MARK_TCORNERCURVE=17 val SC_MARK_CIRCLEPLUS=18 val SC_MARK_CIRCLEPLUSCONNECTED=19 val SC_MARK_CIRCLEMINUS=20 val SC_MARK_CIRCLEMINUSCONNECTED=21 # Invisible mark that only sets the line background colour. val SC_MARK_BACKGROUND=22 val SC_MARK_DOTDOTDOT=23 val SC_MARK_ARROWS=24 val SC_MARK_PIXMAP=25 val SC_MARK_FULLRECT=26 val SC_MARK_LEFTRECT=27 val SC_MARK_AVAILABLE=28 val SC_MARK_UNDERLINE=29 val SC_MARK_RGBAIMAGE=30 val SC_MARK_CHARACTER=10000 enu MarkerOutline=SC_MARKNUM_ # Markers used for outlining column. val SC_MARKNUM_FOLDEREND=25 val SC_MARKNUM_FOLDEROPENMID=26 val SC_MARKNUM_FOLDERMIDTAIL=27 val SC_MARKNUM_FOLDERTAIL=28 val SC_MARKNUM_FOLDERSUB=29 val SC_MARKNUM_FOLDER=30 val SC_MARKNUM_FOLDEROPEN=31 val SC_MASK_FOLDERS=0xFE000000 # Set the symbol used for a particular marker number. fun void MarkerDefine=2040(int markerNumber, int markerSymbol) # Set the foreground colour used for a particular marker number. fun void MarkerSetFore=2041(int markerNumber, colour fore) # Set the background colour used for a particular marker number. fun void MarkerSetBack=2042(int markerNumber, colour back) # Set the background colour used for a particular marker number when its folding block is selected. fun void MarkerSetBackSelected=2292(int markerNumber, colour back) # Enable/disable highlight for current folding bloc (smallest one that contains the caret) fun void MarkerEnableHighlight=2293(bool enabled,) # Add a marker to a line, returning an ID which can be used to find or delete the marker. fun int MarkerAdd=2043(int line, int markerNumber) # Delete a marker from a line. fun void MarkerDelete=2044(int line, int markerNumber) # Delete all markers with a particular number from all lines. fun void MarkerDeleteAll=2045(int markerNumber,) # Get a bit mask of all the markers set on a line. fun int MarkerGet=2046(int line,) # Find the next line at or after lineStart that includes a marker in mask. # Return -1 when no more lines. fun int MarkerNext=2047(int lineStart, int markerMask) # Find the previous line before lineStart that includes a marker in mask. fun int MarkerPrevious=2048(int lineStart, int markerMask) # Define a marker from a pixmap. fun void MarkerDefinePixmap=2049(int markerNumber, string pixmap) # Add a set of markers to a line. fun void MarkerAddSet=2466(int line, int set) # Set the alpha used for a marker that is drawn in the text area, not the margin. fun void MarkerSetAlpha=2476(int markerNumber, int alpha) enu MarginType=SC_MARGIN_ val SC_MARGIN_SYMBOL=0 val SC_MARGIN_NUMBER=1 val SC_MARGIN_BACK=2 val SC_MARGIN_FORE=3 val SC_MARGIN_TEXT=4 val SC_MARGIN_RTEXT=5 # Set a margin to be either numeric or symbolic. set void SetMarginTypeN=2240(int margin, int marginType) # Retrieve the type of a margin. get int GetMarginTypeN=2241(int margin,) # Set the width of a margin to a width expressed in pixels. set void SetMarginWidthN=2242(int margin, int pixelWidth) # Retrieve the width of a margin in pixels. get int GetMarginWidthN=2243(int margin,) # Set a mask that determines which markers are displayed in a margin. set void SetMarginMaskN=2244(int margin, int mask) # Retrieve the marker mask of a margin. get int GetMarginMaskN=2245(int margin,) # Make a margin sensitive or insensitive to mouse clicks. set void SetMarginSensitiveN=2246(int margin, bool sensitive) # Retrieve the mouse click sensitivity of a margin. get bool GetMarginSensitiveN=2247(int margin,) # Set the cursor shown when the mouse is inside a margin. set void SetMarginCursorN=2248(int margin, int cursor) # Retrieve the cursor shown in a margin. get int GetMarginCursorN=2249(int margin,) # Styles in range 32..38 are predefined for parts of the UI and are not used as normal styles. # Style 39 is for future use. enu StylesCommon=STYLE_ val STYLE_DEFAULT=32 val STYLE_LINENUMBER=33 val STYLE_BRACELIGHT=34 val STYLE_BRACEBAD=35 val STYLE_CONTROLCHAR=36 val STYLE_INDENTGUIDE=37 val STYLE_CALLTIP=38 val STYLE_LASTPREDEFINED=39 val STYLE_MAX=255 # Character set identifiers are used in StyleSetCharacterSet. # The values are the same as the Windows *_CHARSET values. enu CharacterSet=SC_CHARSET_ val SC_CHARSET_ANSI=0 val SC_CHARSET_DEFAULT=1 val SC_CHARSET_BALTIC=186 val SC_CHARSET_CHINESEBIG5=136 val SC_CHARSET_EASTEUROPE=238 val SC_CHARSET_GB2312=134 val SC_CHARSET_GREEK=161 val SC_CHARSET_HANGUL=129 val SC_CHARSET_MAC=77 val SC_CHARSET_OEM=255 val SC_CHARSET_RUSSIAN=204 val SC_CHARSET_CYRILLIC=1251 val SC_CHARSET_SHIFTJIS=128 val SC_CHARSET_SYMBOL=2 val SC_CHARSET_TURKISH=162 val SC_CHARSET_JOHAB=130 val SC_CHARSET_HEBREW=177 val SC_CHARSET_ARABIC=178 val SC_CHARSET_VIETNAMESE=163 val SC_CHARSET_THAI=222 val SC_CHARSET_8859_15=1000 # Clear all the styles and make equivalent to the global default style. set void StyleClearAll=2050(,) # Set the foreground colour of a style. set void StyleSetFore=2051(int style, colour fore) # Set the background colour of a style. set void StyleSetBack=2052(int style, colour back) # Set a style to be bold or not. set void StyleSetBold=2053(int style, bool bold) # Set a style to be italic or not. set void StyleSetItalic=2054(int style, bool italic) # Set the size of characters of a style. set void StyleSetSize=2055(int style, int sizePoints) # Set the font of a style. set void StyleSetFont=2056(int style, string fontName) # Set a style to have its end of line filled or not. set void StyleSetEOLFilled=2057(int style, bool filled) # Reset the default style to its state at startup fun void StyleResetDefault=2058(,) # Set a style to be underlined or not. set void StyleSetUnderline=2059(int style, bool underline) enu CaseVisible=SC_CASE_ val SC_CASE_MIXED=0 val SC_CASE_UPPER=1 val SC_CASE_LOWER=2 # Get the foreground colour of a style. get colour StyleGetFore=2481(int style,) # Get the background colour of a style. get colour StyleGetBack=2482(int style,) # Get is a style bold or not. get bool StyleGetBold=2483(int style,) # Get is a style italic or not. get bool StyleGetItalic=2484(int style,) # Get the size of characters of a style. get int StyleGetSize=2485(int style,) # Get the font of a style. # Returns the length of the fontName fun int StyleGetFont=2486(int style, stringresult fontName) # Get is a style to have its end of line filled or not. get bool StyleGetEOLFilled=2487(int style,) # Get is a style underlined or not. get bool StyleGetUnderline=2488(int style,) # Get is a style mixed case, or to force upper or lower case. get int StyleGetCase=2489(int style,) # Get the character get of the font in a style. get int StyleGetCharacterSet=2490(int style,) # Get is a style visible or not. get bool StyleGetVisible=2491(int style,) # Get is a style changeable or not (read only). # Experimental feature, currently buggy. get bool StyleGetChangeable=2492(int style,) # Get is a style a hotspot or not. get bool StyleGetHotSpot=2493(int style,) # Set a style to be mixed case, or to force upper or lower case. set void StyleSetCase=2060(int style, int caseForce) val SC_FONT_SIZE_MULTIPLIER=100 # Set the size of characters of a style. Size is in points multiplied by 100. set void StyleSetSizeFractional=2061(int style, int caseForce) # Get the size of characters of a style in points multiplied by 100 get int StyleGetSizeFractional=2062(int style,) enu FontWeight=SC_WEIGHT_ val SC_WEIGHT_NORMAL=400 val SC_WEIGHT_SEMIBOLD=600 val SC_WEIGHT_BOLD=700 # Set the weight of characters of a style. set void StyleSetWeight=2063(int style, int weight) # Get the weight of characters of a style. get int StyleGetWeight=2064(int style,) # Set the character set of the font in a style. set void StyleSetCharacterSet=2066(int style, int characterSet) # Set a style to be a hotspot or not. set void StyleSetHotSpot=2409(int style, bool hotspot) # Set the foreground colour of the main and additional selections and whether to use this setting. fun void SetSelFore=2067(bool useSetting, colour fore) # Set the background colour of the main and additional selections and whether to use this setting. fun void SetSelBack=2068(bool useSetting, colour back) # Get the alpha of the selection. get int GetSelAlpha=2477(,) # Set the alpha of the selection. set void SetSelAlpha=2478(int alpha,) # Is the selection end of line filled? get bool GetSelEOLFilled=2479(,) # Set the selection to have its end of line filled or not. set void SetSelEOLFilled=2480(bool filled,) # Set the foreground colour of the caret. set void SetCaretFore=2069(colour fore,) # When key+modifier combination km is pressed perform msg. fun void AssignCmdKey=2070(keymod km, int msg) # When key+modifier combination km is pressed do nothing. fun void ClearCmdKey=2071(keymod km,) # Drop all key mappings. fun void ClearAllCmdKeys=2072(,) # Set the styles for a segment of the document. fun void SetStylingEx=2073(int length, string styles) # Set a style to be visible or not. set void StyleSetVisible=2074(int style, bool visible) # Get the time in milliseconds that the caret is on and off. get int GetCaretPeriod=2075(,) # Get the time in milliseconds that the caret is on and off. 0 = steady on. set void SetCaretPeriod=2076(int periodMilliseconds,) # Set the set of characters making up words for when moving or selecting by word. # First sets defaults like SetCharsDefault. set void SetWordChars=2077(, string characters) # Start a sequence of actions that is undone and redone as a unit. # May be nested. fun void BeginUndoAction=2078(,) # End a sequence of actions that is undone and redone as a unit. fun void EndUndoAction=2079(,) # Indicator style enumeration and some constants enu IndicatorStyle=INDIC_ val INDIC_PLAIN=0 val INDIC_SQUIGGLE=1 val INDIC_TT=2 val INDIC_DIAGONAL=3 val INDIC_STRIKE=4 val INDIC_HIDDEN=5 val INDIC_BOX=6 val INDIC_ROUNDBOX=7 val INDIC_STRAIGHTBOX=8 val INDIC_DASH=9 val INDIC_DOTS=10 val INDIC_SQUIGGLELOW=11 val INDIC_DOTBOX=12 val INDIC_MAX=31 val INDIC_CONTAINER=8 val INDIC0_MASK=0x20 val INDIC1_MASK=0x40 val INDIC2_MASK=0x80 val INDICS_MASK=0xE0 # Set an indicator to plain, squiggle or TT. set void IndicSetStyle=2080(int indic, int style) # Retrieve the style of an indicator. get int IndicGetStyle=2081(int indic,) # Set the foreground colour of an indicator. set void IndicSetFore=2082(int indic, colour fore) # Retrieve the foreground colour of an indicator. get colour IndicGetFore=2083(int indic,) # Set an indicator to draw under text or over(default). set void IndicSetUnder=2510(int indic, bool under) # Retrieve whether indicator drawn under or over text. get bool IndicGetUnder=2511(int indic,) # Set the foreground colour of all whitespace and whether to use this setting. fun void SetWhitespaceFore=2084(bool useSetting, colour fore) # Set the background colour of all whitespace and whether to use this setting. fun void SetWhitespaceBack=2085(bool useSetting, colour back) # Set the size of the dots used to mark space characters. set void SetWhitespaceSize=2086(int size,) # Get the size of the dots used to mark space characters. get int GetWhitespaceSize=2087(,) # Divide each styling byte into lexical class bits (default: 5) and indicator # bits (default: 3). If a lexer requires more than 32 lexical states, then this # is used to expand the possible states. set void SetStyleBits=2090(int bits,) # Retrieve number of bits in style bytes used to hold the lexical state. get int GetStyleBits=2091(,) # Used to hold extra styling information for each line. set void SetLineState=2092(int line, int state) # Retrieve the extra styling information for a line. get int GetLineState=2093(int line,) # Retrieve the last line number that has line state. get int GetMaxLineState=2094(,) # Is the background of the line containing the caret in a different colour? get bool GetCaretLineVisible=2095(,) # Display the background of the line containing the caret in a different colour. set void SetCaretLineVisible=2096(bool show,) # Get the colour of the background of the line containing the caret. get colour GetCaretLineBack=2097(,) # Set the colour of the background of the line containing the caret. set void SetCaretLineBack=2098(colour back,) # Set a style to be changeable or not (read only). # Experimental feature, currently buggy. set void StyleSetChangeable=2099(int style, bool changeable) # Display a auto-completion list. # The lenEntered parameter indicates how many characters before # the caret should be used to provide context. fun void AutoCShow=2100(int lenEntered, string itemList) # Remove the auto-completion list from the screen. fun void AutoCCancel=2101(,) # Is there an auto-completion list visible? fun bool AutoCActive=2102(,) # Retrieve the position of the caret when the auto-completion list was displayed. fun position AutoCPosStart=2103(,) # User has selected an item so remove the list and insert the selection. fun void AutoCComplete=2104(,) # Define a set of character that when typed cancel the auto-completion list. fun void AutoCStops=2105(, string characterSet) # Change the separator character in the string setting up an auto-completion list. # Default is space but can be changed if items contain space. set void AutoCSetSeparator=2106(int separatorCharacter,) # Retrieve the auto-completion list separator character. get int AutoCGetSeparator=2107(,) # Select the item in the auto-completion list that starts with a string. fun void AutoCSelect=2108(, string text) # Should the auto-completion list be cancelled if the user backspaces to a # position before where the box was created. set void AutoCSetCancelAtStart=2110(bool cancel,) # Retrieve whether auto-completion cancelled by backspacing before start. get bool AutoCGetCancelAtStart=2111(,) # Define a set of characters that when typed will cause the autocompletion to # choose the selected item. set void AutoCSetFillUps=2112(, string characterSet) # Should a single item auto-completion list automatically choose the item. set void AutoCSetChooseSingle=2113(bool chooseSingle,) # Retrieve whether a single item auto-completion list automatically choose the item. get bool AutoCGetChooseSingle=2114(,) # Set whether case is significant when performing auto-completion searches. set void AutoCSetIgnoreCase=2115(bool ignoreCase,) # Retrieve state of ignore case flag. get bool AutoCGetIgnoreCase=2116(,) # Display a list of strings and send notification when user chooses one. fun void UserListShow=2117(int listType, string itemList) # Set whether or not autocompletion is hidden automatically when nothing matches. set void AutoCSetAutoHide=2118(bool autoHide,) # Retrieve whether or not autocompletion is hidden automatically when nothing matches. get bool AutoCGetAutoHide=2119(,) # Set whether or not autocompletion deletes any word characters # after the inserted text upon completion. set void AutoCSetDropRestOfWord=2270(bool dropRestOfWord,) # Retrieve whether or not autocompletion deletes any word characters # after the inserted text upon completion. get bool AutoCGetDropRestOfWord=2271(,) # Register an XPM image for use in autocompletion lists. fun void RegisterImage=2405(int type, string xpmData) # Clear all the registered XPM images. fun void ClearRegisteredImages=2408(,) # Retrieve the auto-completion list type-separator character. get int AutoCGetTypeSeparator=2285(,) # Change the type-separator character in the string setting up an auto-completion list. # Default is '?' but can be changed if items contain '?'. set void AutoCSetTypeSeparator=2286(int separatorCharacter,) # Set the maximum width, in characters, of auto-completion and user lists. # Set to 0 to autosize to fit longest item, which is the default. set void AutoCSetMaxWidth=2208(int characterCount,) # Get the maximum width, in characters, of auto-completion and user lists. get int AutoCGetMaxWidth=2209(,) # Set the maximum height, in rows, of auto-completion and user lists. # The default is 5 rows. set void AutoCSetMaxHeight=2210(int rowCount,) # Set the maximum height, in rows, of auto-completion and user lists. get int AutoCGetMaxHeight=2211(,) # Set the number of spaces used for one level of indentation. set void SetIndent=2122(int indentSize,) # Retrieve indentation size. get int GetIndent=2123(,) # Indentation will only use space characters if useTabs is false, otherwise # it will use a combination of tabs and spaces. set void SetUseTabs=2124(bool useTabs,) # Retrieve whether tabs will be used in indentation. get bool GetUseTabs=2125(,) # Change the indentation of a line to a number of columns. set void SetLineIndentation=2126(int line, int indentSize) # Retrieve the number of columns that a line is indented. get int GetLineIndentation=2127(int line,) # Retrieve the position before the first non indentation character on a line. get position GetLineIndentPosition=2128(int line,) # Retrieve the column number of a position, taking tab width into account. get int GetColumn=2129(position pos,) # Count characters between two positions. fun int CountCharacters=2633(int startPos, int endPos) # Show or hide the horizontal scroll bar. set void SetHScrollBar=2130(bool show,) # Is the horizontal scroll bar visible? get bool GetHScrollBar=2131(,) enu IndentView=SC_IV_ val SC_IV_NONE=0 val SC_IV_REAL=1 val SC_IV_LOOKFORWARD=2 val SC_IV_LOOKBOTH=3 # Show or hide indentation guides. set void SetIndentationGuides=2132(int indentView,) # Are the indentation guides visible? get int GetIndentationGuides=2133(,) # Set the highlighted indentation guide column. # 0 = no highlighted guide. set void SetHighlightGuide=2134(int column,) # Get the highlighted indentation guide column. get int GetHighlightGuide=2135(,) # Get the position after the last visible characters on a line. get int GetLineEndPosition=2136(int line,) # Get the code page used to interpret the bytes of the document as characters. get int GetCodePage=2137(,) # Get the foreground colour of the caret. get colour GetCaretFore=2138(,) # In read-only mode? get bool GetReadOnly=2140(,) # Sets the position of the caret. set void SetCurrentPos=2141(position pos,) # Sets the position that starts the selection - this becomes the anchor. set void SetSelectionStart=2142(position pos,) # Returns the position at the start of the selection. get position GetSelectionStart=2143(,) # Sets the position that ends the selection - this becomes the currentPosition. set void SetSelectionEnd=2144(position pos,) # Returns the position at the end of the selection. get position GetSelectionEnd=2145(,) # Set caret to a position, while removing any existing selection. fun void SetEmptySelection=2556(position pos,) # Sets the print magnification added to the point size of each style for printing. set void SetPrintMagnification=2146(int magnification,) # Returns the print magnification. get int GetPrintMagnification=2147(,) enu PrintOption=SC_PRINT_ # PrintColourMode - use same colours as screen. val SC_PRINT_NORMAL=0 # PrintColourMode - invert the light value of each style for printing. val SC_PRINT_INVERTLIGHT=1 # PrintColourMode - force black text on white background for printing. val SC_PRINT_BLACKONWHITE=2 # PrintColourMode - text stays coloured, but all background is forced to be white for printing. val SC_PRINT_COLOURONWHITE=3 # PrintColourMode - only the default-background is forced to be white for printing. val SC_PRINT_COLOURONWHITEDEFAULTBG=4 # Modify colours when printing for clearer printed text. set void SetPrintColourMode=2148(int mode,) # Returns the print colour mode. get int GetPrintColourMode=2149(,) enu FindOption=SCFIND_ val SCFIND_WHOLEWORD=2 val SCFIND_MATCHCASE=4 val SCFIND_WORDSTART=0x00100000 val SCFIND_REGEXP=0x00200000 val SCFIND_POSIX=0x00400000 # Find some text in the document. fun position FindText=2150(int flags, findtext ft) # On Windows, will draw the document into a display context such as a printer. fun position FormatRange=2151(bool draw, formatrange fr) # Retrieve the display line at the top of the display. get int GetFirstVisibleLine=2152(,) # Retrieve the contents of a line. # Returns the length of the line. fun int GetLine=2153(int line, stringresult text) # Returns the number of lines in the document. There is always at least one. get int GetLineCount=2154(,) # Sets the size in pixels of the left margin. set void SetMarginLeft=2155(, int pixelWidth) # Returns the size in pixels of the left margin. get int GetMarginLeft=2156(,) # Sets the size in pixels of the right margin. set void SetMarginRight=2157(, int pixelWidth) # Returns the size in pixels of the right margin. get int GetMarginRight=2158(,) # Is the document different from when it was last saved? get bool GetModify=2159(,) # Select a range of text. fun void SetSel=2160(position start, position end) # Retrieve the selected text. # Return the length of the text. fun int GetSelText=2161(, stringresult text) # Retrieve a range of text. # Return the length of the text. fun int GetTextRange=2162(, textrange tr) # Draw the selection in normal style or with selection highlighted. fun void HideSelection=2163(bool normal,) # Retrieve the x value of the point in the window where a position is displayed. fun int PointXFromPosition=2164(, position pos) # Retrieve the y value of the point in the window where a position is displayed. fun int PointYFromPosition=2165(, position pos) # Retrieve the line containing a position. fun int LineFromPosition=2166(position pos,) # Retrieve the position at the start of a line. fun position PositionFromLine=2167(int line,) # Scroll horizontally and vertically. fun void LineScroll=2168(int columns, int lines) # Ensure the caret is visible. fun void ScrollCaret=2169(,) # Replace the selected text with the argument text. fun void ReplaceSel=2170(, string text) # Set to read only or read write. set void SetReadOnly=2171(bool readOnly,) # Null operation. fun void Null=2172(,) # Will a paste succeed? fun bool CanPaste=2173(,) # Are there any undoable actions in the undo history? fun bool CanUndo=2174(,) # Delete the undo history. fun void EmptyUndoBuffer=2175(,) # Undo one action in the undo history. fun void Undo=2176(,) # Cut the selection to the clipboard. fun void Cut=2177(,) # Copy the selection to the clipboard. fun void Copy=2178(,) # Paste the contents of the clipboard into the document replacing the selection. fun void Paste=2179(,) # Clear the selection. fun void Clear=2180(,) # Replace the contents of the document with the argument text. fun void SetText=2181(, string text) # Retrieve all the text in the document. # Returns number of characters retrieved. fun int GetText=2182(int length, stringresult text) # Retrieve the number of characters in the document. get int GetTextLength=2183(,) # Retrieve a pointer to a function that processes messages for this Scintilla. get int GetDirectFunction=2184(,) # Retrieve a pointer value to use as the first argument when calling # the function returned by GetDirectFunction. get int GetDirectPointer=2185(,) # Set to overtype (true) or insert mode. set void SetOvertype=2186(bool overtype,) # Returns true if overtype mode is active otherwise false is returned. get bool GetOvertype=2187(,) # Set the width of the insert mode caret. set void SetCaretWidth=2188(int pixelWidth,) # Returns the width of the insert mode caret. get int GetCaretWidth=2189(,) # Sets the position that starts the target which is used for updating the # document without affecting the scroll position. set void SetTargetStart=2190(position pos,) # Get the position that starts the target. get position GetTargetStart=2191(,) # Sets the position that ends the target which is used for updating the # document without affecting the scroll position. set void SetTargetEnd=2192(position pos,) # Get the position that ends the target. get position GetTargetEnd=2193(,) # Replace the target text with the argument text. # Text is counted so it can contain NULs. # Returns the length of the replacement text. fun int ReplaceTarget=2194(int length, string text) # Replace the target text with the argument text after \d processing. # Text is counted so it can contain NULs. # Looks for \d where d is between 1 and 9 and replaces these with the strings # matched in the last search operation which were surrounded by \( and \). # Returns the length of the replacement text including any change # caused by processing the \d patterns. fun int ReplaceTargetRE=2195(int length, string text) # Search for a counted string in the target and set the target to the found # range. Text is counted so it can contain NULs. # Returns length of range or -1 for failure in which case target is not moved. fun int SearchInTarget=2197(int length, string text) # Set the search flags used by SearchInTarget. set void SetSearchFlags=2198(int flags,) # Get the search flags used by SearchInTarget. get int GetSearchFlags=2199(,) # Show a call tip containing a definition near position pos. fun void CallTipShow=2200(position pos, string definition) # Remove the call tip from the screen. fun void CallTipCancel=2201(,) # Is there an active call tip? fun bool CallTipActive=2202(,) # Retrieve the position where the caret was before displaying the call tip. fun position CallTipPosStart=2203(,) # Highlight a segment of the definition. fun void CallTipSetHlt=2204(int start, int end) # Set the background colour for the call tip. set void CallTipSetBack=2205(colour back,) # Set the foreground colour for the call tip. set void CallTipSetFore=2206(colour fore,) # Set the foreground colour for the highlighted part of the call tip. set void CallTipSetForeHlt=2207(colour fore,) # Enable use of STYLE_CALLTIP and set call tip tab size in pixels. set void CallTipUseStyle=2212(int tabSize,) # Set position of calltip, above or below text. set void CallTipSetPosition=2213(bool above,) # Find the display line of a document line taking hidden lines into account. fun int VisibleFromDocLine=2220(int line,) # Find the document line of a display line taking hidden lines into account. fun int DocLineFromVisible=2221(int lineDisplay,) # The number of display lines needed to wrap a document line fun int WrapCount=2235(int line,) enu FoldLevel=SC_FOLDLEVEL val SC_FOLDLEVELBASE=0x400 val SC_FOLDLEVELWHITEFLAG=0x1000 val SC_FOLDLEVELHEADERFLAG=0x2000 val SC_FOLDLEVELNUMBERMASK=0x0FFF # Set the fold level of a line. # This encodes an integer level along with flags indicating whether the # line is a header and whether it is effectively white space. set void SetFoldLevel=2222(int line, int level) # Retrieve the fold level of a line. get int GetFoldLevel=2223(int line,) # Find the last child line of a header line. get int GetLastChild=2224(int line, int level) # Find the parent line of a child line. get int GetFoldParent=2225(int line,) # Make a range of lines visible. fun void ShowLines=2226(int lineStart, int lineEnd) # Make a range of lines invisible. fun void HideLines=2227(int lineStart, int lineEnd) # Is a line visible? get bool GetLineVisible=2228(int line,) # Are all lines visible? get bool GetAllLinesVisible=2236(,) # Show the children of a header line. set void SetFoldExpanded=2229(int line, bool expanded) # Is a header line expanded? get bool GetFoldExpanded=2230(int line,) # Switch a header line between expanded and contracted. fun void ToggleFold=2231(int line,) # Ensure a particular line is visible by expanding any header line hiding it. fun void EnsureVisible=2232(int line,) enu FoldFlag=SC_FOLDFLAG_ val SC_FOLDFLAG_LINEBEFORE_EXPANDED=0x0002 val SC_FOLDFLAG_LINEBEFORE_CONTRACTED=0x0004 val SC_FOLDFLAG_LINEAFTER_EXPANDED=0x0008 val SC_FOLDFLAG_LINEAFTER_CONTRACTED=0x0010 val SC_FOLDFLAG_LEVELNUMBERS=0x0040 # Set some style options for folding. fun void SetFoldFlags=2233(int flags,) # Ensure a particular line is visible by expanding any header line hiding it. # Use the currently set visibility policy to determine which range to display. fun void EnsureVisibleEnforcePolicy=2234(int line,) # Sets whether a tab pressed when caret is within indentation indents. set void SetTabIndents=2260(bool tabIndents,) # Does a tab pressed when caret is within indentation indent? get bool GetTabIndents=2261(,) # Sets whether a backspace pressed when caret is within indentation unindents. set void SetBackSpaceUnIndents=2262(bool bsUnIndents,) # Does a backspace pressed when caret is within indentation unindent? get bool GetBackSpaceUnIndents=2263(,) val SC_TIME_FOREVER=10000000 # Sets the time the mouse must sit still to generate a mouse dwell event. set void SetMouseDwellTime=2264(int periodMilliseconds,) # Retrieve the time the mouse must sit still to generate a mouse dwell event. get int GetMouseDwellTime=2265(,) # Get position of start of word. fun int WordStartPosition=2266(position pos, bool onlyWordCharacters) # Get position of end of word. fun int WordEndPosition=2267(position pos, bool onlyWordCharacters) enu Wrap=SC_WRAP_ val SC_WRAP_NONE=0 val SC_WRAP_WORD=1 val SC_WRAP_CHAR=2 # Sets whether text is word wrapped. set void SetWrapMode=2268(int mode,) # Retrieve whether text is word wrapped. get int GetWrapMode=2269(,) enu WrapVisualFlag=SC_WRAPVISUALFLAG_ val SC_WRAPVISUALFLAG_NONE=0x0000 val SC_WRAPVISUALFLAG_END=0x0001 val SC_WRAPVISUALFLAG_START=0x0002 # Set the display mode of visual flags for wrapped lines. set void SetWrapVisualFlags=2460(int wrapVisualFlags,) # Retrive the display mode of visual flags for wrapped lines. get int GetWrapVisualFlags=2461(,) enu WrapVisualLocation=SC_WRAPVISUALFLAGLOC_ val SC_WRAPVISUALFLAGLOC_DEFAULT=0x0000 val SC_WRAPVISUALFLAGLOC_END_BY_TEXT=0x0001 val SC_WRAPVISUALFLAGLOC_START_BY_TEXT=0x0002 # Set the location of visual flags for wrapped lines. set void SetWrapVisualFlagsLocation=2462(int wrapVisualFlagsLocation,) # Retrive the location of visual flags for wrapped lines. get int GetWrapVisualFlagsLocation=2463(,) # Set the start indent for wrapped lines. set void SetWrapStartIndent=2464(int indent,) # Retrive the start indent for wrapped lines. get int GetWrapStartIndent=2465(,) enu WrapIndentMode=SC_WRAPINDENT_ val SC_WRAPINDENT_FIXED=0 val SC_WRAPINDENT_SAME=1 val SC_WRAPINDENT_INDENT=2 # Sets how wrapped sublines are placed. Default is fixed. set void SetWrapIndentMode=2472(int mode,) # Retrieve how wrapped sublines are placed. Default is fixed. get int GetWrapIndentMode=2473(,) enu LineCache=SC_CACHE_ val SC_CACHE_NONE=0 val SC_CACHE_CARET=1 val SC_CACHE_PAGE=2 val SC_CACHE_DOCUMENT=3 # Sets the degree of caching of layout information. set void SetLayoutCache=2272(int mode,) # Retrieve the degree of caching of layout information. get int GetLayoutCache=2273(,) # Sets the document width assumed for scrolling. set void SetScrollWidth=2274(int pixelWidth,) # Retrieve the document width assumed for scrolling. get int GetScrollWidth=2275(,) # Sets whether the maximum width line displayed is used to set scroll width. set void SetScrollWidthTracking=2516(bool tracking,) # Retrieve whether the scroll width tracks wide lines. get bool GetScrollWidthTracking=2517(,) # Measure the pixel width of some text in a particular style. # NUL terminated text argument. # Does not handle tab or control characters. fun int TextWidth=2276(int style, string text) # Sets the scroll range so that maximum scroll position has # the last line at the bottom of the view (default). # Setting this to false allows scrolling one page below the last line. set void SetEndAtLastLine=2277(bool endAtLastLine,) # Retrieve whether the maximum scroll position has the last # line at the bottom of the view. get bool GetEndAtLastLine=2278(,) # Retrieve the height of a particular line of text in pixels. fun int TextHeight=2279(int line,) # Show or hide the vertical scroll bar. set void SetVScrollBar=2280(bool show,) # Is the vertical scroll bar visible? get bool GetVScrollBar=2281(,) # Append a string to the end of the document without changing the selection. fun void AppendText=2282(int length, string text) # Is drawing done in two phases with backgrounds drawn before faoregrounds? get bool GetTwoPhaseDraw=2283(,) # In twoPhaseDraw mode, drawing is performed in two phases, first the background # and then the foreground. This avoids chopping off characters that overlap the next run. set void SetTwoPhaseDraw=2284(bool twoPhase,) # Control font anti-aliasing. enu FontQuality=SC_EFF_ val SC_EFF_QUALITY_MASK=0xF val SC_EFF_QUALITY_DEFAULT=0 val SC_EFF_QUALITY_NON_ANTIALIASED=1 val SC_EFF_QUALITY_ANTIALIASED=2 val SC_EFF_QUALITY_LCD_OPTIMIZED=3 # Choose the quality level for text from the FontQuality enumeration. set void SetFontQuality=2611(int fontQuality,) # Retrieve the quality level for text. get int GetFontQuality=2612(,) # Scroll so that a display line is at the top of the display. set void SetFirstVisibleLine=2613(int lineDisplay,) enu MultiPaste=SC_MULTIPASTE_ val SC_MULTIPASTE_ONCE=0 val SC_MULTIPASTE_EACH=1 # Change the effect of pasting when there are multiple selections. set void SetMultiPaste=2614(int multiPaste,) # Retrieve the effect of pasting when there are multiple selections.. get int GetMultiPaste=2615(,) # Retrieve the value of a tag from a regular expression search. fun int GetTag=2616(int tagNumber, stringresult tagValue) # Make the target range start and end be the same as the selection range start and end. fun void TargetFromSelection=2287(,) # Join the lines in the target. fun void LinesJoin=2288(,) # Split the lines in the target into lines that are less wide than pixelWidth # where possible. fun void LinesSplit=2289(int pixelWidth,) # Set the colours used as a chequerboard pattern in the fold margin fun void SetFoldMarginColour=2290(bool useSetting, colour back) fun void SetFoldMarginHiColour=2291(bool useSetting, colour fore) ## New messages go here ## Start of key messages # Move caret down one line. fun void LineDown=2300(,) # Move caret down one line extending selection to new caret position. fun void LineDownExtend=2301(,) # Move caret up one line. fun void LineUp=2302(,) # Move caret up one line extending selection to new caret position. fun void LineUpExtend=2303(,) # Move caret left one character. fun void CharLeft=2304(,) # Move caret left one character extending selection to new caret position. fun void CharLeftExtend=2305(,) # Move caret right one character. fun void CharRight=2306(,) # Move caret right one character extending selection to new caret position. fun void CharRightExtend=2307(,) # Move caret left one word. fun void WordLeft=2308(,) # Move caret left one word extending selection to new caret position. fun void WordLeftExtend=2309(,) # Move caret right one word. fun void WordRight=2310(,) # Move caret right one word extending selection to new caret position. fun void WordRightExtend=2311(,) # Move caret to first position on line. fun void Home=2312(,) # Move caret to first position on line extending selection to new caret position. fun void HomeExtend=2313(,) # Move caret to last position on line. fun void LineEnd=2314(,) # Move caret to last position on line extending selection to new caret position. fun void LineEndExtend=2315(,) # Move caret to first position in document. fun void DocumentStart=2316(,) # Move caret to first position in document extending selection to new caret position. fun void DocumentStartExtend=2317(,) # Move caret to last position in document. fun void DocumentEnd=2318(,) # Move caret to last position in document extending selection to new caret position. fun void DocumentEndExtend=2319(,) # Move caret one page up. fun void PageUp=2320(,) # Move caret one page up extending selection to new caret position. fun void PageUpExtend=2321(,) # Move caret one page down. fun void PageDown=2322(,) # Move caret one page down extending selection to new caret position. fun void PageDownExtend=2323(,) # Switch from insert to overtype mode or the reverse. fun void EditToggleOvertype=2324(,) # Cancel any modes such as call tip or auto-completion list display. fun void Cancel=2325(,) # Delete the selection or if no selection, the character before the caret. fun void DeleteBack=2326(,) # If selection is empty or all on one line replace the selection with a tab character. # If more than one line selected, indent the lines. fun void Tab=2327(,) # Dedent the selected lines. fun void BackTab=2328(,) # Insert a new line, may use a CRLF, CR or LF depending on EOL mode. fun void NewLine=2329(,) # Insert a Form Feed character. fun void FormFeed=2330(,) # Move caret to before first visible character on line. # If already there move to first character on line. fun void VCHome=2331(,) # Like VCHome but extending selection to new caret position. fun void VCHomeExtend=2332(,) # Magnify the displayed text by increasing the sizes by 1 point. fun void ZoomIn=2333(,) # Make the displayed text smaller by decreasing the sizes by 1 point. fun void ZoomOut=2334(,) # Delete the word to the left of the caret. fun void DelWordLeft=2335(,) # Delete the word to the right of the caret. fun void DelWordRight=2336(,) # Delete the word to the right of the caret, but not the trailing non-word characters. fun void DelWordRightEnd=2518(,) # Cut the line containing the caret. fun void LineCut=2337(,) # Delete the line containing the caret. fun void LineDelete=2338(,) # Switch the current line with the previous. fun void LineTranspose=2339(,) # Duplicate the current line. fun void LineDuplicate=2404(,) # Transform the selection to lower case. fun void LowerCase=2340(,) # Transform the selection to upper case. fun void UpperCase=2341(,) # Scroll the document down, keeping the caret visible. fun void LineScrollDown=2342(,) # Scroll the document up, keeping the caret visible. fun void LineScrollUp=2343(,) # Delete the selection or if no selection, the character before the caret. # Will not delete the character before at the start of a line. fun void DeleteBackNotLine=2344(,) # Move caret to first position on display line. fun void HomeDisplay=2345(,) # Move caret to first position on display line extending selection to # new caret position. fun void HomeDisplayExtend=2346(,) # Move caret to last position on display line. fun void LineEndDisplay=2347(,) # Move caret to last position on display line extending selection to new # caret position. fun void LineEndDisplayExtend=2348(,) # These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)? # except they behave differently when word-wrap is enabled: # They go first to the start / end of the display line, like (Home|LineEnd)Display # The difference is that, the cursor is already at the point, it goes on to the start # or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?. fun void HomeWrap=2349(,) fun void HomeWrapExtend=2450(,) fun void LineEndWrap=2451(,) fun void LineEndWrapExtend=2452(,) fun void VCHomeWrap=2453(,) fun void VCHomeWrapExtend=2454(,) # Copy the line containing the caret. fun void LineCopy=2455(,) # Move the caret inside current view if it's not there already. fun void MoveCaretInsideView=2401(,) # How many characters are on a line, including end of line characters? fun int LineLength=2350(int line,) # Highlight the characters at two positions. fun void BraceHighlight=2351(position pos1, position pos2) # Use specified indicator to highlight matching braces instead of changing their style. fun void BraceHighlightIndicator=2498(bool useBraceHighlightIndicator, int indicator) # Highlight the character at a position indicating there is no matching brace. fun void BraceBadLight=2352(position pos,) # Use specified indicator to highlight non matching brace instead of changing its style. fun void BraceBadLightIndicator=2499(bool useBraceBadLightIndicator, int indicator) # Find the position of a matching brace or INVALID_POSITION if no match. fun position BraceMatch=2353(position pos,) # Are the end of line characters visible? get bool GetViewEOL=2355(,) # Make the end of line characters visible or invisible. set void SetViewEOL=2356(bool visible,) # Retrieve a pointer to the document object. get int GetDocPointer=2357(,) # Change the document object used. set void SetDocPointer=2358(, int pointer) # Set which document modification events are sent to the container. set void SetModEventMask=2359(int mask,) enu EdgeVisualStyle=EDGE_ val EDGE_NONE=0 val EDGE_LINE=1 val EDGE_BACKGROUND=2 # Retrieve the column number which text should be kept within. get int GetEdgeColumn=2360(,) # Set the column number of the edge. # If text goes past the edge then it is highlighted. set void SetEdgeColumn=2361(int column,) # Retrieve the edge highlight mode. get int GetEdgeMode=2362(,) # The edge may be displayed by a line (EDGE_LINE) or by highlighting text that # goes beyond it (EDGE_BACKGROUND) or not displayed at all (EDGE_NONE). set void SetEdgeMode=2363(int mode,) # Retrieve the colour used in edge indication. get colour GetEdgeColour=2364(,) # Change the colour used in edge indication. set void SetEdgeColour=2365(colour edgeColour,) # Sets the current caret position to be the search anchor. fun void SearchAnchor=2366(,) # Find some text starting at the search anchor. # Does not ensure the selection is visible. fun int SearchNext=2367(int flags, string text) # Find some text starting at the search anchor and moving backwards. # Does not ensure the selection is visible. fun int SearchPrev=2368(int flags, string text) # Retrieves the number of lines completely visible. get int LinesOnScreen=2370(,) # Set whether a pop up menu is displayed automatically when the user presses # the wrong mouse button. fun void UsePopUp=2371(bool allowPopUp,) # Is the selection rectangular? The alternative is the more common stream selection. get bool SelectionIsRectangle=2372(,) # Set the zoom level. This number of points is added to the size of all fonts. # It may be positive to magnify or negative to reduce. set void SetZoom=2373(int zoom,) # Retrieve the zoom level. get int GetZoom=2374(,) # Create a new document object. # Starts with reference count of 1 and not selected into editor. fun int CreateDocument=2375(,) # Extend life of document. fun void AddRefDocument=2376(, int doc) # Release a reference to the document, deleting document if it fades to black. fun void ReleaseDocument=2377(, int doc) # Get which document modification events are sent to the container. get int GetModEventMask=2378(,) # Change internal focus flag. set void SetFocus=2380(bool focus,) # Get internal focus flag. get bool GetFocus=2381(,) enu Status=SC_STATUS_ val SC_STATUS_OK=0 val SC_STATUS_FAILURE=1 val SC_STATUS_BADALLOC=2 # Change error status - 0 = OK. set void SetStatus=2382(int statusCode,) # Get error status. get int GetStatus=2383(,) # Set whether the mouse is captured when its button is pressed. set void SetMouseDownCaptures=2384(bool captures,) # Get whether mouse gets captured. get bool GetMouseDownCaptures=2385(,) enu CursorShape=SC_CURSOR val SC_CURSORNORMAL=-1 val SC_CURSORARROW=2 val SC_CURSORWAIT=4 val SC_CURSORREVERSEARROW=7 # Sets the cursor to one of the SC_CURSOR* values. set void SetCursor=2386(int cursorType,) # Get cursor type. get int GetCursor=2387(,) # Change the way control characters are displayed: # If symbol is < 32, keep the drawn way, else, use the given character. set void SetControlCharSymbol=2388(int symbol,) # Get the way control characters are displayed. get int GetControlCharSymbol=2389(,) # Move to the previous change in capitalisation. fun void WordPartLeft=2390(,) # Move to the previous change in capitalisation extending selection # to new caret position. fun void WordPartLeftExtend=2391(,) # Move to the change next in capitalisation. fun void WordPartRight=2392(,) # Move to the next change in capitalisation extending selection # to new caret position. fun void WordPartRightExtend=2393(,) # Constants for use with SetVisiblePolicy, similar to SetCaretPolicy. val VISIBLE_SLOP=0x01 val VISIBLE_STRICT=0x04 # Set the way the display area is determined when a particular line # is to be moved to by Find, FindNext, GotoLine, etc. fun void SetVisiblePolicy=2394(int visiblePolicy, int visibleSlop) # Delete back from the current position to the start of the line. fun void DelLineLeft=2395(,) # Delete forwards from the current position to the end of the line. fun void DelLineRight=2396(,) # Get and Set the xOffset (ie, horizonal scroll position). set void SetXOffset=2397(int newOffset,) get int GetXOffset=2398(,) # Set the last x chosen value to be the caret x position. fun void ChooseCaretX=2399(,) # Set the focus to this Scintilla widget. fun void GrabFocus=2400(,) enu CaretPolicy=CARET_ # Caret policy, used by SetXCaretPolicy and SetYCaretPolicy. # If CARET_SLOP is set, we can define a slop value: caretSlop. # This value defines an unwanted zone (UZ) where the caret is... unwanted. # This zone is defined as a number of pixels near the vertical margins, # and as a number of lines near the horizontal margins. # By keeping the caret away from the edges, it is seen within its context, # so it is likely that the identifier that the caret is on can be completely seen, # and that the current line is seen with some of the lines following it which are # often dependent on that line. val CARET_SLOP=0x01 # If CARET_STRICT is set, the policy is enforced... strictly. # The caret is centred on the display if slop is not set, # and cannot go in the UZ if slop is set. val CARET_STRICT=0x04 # If CARET_JUMPS is set, the display is moved more energetically # so the caret can move in the same direction longer before the policy is applied again. val CARET_JUMPS=0x10 # If CARET_EVEN is not set, instead of having symmetrical UZs, # the left and bottom UZs are extended up to right and top UZs respectively. # This way, we favour the displaying of useful information: the begining of lines, # where most code reside, and the lines after the caret, eg. the body of a function. val CARET_EVEN=0x08 # Set the way the caret is kept visible when going sideway. # The exclusion zone is given in pixels. fun void SetXCaretPolicy=2402(int caretPolicy, int caretSlop) # Set the way the line the caret is on is kept visible. # The exclusion zone is given in lines. fun void SetYCaretPolicy=2403(int caretPolicy, int caretSlop) # Set printing to line wrapped (SC_WRAP_WORD) or not line wrapped (SC_WRAP_NONE). set void SetPrintWrapMode=2406(int mode,) # Is printing line wrapped? get int GetPrintWrapMode=2407(,) # Set a fore colour for active hotspots. set void SetHotspotActiveFore=2410(bool useSetting, colour fore) # Get the fore colour for active hotspots. get colour GetHotspotActiveFore=2494(,) # Set a back colour for active hotspots. set void SetHotspotActiveBack=2411(bool useSetting, colour back) # Get the back colour for active hotspots. get colour GetHotspotActiveBack=2495(,) # Enable / Disable underlining active hotspots. set void SetHotspotActiveUnderline=2412(bool underline,) # Get whether underlining for active hotspots. get bool GetHotspotActiveUnderline=2496(,) # Limit hotspots to single line so hotspots on two lines don't merge. set void SetHotspotSingleLine=2421(bool singleLine,) # Get the HotspotSingleLine property get bool GetHotspotSingleLine=2497(,) # Move caret between paragraphs (delimited by empty lines). fun void ParaDown=2413(,) fun void ParaDownExtend=2414(,) fun void ParaUp=2415(,) fun void ParaUpExtend=2416(,) # Given a valid document position, return the previous position taking code # page into account. Returns 0 if passed 0. fun position PositionBefore=2417(position pos,) # Given a valid document position, return the next position taking code # page into account. Maximum value returned is the last position in the document. fun position PositionAfter=2418(position pos,) # Copy a range of text to the clipboard. Positions are clipped into the document. fun void CopyRange=2419(position start, position end) # Copy argument text to the clipboard. fun void CopyText=2420(int length, string text) enu SelectionMode=SC_SEL_ val SC_SEL_STREAM=0 val SC_SEL_RECTANGLE=1 val SC_SEL_LINES=2 val SC_SEL_THIN=3 # Set the selection mode to stream (SC_SEL_STREAM) or rectangular (SC_SEL_RECTANGLE/SC_SEL_THIN) or # by lines (SC_SEL_LINES). set void SetSelectionMode=2422(int mode,) # Get the mode of the current selection. get int GetSelectionMode=2423(,) # Retrieve the position of the start of the selection at the given line (INVALID_POSITION if no selection on this line). fun position GetLineSelStartPosition=2424(int line,) # Retrieve the position of the end of the selection at the given line (INVALID_POSITION if no selection on this line). fun position GetLineSelEndPosition=2425(int line,) ## RectExtended rectangular selection moves # Move caret down one line, extending rectangular selection to new caret position. fun void LineDownRectExtend=2426(,) # Move caret up one line, extending rectangular selection to new caret position. fun void LineUpRectExtend=2427(,) # Move caret left one character, extending rectangular selection to new caret position. fun void CharLeftRectExtend=2428(,) # Move caret right one character, extending rectangular selection to new caret position. fun void CharRightRectExtend=2429(,) # Move caret to first position on line, extending rectangular selection to new caret position. fun void HomeRectExtend=2430(,) # Move caret to before first visible character on line. # If already there move to first character on line. # In either case, extend rectangular selection to new caret position. fun void VCHomeRectExtend=2431(,) # Move caret to last position on line, extending rectangular selection to new caret position. fun void LineEndRectExtend=2432(,) # Move caret one page up, extending rectangular selection to new caret position. fun void PageUpRectExtend=2433(,) # Move caret one page down, extending rectangular selection to new caret position. fun void PageDownRectExtend=2434(,) # Move caret to top of page, or one page up if already at top of page. fun void StutteredPageUp=2435(,) # Move caret to top of page, or one page up if already at top of page, extending selection to new caret position. fun void StutteredPageUpExtend=2436(,) # Move caret to bottom of page, or one page down if already at bottom of page. fun void StutteredPageDown=2437(,) # Move caret to bottom of page, or one page down if already at bottom of page, extending selection to new caret position. fun void StutteredPageDownExtend=2438(,) # Move caret left one word, position cursor at end of word. fun void WordLeftEnd=2439(,) # Move caret left one word, position cursor at end of word, extending selection to new caret position. fun void WordLeftEndExtend=2440(,) # Move caret right one word, position cursor at end of word. fun void WordRightEnd=2441(,) # Move caret right one word, position cursor at end of word, extending selection to new caret position. fun void WordRightEndExtend=2442(,) # Set the set of characters making up whitespace for when moving or selecting by word. # Should be called after SetWordChars. set void SetWhitespaceChars=2443(, string characters) # Reset the set of characters for whitespace and word characters to the defaults. fun void SetCharsDefault=2444(,) # Get currently selected item position in the auto-completion list fun int AutoCGetCurrent=2445(,) # Get currently selected item text in the auto-completion list # Returns the length of the item text fun int AutoCGetCurrentText=2610(, stringresult s) # Enlarge the document to a particular size of text bytes. fun void Allocate=2446(int bytes,) # Returns the target converted to UTF8. # Return the length in bytes. fun int TargetAsUTF8=2447(, stringresult s) # Set the length of the utf8 argument for calling EncodedFromUTF8. # Set to -1 and the string will be measured to the first nul. fun void SetLengthForEncode=2448(int bytes,) # Translates a UTF8 string into the document encoding. # Return the length of the result in bytes. # On error return 0. fun int EncodedFromUTF8=2449(string utf8, stringresult encoded) # Find the position of a column on a line taking into account tabs and # multi-byte characters. If beyond end of line, return line end position. fun int FindColumn=2456(int line, int column) # Can the caret preferred x position only be changed by explicit movement commands? get int GetCaretSticky=2457(,) # Stop the caret preferred x position changing when the user types. set void SetCaretSticky=2458(int useCaretStickyBehaviour,) enu CaretSticky=SC_CARETSTICKY_ val SC_CARETSTICKY_OFF=0 val SC_CARETSTICKY_ON=1 val SC_CARETSTICKY_WHITESPACE=2 # Switch between sticky and non-sticky: meant to be bound to a key. fun void ToggleCaretSticky=2459(,) # Enable/Disable convert-on-paste for line endings set void SetPasteConvertEndings=2467(bool convert,) # Get convert-on-paste setting get bool GetPasteConvertEndings=2468(,) # Duplicate the selection. If selection empty duplicate the line containing the caret. fun void SelectionDuplicate=2469(,) val SC_ALPHA_TRANSPARENT=0 val SC_ALPHA_OPAQUE=255 val SC_ALPHA_NOALPHA=256 # Set background alpha of the caret line. set void SetCaretLineBackAlpha=2470(int alpha,) # Get the background alpha of the caret line. get int GetCaretLineBackAlpha=2471(,) enu CaretStyle=CARETSTYLE_ val CARETSTYLE_INVISIBLE=0 val CARETSTYLE_LINE=1 val CARETSTYLE_BLOCK=2 # Set the style of the caret to be drawn. set void SetCaretStyle=2512(int caretStyle,) # Returns the current style of the caret. get int GetCaretStyle=2513(,) # Set the indicator used for IndicatorFillRange and IndicatorClearRange set void SetIndicatorCurrent=2500(int indicator,) # Get the current indicator get int GetIndicatorCurrent=2501(,) # Set the value used for IndicatorFillRange set void SetIndicatorValue=2502(int value,) # Get the current indicator vaue get int GetIndicatorValue=2503(,) # Turn a indicator on over a range. fun void IndicatorFillRange=2504(int position, int fillLength) # Turn a indicator off over a range. fun void IndicatorClearRange=2505(int position, int clearLength) # Are any indicators present at position? fun int IndicatorAllOnFor=2506(int position,) # What value does a particular indicator have at at a position? fun int IndicatorValueAt=2507(int indicator, int position) # Where does a particular indicator start? fun int IndicatorStart=2508(int indicator, int position) # Where does a particular indicator end? fun int IndicatorEnd=2509(int indicator, int position) # Set number of entries in position cache set void SetPositionCache=2514(int size,) # How many entries are allocated to the position cache? get int GetPositionCache=2515(,) # Copy the selection, if selection empty copy the line with the caret fun void CopyAllowLine=2519(,) # Compact the document buffer and return a read-only pointer to the # characters in the document. get int GetCharacterPointer=2520(,) # Always interpret keyboard input as Unicode set void SetKeysUnicode=2521(bool keysUnicode,) # Are keys always interpreted as Unicode? get bool GetKeysUnicode=2522(,) # Set the alpha fill colour of the given indicator. set void IndicSetAlpha=2523(int indicator, int alpha) # Get the alpha fill colour of the given indicator. get int IndicGetAlpha=2524(int indicator,) # Set the alpha outline colour of the given indicator. set void IndicSetOutlineAlpha=2558(int indicator, int alpha) # Get the alpha outline colour of the given indicator. get int IndicGetOutlineAlpha=2559(int indicator,) # Set extra ascent for each line set void SetExtraAscent=2525(int extraAscent,) # Get extra ascent for each line get int GetExtraAscent=2526(,) # Set extra descent for each line set void SetExtraDescent=2527(int extraDescent,) # Get extra descent for each line get int GetExtraDescent=2528(,) # Which symbol was defined for markerNumber with MarkerDefine fun int MarkerSymbolDefined=2529(int markerNumber,) # Set the text in the text margin for a line set void MarginSetText=2530(int line, string text) # Get the text in the text margin for a line get int MarginGetText=2531(int line, stringresult text) # Set the style number for the text margin for a line set void MarginSetStyle=2532(int line, int style) # Get the style number for the text margin for a line get int MarginGetStyle=2533(int line,) # Set the style in the text margin for a line set void MarginSetStyles=2534(int line, string styles) # Get the styles in the text margin for a line get int MarginGetStyles=2535(int line, stringresult styles) # Clear the margin text on all lines fun void MarginTextClearAll=2536(,) # Get the start of the range of style numbers used for margin text set void MarginSetStyleOffset=2537(int style,) # Get the start of the range of style numbers used for margin text get int MarginGetStyleOffset=2538(,) enu MarginOption=SC_MARGINOPTION_ val SC_MARGINOPTION_NONE=0 val SC_MARGINOPTION_SUBLINESELECT=1 # Set the margin options. set void SetMarginOptions=2539(int marginOptions,) # Get the margin options. get int GetMarginOptions=2557(,) # Set the annotation text for a line set void AnnotationSetText=2540(int line, string text) # Get the annotation text for a line get int AnnotationGetText=2541(int line, stringresult text) # Set the style number for the annotations for a line set void AnnotationSetStyle=2542(int line, int style) # Get the style number for the annotations for a line get int AnnotationGetStyle=2543(int line,) # Set the annotation styles for a line set void AnnotationSetStyles=2544(int line, string styles) # Get the annotation styles for a line get int AnnotationGetStyles=2545(int line, stringresult styles) # Get the number of annotation lines for a line get int AnnotationGetLines=2546(int line,) # Clear the annotations from all lines fun void AnnotationClearAll=2547(,) enu AnnotationVisible=ANNOTATION_ val ANNOTATION_HIDDEN=0 val ANNOTATION_STANDARD=1 val ANNOTATION_BOXED=2 # Set the visibility for the annotations for a view set void AnnotationSetVisible=2548(int visible,) # Get the visibility for the annotations for a view get int AnnotationGetVisible=2549(,) # Get the start of the range of style numbers used for annotations set void AnnotationSetStyleOffset=2550(int style,) # Get the start of the range of style numbers used for annotations get int AnnotationGetStyleOffset=2551(,) val UNDO_MAY_COALESCE=1 # Add a container action to the undo stack fun void AddUndoAction=2560(int token, int flags) # Find the position of a character from a point within the window. fun position CharPositionFromPoint=2561(int x, int y) # Find the position of a character from a point within the window. # Return INVALID_POSITION if not close to text. fun position CharPositionFromPointClose=2562(int x, int y) # Set whether multiple selections can be made set void SetMultipleSelection=2563(bool multipleSelection,) # Whether multiple selections can be made get bool GetMultipleSelection=2564(,) # Set whether typing can be performed into multiple selections set void SetAdditionalSelectionTyping=2565(bool additionalSelectionTyping,) # Whether typing can be performed into multiple selections get bool GetAdditionalSelectionTyping=2566(,) # Set whether additional carets will blink set void SetAdditionalCaretsBlink=2567(bool additionalCaretsBlink,) # Whether additional carets will blink get bool GetAdditionalCaretsBlink=2568(,) # Set whether additional carets are visible set void SetAdditionalCaretsVisible=2608(bool additionalCaretsBlink,) # Whether additional carets are visible get bool GetAdditionalCaretsVisible=2609(,) # How many selections are there? get int GetSelections=2570(,) # Clear selections to a single empty stream selection fun void ClearSelections=2571(,) # Set a simple selection fun int SetSelection=2572(int caret,int anchor) # Add a selection fun int AddSelection=2573(int caret,int anchor) # Set the main selection set void SetMainSelection=2574(int selection,) # Which selection is the main selection get int GetMainSelection=2575(,) set void SetSelectionNCaret=2576(int selection, position pos) get position GetSelectionNCaret=2577(int selection,) set void SetSelectionNAnchor=2578(int selection, position posAnchor) get position GetSelectionNAnchor=2579(int selection,) set void SetSelectionNCaretVirtualSpace=2580(int selection, int space) get int GetSelectionNCaretVirtualSpace=2581(int selection,) set void SetSelectionNAnchorVirtualSpace=2582(int selection, int space) get int GetSelectionNAnchorVirtualSpace=2583(int selection,) # Sets the position that starts the selection - this becomes the anchor. set void SetSelectionNStart=2584(int selection, position pos) # Returns the position at the start of the selection. get position GetSelectionNStart=2585(int selection,) # Sets the position that ends the selection - this becomes the currentPosition. set void SetSelectionNEnd=2586(int selection, position pos,) # Returns the position at the end of the selection. get position GetSelectionNEnd=2587(int selection,) set void SetRectangularSelectionCaret=2588(position pos,) get position GetRectangularSelectionCaret=2589(,) set void SetRectangularSelectionAnchor=2590(position posAnchor,) get position GetRectangularSelectionAnchor=2591(,) set void SetRectangularSelectionCaretVirtualSpace=2592(int space,) get int GetRectangularSelectionCaretVirtualSpace=2593(,) set void SetRectangularSelectionAnchorVirtualSpace=2594(int space,) get int GetRectangularSelectionAnchorVirtualSpace=2595(,) enu VirtualSpace=SCVS_ val SCVS_NONE=0 val SCVS_RECTANGULARSELECTION=1 val SCVS_USERACCESSIBLE=2 set void SetVirtualSpaceOptions=2596(int virtualSpaceOptions,) get int GetVirtualSpaceOptions=2597(,) # On GTK+, allow selecting the modifier key to use for mouse-based # rectangular selection. Often the window manager requires Alt+Mouse Drag # for moving windows. # Valid values are SCMOD_CTRL(default), SCMOD_ALT, or SCMOD_SUPER. set void SetRectangularSelectionModifier=2598(int modifier,) # Get the modifier key used for rectangular selection. get int GetRectangularSelectionModifier=2599(,) # Set the foreground colour of additional selections. # Must have previously called SetSelFore with non-zero first argument for this to have an effect. set void SetAdditionalSelFore=2600(colour fore,) # Set the background colour of additional selections. # Must have previously called SetSelBack with non-zero first argument for this to have an effect. set void SetAdditionalSelBack=2601(colour back,) # Set the alpha of the selection. set void SetAdditionalSelAlpha=2602(int alpha,) # Get the alpha of the selection. get int GetAdditionalSelAlpha=2603(,) # Set the foreground colour of additional carets. set void SetAdditionalCaretFore=2604(colour fore,) # Get the foreground colour of additional carets. get colour GetAdditionalCaretFore=2605(,) # Set the main selection to the next selection. fun void RotateSelection=2606(,) # Swap that caret and anchor of the main selection. fun void SwapMainAnchorCaret=2607(,) # Indicate that the internal state of a lexer has changed over a range and therefore # there may be a need to redraw. fun int ChangeLexerState=2617(position start, position end) # Find the next line at or after lineStart that is a contracted fold header line. # Return -1 when no more lines. fun int ContractedFoldNext=2618(int lineStart,) # Centre current line in window. fun void VerticalCentreCaret=2619(,) # Move the selected lines up one line, shifting the line above after the selection fun void MoveSelectedLinesUp=2620(,) # Move the selected lines down one line, shifting the line below before the selection fun void MoveSelectedLinesDown=2621(,) # Set the identifier reported as idFrom in notification messages. set void SetIdentifier=2622(int identifier,) # Get the identifier. get int GetIdentifier=2623(,) # Set the width for future RGBA image data. set void RGBAImageSetWidth=2624(int width,) # Set the height for future RGBA image data. set void RGBAImageSetHeight=2625(int height,) # Define a marker from RGBA data. # It has the width and height from RGBAImageSetWidth/Height fun void MarkerDefineRGBAImage=2626(int markerNumber, string pixels) # Register an RGBA image for use in autocompletion lists. # It has the width and height from RGBAImageSetWidth/Height fun void RegisterRGBAImage=2627(int type, string pixels) # Scroll to start of document. fun void ScrollToStart=2628(,) # Scroll to end of document. fun void ScrollToEnd=2629(,) val SC_TECHNOLOGY_DEFAULT=0 val SC_TECHNOLOGY_DIRECTWRITE=1 # Set the technolgy used. set void SetTechnology=2630(int technology,) # Get the tech. get int GetTechnology=2631(,) # Create an ILoader*. fun int CreateLoader=2632(int bytes,) # Start notifying the container of all key presses and commands. fun void StartRecord=3001(,) # Stop notifying the container of all key presses and commands. fun void StopRecord=3002(,) # Set the lexing language of the document. set void SetLexer=4001(int lexer,) # Retrieve the lexing language of the document. get int GetLexer=4002(,) # Colourise a segment of the document using the current lexing language. fun void Colourise=4003(position start, position end) # Set up a value that may be used by a lexer for some optional feature. set void SetProperty=4004(string key, string value) # Maximum value of keywordSet parameter of SetKeyWords. val KEYWORDSET_MAX=8 # Set up the key words used by the lexer. set void SetKeyWords=4005(int keywordSet, string keyWords) # Set the lexing language of the document based on string name. set void SetLexerLanguage=4006(, string language) # Load a lexer library (dll / so). fun void LoadLexerLibrary=4007(, string path) # Retrieve a "property" value previously set with SetProperty. fun int GetProperty=4008(string key, stringresult buf) # Retrieve a "property" value previously set with SetProperty, # with "$()" variable replacement on returned buffer. fun int GetPropertyExpanded=4009(string key, stringresult buf) # Retrieve a "property" value previously set with SetProperty, # interpreted as an int AFTER any "$()" variable replacement. get int GetPropertyInt=4010(string key,) # Retrieve the number of bits the current lexer needs for styling. get int GetStyleBitsNeeded=4011(,) # Retrieve the name of the lexer. # Return the length of the text. get int GetLexerLanguage=4012(, stringresult text) # For private communication between an application and a known lexer. fun int PrivateLexerCall=4013(int operation, int pointer) # Retrieve a '\n' separated list of properties understood by the current lexer. fun int PropertyNames=4014(, stringresult names) enu TypeProperty=SC_TYPE_ val SC_TYPE_BOOLEAN=0 val SC_TYPE_INTEGER=1 val SC_TYPE_STRING=2 # Retrieve the type of a property. fun int PropertyType=4015(string name,) # Describe a property. fun int DescribeProperty=4016(string name, stringresult description) # Retrieve a '\n' separated list of descriptions of the keyword sets understood by the current lexer. fun int DescribeKeyWordSets=4017(, stringresult descriptions) # Notifications # Type of modification and the action which caused the modification. # These are defined as a bit mask to make it easy to specify which notifications are wanted. # One bit is set from each of SC_MOD_* and SC_PERFORMED_*. enu ModificationFlags=SC_MOD_ SC_PERFORMED_ SC_LAST val SC_MOD_INSERTTEXT=0x1 val SC_MOD_DELETETEXT=0x2 val SC_MOD_CHANGESTYLE=0x4 val SC_MOD_CHANGEFOLD=0x8 val SC_PERFORMED_USER=0x10 val SC_PERFORMED_UNDO=0x20 val SC_PERFORMED_REDO=0x40 val SC_MULTISTEPUNDOREDO=0x80 val SC_LASTSTEPINUNDOREDO=0x100 val SC_MOD_CHANGEMARKER=0x200 val SC_MOD_BEFOREINSERT=0x400 val SC_MOD_BEFOREDELETE=0x800 val SC_MULTILINEUNDOREDO=0x1000 val SC_STARTACTION=0x2000 val SC_MOD_CHANGEINDICATOR=0x4000 val SC_MOD_CHANGELINESTATE=0x8000 val SC_MOD_CHANGEMARGIN=0x10000 val SC_MOD_CHANGEANNOTATION=0x20000 val SC_MOD_CONTAINER=0x40000 val SC_MOD_LEXERSTATE=0x80000 val SC_MODEVENTMASKALL=0xFFFFF enu Update=SC_UPDATE_ val SC_UPDATE_CONTENT=0x1 val SC_UPDATE_SELECTION=0x2 val SC_UPDATE_V_SCROLL=0x4 val SC_UPDATE_H_SCROLL=0x8 # For compatibility, these go through the COMMAND notification rather than NOTIFY # and should have had exactly the same values as the EN_* constants. # Unfortunately the SETFOCUS and KILLFOCUS are flipped over from EN_* # As clients depend on these constants, this will not be changed. val SCEN_CHANGE=768 val SCEN_SETFOCUS=512 val SCEN_KILLFOCUS=256 # Symbolic key codes and modifier flags. # ASCII and other printable characters below 256. # Extended keys above 300. enu Keys=SCK_ val SCK_DOWN=300 val SCK_UP=301 val SCK_LEFT=302 val SCK_RIGHT=303 val SCK_HOME=304 val SCK_END=305 val SCK_PRIOR=306 val SCK_NEXT=307 val SCK_DELETE=308 val SCK_INSERT=309 val SCK_ESCAPE=7 val SCK_BACK=8 val SCK_TAB=9 val SCK_RETURN=13 val SCK_ADD=310 val SCK_SUBTRACT=311 val SCK_DIVIDE=312 val SCK_WIN=313 val SCK_RWIN=314 val SCK_MENU=315 enu KeyMod=SCMOD_ val SCMOD_NORM=0 val SCMOD_SHIFT=1 val SCMOD_CTRL=2 val SCMOD_ALT=4 val SCMOD_SUPER=8 val SCMOD_META=16 ################################################ # For SciLexer.h enu Lexer=SCLEX_ val SCLEX_CONTAINER=0 val SCLEX_NULL=1 val SCLEX_PYTHON=2 val SCLEX_CPP=3 val SCLEX_HTML=4 val SCLEX_XML=5 val SCLEX_PERL=6 val SCLEX_SQL=7 val SCLEX_VB=8 val SCLEX_PROPERTIES=9 val SCLEX_ERRORLIST=10 val SCLEX_MAKEFILE=11 val SCLEX_BATCH=12 val SCLEX_XCODE=13 val SCLEX_LATEX=14 val SCLEX_LUA=15 val SCLEX_DIFF=16 val SCLEX_CONF=17 val SCLEX_PASCAL=18 val SCLEX_AVE=19 val SCLEX_ADA=20 val SCLEX_LISP=21 val SCLEX_RUBY=22 val SCLEX_EIFFEL=23 val SCLEX_EIFFELKW=24 val SCLEX_TCL=25 val SCLEX_NNCRONTAB=26 val SCLEX_BULLANT=27 val SCLEX_VBSCRIPT=28 val SCLEX_BAAN=31 val SCLEX_MATLAB=32 val SCLEX_SCRIPTOL=33 val SCLEX_ASM=34 val SCLEX_CPPNOCASE=35 val SCLEX_FORTRAN=36 val SCLEX_F77=37 val SCLEX_CSS=38 val SCLEX_POV=39 val SCLEX_LOUT=40 val SCLEX_ESCRIPT=41 val SCLEX_PS=42 val SCLEX_NSIS=43 val SCLEX_MMIXAL=44 val SCLEX_CLW=45 val SCLEX_CLWNOCASE=46 val SCLEX_LOT=47 val SCLEX_YAML=48 val SCLEX_TEX=49 val SCLEX_METAPOST=50 val SCLEX_POWERBASIC=51 val SCLEX_FORTH=52 val SCLEX_ERLANG=53 val SCLEX_OCTAVE=54 val SCLEX_MSSQL=55 val SCLEX_VERILOG=56 val SCLEX_KIX=57 val SCLEX_GUI4CLI=58 val SCLEX_SPECMAN=59 val SCLEX_AU3=60 val SCLEX_APDL=61 val SCLEX_BASH=62 val SCLEX_ASN1=63 val SCLEX_VHDL=64 val SCLEX_CAML=65 val SCLEX_BLITZBASIC=66 val SCLEX_PUREBASIC=67 val SCLEX_HASKELL=68 val SCLEX_PHPSCRIPT=69 val SCLEX_TADS3=70 val SCLEX_REBOL=71 val SCLEX_SMALLTALK=72 val SCLEX_FLAGSHIP=73 val SCLEX_CSOUND=74 val SCLEX_FREEBASIC=75 val SCLEX_INNOSETUP=76 val SCLEX_OPAL=77 val SCLEX_SPICE=78 val SCLEX_D=79 val SCLEX_CMAKE=80 val SCLEX_GAP=81 val SCLEX_PLM=82 val SCLEX_PROGRESS=83 val SCLEX_ABAQUS=84 val SCLEX_ASYMPTOTE=85 val SCLEX_R=86 val SCLEX_MAGIK=87 val SCLEX_POWERSHELL=88 val SCLEX_MYSQL=89 val SCLEX_PO=90 val SCLEX_TAL=91 val SCLEX_COBOL=92 val SCLEX_TACL=93 val SCLEX_SORCUS=94 val SCLEX_POWERPRO=95 val SCLEX_NIMROD=96 val SCLEX_SML=97 val SCLEX_MARKDOWN=98 val SCLEX_TXT2TAGS=99 val SCLEX_A68K=100 val SCLEX_MODULA=101 val SCLEX_COFFEESCRIPT=102 val SCLEX_TCMD=103 val SCLEX_AVS=104 val SCLEX_ECL=105 # When a lexer specifies its language as SCLEX_AUTOMATIC it receives a # value assigned in sequence from SCLEX_AUTOMATIC+1. val SCLEX_AUTOMATIC=1000 # Lexical states for SCLEX_PYTHON lex Python=SCLEX_PYTHON SCE_P_ lex Nimrod=SCLEX_NIMROD SCE_P_ val SCE_P_DEFAULT=0 val SCE_P_COMMENTLINE=1 val SCE_P_NUMBER=2 val SCE_P_STRING=3 val SCE_P_CHARACTER=4 val SCE_P_WORD=5 val SCE_P_TRIPLE=6 val SCE_P_TRIPLEDOUBLE=7 val SCE_P_CLASSNAME=8 val SCE_P_DEFNAME=9 val SCE_P_OPERATOR=10 val SCE_P_IDENTIFIER=11 val SCE_P_COMMENTBLOCK=12 val SCE_P_STRINGEOL=13 val SCE_P_WORD2=14 val SCE_P_DECORATOR=15 # Lexical states for SCLEX_CPP lex Cpp=SCLEX_CPP SCE_C_ lex BullAnt=SCLEX_BULLANT SCE_C_ val SCE_C_DEFAULT=0 val SCE_C_COMMENT=1 val SCE_C_COMMENTLINE=2 val SCE_C_COMMENTDOC=3 val SCE_C_NUMBER=4 val SCE_C_WORD=5 val SCE_C_STRING=6 val SCE_C_CHARACTER=7 val SCE_C_UUID=8 val SCE_C_PREPROCESSOR=9 val SCE_C_OPERATOR=10 val SCE_C_IDENTIFIER=11 val SCE_C_STRINGEOL=12 val SCE_C_VERBATIM=13 val SCE_C_REGEX=14 val SCE_C_COMMENTLINEDOC=15 val SCE_C_WORD2=16 val SCE_C_COMMENTDOCKEYWORD=17 val SCE_C_COMMENTDOCKEYWORDERROR=18 val SCE_C_GLOBALCLASS=19 val SCE_C_STRINGRAW=20 val SCE_C_TRIPLEVERBATIM=21 val SCE_C_HASHQUOTEDSTRING=22 # Lexical states for SCLEX_D lex D=SCLEX_D SCE_D_ val SCE_D_DEFAULT=0 val SCE_D_COMMENT=1 val SCE_D_COMMENTLINE=2 val SCE_D_COMMENTDOC=3 val SCE_D_COMMENTNESTED=4 val SCE_D_NUMBER=5 val SCE_D_WORD=6 val SCE_D_WORD2=7 val SCE_D_WORD3=8 val SCE_D_TYPEDEF=9 val SCE_D_STRING=10 val SCE_D_STRINGEOL=11 val SCE_D_CHARACTER=12 val SCE_D_OPERATOR=13 val SCE_D_IDENTIFIER=14 val SCE_D_COMMENTLINEDOC=15 val SCE_D_COMMENTDOCKEYWORD=16 val SCE_D_COMMENTDOCKEYWORDERROR=17 val SCE_D_STRINGB=18 val SCE_D_STRINGR=19 val SCE_D_WORD5=20 val SCE_D_WORD6=21 val SCE_D_WORD7=22 # Lexical states for SCLEX_TCL lex TCL=SCLEX_TCL SCE_TCL_ val SCE_TCL_DEFAULT=0 val SCE_TCL_COMMENT=1 val SCE_TCL_COMMENTLINE=2 val SCE_TCL_NUMBER=3 val SCE_TCL_WORD_IN_QUOTE=4 val SCE_TCL_IN_QUOTE=5 val SCE_TCL_OPERATOR=6 val SCE_TCL_IDENTIFIER=7 val SCE_TCL_SUBSTITUTION=8 val SCE_TCL_SUB_BRACE=9 val SCE_TCL_MODIFIER=10 val SCE_TCL_EXPAND=11 val SCE_TCL_WORD=12 val SCE_TCL_WORD2=13 val SCE_TCL_WORD3=14 val SCE_TCL_WORD4=15 val SCE_TCL_WORD5=16 val SCE_TCL_WORD6=17 val SCE_TCL_WORD7=18 val SCE_TCL_WORD8=19 val SCE_TCL_COMMENT_BOX=20 val SCE_TCL_BLOCK_COMMENT=21 # Lexical states for SCLEX_HTML, SCLEX_XML lex HTML=SCLEX_HTML SCE_H lex XML=SCLEX_XML SCE_H lex ASP=SCLEX_ASP SCE_H lex PHP=SCLEX_PHP SCE_H val SCE_H_DEFAULT=0 val SCE_H_TAG=1 val SCE_H_TAGUNKNOWN=2 val SCE_H_ATTRIBUTE=3 val SCE_H_ATTRIBUTEUNKNOWN=4 val SCE_H_NUMBER=5 val SCE_H_DOUBLESTRING=6 val SCE_H_SINGLESTRING=7 val SCE_H_OTHER=8 val SCE_H_COMMENT=9 val SCE_H_ENTITY=10 # XML and ASP val SCE_H_TAGEND=11 val SCE_H_XMLSTART=12 val SCE_H_XMLEND=13 val SCE_H_SCRIPT=14 val SCE_H_ASP=15 val SCE_H_ASPAT=16 val SCE_H_CDATA=17 val SCE_H_QUESTION=18 # More HTML val SCE_H_VALUE=19 # X-Code val SCE_H_XCCOMMENT=20 # SGML val SCE_H_SGML_DEFAULT=21 val SCE_H_SGML_COMMAND=22 val SCE_H_SGML_1ST_PARAM=23 val SCE_H_SGML_DOUBLESTRING=24 val SCE_H_SGML_SIMPLESTRING=25 val SCE_H_SGML_ERROR=26 val SCE_H_SGML_SPECIAL=27 val SCE_H_SGML_ENTITY=28 val SCE_H_SGML_COMMENT=29 val SCE_H_SGML_1ST_PARAM_COMMENT=30 val SCE_H_SGML_BLOCK_DEFAULT=31 # Embedded Javascript val SCE_HJ_START=40 val SCE_HJ_DEFAULT=41 val SCE_HJ_COMMENT=42 val SCE_HJ_COMMENTLINE=43 val SCE_HJ_COMMENTDOC=44 val SCE_HJ_NUMBER=45 val SCE_HJ_WORD=46 val SCE_HJ_KEYWORD=47 val SCE_HJ_DOUBLESTRING=48 val SCE_HJ_SINGLESTRING=49 val SCE_HJ_SYMBOLS=50 val SCE_HJ_STRINGEOL=51 val SCE_HJ_REGEX=52 # ASP Javascript val SCE_HJA_START=55 val SCE_HJA_DEFAULT=56 val SCE_HJA_COMMENT=57 val SCE_HJA_COMMENTLINE=58 val SCE_HJA_COMMENTDOC=59 val SCE_HJA_NUMBER=60 val SCE_HJA_WORD=61 val SCE_HJA_KEYWORD=62 val SCE_HJA_DOUBLESTRING=63 val SCE_HJA_SINGLESTRING=64 val SCE_HJA_SYMBOLS=65 val SCE_HJA_STRINGEOL=66 val SCE_HJA_REGEX=67 # Embedded VBScript val SCE_HB_START=70 val SCE_HB_DEFAULT=71 val SCE_HB_COMMENTLINE=72 val SCE_HB_NUMBER=73 val SCE_HB_WORD=74 val SCE_HB_STRING=75 val SCE_HB_IDENTIFIER=76 val SCE_HB_STRINGEOL=77 # ASP VBScript val SCE_HBA_START=80 val SCE_HBA_DEFAULT=81 val SCE_HBA_COMMENTLINE=82 val SCE_HBA_NUMBER=83 val SCE_HBA_WORD=84 val SCE_HBA_STRING=85 val SCE_HBA_IDENTIFIER=86 val SCE_HBA_STRINGEOL=87 # Embedded Python val SCE_HP_START=90 val SCE_HP_DEFAULT=91 val SCE_HP_COMMENTLINE=92 val SCE_HP_NUMBER=93 val SCE_HP_STRING=94 val SCE_HP_CHARACTER=95 val SCE_HP_WORD=96 val SCE_HP_TRIPLE=97 val SCE_HP_TRIPLEDOUBLE=98 val SCE_HP_CLASSNAME=99 val SCE_HP_DEFNAME=100 val SCE_HP_OPERATOR=101 val SCE_HP_IDENTIFIER=102 # PHP val SCE_HPHP_COMPLEX_VARIABLE=104 # ASP Python val SCE_HPA_START=105 val SCE_HPA_DEFAULT=106 val SCE_HPA_COMMENTLINE=107 val SCE_HPA_NUMBER=108 val SCE_HPA_STRING=109 val SCE_HPA_CHARACTER=110 val SCE_HPA_WORD=111 val SCE_HPA_TRIPLE=112 val SCE_HPA_TRIPLEDOUBLE=113 val SCE_HPA_CLASSNAME=114 val SCE_HPA_DEFNAME=115 val SCE_HPA_OPERATOR=116 val SCE_HPA_IDENTIFIER=117 # PHP val SCE_HPHP_DEFAULT=118 val SCE_HPHP_HSTRING=119 val SCE_HPHP_SIMPLESTRING=120 val SCE_HPHP_WORD=121 val SCE_HPHP_NUMBER=122 val SCE_HPHP_VARIABLE=123 val SCE_HPHP_COMMENT=124 val SCE_HPHP_COMMENTLINE=125 val SCE_HPHP_HSTRING_VARIABLE=126 val SCE_HPHP_OPERATOR=127 # Lexical states for SCLEX_PERL lex Perl=SCLEX_PERL SCE_PL_ val SCE_PL_DEFAULT=0 val SCE_PL_ERROR=1 val SCE_PL_COMMENTLINE=2 val SCE_PL_POD=3 val SCE_PL_NUMBER=4 val SCE_PL_WORD=5 val SCE_PL_STRING=6 val SCE_PL_CHARACTER=7 val SCE_PL_PUNCTUATION=8 val SCE_PL_PREPROCESSOR=9 val SCE_PL_OPERATOR=10 val SCE_PL_IDENTIFIER=11 val SCE_PL_SCALAR=12 val SCE_PL_ARRAY=13 val SCE_PL_HASH=14 val SCE_PL_SYMBOLTABLE=15 val SCE_PL_VARIABLE_INDEXER=16 val SCE_PL_REGEX=17 val SCE_PL_REGSUBST=18 val SCE_PL_LONGQUOTE=19 val SCE_PL_BACKTICKS=20 val SCE_PL_DATASECTION=21 val SCE_PL_HERE_DELIM=22 val SCE_PL_HERE_Q=23 val SCE_PL_HERE_QQ=24 val SCE_PL_HERE_QX=25 val SCE_PL_STRING_Q=26 val SCE_PL_STRING_QQ=27 val SCE_PL_STRING_QX=28 val SCE_PL_STRING_QR=29 val SCE_PL_STRING_QW=30 val SCE_PL_POD_VERB=31 val SCE_PL_SUB_PROTOTYPE=40 val SCE_PL_FORMAT_IDENT=41 val SCE_PL_FORMAT=42 val SCE_PL_STRING_VAR=43 val SCE_PL_XLAT=44 val SCE_PL_REGEX_VAR=54 val SCE_PL_REGSUBST_VAR=55 val SCE_PL_BACKTICKS_VAR=57 val SCE_PL_HERE_QQ_VAR=61 val SCE_PL_HERE_QX_VAR=62 val SCE_PL_STRING_QQ_VAR=64 val SCE_PL_STRING_QX_VAR=65 val SCE_PL_STRING_QR_VAR=66 # Lexical states for SCLEX_RUBY lex Ruby=SCLEX_RUBY SCE_RB_ val SCE_RB_DEFAULT=0 val SCE_RB_ERROR=1 val SCE_RB_COMMENTLINE=2 val SCE_RB_POD=3 val SCE_RB_NUMBER=4 val SCE_RB_WORD=5 val SCE_RB_STRING=6 val SCE_RB_CHARACTER=7 val SCE_RB_CLASSNAME=8 val SCE_RB_DEFNAME=9 val SCE_RB_OPERATOR=10 val SCE_RB_IDENTIFIER=11 val SCE_RB_REGEX=12 val SCE_RB_GLOBAL=13 val SCE_RB_SYMBOL=14 val SCE_RB_MODULE_NAME=15 val SCE_RB_INSTANCE_VAR=16 val SCE_RB_CLASS_VAR=17 val SCE_RB_BACKTICKS=18 val SCE_RB_DATASECTION=19 val SCE_RB_HERE_DELIM=20 val SCE_RB_HERE_Q=21 val SCE_RB_HERE_QQ=22 val SCE_RB_HERE_QX=23 val SCE_RB_STRING_Q=24 val SCE_RB_STRING_QQ=25 val SCE_RB_STRING_QX=26 val SCE_RB_STRING_QR=27 val SCE_RB_STRING_QW=28 val SCE_RB_WORD_DEMOTED=29 val SCE_RB_STDIN=30 val SCE_RB_STDOUT=31 val SCE_RB_STDERR=40 val SCE_RB_UPPER_BOUND=41 # Lexical states for SCLEX_VB, SCLEX_VBSCRIPT, SCLEX_POWERBASIC lex VB=SCLEX_VB SCE_B_ lex VBScript=SCLEX_VBSCRIPT SCE_B_ lex PowerBasic=SCLEX_POWERBASIC SCE_B_ val SCE_B_DEFAULT=0 val SCE_B_COMMENT=1 val SCE_B_NUMBER=2 val SCE_B_KEYWORD=3 val SCE_B_STRING=4 val SCE_B_PREPROCESSOR=5 val SCE_B_OPERATOR=6 val SCE_B_IDENTIFIER=7 val SCE_B_DATE=8 val SCE_B_STRINGEOL=9 val SCE_B_KEYWORD2=10 val SCE_B_KEYWORD3=11 val SCE_B_KEYWORD4=12 val SCE_B_CONSTANT=13 val SCE_B_ASM=14 val SCE_B_LABEL=15 val SCE_B_ERROR=16 val SCE_B_HEXNUMBER=17 val SCE_B_BINNUMBER=18 # Lexical states for SCLEX_PROPERTIES lex Properties=SCLEX_PROPERTIES SCE_PROPS_ val SCE_PROPS_DEFAULT=0 val SCE_PROPS_COMMENT=1 val SCE_PROPS_SECTION=2 val SCE_PROPS_ASSIGNMENT=3 val SCE_PROPS_DEFVAL=4 val SCE_PROPS_KEY=5 # Lexical states for SCLEX_LATEX lex LaTeX=SCLEX_LATEX SCE_L_ val SCE_L_DEFAULT=0 val SCE_L_COMMAND=1 val SCE_L_TAG=2 val SCE_L_MATH=3 val SCE_L_COMMENT=4 val SCE_L_TAG2=5 val SCE_L_MATH2=6 val SCE_L_COMMENT2=7 val SCE_L_VERBATIM=8 val SCE_L_SHORTCMD=9 val SCE_L_SPECIAL=10 val SCE_L_CMDOPT=11 val SCE_L_ERROR=12 # Lexical states for SCLEX_LUA lex Lua=SCLEX_LUA SCE_LUA_ val SCE_LUA_DEFAULT=0 val SCE_LUA_COMMENT=1 val SCE_LUA_COMMENTLINE=2 val SCE_LUA_COMMENTDOC=3 val SCE_LUA_NUMBER=4 val SCE_LUA_WORD=5 val SCE_LUA_STRING=6 val SCE_LUA_CHARACTER=7 val SCE_LUA_LITERALSTRING=8 val SCE_LUA_PREPROCESSOR=9 val SCE_LUA_OPERATOR=10 val SCE_LUA_IDENTIFIER=11 val SCE_LUA_STRINGEOL=12 val SCE_LUA_WORD2=13 val SCE_LUA_WORD3=14 val SCE_LUA_WORD4=15 val SCE_LUA_WORD5=16 val SCE_LUA_WORD6=17 val SCE_LUA_WORD7=18 val SCE_LUA_WORD8=19 val SCE_LUA_LABEL=20 # Lexical states for SCLEX_ERRORLIST lex ErrorList=SCLEX_ERRORLIST SCE_ERR_ val SCE_ERR_DEFAULT=0 val SCE_ERR_PYTHON=1 val SCE_ERR_GCC=2 val SCE_ERR_MS=3 val SCE_ERR_CMD=4 val SCE_ERR_BORLAND=5 val SCE_ERR_PERL=6 val SCE_ERR_NET=7 val SCE_ERR_LUA=8 val SCE_ERR_CTAG=9 val SCE_ERR_DIFF_CHANGED=10 val SCE_ERR_DIFF_ADDITION=11 val SCE_ERR_DIFF_DELETION=12 val SCE_ERR_DIFF_MESSAGE=13 val SCE_ERR_PHP=14 val SCE_ERR_ELF=15 val SCE_ERR_IFC=16 val SCE_ERR_IFORT=17 val SCE_ERR_ABSF=18 val SCE_ERR_TIDY=19 val SCE_ERR_JAVA_STACK=20 val SCE_ERR_VALUE=21 # Lexical states for SCLEX_BATCH lex Batch=SCLEX_BATCH SCE_BAT_ val SCE_BAT_DEFAULT=0 val SCE_BAT_COMMENT=1 val SCE_BAT_WORD=2 val SCE_BAT_LABEL=3 val SCE_BAT_HIDE=4 val SCE_BAT_COMMAND=5 val SCE_BAT_IDENTIFIER=6 val SCE_BAT_OPERATOR=7 # Lexical states for SCLEX_TCMD lex TCMD=SCLEX_TCMD SCE_TCMD_ val SCE_TCMD_DEFAULT=0 val SCE_TCMD_COMMENT=1 val SCE_TCMD_WORD=2 val SCE_TCMD_LABEL=3 val SCE_TCMD_HIDE=4 val SCE_TCMD_COMMAND=5 val SCE_TCMD_IDENTIFIER=6 val SCE_TCMD_OPERATOR=7 val SCE_TCMD_ENVIRONMENT=8 val SCE_TCMD_EXPANSION=9 val SCE_TCMD_CLABEL=10 # Lexical states for SCLEX_MAKEFILE lex MakeFile=SCLEX_MAKEFILE SCE_MAKE_ val SCE_MAKE_DEFAULT=0 val SCE_MAKE_COMMENT=1 val SCE_MAKE_PREPROCESSOR=2 val SCE_MAKE_IDENTIFIER=3 val SCE_MAKE_OPERATOR=4 val SCE_MAKE_TARGET=5 val SCE_MAKE_IDEOL=9 # Lexical states for SCLEX_DIFF lex Diff=SCLEX_DIFF SCE_DIFF_ val SCE_DIFF_DEFAULT=0 val SCE_DIFF_COMMENT=1 val SCE_DIFF_COMMAND=2 val SCE_DIFF_HEADER=3 val SCE_DIFF_POSITION=4 val SCE_DIFF_DELETED=5 val SCE_DIFF_ADDED=6 val SCE_DIFF_CHANGED=7 # Lexical states for SCLEX_CONF (Apache Configuration Files Lexer) lex Conf=SCLEX_CONF SCE_CONF_ val SCE_CONF_DEFAULT=0 val SCE_CONF_COMMENT=1 val SCE_CONF_NUMBER=2 val SCE_CONF_IDENTIFIER=3 val SCE_CONF_EXTENSION=4 val SCE_CONF_PARAMETER=5 val SCE_CONF_STRING=6 val SCE_CONF_OPERATOR=7 val SCE_CONF_IP=8 val SCE_CONF_DIRECTIVE=9 # Lexical states for SCLEX_AVE, Avenue lex Avenue=SCLEX_AVE SCE_AVE_ val SCE_AVE_DEFAULT=0 val SCE_AVE_COMMENT=1 val SCE_AVE_NUMBER=2 val SCE_AVE_WORD=3 val SCE_AVE_STRING=6 val SCE_AVE_ENUM=7 val SCE_AVE_STRINGEOL=8 val SCE_AVE_IDENTIFIER=9 val SCE_AVE_OPERATOR=10 val SCE_AVE_WORD1=11 val SCE_AVE_WORD2=12 val SCE_AVE_WORD3=13 val SCE_AVE_WORD4=14 val SCE_AVE_WORD5=15 val SCE_AVE_WORD6=16 # Lexical states for SCLEX_ADA lex Ada=SCLEX_ADA SCE_ADA_ val SCE_ADA_DEFAULT=0 val SCE_ADA_WORD=1 val SCE_ADA_IDENTIFIER=2 val SCE_ADA_NUMBER=3 val SCE_ADA_DELIMITER=4 val SCE_ADA_CHARACTER=5 val SCE_ADA_CHARACTEREOL=6 val SCE_ADA_STRING=7 val SCE_ADA_STRINGEOL=8 val SCE_ADA_LABEL=9 val SCE_ADA_COMMENTLINE=10 val SCE_ADA_ILLEGAL=11 # Lexical states for SCLEX_BAAN lex Baan=SCLEX_BAAN SCE_BAAN_ val SCE_BAAN_DEFAULT=0 val SCE_BAAN_COMMENT=1 val SCE_BAAN_COMMENTDOC=2 val SCE_BAAN_NUMBER=3 val SCE_BAAN_WORD=4 val SCE_BAAN_STRING=5 val SCE_BAAN_PREPROCESSOR=6 val SCE_BAAN_OPERATOR=7 val SCE_BAAN_IDENTIFIER=8 val SCE_BAAN_STRINGEOL=9 val SCE_BAAN_WORD2=10 # Lexical states for SCLEX_LISP lex Lisp=SCLEX_LISP SCE_LISP_ val SCE_LISP_DEFAULT=0 val SCE_LISP_COMMENT=1 val SCE_LISP_NUMBER=2 val SCE_LISP_KEYWORD=3 val SCE_LISP_KEYWORD_KW=4 val SCE_LISP_SYMBOL=5 val SCE_LISP_STRING=6 val SCE_LISP_STRINGEOL=8 val SCE_LISP_IDENTIFIER=9 val SCE_LISP_OPERATOR=10 val SCE_LISP_SPECIAL=11 val SCE_LISP_MULTI_COMMENT=12 # Lexical states for SCLEX_EIFFEL and SCLEX_EIFFELKW lex Eiffel=SCLEX_EIFFEL SCE_EIFFEL_ lex EiffelKW=SCLEX_EIFFELKW SCE_EIFFEL_ val SCE_EIFFEL_DEFAULT=0 val SCE_EIFFEL_COMMENTLINE=1 val SCE_EIFFEL_NUMBER=2 val SCE_EIFFEL_WORD=3 val SCE_EIFFEL_STRING=4 val SCE_EIFFEL_CHARACTER=5 val SCE_EIFFEL_OPERATOR=6 val SCE_EIFFEL_IDENTIFIER=7 val SCE_EIFFEL_STRINGEOL=8 # Lexical states for SCLEX_NNCRONTAB (nnCron crontab Lexer) lex NNCronTab=SCLEX_NNCRONTAB SCE_NNCRONTAB_ val SCE_NNCRONTAB_DEFAULT=0 val SCE_NNCRONTAB_COMMENT=1 val SCE_NNCRONTAB_TASK=2 val SCE_NNCRONTAB_SECTION=3 val SCE_NNCRONTAB_KEYWORD=4 val SCE_NNCRONTAB_MODIFIER=5 val SCE_NNCRONTAB_ASTERISK=6 val SCE_NNCRONTAB_NUMBER=7 val SCE_NNCRONTAB_STRING=8 val SCE_NNCRONTAB_ENVIRONMENT=9 val SCE_NNCRONTAB_IDENTIFIER=10 # Lexical states for SCLEX_FORTH (Forth Lexer) lex Forth=SCLEX_FORTH SCE_FORTH_ val SCE_FORTH_DEFAULT=0 val SCE_FORTH_COMMENT=1 val SCE_FORTH_COMMENT_ML=2 val SCE_FORTH_IDENTIFIER=3 val SCE_FORTH_CONTROL=4 val SCE_FORTH_KEYWORD=5 val SCE_FORTH_DEFWORD=6 val SCE_FORTH_PREWORD1=7 val SCE_FORTH_PREWORD2=8 val SCE_FORTH_NUMBER=9 val SCE_FORTH_STRING=10 val SCE_FORTH_LOCALE=11 # Lexical states for SCLEX_MATLAB lex MatLab=SCLEX_MATLAB SCE_MATLAB_ val SCE_MATLAB_DEFAULT=0 val SCE_MATLAB_COMMENT=1 val SCE_MATLAB_COMMAND=2 val SCE_MATLAB_NUMBER=3 val SCE_MATLAB_KEYWORD=4 # single quoted string val SCE_MATLAB_STRING=5 val SCE_MATLAB_OPERATOR=6 val SCE_MATLAB_IDENTIFIER=7 val SCE_MATLAB_DOUBLEQUOTESTRING=8 # Lexical states for SCLEX_SCRIPTOL lex Sol=SCLEX_SCRIPTOL SCE_SCRIPTOL_ val SCE_SCRIPTOL_DEFAULT=0 val SCE_SCRIPTOL_WHITE=1 val SCE_SCRIPTOL_COMMENTLINE=2 val SCE_SCRIPTOL_PERSISTENT=3 val SCE_SCRIPTOL_CSTYLE=4 val SCE_SCRIPTOL_COMMENTBLOCK=5 val SCE_SCRIPTOL_NUMBER=6 val SCE_SCRIPTOL_STRING=7 val SCE_SCRIPTOL_CHARACTER=8 val SCE_SCRIPTOL_STRINGEOL=9 val SCE_SCRIPTOL_KEYWORD=10 val SCE_SCRIPTOL_OPERATOR=11 val SCE_SCRIPTOL_IDENTIFIER=12 val SCE_SCRIPTOL_TRIPLE=13 val SCE_SCRIPTOL_CLASSNAME=14 val SCE_SCRIPTOL_PREPROCESSOR=15 # Lexical states for SCLEX_ASM lex Asm=SCLEX_ASM SCE_ASM_ val SCE_ASM_DEFAULT=0 val SCE_ASM_COMMENT=1 val SCE_ASM_NUMBER=2 val SCE_ASM_STRING=3 val SCE_ASM_OPERATOR=4 val SCE_ASM_IDENTIFIER=5 val SCE_ASM_CPUINSTRUCTION=6 val SCE_ASM_MATHINSTRUCTION=7 val SCE_ASM_REGISTER=8 val SCE_ASM_DIRECTIVE=9 val SCE_ASM_DIRECTIVEOPERAND=10 val SCE_ASM_COMMENTBLOCK=11 val SCE_ASM_CHARACTER=12 val SCE_ASM_STRINGEOL=13 val SCE_ASM_EXTINSTRUCTION=14 val SCE_ASM_COMMENTDIRECTIVE=15 # Lexical states for SCLEX_FORTRAN lex Fortran=SCLEX_FORTRAN SCE_F_ lex F77=SCLEX_F77 SCE_F_ val SCE_F_DEFAULT=0 val SCE_F_COMMENT=1 val SCE_F_NUMBER=2 val SCE_F_STRING1=3 val SCE_F_STRING2=4 val SCE_F_STRINGEOL=5 val SCE_F_OPERATOR=6 val SCE_F_IDENTIFIER=7 val SCE_F_WORD=8 val SCE_F_WORD2=9 val SCE_F_WORD3=10 val SCE_F_PREPROCESSOR=11 val SCE_F_OPERATOR2=12 val SCE_F_LABEL=13 val SCE_F_CONTINUATION=14 # Lexical states for SCLEX_CSS lex CSS=SCLEX_CSS SCE_CSS_ val SCE_CSS_DEFAULT=0 val SCE_CSS_TAG=1 val SCE_CSS_CLASS=2 val SCE_CSS_PSEUDOCLASS=3 val SCE_CSS_UNKNOWN_PSEUDOCLASS=4 val SCE_CSS_OPERATOR=5 val SCE_CSS_IDENTIFIER=6 val SCE_CSS_UNKNOWN_IDENTIFIER=7 val SCE_CSS_VALUE=8 val SCE_CSS_COMMENT=9 val SCE_CSS_ID=10 val SCE_CSS_IMPORTANT=11 val SCE_CSS_DIRECTIVE=12 val SCE_CSS_DOUBLESTRING=13 val SCE_CSS_SINGLESTRING=14 val SCE_CSS_IDENTIFIER2=15 val SCE_CSS_ATTRIBUTE=16 val SCE_CSS_IDENTIFIER3=17 val SCE_CSS_PSEUDOELEMENT=18 val SCE_CSS_EXTENDED_IDENTIFIER=19 val SCE_CSS_EXTENDED_PSEUDOCLASS=20 val SCE_CSS_EXTENDED_PSEUDOELEMENT=21 val SCE_CSS_MEDIA=22 val SCE_CSS_VARIABLE=23 # Lexical states for SCLEX_POV lex POV=SCLEX_POV SCE_POV_ val SCE_POV_DEFAULT=0 val SCE_POV_COMMENT=1 val SCE_POV_COMMENTLINE=2 val SCE_POV_NUMBER=3 val SCE_POV_OPERATOR=4 val SCE_POV_IDENTIFIER=5 val SCE_POV_STRING=6 val SCE_POV_STRINGEOL=7 val SCE_POV_DIRECTIVE=8 val SCE_POV_BADDIRECTIVE=9 val SCE_POV_WORD2=10 val SCE_POV_WORD3=11 val SCE_POV_WORD4=12 val SCE_POV_WORD5=13 val SCE_POV_WORD6=14 val SCE_POV_WORD7=15 val SCE_POV_WORD8=16 # Lexical states for SCLEX_LOUT lex LOUT=SCLEX_LOUT SCE_LOUT_ val SCE_LOUT_DEFAULT=0 val SCE_LOUT_COMMENT=1 val SCE_LOUT_NUMBER=2 val SCE_LOUT_WORD=3 val SCE_LOUT_WORD2=4 val SCE_LOUT_WORD3=5 val SCE_LOUT_WORD4=6 val SCE_LOUT_STRING=7 val SCE_LOUT_OPERATOR=8 val SCE_LOUT_IDENTIFIER=9 val SCE_LOUT_STRINGEOL=10 # Lexical states for SCLEX_ESCRIPT lex ESCRIPT=SCLEX_ESCRIPT SCE_ESCRIPT_ val SCE_ESCRIPT_DEFAULT=0 val SCE_ESCRIPT_COMMENT=1 val SCE_ESCRIPT_COMMENTLINE=2 val SCE_ESCRIPT_COMMENTDOC=3 val SCE_ESCRIPT_NUMBER=4 val SCE_ESCRIPT_WORD=5 val SCE_ESCRIPT_STRING=6 val SCE_ESCRIPT_OPERATOR=7 val SCE_ESCRIPT_IDENTIFIER=8 val SCE_ESCRIPT_BRACE=9 val SCE_ESCRIPT_WORD2=10 val SCE_ESCRIPT_WORD3=11 # Lexical states for SCLEX_PS lex PS=SCLEX_PS SCE_PS_ val SCE_PS_DEFAULT=0 val SCE_PS_COMMENT=1 val SCE_PS_DSC_COMMENT=2 val SCE_PS_DSC_VALUE=3 val SCE_PS_NUMBER=4 val SCE_PS_NAME=5 val SCE_PS_KEYWORD=6 val SCE_PS_LITERAL=7 val SCE_PS_IMMEVAL=8 val SCE_PS_PAREN_ARRAY=9 val SCE_PS_PAREN_DICT=10 val SCE_PS_PAREN_PROC=11 val SCE_PS_TEXT=12 val SCE_PS_HEXSTRING=13 val SCE_PS_BASE85STRING=14 val SCE_PS_BADSTRINGCHAR=15 # Lexical states for SCLEX_NSIS lex NSIS=SCLEX_NSIS SCE_NSIS_ val SCE_NSIS_DEFAULT=0 val SCE_NSIS_COMMENT=1 val SCE_NSIS_STRINGDQ=2 val SCE_NSIS_STRINGLQ=3 val SCE_NSIS_STRINGRQ=4 val SCE_NSIS_FUNCTION=5 val SCE_NSIS_VARIABLE=6 val SCE_NSIS_LABEL=7 val SCE_NSIS_USERDEFINED=8 val SCE_NSIS_SECTIONDEF=9 val SCE_NSIS_SUBSECTIONDEF=10 val SCE_NSIS_IFDEFINEDEF=11 val SCE_NSIS_MACRODEF=12 val SCE_NSIS_STRINGVAR=13 val SCE_NSIS_NUMBER=14 val SCE_NSIS_SECTIONGROUP=15 val SCE_NSIS_PAGEEX=16 val SCE_NSIS_FUNCTIONDEF=17 val SCE_NSIS_COMMENTBOX=18 # Lexical states for SCLEX_MMIXAL lex MMIXAL=SCLEX_MMIXAL SCE_MMIXAL_ val SCE_MMIXAL_LEADWS=0 val SCE_MMIXAL_COMMENT=1 val SCE_MMIXAL_LABEL=2 val SCE_MMIXAL_OPCODE=3 val SCE_MMIXAL_OPCODE_PRE=4 val SCE_MMIXAL_OPCODE_VALID=5 val SCE_MMIXAL_OPCODE_UNKNOWN=6 val SCE_MMIXAL_OPCODE_POST=7 val SCE_MMIXAL_OPERANDS=8 val SCE_MMIXAL_NUMBER=9 val SCE_MMIXAL_REF=10 val SCE_MMIXAL_CHAR=11 val SCE_MMIXAL_STRING=12 val SCE_MMIXAL_REGISTER=13 val SCE_MMIXAL_HEX=14 val SCE_MMIXAL_OPERATOR=15 val SCE_MMIXAL_SYMBOL=16 val SCE_MMIXAL_INCLUDE=17 # Lexical states for SCLEX_CLW lex Clarion=SCLEX_CLW SCE_CLW_ val SCE_CLW_DEFAULT=0 val SCE_CLW_LABEL=1 val SCE_CLW_COMMENT=2 val SCE_CLW_STRING=3 val SCE_CLW_USER_IDENTIFIER=4 val SCE_CLW_INTEGER_CONSTANT=5 val SCE_CLW_REAL_CONSTANT=6 val SCE_CLW_PICTURE_STRING=7 val SCE_CLW_KEYWORD=8 val SCE_CLW_COMPILER_DIRECTIVE=9 val SCE_CLW_RUNTIME_EXPRESSIONS=10 val SCE_CLW_BUILTIN_PROCEDURES_FUNCTION=11 val SCE_CLW_STRUCTURE_DATA_TYPE=12 val SCE_CLW_ATTRIBUTE=13 val SCE_CLW_STANDARD_EQUATE=14 val SCE_CLW_ERROR=15 val SCE_CLW_DEPRECATED=16 # Lexical states for SCLEX_LOT lex LOT=SCLEX_LOT SCE_LOT_ val SCE_LOT_DEFAULT=0 val SCE_LOT_HEADER=1 val SCE_LOT_BREAK=2 val SCE_LOT_SET=3 val SCE_LOT_PASS=4 val SCE_LOT_FAIL=5 val SCE_LOT_ABORT=6 # Lexical states for SCLEX_YAML lex YAML=SCLEX_YAML SCE_YAML_ val SCE_YAML_DEFAULT=0 val SCE_YAML_COMMENT=1 val SCE_YAML_IDENTIFIER=2 val SCE_YAML_KEYWORD=3 val SCE_YAML_NUMBER=4 val SCE_YAML_REFERENCE=5 val SCE_YAML_DOCUMENT=6 val SCE_YAML_TEXT=7 val SCE_YAML_ERROR=8 val SCE_YAML_OPERATOR=9 # Lexical states for SCLEX_TEX lex TeX=SCLEX_TEX SCE_TEX_ val SCE_TEX_DEFAULT=0 val SCE_TEX_SPECIAL=1 val SCE_TEX_GROUP=2 val SCE_TEX_SYMBOL=3 val SCE_TEX_COMMAND=4 val SCE_TEX_TEXT=5 lex Metapost=SCLEX_METAPOST SCE_METAPOST_ val SCE_METAPOST_DEFAULT=0 val SCE_METAPOST_SPECIAL=1 val SCE_METAPOST_GROUP=2 val SCE_METAPOST_SYMBOL=3 val SCE_METAPOST_COMMAND=4 val SCE_METAPOST_TEXT=5 val SCE_METAPOST_EXTRA=6 # Lexical states for SCLEX_ERLANG lex Erlang=SCLEX_ERLANG SCE_ERLANG_ val SCE_ERLANG_DEFAULT=0 val SCE_ERLANG_COMMENT=1 val SCE_ERLANG_VARIABLE=2 val SCE_ERLANG_NUMBER=3 val SCE_ERLANG_KEYWORD=4 val SCE_ERLANG_STRING=5 val SCE_ERLANG_OPERATOR=6 val SCE_ERLANG_ATOM=7 val SCE_ERLANG_FUNCTION_NAME=8 val SCE_ERLANG_CHARACTER=9 val SCE_ERLANG_MACRO=10 val SCE_ERLANG_RECORD=11 val SCE_ERLANG_PREPROC=12 val SCE_ERLANG_NODE_NAME=13 val SCE_ERLANG_COMMENT_FUNCTION=14 val SCE_ERLANG_COMMENT_MODULE=15 val SCE_ERLANG_COMMENT_DOC=16 val SCE_ERLANG_COMMENT_DOC_MACRO=17 val SCE_ERLANG_ATOM_QUOTED=18 val SCE_ERLANG_MACRO_QUOTED=19 val SCE_ERLANG_RECORD_QUOTED=20 val SCE_ERLANG_NODE_NAME_QUOTED=21 val SCE_ERLANG_BIFS=22 val SCE_ERLANG_MODULES=23 val SCE_ERLANG_MODULES_ATT=24 val SCE_ERLANG_UNKNOWN=31 # Lexical states for SCLEX_OCTAVE are identical to MatLab lex Octave=SCLEX_OCTAVE SCE_MATLAB_ # Lexical states for SCLEX_MSSQL lex MSSQL=SCLEX_MSSQL SCE_MSSQL_ val SCE_MSSQL_DEFAULT=0 val SCE_MSSQL_COMMENT=1 val SCE_MSSQL_LINE_COMMENT=2 val SCE_MSSQL_NUMBER=3 val SCE_MSSQL_STRING=4 val SCE_MSSQL_OPERATOR=5 val SCE_MSSQL_IDENTIFIER=6 val SCE_MSSQL_VARIABLE=7 val SCE_MSSQL_COLUMN_NAME=8 val SCE_MSSQL_STATEMENT=9 val SCE_MSSQL_DATATYPE=10 val SCE_MSSQL_SYSTABLE=11 val SCE_MSSQL_GLOBAL_VARIABLE=12 val SCE_MSSQL_FUNCTION=13 val SCE_MSSQL_STORED_PROCEDURE=14 val SCE_MSSQL_DEFAULT_PREF_DATATYPE=15 val SCE_MSSQL_COLUMN_NAME_2=16 # Lexical states for SCLEX_VERILOG lex Verilog=SCLEX_VERILOG SCE_V_ val SCE_V_DEFAULT=0 val SCE_V_COMMENT=1 val SCE_V_COMMENTLINE=2 val SCE_V_COMMENTLINEBANG=3 val SCE_V_NUMBER=4 val SCE_V_WORD=5 val SCE_V_STRING=6 val SCE_V_WORD2=7 val SCE_V_WORD3=8 val SCE_V_PREPROCESSOR=9 val SCE_V_OPERATOR=10 val SCE_V_IDENTIFIER=11 val SCE_V_STRINGEOL=12 val SCE_V_USER=19 # Lexical states for SCLEX_KIX lex Kix=SCLEX_KIX SCE_KIX_ val SCE_KIX_DEFAULT=0 val SCE_KIX_COMMENT=1 val SCE_KIX_STRING1=2 val SCE_KIX_STRING2=3 val SCE_KIX_NUMBER=4 val SCE_KIX_VAR=5 val SCE_KIX_MACRO=6 val SCE_KIX_KEYWORD=7 val SCE_KIX_FUNCTIONS=8 val SCE_KIX_OPERATOR=9 val SCE_KIX_IDENTIFIER=31 # Lexical states for SCLEX_GUI4CLI val SCE_GC_DEFAULT=0 val SCE_GC_COMMENTLINE=1 val SCE_GC_COMMENTBLOCK=2 val SCE_GC_GLOBAL=3 val SCE_GC_EVENT=4 val SCE_GC_ATTRIBUTE=5 val SCE_GC_CONTROL=6 val SCE_GC_COMMAND=7 val SCE_GC_STRING=8 val SCE_GC_OPERATOR=9 # Lexical states for SCLEX_SPECMAN lex Specman=SCLEX_SPECMAN SCE_SN_ val SCE_SN_DEFAULT=0 val SCE_SN_CODE=1 val SCE_SN_COMMENTLINE=2 val SCE_SN_COMMENTLINEBANG=3 val SCE_SN_NUMBER=4 val SCE_SN_WORD=5 val SCE_SN_STRING=6 val SCE_SN_WORD2=7 val SCE_SN_WORD3=8 val SCE_SN_PREPROCESSOR=9 val SCE_SN_OPERATOR=10 val SCE_SN_IDENTIFIER=11 val SCE_SN_STRINGEOL=12 val SCE_SN_REGEXTAG=13 val SCE_SN_SIGNAL=14 val SCE_SN_USER=19 # Lexical states for SCLEX_AU3 lex Au3=SCLEX_AU3 SCE_AU3_ val SCE_AU3_DEFAULT=0 val SCE_AU3_COMMENT=1 val SCE_AU3_COMMENTBLOCK=2 val SCE_AU3_NUMBER=3 val SCE_AU3_FUNCTION=4 val SCE_AU3_KEYWORD=5 val SCE_AU3_MACRO=6 val SCE_AU3_STRING=7 val SCE_AU3_OPERATOR=8 val SCE_AU3_VARIABLE=9 val SCE_AU3_SENT=10 val SCE_AU3_PREPROCESSOR=11 val SCE_AU3_SPECIAL=12 val SCE_AU3_EXPAND=13 val SCE_AU3_COMOBJ=14 val SCE_AU3_UDF=15 # Lexical states for SCLEX_APDL lex APDL=SCLEX_APDL SCE_APDL_ val SCE_APDL_DEFAULT=0 val SCE_APDL_COMMENT=1 val SCE_APDL_COMMENTBLOCK=2 val SCE_APDL_NUMBER=3 val SCE_APDL_STRING=4 val SCE_APDL_OPERATOR=5 val SCE_APDL_WORD=6 val SCE_APDL_PROCESSOR=7 val SCE_APDL_COMMAND=8 val SCE_APDL_SLASHCOMMAND=9 val SCE_APDL_STARCOMMAND=10 val SCE_APDL_ARGUMENT=11 val SCE_APDL_FUNCTION=12 # Lexical states for SCLEX_BASH lex Bash=SCLEX_BASH SCE_SH_ val SCE_SH_DEFAULT=0 val SCE_SH_ERROR=1 val SCE_SH_COMMENTLINE=2 val SCE_SH_NUMBER=3 val SCE_SH_WORD=4 val SCE_SH_STRING=5 val SCE_SH_CHARACTER=6 val SCE_SH_OPERATOR=7 val SCE_SH_IDENTIFIER=8 val SCE_SH_SCALAR=9 val SCE_SH_PARAM=10 val SCE_SH_BACKTICKS=11 val SCE_SH_HERE_DELIM=12 val SCE_SH_HERE_Q=13 # Lexical states for SCLEX_ASN1 lex Asn1=SCLEX_ASN1 SCE_ASN1_ val SCE_ASN1_DEFAULT=0 val SCE_ASN1_COMMENT=1 val SCE_ASN1_IDENTIFIER=2 val SCE_ASN1_STRING=3 val SCE_ASN1_OID=4 val SCE_ASN1_SCALAR=5 val SCE_ASN1_KEYWORD=6 val SCE_ASN1_ATTRIBUTE=7 val SCE_ASN1_DESCRIPTOR=8 val SCE_ASN1_TYPE=9 val SCE_ASN1_OPERATOR=10 # Lexical states for SCLEX_VHDL lex VHDL=SCLEX_VHDL SCE_VHDL_ val SCE_VHDL_DEFAULT=0 val SCE_VHDL_COMMENT=1 val SCE_VHDL_COMMENTLINEBANG=2 val SCE_VHDL_NUMBER=3 val SCE_VHDL_STRING=4 val SCE_VHDL_OPERATOR=5 val SCE_VHDL_IDENTIFIER=6 val SCE_VHDL_STRINGEOL=7 val SCE_VHDL_KEYWORD=8 val SCE_VHDL_STDOPERATOR=9 val SCE_VHDL_ATTRIBUTE=10 val SCE_VHDL_STDFUNCTION=11 val SCE_VHDL_STDPACKAGE=12 val SCE_VHDL_STDTYPE=13 val SCE_VHDL_USERWORD=14 # Lexical states for SCLEX_CAML lex Caml=SCLEX_CAML SCE_CAML_ val SCE_CAML_DEFAULT=0 val SCE_CAML_IDENTIFIER=1 val SCE_CAML_TAGNAME=2 val SCE_CAML_KEYWORD=3 val SCE_CAML_KEYWORD2=4 val SCE_CAML_KEYWORD3=5 val SCE_CAML_LINENUM=6 val SCE_CAML_OPERATOR=7 val SCE_CAML_NUMBER=8 val SCE_CAML_CHAR=9 val SCE_CAML_WHITE=10 val SCE_CAML_STRING=11 val SCE_CAML_COMMENT=12 val SCE_CAML_COMMENT1=13 val SCE_CAML_COMMENT2=14 val SCE_CAML_COMMENT3=15 # Lexical states for SCLEX_HASKELL lex Haskell=SCLEX_HASKELL SCE_HA_ val SCE_HA_DEFAULT=0 val SCE_HA_IDENTIFIER=1 val SCE_HA_KEYWORD=2 val SCE_HA_NUMBER=3 val SCE_HA_STRING=4 val SCE_HA_CHARACTER=5 val SCE_HA_CLASS=6 val SCE_HA_MODULE=7 val SCE_HA_CAPITAL=8 val SCE_HA_DATA=9 val SCE_HA_IMPORT=10 val SCE_HA_OPERATOR=11 val SCE_HA_INSTANCE=12 val SCE_HA_COMMENTLINE=13 val SCE_HA_COMMENTBLOCK=14 val SCE_HA_COMMENTBLOCK2=15 val SCE_HA_COMMENTBLOCK3=16 # Lexical states of SCLEX_TADS3 lex TADS3=SCLEX_TADS3 SCE_T3_ val SCE_T3_DEFAULT=0 val SCE_T3_X_DEFAULT=1 val SCE_T3_PREPROCESSOR=2 val SCE_T3_BLOCK_COMMENT=3 val SCE_T3_LINE_COMMENT=4 val SCE_T3_OPERATOR=5 val SCE_T3_KEYWORD=6 val SCE_T3_NUMBER=7 val SCE_T3_IDENTIFIER=8 val SCE_T3_S_STRING=9 val SCE_T3_D_STRING=10 val SCE_T3_X_STRING=11 val SCE_T3_LIB_DIRECTIVE=12 val SCE_T3_MSG_PARAM=13 val SCE_T3_HTML_TAG=14 val SCE_T3_HTML_DEFAULT=15 val SCE_T3_HTML_STRING=16 val SCE_T3_USER1=17 val SCE_T3_USER2=18 val SCE_T3_USER3=19 val SCE_T3_BRACE=20 # Lexical states for SCLEX_REBOL lex Rebol=SCLEX_REBOL SCE_REBOL_ val SCE_REBOL_DEFAULT=0 val SCE_REBOL_COMMENTLINE=1 val SCE_REBOL_COMMENTBLOCK=2 val SCE_REBOL_PREFACE=3 val SCE_REBOL_OPERATOR=4 val SCE_REBOL_CHARACTER=5 val SCE_REBOL_QUOTEDSTRING=6 val SCE_REBOL_BRACEDSTRING=7 val SCE_REBOL_NUMBER=8 val SCE_REBOL_PAIR=9 val SCE_REBOL_TUPLE=10 val SCE_REBOL_BINARY=11 val SCE_REBOL_MONEY=12 val SCE_REBOL_ISSUE=13 val SCE_REBOL_TAG=14 val SCE_REBOL_FILE=15 val SCE_REBOL_EMAIL=16 val SCE_REBOL_URL=17 val SCE_REBOL_DATE=18 val SCE_REBOL_TIME=19 val SCE_REBOL_IDENTIFIER=20 val SCE_REBOL_WORD=21 val SCE_REBOL_WORD2=22 val SCE_REBOL_WORD3=23 val SCE_REBOL_WORD4=24 val SCE_REBOL_WORD5=25 val SCE_REBOL_WORD6=26 val SCE_REBOL_WORD7=27 val SCE_REBOL_WORD8=28 # Lexical states for SCLEX_SQL lex SQL=SCLEX_SQL SCE_SQL_ val SCE_SQL_DEFAULT=0 val SCE_SQL_COMMENT=1 val SCE_SQL_COMMENTLINE=2 val SCE_SQL_COMMENTDOC=3 val SCE_SQL_NUMBER=4 val SCE_SQL_WORD=5 val SCE_SQL_STRING=6 val SCE_SQL_CHARACTER=7 val SCE_SQL_SQLPLUS=8 val SCE_SQL_SQLPLUS_PROMPT=9 val SCE_SQL_OPERATOR=10 val SCE_SQL_IDENTIFIER=11 val SCE_SQL_SQLPLUS_COMMENT=13 val SCE_SQL_COMMENTLINEDOC=15 val SCE_SQL_WORD2=16 val SCE_SQL_COMMENTDOCKEYWORD=17 val SCE_SQL_COMMENTDOCKEYWORDERROR=18 val SCE_SQL_USER1=19 val SCE_SQL_USER2=20 val SCE_SQL_USER3=21 val SCE_SQL_USER4=22 val SCE_SQL_QUOTEDIDENTIFIER=23 # Lexical states for SCLEX_SMALLTALK lex Smalltalk=SCLEX_SMALLTALK SCE_ST_ val SCE_ST_DEFAULT=0 val SCE_ST_STRING=1 val SCE_ST_NUMBER=2 val SCE_ST_COMMENT=3 val SCE_ST_SYMBOL=4 val SCE_ST_BINARY=5 val SCE_ST_BOOL=6 val SCE_ST_SELF=7 val SCE_ST_SUPER=8 val SCE_ST_NIL=9 val SCE_ST_GLOBAL=10 val SCE_ST_RETURN=11 val SCE_ST_SPECIAL=12 val SCE_ST_KWSEND=13 val SCE_ST_ASSIGN=14 val SCE_ST_CHARACTER=15 val SCE_ST_SPEC_SEL=16 # Lexical states for SCLEX_FLAGSHIP (clipper) lex FlagShip=SCLEX_FLAGSHIP SCE_FS_ val SCE_FS_DEFAULT=0 val SCE_FS_COMMENT=1 val SCE_FS_COMMENTLINE=2 val SCE_FS_COMMENTDOC=3 val SCE_FS_COMMENTLINEDOC=4 val SCE_FS_COMMENTDOCKEYWORD=5 val SCE_FS_COMMENTDOCKEYWORDERROR=6 val SCE_FS_KEYWORD=7 val SCE_FS_KEYWORD2=8 val SCE_FS_KEYWORD3=9 val SCE_FS_KEYWORD4=10 val SCE_FS_NUMBER=11 val SCE_FS_STRING=12 val SCE_FS_PREPROCESSOR=13 val SCE_FS_OPERATOR=14 val SCE_FS_IDENTIFIER=15 val SCE_FS_DATE=16 val SCE_FS_STRINGEOL=17 val SCE_FS_CONSTANT=18 val SCE_FS_WORDOPERATOR=19 val SCE_FS_DISABLEDCODE=20 val SCE_FS_DEFAULT_C=21 val SCE_FS_COMMENTDOC_C=22 val SCE_FS_COMMENTLINEDOC_C=23 val SCE_FS_KEYWORD_C=24 val SCE_FS_KEYWORD2_C=25 val SCE_FS_NUMBER_C=26 val SCE_FS_STRING_C=27 val SCE_FS_PREPROCESSOR_C=28 val SCE_FS_OPERATOR_C=29 val SCE_FS_IDENTIFIER_C=30 val SCE_FS_STRINGEOL_C=31 # Lexical states for SCLEX_CSOUND lex Csound=SCLEX_CSOUND SCE_CSOUND_ val SCE_CSOUND_DEFAULT=0 val SCE_CSOUND_COMMENT=1 val SCE_CSOUND_NUMBER=2 val SCE_CSOUND_OPERATOR=3 val SCE_CSOUND_INSTR=4 val SCE_CSOUND_IDENTIFIER=5 val SCE_CSOUND_OPCODE=6 val SCE_CSOUND_HEADERSTMT=7 val SCE_CSOUND_USERKEYWORD=8 val SCE_CSOUND_COMMENTBLOCK=9 val SCE_CSOUND_PARAM=10 val SCE_CSOUND_ARATE_VAR=11 val SCE_CSOUND_KRATE_VAR=12 val SCE_CSOUND_IRATE_VAR=13 val SCE_CSOUND_GLOBAL_VAR=14 val SCE_CSOUND_STRINGEOL=15 # Lexical states for SCLEX_INNOSETUP lex Inno=SCLEX_INNOSETUP SCE_INNO_ val SCE_INNO_DEFAULT=0 val SCE_INNO_COMMENT=1 val SCE_INNO_KEYWORD=2 val SCE_INNO_PARAMETER=3 val SCE_INNO_SECTION=4 val SCE_INNO_PREPROC=5 val SCE_INNO_INLINE_EXPANSION=6 val SCE_INNO_COMMENT_PASCAL=7 val SCE_INNO_KEYWORD_PASCAL=8 val SCE_INNO_KEYWORD_USER=9 val SCE_INNO_STRING_DOUBLE=10 val SCE_INNO_STRING_SINGLE=11 val SCE_INNO_IDENTIFIER=12 # Lexical states for SCLEX_OPAL lex Opal=SCLEX_OPAL SCE_OPAL_ val SCE_OPAL_SPACE=0 val SCE_OPAL_COMMENT_BLOCK=1 val SCE_OPAL_COMMENT_LINE=2 val SCE_OPAL_INTEGER=3 val SCE_OPAL_KEYWORD=4 val SCE_OPAL_SORT=5 val SCE_OPAL_STRING=6 val SCE_OPAL_PAR=7 val SCE_OPAL_BOOL_CONST=8 val SCE_OPAL_DEFAULT=32 # Lexical states for SCLEX_SPICE lex Spice=SCLEX_SPICE SCE_SPICE_ val SCE_SPICE_DEFAULT=0 val SCE_SPICE_IDENTIFIER=1 val SCE_SPICE_KEYWORD=2 val SCE_SPICE_KEYWORD2=3 val SCE_SPICE_KEYWORD3=4 val SCE_SPICE_NUMBER=5 val SCE_SPICE_DELIMITER=6 val SCE_SPICE_VALUE=7 val SCE_SPICE_COMMENTLINE=8 # Lexical states for SCLEX_CMAKE lex CMAKE=SCLEX_CMAKE SCE_CMAKE_ val SCE_CMAKE_DEFAULT=0 val SCE_CMAKE_COMMENT=1 val SCE_CMAKE_STRINGDQ=2 val SCE_CMAKE_STRINGLQ=3 val SCE_CMAKE_STRINGRQ=4 val SCE_CMAKE_COMMANDS=5 val SCE_CMAKE_PARAMETERS=6 val SCE_CMAKE_VARIABLE=7 val SCE_CMAKE_USERDEFINED=8 val SCE_CMAKE_WHILEDEF=9 val SCE_CMAKE_FOREACHDEF=10 val SCE_CMAKE_IFDEFINEDEF=11 val SCE_CMAKE_MACRODEF=12 val SCE_CMAKE_STRINGVAR=13 val SCE_CMAKE_NUMBER=14 # Lexical states for SCLEX_GAP lex Gap=SCLEX_GAP SCE_GAP_ val SCE_GAP_DEFAULT=0 val SCE_GAP_IDENTIFIER=1 val SCE_GAP_KEYWORD=2 val SCE_GAP_KEYWORD2=3 val SCE_GAP_KEYWORD3=4 val SCE_GAP_KEYWORD4=5 val SCE_GAP_STRING=6 val SCE_GAP_CHAR=7 val SCE_GAP_OPERATOR=8 val SCE_GAP_COMMENT=9 val SCE_GAP_NUMBER=10 val SCE_GAP_STRINGEOL=11 # Lexical state for SCLEX_PLM lex PLM=SCLEX_PLM SCE_PLM_ val SCE_PLM_DEFAULT=0 val SCE_PLM_COMMENT=1 val SCE_PLM_STRING=2 val SCE_PLM_NUMBER=3 val SCE_PLM_IDENTIFIER=4 val SCE_PLM_OPERATOR=5 val SCE_PLM_CONTROL=6 val SCE_PLM_KEYWORD=7 # Lexical state for SCLEX_PROGRESS lex Progress=SCLEX_PROGRESS SCE_4GL_ val SCE_4GL_DEFAULT=0 val SCE_4GL_NUMBER=1 val SCE_4GL_WORD=2 val SCE_4GL_STRING=3 val SCE_4GL_CHARACTER=4 val SCE_4GL_PREPROCESSOR=5 val SCE_4GL_OPERATOR=6 val SCE_4GL_IDENTIFIER=7 val SCE_4GL_BLOCK=8 val SCE_4GL_END=9 val SCE_4GL_COMMENT1=10 val SCE_4GL_COMMENT2=11 val SCE_4GL_COMMENT3=12 val SCE_4GL_COMMENT4=13 val SCE_4GL_COMMENT5=14 val SCE_4GL_COMMENT6=15 val SCE_4GL_DEFAULT_=16 val SCE_4GL_NUMBER_=17 val SCE_4GL_WORD_=18 val SCE_4GL_STRING_=19 val SCE_4GL_CHARACTER_=20 val SCE_4GL_PREPROCESSOR_=21 val SCE_4GL_OPERATOR_=22 val SCE_4GL_IDENTIFIER_=23 val SCE_4GL_BLOCK_=24 val SCE_4GL_END_=25 val SCE_4GL_COMMENT1_=26 val SCE_4GL_COMMENT2_=27 val SCE_4GL_COMMENT3_=28 val SCE_4GL_COMMENT4_=29 val SCE_4GL_COMMENT5_=30 val SCE_4GL_COMMENT6_=31 # Lexical states for SCLEX_ABAQUS lex ABAQUS=SCLEX_ABAQUS SCE_ABAQUS_ val SCE_ABAQUS_DEFAULT=0 val SCE_ABAQUS_COMMENT=1 val SCE_ABAQUS_COMMENTBLOCK=2 val SCE_ABAQUS_NUMBER=3 val SCE_ABAQUS_STRING=4 val SCE_ABAQUS_OPERATOR=5 val SCE_ABAQUS_WORD=6 val SCE_ABAQUS_PROCESSOR=7 val SCE_ABAQUS_COMMAND=8 val SCE_ABAQUS_SLASHCOMMAND=9 val SCE_ABAQUS_STARCOMMAND=10 val SCE_ABAQUS_ARGUMENT=11 val SCE_ABAQUS_FUNCTION=12 # Lexical states for SCLEX_ASYMPTOTE lex Asymptote=SCLEX_ASYMPTOTE SCE_ASY_ val SCE_ASY_DEFAULT=0 val SCE_ASY_COMMENT=1 val SCE_ASY_COMMENTLINE=2 val SCE_ASY_NUMBER=3 val SCE_ASY_WORD=4 val SCE_ASY_STRING=5 val SCE_ASY_CHARACTER=6 val SCE_ASY_OPERATOR=7 val SCE_ASY_IDENTIFIER=8 val SCE_ASY_STRINGEOL=9 val SCE_ASY_COMMENTLINEDOC=10 val SCE_ASY_WORD2=11 # Lexical states for SCLEX_R lex R=SCLEX_R SCE_R_ val SCE_R_DEFAULT=0 val SCE_R_COMMENT=1 val SCE_R_KWORD=2 val SCE_R_BASEKWORD=3 val SCE_R_OTHERKWORD=4 val SCE_R_NUMBER=5 val SCE_R_STRING=6 val SCE_R_STRING2=7 val SCE_R_OPERATOR=8 val SCE_R_IDENTIFIER=9 val SCE_R_INFIX=10 val SCE_R_INFIXEOL=11 # Lexical state for SCLEX_MAGIKSF lex MagikSF=SCLEX_MAGIKSF SCE_MAGIK_ val SCE_MAGIK_DEFAULT=0 val SCE_MAGIK_COMMENT=1 val SCE_MAGIK_HYPER_COMMENT=16 val SCE_MAGIK_STRING=2 val SCE_MAGIK_CHARACTER=3 val SCE_MAGIK_NUMBER=4 val SCE_MAGIK_IDENTIFIER=5 val SCE_MAGIK_OPERATOR=6 val SCE_MAGIK_FLOW=7 val SCE_MAGIK_CONTAINER=8 val SCE_MAGIK_BRACKET_BLOCK=9 val SCE_MAGIK_BRACE_BLOCK=10 val SCE_MAGIK_SQBRACKET_BLOCK=11 val SCE_MAGIK_UNKNOWN_KEYWORD=12 val SCE_MAGIK_KEYWORD=13 val SCE_MAGIK_PRAGMA=14 val SCE_MAGIK_SYMBOL=15 # Lexical state for SCLEX_POWERSHELL lex PowerShell=SCLEX_POWERSHELL SCE_POWERSHELL_ val SCE_POWERSHELL_DEFAULT=0 val SCE_POWERSHELL_COMMENT=1 val SCE_POWERSHELL_STRING=2 val SCE_POWERSHELL_CHARACTER=3 val SCE_POWERSHELL_NUMBER=4 val SCE_POWERSHELL_VARIABLE=5 val SCE_POWERSHELL_OPERATOR=6 val SCE_POWERSHELL_IDENTIFIER=7 val SCE_POWERSHELL_KEYWORD=8 val SCE_POWERSHELL_CMDLET=9 val SCE_POWERSHELL_ALIAS=10 val SCE_POWERSHELL_FUNCTION=11 val SCE_POWERSHELL_USER1=12 val SCE_POWERSHELL_COMMENTSTREAM=13 # Lexical state for SCLEX_MYSQL lex MySQL=SCLEX_MYSQL SCE_MYSQL_ val SCE_MYSQL_DEFAULT=0 val SCE_MYSQL_COMMENT=1 val SCE_MYSQL_COMMENTLINE=2 val SCE_MYSQL_VARIABLE=3 val SCE_MYSQL_SYSTEMVARIABLE=4 val SCE_MYSQL_KNOWNSYSTEMVARIABLE=5 val SCE_MYSQL_NUMBER=6 val SCE_MYSQL_MAJORKEYWORD=7 val SCE_MYSQL_KEYWORD=8 val SCE_MYSQL_DATABASEOBJECT=9 val SCE_MYSQL_PROCEDUREKEYWORD=10 val SCE_MYSQL_STRING=11 val SCE_MYSQL_SQSTRING=12 val SCE_MYSQL_DQSTRING=13 val SCE_MYSQL_OPERATOR=14 val SCE_MYSQL_FUNCTION=15 val SCE_MYSQL_IDENTIFIER=16 val SCE_MYSQL_QUOTEDIDENTIFIER=17 val SCE_MYSQL_USER1=18 val SCE_MYSQL_USER2=19 val SCE_MYSQL_USER3=20 val SCE_MYSQL_HIDDENCOMMAND=21 # Lexical state for SCLEX_PO lex Po=SCLEX_PO SCE_PO_ val SCE_PO_DEFAULT=0 val SCE_PO_COMMENT=1 val SCE_PO_MSGID=2 val SCE_PO_MSGID_TEXT=3 val SCE_PO_MSGSTR=4 val SCE_PO_MSGSTR_TEXT=5 val SCE_PO_MSGCTXT=6 val SCE_PO_MSGCTXT_TEXT=7 val SCE_PO_FUZZY=8 # Lexical states for SCLEX_PASCAL lex Pascal=SCLEX_PASCAL SCE_PAS_ val SCE_PAS_DEFAULT=0 val SCE_PAS_IDENTIFIER=1 val SCE_PAS_COMMENT=2 val SCE_PAS_COMMENT2=3 val SCE_PAS_COMMENTLINE=4 val SCE_PAS_PREPROCESSOR=5 val SCE_PAS_PREPROCESSOR2=6 val SCE_PAS_NUMBER=7 val SCE_PAS_HEXNUMBER=8 val SCE_PAS_WORD=9 val SCE_PAS_STRING=10 val SCE_PAS_STRINGEOL=11 val SCE_PAS_CHARACTER=12 val SCE_PAS_OPERATOR=13 val SCE_PAS_ASM=14 # Lexical state for SCLEX_SORCUS lex SORCUS=SCLEX_SORCUS SCE_SORCUS_ val SCE_SORCUS_DEFAULT=0 val SCE_SORCUS_COMMAND=1 val SCE_SORCUS_PARAMETER=2 val SCE_SORCUS_COMMENTLINE=3 val SCE_SORCUS_STRING=4 val SCE_SORCUS_STRINGEOL=5 val SCE_SORCUS_IDENTIFIER=6 val SCE_SORCUS_OPERATOR=7 val SCE_SORCUS_NUMBER=8 val SCE_SORCUS_CONSTANT=9 # Lexical state for SCLEX_POWERPRO lex PowerPro=SCLEX_POWERPRO SCE_POWERPRO_ val SCE_POWERPRO_DEFAULT=0 val SCE_POWERPRO_COMMENTBLOCK=1 val SCE_POWERPRO_COMMENTLINE=2 val SCE_POWERPRO_NUMBER=3 val SCE_POWERPRO_WORD=4 val SCE_POWERPRO_WORD2=5 val SCE_POWERPRO_WORD3=6 val SCE_POWERPRO_WORD4=7 val SCE_POWERPRO_DOUBLEQUOTEDSTRING=8 val SCE_POWERPRO_SINGLEQUOTEDSTRING=9 val SCE_POWERPRO_LINECONTINUE=10 val SCE_POWERPRO_OPERATOR=11 val SCE_POWERPRO_IDENTIFIER=12 val SCE_POWERPRO_STRINGEOL=13 val SCE_POWERPRO_VERBATIM=14 val SCE_POWERPRO_ALTQUOTE=15 val SCE_POWERPRO_FUNCTION=16 # Lexical states for SCLEX_SML lex SML=SCLEX_SML SCE_SML_ val SCE_SML_DEFAULT=0 val SCE_SML_IDENTIFIER=1 val SCE_SML_TAGNAME=2 val SCE_SML_KEYWORD=3 val SCE_SML_KEYWORD2=4 val SCE_SML_KEYWORD3=5 val SCE_SML_LINENUM=6 val SCE_SML_OPERATOR=7 val SCE_SML_NUMBER=8 val SCE_SML_CHAR=9 val SCE_SML_STRING=11 val SCE_SML_COMMENT=12 val SCE_SML_COMMENT1=13 val SCE_SML_COMMENT2=14 val SCE_SML_COMMENT3=15 # Lexical state for SCLEX_MARKDOWN lex Markdown=SCLEX_MARKDOWN SCE_MARKDOWN_ val SCE_MARKDOWN_DEFAULT=0 val SCE_MARKDOWN_LINE_BEGIN=1 val SCE_MARKDOWN_STRONG1=2 val SCE_MARKDOWN_STRONG2=3 val SCE_MARKDOWN_EM1=4 val SCE_MARKDOWN_EM2=5 val SCE_MARKDOWN_HEADER1=6 val SCE_MARKDOWN_HEADER2=7 val SCE_MARKDOWN_HEADER3=8 val SCE_MARKDOWN_HEADER4=9 val SCE_MARKDOWN_HEADER5=10 val SCE_MARKDOWN_HEADER6=11 val SCE_MARKDOWN_PRECHAR=12 val SCE_MARKDOWN_ULIST_ITEM=13 val SCE_MARKDOWN_OLIST_ITEM=14 val SCE_MARKDOWN_BLOCKQUOTE=15 val SCE_MARKDOWN_STRIKEOUT=16 val SCE_MARKDOWN_HRULE=17 val SCE_MARKDOWN_LINK=18 val SCE_MARKDOWN_CODE=19 val SCE_MARKDOWN_CODE2=20 val SCE_MARKDOWN_CODEBK=21 # Lexical state for SCLEX_TXT2TAGS lex Txt2tags=SCLEX_TXT2TAGS SCE_TXT2TAGS_ val SCE_TXT2TAGS_DEFAULT=0 val SCE_TXT2TAGS_LINE_BEGIN=1 val SCE_TXT2TAGS_STRONG1=2 val SCE_TXT2TAGS_STRONG2=3 val SCE_TXT2TAGS_EM1=4 val SCE_TXT2TAGS_EM2=5 val SCE_TXT2TAGS_HEADER1=6 val SCE_TXT2TAGS_HEADER2=7 val SCE_TXT2TAGS_HEADER3=8 val SCE_TXT2TAGS_HEADER4=9 val SCE_TXT2TAGS_HEADER5=10 val SCE_TXT2TAGS_HEADER6=11 val SCE_TXT2TAGS_PRECHAR=12 val SCE_TXT2TAGS_ULIST_ITEM=13 val SCE_TXT2TAGS_OLIST_ITEM=14 val SCE_TXT2TAGS_BLOCKQUOTE=15 val SCE_TXT2TAGS_STRIKEOUT=16 val SCE_TXT2TAGS_HRULE=17 val SCE_TXT2TAGS_LINK=18 val SCE_TXT2TAGS_CODE=19 val SCE_TXT2TAGS_CODE2=20 val SCE_TXT2TAGS_CODEBK=21 val SCE_TXT2TAGS_COMMENT=22 val SCE_TXT2TAGS_OPTION=23 val SCE_TXT2TAGS_PREPROC=24 val SCE_TXT2TAGS_POSTPROC=25 # Lexical states for SCLEX_A68K lex A68k=SCLEX_A68K SCE_A68K_ val SCE_A68K_DEFAULT=0 val SCE_A68K_COMMENT=1 val SCE_A68K_NUMBER_DEC=2 val SCE_A68K_NUMBER_BIN=3 val SCE_A68K_NUMBER_HEX=4 val SCE_A68K_STRING1=5 val SCE_A68K_OPERATOR=6 val SCE_A68K_CPUINSTRUCTION=7 val SCE_A68K_EXTINSTRUCTION=8 val SCE_A68K_REGISTER=9 val SCE_A68K_DIRECTIVE=10 val SCE_A68K_MACRO_ARG=11 val SCE_A68K_LABEL=12 val SCE_A68K_STRING2=13 val SCE_A68K_IDENTIFIER=14 val SCE_A68K_MACRO_DECLARATION=15 val SCE_A68K_COMMENT_WORD=16 val SCE_A68K_COMMENT_SPECIAL=17 val SCE_A68K_COMMENT_DOXYGEN=18 # Lexical states for SCLEX_MODULA lex Modula=SCLEX_MODULA SCE_MODULA_ val SCE_MODULA_DEFAULT=0 val SCE_MODULA_COMMENT=1 val SCE_MODULA_DOXYCOMM=2 val SCE_MODULA_DOXYKEY=3 val SCE_MODULA_KEYWORD=4 val SCE_MODULA_RESERVED=5 val SCE_MODULA_NUMBER=6 val SCE_MODULA_BASENUM=7 val SCE_MODULA_FLOAT=8 val SCE_MODULA_STRING=9 val SCE_MODULA_STRSPEC=10 val SCE_MODULA_CHAR=11 val SCE_MODULA_CHARSPEC=12 val SCE_MODULA_PROC=13 val SCE_MODULA_PRAGMA=14 val SCE_MODULA_PRGKEY=15 val SCE_MODULA_OPERATOR=16 val SCE_MODULA_BADSTR=17 # Lexical states for SCLEX_COFFEESCRIPT lex CoffeeScript=SCLEX_COFFEESCRIPT SCE_COFFEESCRIPT_ val SCE_COFFEESCRIPT_DEFAULT=0 val SCE_COFFEESCRIPT_COMMENT=1 val SCE_COFFEESCRIPT_COMMENTLINE=2 val SCE_COFFEESCRIPT_COMMENTDOC=3 val SCE_COFFEESCRIPT_NUMBER=4 val SCE_COFFEESCRIPT_WORD=5 val SCE_COFFEESCRIPT_STRING=6 val SCE_COFFEESCRIPT_CHARACTER=7 val SCE_COFFEESCRIPT_UUID=8 val SCE_COFFEESCRIPT_PREPROCESSOR=9 val SCE_COFFEESCRIPT_OPERATOR=10 val SCE_COFFEESCRIPT_IDENTIFIER=11 val SCE_COFFEESCRIPT_STRINGEOL=12 val SCE_COFFEESCRIPT_VERBATIM=13 val SCE_COFFEESCRIPT_REGEX=14 val SCE_COFFEESCRIPT_COMMENTLINEDOC=15 val SCE_COFFEESCRIPT_WORD2=16 val SCE_COFFEESCRIPT_COMMENTDOCKEYWORD=17 val SCE_COFFEESCRIPT_COMMENTDOCKEYWORDERROR=18 val SCE_COFFEESCRIPT_GLOBALCLASS=19 val SCE_COFFEESCRIPT_STRINGRAW=20 val SCE_COFFEESCRIPT_TRIPLEVERBATIM=21 val SCE_COFFEESCRIPT_HASHQUOTEDSTRING=22 val SCE_COFFEESCRIPT_COMMENTBLOCK=22 val SCE_COFFEESCRIPT_VERBOSE_REGEX=23 val SCE_COFFEESCRIPT_VERBOSE_REGEX_COMMENT=24 # Lexical states for SCLEX_AVS lex AVS=SCLEX_AVS SCE_AVS_ val SCE_AVS_DEFAULT=0 val SCE_AVS_COMMENTBLOCK=1 val SCE_AVS_COMMENTBLOCKN=2 val SCE_AVS_COMMENTLINE=3 val SCE_AVS_NUMBER=4 val SCE_AVS_OPERATOR=5 val SCE_AVS_IDENTIFIER=6 val SCE_AVS_STRING=7 val SCE_AVS_TRIPLESTRING=8 val SCE_AVS_KEYWORD=9 val SCE_AVS_FILTER=10 val SCE_AVS_PLUGIN=11 val SCE_AVS_FUNCTION=12 val SCE_AVS_CLIPPROP=13 val SCE_AVS_USERDFN=14 # Lexical states for SCLEX_ECL lex ECL=SCLEX_ECL SCE_ECL_ val SCE_ECL_DEFAULT=0 val SCE_ECL_COMMENT=1 val SCE_ECL_COMMENTLINE=2 val SCE_ECL_NUMBER=3 val SCE_ECL_STRING=4 val SCE_ECL_WORD0=5 val SCE_ECL_OPERATOR=6 val SCE_ECL_CHARACTER=7 val SCE_ECL_UUID=8 val SCE_ECL_PREPROCESSOR=9 val SCE_ECL_UNKNOWN=10 val SCE_ECL_IDENTIFIER=11 val SCE_ECL_STRINGEOL=12 val SCE_ECL_VERBATIM=13 val SCE_ECL_REGEX=14 val SCE_ECL_COMMENTLINEDOC=15 val SCE_ECL_WORD1=16 val SCE_ECL_COMMENTDOCKEYWORD=17 val SCE_ECL_COMMENTDOCKEYWORDERROR=18 val SCE_ECL_WORD2=19 val SCE_ECL_WORD3=20 val SCE_ECL_WORD4=21 val SCE_ECL_WORD5=22 val SCE_ECL_COMMENTDOC=23 val SCE_ECL_ADDED=24 val SCE_ECL_DELETED=25 val SCE_ECL_CHANGED=26 val SCE_ECL_MOVED=27 # Events evt void StyleNeeded=2000(int position) evt void CharAdded=2001(int ch) evt void SavePointReached=2002(void) evt void SavePointLeft=2003(void) evt void ModifyAttemptRO=2004(void) # GTK+ Specific to work around focus and accelerator problems: evt void Key=2005(int ch, int modifiers) evt void DoubleClick=2006(int modifiers, int position, int line) evt void UpdateUI=2007(int updated) evt void Modified=2008(int position, int modificationType, string text, int length, int linesAdded, int line, int foldLevelNow, int foldLevelPrev, int token, int annotationLinesAdded) evt void MacroRecord=2009(int message, int wParam, int lParam) evt void MarginClick=2010(int modifiers, int position, int margin) evt void NeedShown=2011(int position, int length) evt void Painted=2013(void) evt void UserListSelection=2014(int listType, string text, int position) evt void URIDropped=2015(string text) evt void DwellStart=2016(int position, int x, int y) evt void DwellEnd=2017(int position, int x, int y) evt void Zoom=2018(void) evt void HotSpotClick=2019(int modifiers, int position) evt void HotSpotDoubleClick=2020(int modifiers, int position) evt void CallTipClick=2021(int position) evt void AutoCSelection=2022(string text, int position) evt void IndicatorClick=2023(int modifiers, int position) evt void IndicatorRelease=2024(int modifiers, int position) evt void AutoCCancelled=2025(void) evt void AutoCCharDeleted=2026(void) evt void HotSpotReleaseClick=2027(int modifiers, int position) cat Deprecated # Deprecated in 2.21 # The SC_CP_DBCS value can be used to indicate a DBCS mode for GTK+. val SC_CP_DBCS=1 # Deprecated in 2.30 # In palette mode? get bool GetUsePalette=2139(,) # In palette mode, Scintilla uses the environment's palette calls to display # more colours. This may lead to ugly displays. set void SetUsePalette=2039(bool usePalette,) Wx-Scintilla-0.38/wx-scintilla/src/scintilla/include/SciLexer.h000444001750001750 13132411727344243 25164 0ustar00azawawiazawawi000000000000/* Scintilla source code edit control */ /** @file SciLexer.h ** Interface to the added lexer functions in the SciLexer version of the edit control. **/ /* Copyright 1998-2002 by Neil Hodgson * The License.txt file describes the conditions under which this software may be distributed. */ /* Most of this file is automatically generated from the Scintilla.iface interface definition * file which contains any comments about the definitions. HFacer.py does the generation. */ #ifndef SCILEXER_H #define SCILEXER_H /* SciLexer features - not in standard Scintilla */ /* ++Autogenerated -- start of section automatically generated from Scintilla.iface */ #define SCLEX_CONTAINER 0 #define SCLEX_NULL 1 #define SCLEX_PYTHON 2 #define SCLEX_CPP 3 #define SCLEX_HTML 4 #define SCLEX_XML 5 #define SCLEX_PERL 6 #define SCLEX_SQL 7 #define SCLEX_VB 8 #define SCLEX_PROPERTIES 9 #define SCLEX_ERRORLIST 10 #define SCLEX_MAKEFILE 11 #define SCLEX_BATCH 12 #define SCLEX_XCODE 13 #define SCLEX_LATEX 14 #define SCLEX_LUA 15 #define SCLEX_DIFF 16 #define SCLEX_CONF 17 #define SCLEX_PASCAL 18 #define SCLEX_AVE 19 #define SCLEX_ADA 20 #define SCLEX_LISP 21 #define SCLEX_RUBY 22 #define SCLEX_EIFFEL 23 #define SCLEX_EIFFELKW 24 #define SCLEX_TCL 25 #define SCLEX_NNCRONTAB 26 #define SCLEX_BULLANT 27 #define SCLEX_VBSCRIPT 28 #define SCLEX_BAAN 31 #define SCLEX_MATLAB 32 #define SCLEX_SCRIPTOL 33 #define SCLEX_ASM 34 #define SCLEX_CPPNOCASE 35 #define SCLEX_FORTRAN 36 #define SCLEX_F77 37 #define SCLEX_CSS 38 #define SCLEX_POV 39 #define SCLEX_LOUT 40 #define SCLEX_ESCRIPT 41 #define SCLEX_PS 42 #define SCLEX_NSIS 43 #define SCLEX_MMIXAL 44 #define SCLEX_CLW 45 #define SCLEX_CLWNOCASE 46 #define SCLEX_LOT 47 #define SCLEX_YAML 48 #define SCLEX_TEX 49 #define SCLEX_METAPOST 50 #define SCLEX_POWERBASIC 51 #define SCLEX_FORTH 52 #define SCLEX_ERLANG 53 #define SCLEX_OCTAVE 54 #define SCLEX_MSSQL 55 #define SCLEX_VERILOG 56 #define SCLEX_KIX 57 #define SCLEX_GUI4CLI 58 #define SCLEX_SPECMAN 59 #define SCLEX_AU3 60 #define SCLEX_APDL 61 #define SCLEX_BASH 62 #define SCLEX_ASN1 63 #define SCLEX_VHDL 64 #define SCLEX_CAML 65 #define SCLEX_BLITZBASIC 66 #define SCLEX_PUREBASIC 67 #define SCLEX_HASKELL 68 #define SCLEX_PHPSCRIPT 69 #define SCLEX_TADS3 70 #define SCLEX_REBOL 71 #define SCLEX_SMALLTALK 72 #define SCLEX_FLAGSHIP 73 #define SCLEX_CSOUND 74 #define SCLEX_FREEBASIC 75 #define SCLEX_INNOSETUP 76 #define SCLEX_OPAL 77 #define SCLEX_SPICE 78 #define SCLEX_D 79 #define SCLEX_CMAKE 80 #define SCLEX_GAP 81 #define SCLEX_PLM 82 #define SCLEX_PROGRESS 83 #define SCLEX_ABAQUS 84 #define SCLEX_ASYMPTOTE 85 #define SCLEX_R 86 #define SCLEX_MAGIK 87 #define SCLEX_POWERSHELL 88 #define SCLEX_MYSQL 89 #define SCLEX_PO 90 #define SCLEX_TAL 91 #define SCLEX_COBOL 92 #define SCLEX_TACL 93 #define SCLEX_SORCUS 94 #define SCLEX_POWERPRO 95 #define SCLEX_NIMROD 96 #define SCLEX_SML 97 #define SCLEX_MARKDOWN 98 #define SCLEX_TXT2TAGS 99 #define SCLEX_A68K 100 #define SCLEX_MODULA 101 #define SCLEX_COFFEESCRIPT 102 #define SCLEX_TCMD 103 #define SCLEX_AVS 104 #define SCLEX_ECL 105 #define SCLEX_PERL6 199 #define SCLEX_AUTOMATIC 1000 #define SCE_P_DEFAULT 0 #define SCE_P_COMMENTLINE 1 #define SCE_P_NUMBER 2 #define SCE_P_STRING 3 #define SCE_P_CHARACTER 4 #define SCE_P_WORD 5 #define SCE_P_TRIPLE 6 #define SCE_P_TRIPLEDOUBLE 7 #define SCE_P_CLASSNAME 8 #define SCE_P_DEFNAME 9 #define SCE_P_OPERATOR 10 #define SCE_P_IDENTIFIER 11 #define SCE_P_COMMENTBLOCK 12 #define SCE_P_STRINGEOL 13 #define SCE_P_WORD2 14 #define SCE_P_DECORATOR 15 #define SCE_C_DEFAULT 0 #define SCE_C_COMMENT 1 #define SCE_C_COMMENTLINE 2 #define SCE_C_COMMENTDOC 3 #define SCE_C_NUMBER 4 #define SCE_C_WORD 5 #define SCE_C_STRING 6 #define SCE_C_CHARACTER 7 #define SCE_C_UUID 8 #define SCE_C_PREPROCESSOR 9 #define SCE_C_OPERATOR 10 #define SCE_C_IDENTIFIER 11 #define SCE_C_STRINGEOL 12 #define SCE_C_VERBATIM 13 #define SCE_C_REGEX 14 #define SCE_C_COMMENTLINEDOC 15 #define SCE_C_WORD2 16 #define SCE_C_COMMENTDOCKEYWORD 17 #define SCE_C_COMMENTDOCKEYWORDERROR 18 #define SCE_C_GLOBALCLASS 19 #define SCE_C_STRINGRAW 20 #define SCE_C_TRIPLEVERBATIM 21 #define SCE_C_HASHQUOTEDSTRING 22 #define SCE_D_DEFAULT 0 #define SCE_D_COMMENT 1 #define SCE_D_COMMENTLINE 2 #define SCE_D_COMMENTDOC 3 #define SCE_D_COMMENTNESTED 4 #define SCE_D_NUMBER 5 #define SCE_D_WORD 6 #define SCE_D_WORD2 7 #define SCE_D_WORD3 8 #define SCE_D_TYPEDEF 9 #define SCE_D_STRING 10 #define SCE_D_STRINGEOL 11 #define SCE_D_CHARACTER 12 #define SCE_D_OPERATOR 13 #define SCE_D_IDENTIFIER 14 #define SCE_D_COMMENTLINEDOC 15 #define SCE_D_COMMENTDOCKEYWORD 16 #define SCE_D_COMMENTDOCKEYWORDERROR 17 #define SCE_D_STRINGB 18 #define SCE_D_STRINGR 19 #define SCE_D_WORD5 20 #define SCE_D_WORD6 21 #define SCE_D_WORD7 22 #define SCE_TCL_DEFAULT 0 #define SCE_TCL_COMMENT 1 #define SCE_TCL_COMMENTLINE 2 #define SCE_TCL_NUMBER 3 #define SCE_TCL_WORD_IN_QUOTE 4 #define SCE_TCL_IN_QUOTE 5 #define SCE_TCL_OPERATOR 6 #define SCE_TCL_IDENTIFIER 7 #define SCE_TCL_SUBSTITUTION 8 #define SCE_TCL_SUB_BRACE 9 #define SCE_TCL_MODIFIER 10 #define SCE_TCL_EXPAND 11 #define SCE_TCL_WORD 12 #define SCE_TCL_WORD2 13 #define SCE_TCL_WORD3 14 #define SCE_TCL_WORD4 15 #define SCE_TCL_WORD5 16 #define SCE_TCL_WORD6 17 #define SCE_TCL_WORD7 18 #define SCE_TCL_WORD8 19 #define SCE_TCL_COMMENT_BOX 20 #define SCE_TCL_BLOCK_COMMENT 21 #define SCE_H_DEFAULT 0 #define SCE_H_TAG 1 #define SCE_H_TAGUNKNOWN 2 #define SCE_H_ATTRIBUTE 3 #define SCE_H_ATTRIBUTEUNKNOWN 4 #define SCE_H_NUMBER 5 #define SCE_H_DOUBLESTRING 6 #define SCE_H_SINGLESTRING 7 #define SCE_H_OTHER 8 #define SCE_H_COMMENT 9 #define SCE_H_ENTITY 10 #define SCE_H_TAGEND 11 #define SCE_H_XMLSTART 12 #define SCE_H_XMLEND 13 #define SCE_H_SCRIPT 14 #define SCE_H_ASP 15 #define SCE_H_ASPAT 16 #define SCE_H_CDATA 17 #define SCE_H_QUESTION 18 #define SCE_H_VALUE 19 #define SCE_H_XCCOMMENT 20 #define SCE_H_SGML_DEFAULT 21 #define SCE_H_SGML_COMMAND 22 #define SCE_H_SGML_1ST_PARAM 23 #define SCE_H_SGML_DOUBLESTRING 24 #define SCE_H_SGML_SIMPLESTRING 25 #define SCE_H_SGML_ERROR 26 #define SCE_H_SGML_SPECIAL 27 #define SCE_H_SGML_ENTITY 28 #define SCE_H_SGML_COMMENT 29 #define SCE_H_SGML_1ST_PARAM_COMMENT 30 #define SCE_H_SGML_BLOCK_DEFAULT 31 #define SCE_HJ_START 40 #define SCE_HJ_DEFAULT 41 #define SCE_HJ_COMMENT 42 #define SCE_HJ_COMMENTLINE 43 #define SCE_HJ_COMMENTDOC 44 #define SCE_HJ_NUMBER 45 #define SCE_HJ_WORD 46 #define SCE_HJ_KEYWORD 47 #define SCE_HJ_DOUBLESTRING 48 #define SCE_HJ_SINGLESTRING 49 #define SCE_HJ_SYMBOLS 50 #define SCE_HJ_STRINGEOL 51 #define SCE_HJ_REGEX 52 #define SCE_HJA_START 55 #define SCE_HJA_DEFAULT 56 #define SCE_HJA_COMMENT 57 #define SCE_HJA_COMMENTLINE 58 #define SCE_HJA_COMMENTDOC 59 #define SCE_HJA_NUMBER 60 #define SCE_HJA_WORD 61 #define SCE_HJA_KEYWORD 62 #define SCE_HJA_DOUBLESTRING 63 #define SCE_HJA_SINGLESTRING 64 #define SCE_HJA_SYMBOLS 65 #define SCE_HJA_STRINGEOL 66 #define SCE_HJA_REGEX 67 #define SCE_HB_START 70 #define SCE_HB_DEFAULT 71 #define SCE_HB_COMMENTLINE 72 #define SCE_HB_NUMBER 73 #define SCE_HB_WORD 74 #define SCE_HB_STRING 75 #define SCE_HB_IDENTIFIER 76 #define SCE_HB_STRINGEOL 77 #define SCE_HBA_START 80 #define SCE_HBA_DEFAULT 81 #define SCE_HBA_COMMENTLINE 82 #define SCE_HBA_NUMBER 83 #define SCE_HBA_WORD 84 #define SCE_HBA_STRING 85 #define SCE_HBA_IDENTIFIER 86 #define SCE_HBA_STRINGEOL 87 #define SCE_HP_START 90 #define SCE_HP_DEFAULT 91 #define SCE_HP_COMMENTLINE 92 #define SCE_HP_NUMBER 93 #define SCE_HP_STRING 94 #define SCE_HP_CHARACTER 95 #define SCE_HP_WORD 96 #define SCE_HP_TRIPLE 97 #define SCE_HP_TRIPLEDOUBLE 98 #define SCE_HP_CLASSNAME 99 #define SCE_HP_DEFNAME 100 #define SCE_HP_OPERATOR 101 #define SCE_HP_IDENTIFIER 102 #define SCE_HPHP_COMPLEX_VARIABLE 104 #define SCE_HPA_START 105 #define SCE_HPA_DEFAULT 106 #define SCE_HPA_COMMENTLINE 107 #define SCE_HPA_NUMBER 108 #define SCE_HPA_STRING 109 #define SCE_HPA_CHARACTER 110 #define SCE_HPA_WORD 111 #define SCE_HPA_TRIPLE 112 #define SCE_HPA_TRIPLEDOUBLE 113 #define SCE_HPA_CLASSNAME 114 #define SCE_HPA_DEFNAME 115 #define SCE_HPA_OPERATOR 116 #define SCE_HPA_IDENTIFIER 117 #define SCE_HPHP_DEFAULT 118 #define SCE_HPHP_HSTRING 119 #define SCE_HPHP_SIMPLESTRING 120 #define SCE_HPHP_WORD 121 #define SCE_HPHP_NUMBER 122 #define SCE_HPHP_VARIABLE 123 #define SCE_HPHP_COMMENT 124 #define SCE_HPHP_COMMENTLINE 125 #define SCE_HPHP_HSTRING_VARIABLE 126 #define SCE_HPHP_OPERATOR 127 #define SCE_PL_DEFAULT 0 #define SCE_PL_ERROR 1 #define SCE_PL_COMMENTLINE 2 #define SCE_PL_POD 3 #define SCE_PL_NUMBER 4 #define SCE_PL_WORD 5 #define SCE_PL_STRING 6 #define SCE_PL_CHARACTER 7 #define SCE_PL_PUNCTUATION 8 #define SCE_PL_PREPROCESSOR 9 #define SCE_PL_OPERATOR 10 #define SCE_PL_IDENTIFIER 11 #define SCE_PL_SCALAR 12 #define SCE_PL_ARRAY 13 #define SCE_PL_HASH 14 #define SCE_PL_SYMBOLTABLE 15 #define SCE_PL_VARIABLE_INDEXER 16 #define SCE_PL_REGEX 17 #define SCE_PL_REGSUBST 18 #define SCE_PL_LONGQUOTE 19 #define SCE_PL_BACKTICKS 20 #define SCE_PL_DATASECTION 21 #define SCE_PL_HERE_DELIM 22 #define SCE_PL_HERE_Q 23 #define SCE_PL_HERE_QQ 24 #define SCE_PL_HERE_QX 25 #define SCE_PL_STRING_Q 26 #define SCE_PL_STRING_QQ 27 #define SCE_PL_STRING_QX 28 #define SCE_PL_STRING_QR 29 #define SCE_PL_STRING_QW 30 #define SCE_PL_POD_VERB 31 #define SCE_PL_SUB_PROTOTYPE 40 #define SCE_PL_FORMAT_IDENT 41 #define SCE_PL_FORMAT 42 #define SCE_PL_STRING_VAR 43 #define SCE_PL_XLAT 44 #define SCE_PL_REGEX_VAR 54 #define SCE_PL_REGSUBST_VAR 55 #define SCE_PL_BACKTICKS_VAR 57 #define SCE_PL_HERE_QQ_VAR 61 #define SCE_PL_HERE_QX_VAR 62 #define SCE_PL_STRING_QQ_VAR 64 #define SCE_PL_STRING_QX_VAR 65 #define SCE_PL_STRING_QR_VAR 66 #define SCE_P6_DEFAULT 0 #define SCE_P6_COMMENT 1 #define SCE_P6_STRING 2 #define SCE_RB_DEFAULT 0 #define SCE_RB_ERROR 1 #define SCE_RB_COMMENTLINE 2 #define SCE_RB_POD 3 #define SCE_RB_NUMBER 4 #define SCE_RB_WORD 5 #define SCE_RB_STRING 6 #define SCE_RB_CHARACTER 7 #define SCE_RB_CLASSNAME 8 #define SCE_RB_DEFNAME 9 #define SCE_RB_OPERATOR 10 #define SCE_RB_IDENTIFIER 11 #define SCE_RB_REGEX 12 #define SCE_RB_GLOBAL 13 #define SCE_RB_SYMBOL 14 #define SCE_RB_MODULE_NAME 15 #define SCE_RB_INSTANCE_VAR 16 #define SCE_RB_CLASS_VAR 17 #define SCE_RB_BACKTICKS 18 #define SCE_RB_DATASECTION 19 #define SCE_RB_HERE_DELIM 20 #define SCE_RB_HERE_Q 21 #define SCE_RB_HERE_QQ 22 #define SCE_RB_HERE_QX 23 #define SCE_RB_STRING_Q 24 #define SCE_RB_STRING_QQ 25 #define SCE_RB_STRING_QX 26 #define SCE_RB_STRING_QR 27 #define SCE_RB_STRING_QW 28 #define SCE_RB_WORD_DEMOTED 29 #define SCE_RB_STDIN 30 #define SCE_RB_STDOUT 31 #define SCE_RB_STDERR 40 #define SCE_RB_UPPER_BOUND 41 #define SCE_B_DEFAULT 0 #define SCE_B_COMMENT 1 #define SCE_B_NUMBER 2 #define SCE_B_KEYWORD 3 #define SCE_B_STRING 4 #define SCE_B_PREPROCESSOR 5 #define SCE_B_OPERATOR 6 #define SCE_B_IDENTIFIER 7 #define SCE_B_DATE 8 #define SCE_B_STRINGEOL 9 #define SCE_B_KEYWORD2 10 #define SCE_B_KEYWORD3 11 #define SCE_B_KEYWORD4 12 #define SCE_B_CONSTANT 13 #define SCE_B_ASM 14 #define SCE_B_LABEL 15 #define SCE_B_ERROR 16 #define SCE_B_HEXNUMBER 17 #define SCE_B_BINNUMBER 18 #define SCE_PROPS_DEFAULT 0 #define SCE_PROPS_COMMENT 1 #define SCE_PROPS_SECTION 2 #define SCE_PROPS_ASSIGNMENT 3 #define SCE_PROPS_DEFVAL 4 #define SCE_PROPS_KEY 5 #define SCE_L_DEFAULT 0 #define SCE_L_COMMAND 1 #define SCE_L_TAG 2 #define SCE_L_MATH 3 #define SCE_L_COMMENT 4 #define SCE_L_TAG2 5 #define SCE_L_MATH2 6 #define SCE_L_COMMENT2 7 #define SCE_L_VERBATIM 8 #define SCE_L_SHORTCMD 9 #define SCE_L_SPECIAL 10 #define SCE_L_CMDOPT 11 #define SCE_L_ERROR 12 #define SCE_LUA_DEFAULT 0 #define SCE_LUA_COMMENT 1 #define SCE_LUA_COMMENTLINE 2 #define SCE_LUA_COMMENTDOC 3 #define SCE_LUA_NUMBER 4 #define SCE_LUA_WORD 5 #define SCE_LUA_STRING 6 #define SCE_LUA_CHARACTER 7 #define SCE_LUA_LITERALSTRING 8 #define SCE_LUA_PREPROCESSOR 9 #define SCE_LUA_OPERATOR 10 #define SCE_LUA_IDENTIFIER 11 #define SCE_LUA_STRINGEOL 12 #define SCE_LUA_WORD2 13 #define SCE_LUA_WORD3 14 #define SCE_LUA_WORD4 15 #define SCE_LUA_WORD5 16 #define SCE_LUA_WORD6 17 #define SCE_LUA_WORD7 18 #define SCE_LUA_WORD8 19 #define SCE_LUA_LABEL 20 #define SCE_ERR_DEFAULT 0 #define SCE_ERR_PYTHON 1 #define SCE_ERR_GCC 2 #define SCE_ERR_MS 3 #define SCE_ERR_CMD 4 #define SCE_ERR_BORLAND 5 #define SCE_ERR_PERL 6 #define SCE_ERR_NET 7 #define SCE_ERR_LUA 8 #define SCE_ERR_CTAG 9 #define SCE_ERR_DIFF_CHANGED 10 #define SCE_ERR_DIFF_ADDITION 11 #define SCE_ERR_DIFF_DELETION 12 #define SCE_ERR_DIFF_MESSAGE 13 #define SCE_ERR_PHP 14 #define SCE_ERR_ELF 15 #define SCE_ERR_IFC 16 #define SCE_ERR_IFORT 17 #define SCE_ERR_ABSF 18 #define SCE_ERR_TIDY 19 #define SCE_ERR_JAVA_STACK 20 #define SCE_ERR_VALUE 21 #define SCE_BAT_DEFAULT 0 #define SCE_BAT_COMMENT 1 #define SCE_BAT_WORD 2 #define SCE_BAT_LABEL 3 #define SCE_BAT_HIDE 4 #define SCE_BAT_COMMAND 5 #define SCE_BAT_IDENTIFIER 6 #define SCE_BAT_OPERATOR 7 #define SCE_TCMD_DEFAULT 0 #define SCE_TCMD_COMMENT 1 #define SCE_TCMD_WORD 2 #define SCE_TCMD_LABEL 3 #define SCE_TCMD_HIDE 4 #define SCE_TCMD_COMMAND 5 #define SCE_TCMD_IDENTIFIER 6 #define SCE_TCMD_OPERATOR 7 #define SCE_TCMD_ENVIRONMENT 8 #define SCE_TCMD_EXPANSION 9 #define SCE_TCMD_CLABEL 10 #define SCE_MAKE_DEFAULT 0 #define SCE_MAKE_COMMENT 1 #define SCE_MAKE_PREPROCESSOR 2 #define SCE_MAKE_IDENTIFIER 3 #define SCE_MAKE_OPERATOR 4 #define SCE_MAKE_TARGET 5 #define SCE_MAKE_IDEOL 9 #define SCE_DIFF_DEFAULT 0 #define SCE_DIFF_COMMENT 1 #define SCE_DIFF_COMMAND 2 #define SCE_DIFF_HEADER 3 #define SCE_DIFF_POSITION 4 #define SCE_DIFF_DELETED 5 #define SCE_DIFF_ADDED 6 #define SCE_DIFF_CHANGED 7 #define SCE_CONF_DEFAULT 0 #define SCE_CONF_COMMENT 1 #define SCE_CONF_NUMBER 2 #define SCE_CONF_IDENTIFIER 3 #define SCE_CONF_EXTENSION 4 #define SCE_CONF_PARAMETER 5 #define SCE_CONF_STRING 6 #define SCE_CONF_OPERATOR 7 #define SCE_CONF_IP 8 #define SCE_CONF_DIRECTIVE 9 #define SCE_AVE_DEFAULT 0 #define SCE_AVE_COMMENT 1 #define SCE_AVE_NUMBER 2 #define SCE_AVE_WORD 3 #define SCE_AVE_STRING 6 #define SCE_AVE_ENUM 7 #define SCE_AVE_STRINGEOL 8 #define SCE_AVE_IDENTIFIER 9 #define SCE_AVE_OPERATOR 10 #define SCE_AVE_WORD1 11 #define SCE_AVE_WORD2 12 #define SCE_AVE_WORD3 13 #define SCE_AVE_WORD4 14 #define SCE_AVE_WORD5 15 #define SCE_AVE_WORD6 16 #define SCE_ADA_DEFAULT 0 #define SCE_ADA_WORD 1 #define SCE_ADA_IDENTIFIER 2 #define SCE_ADA_NUMBER 3 #define SCE_ADA_DELIMITER 4 #define SCE_ADA_CHARACTER 5 #define SCE_ADA_CHARACTEREOL 6 #define SCE_ADA_STRING 7 #define SCE_ADA_STRINGEOL 8 #define SCE_ADA_LABEL 9 #define SCE_ADA_COMMENTLINE 10 #define SCE_ADA_ILLEGAL 11 #define SCE_BAAN_DEFAULT 0 #define SCE_BAAN_COMMENT 1 #define SCE_BAAN_COMMENTDOC 2 #define SCE_BAAN_NUMBER 3 #define SCE_BAAN_WORD 4 #define SCE_BAAN_STRING 5 #define SCE_BAAN_PREPROCESSOR 6 #define SCE_BAAN_OPERATOR 7 #define SCE_BAAN_IDENTIFIER 8 #define SCE_BAAN_STRINGEOL 9 #define SCE_BAAN_WORD2 10 #define SCE_LISP_DEFAULT 0 #define SCE_LISP_COMMENT 1 #define SCE_LISP_NUMBER 2 #define SCE_LISP_KEYWORD 3 #define SCE_LISP_KEYWORD_KW 4 #define SCE_LISP_SYMBOL 5 #define SCE_LISP_STRING 6 #define SCE_LISP_STRINGEOL 8 #define SCE_LISP_IDENTIFIER 9 #define SCE_LISP_OPERATOR 10 #define SCE_LISP_SPECIAL 11 #define SCE_LISP_MULTI_COMMENT 12 #define SCE_EIFFEL_DEFAULT 0 #define SCE_EIFFEL_COMMENTLINE 1 #define SCE_EIFFEL_NUMBER 2 #define SCE_EIFFEL_WORD 3 #define SCE_EIFFEL_STRING 4 #define SCE_EIFFEL_CHARACTER 5 #define SCE_EIFFEL_OPERATOR 6 #define SCE_EIFFEL_IDENTIFIER 7 #define SCE_EIFFEL_STRINGEOL 8 #define SCE_NNCRONTAB_DEFAULT 0 #define SCE_NNCRONTAB_COMMENT 1 #define SCE_NNCRONTAB_TASK 2 #define SCE_NNCRONTAB_SECTION 3 #define SCE_NNCRONTAB_KEYWORD 4 #define SCE_NNCRONTAB_MODIFIER 5 #define SCE_NNCRONTAB_ASTERISK 6 #define SCE_NNCRONTAB_NUMBER 7 #define SCE_NNCRONTAB_STRING 8 #define SCE_NNCRONTAB_ENVIRONMENT 9 #define SCE_NNCRONTAB_IDENTIFIER 10 #define SCE_FORTH_DEFAULT 0 #define SCE_FORTH_COMMENT 1 #define SCE_FORTH_COMMENT_ML 2 #define SCE_FORTH_IDENTIFIER 3 #define SCE_FORTH_CONTROL 4 #define SCE_FORTH_KEYWORD 5 #define SCE_FORTH_DEFWORD 6 #define SCE_FORTH_PREWORD1 7 #define SCE_FORTH_PREWORD2 8 #define SCE_FORTH_NUMBER 9 #define SCE_FORTH_STRING 10 #define SCE_FORTH_LOCALE 11 #define SCE_MATLAB_DEFAULT 0 #define SCE_MATLAB_COMMENT 1 #define SCE_MATLAB_COMMAND 2 #define SCE_MATLAB_NUMBER 3 #define SCE_MATLAB_KEYWORD 4 #define SCE_MATLAB_STRING 5 #define SCE_MATLAB_OPERATOR 6 #define SCE_MATLAB_IDENTIFIER 7 #define SCE_MATLAB_DOUBLEQUOTESTRING 8 #define SCE_SCRIPTOL_DEFAULT 0 #define SCE_SCRIPTOL_WHITE 1 #define SCE_SCRIPTOL_COMMENTLINE 2 #define SCE_SCRIPTOL_PERSISTENT 3 #define SCE_SCRIPTOL_CSTYLE 4 #define SCE_SCRIPTOL_COMMENTBLOCK 5 #define SCE_SCRIPTOL_NUMBER 6 #define SCE_SCRIPTOL_STRING 7 #define SCE_SCRIPTOL_CHARACTER 8 #define SCE_SCRIPTOL_STRINGEOL 9 #define SCE_SCRIPTOL_KEYWORD 10 #define SCE_SCRIPTOL_OPERATOR 11 #define SCE_SCRIPTOL_IDENTIFIER 12 #define SCE_SCRIPTOL_TRIPLE 13 #define SCE_SCRIPTOL_CLASSNAME 14 #define SCE_SCRIPTOL_PREPROCESSOR 15 #define SCE_ASM_DEFAULT 0 #define SCE_ASM_COMMENT 1 #define SCE_ASM_NUMBER 2 #define SCE_ASM_STRING 3 #define SCE_ASM_OPERATOR 4 #define SCE_ASM_IDENTIFIER 5 #define SCE_ASM_CPUINSTRUCTION 6 #define SCE_ASM_MATHINSTRUCTION 7 #define SCE_ASM_REGISTER 8 #define SCE_ASM_DIRECTIVE 9 #define SCE_ASM_DIRECTIVEOPERAND 10 #define SCE_ASM_COMMENTBLOCK 11 #define SCE_ASM_CHARACTER 12 #define SCE_ASM_STRINGEOL 13 #define SCE_ASM_EXTINSTRUCTION 14 #define SCE_ASM_COMMENTDIRECTIVE 15 #define SCE_F_DEFAULT 0 #define SCE_F_COMMENT 1 #define SCE_F_NUMBER 2 #define SCE_F_STRING1 3 #define SCE_F_STRING2 4 #define SCE_F_STRINGEOL 5 #define SCE_F_OPERATOR 6 #define SCE_F_IDENTIFIER 7 #define SCE_F_WORD 8 #define SCE_F_WORD2 9 #define SCE_F_WORD3 10 #define SCE_F_PREPROCESSOR 11 #define SCE_F_OPERATOR2 12 #define SCE_F_LABEL 13 #define SCE_F_CONTINUATION 14 #define SCE_CSS_DEFAULT 0 #define SCE_CSS_TAG 1 #define SCE_CSS_CLASS 2 #define SCE_CSS_PSEUDOCLASS 3 #define SCE_CSS_UNKNOWN_PSEUDOCLASS 4 #define SCE_CSS_OPERATOR 5 #define SCE_CSS_IDENTIFIER 6 #define SCE_CSS_UNKNOWN_IDENTIFIER 7 #define SCE_CSS_VALUE 8 #define SCE_CSS_COMMENT 9 #define SCE_CSS_ID 10 #define SCE_CSS_IMPORTANT 11 #define SCE_CSS_DIRECTIVE 12 #define SCE_CSS_DOUBLESTRING 13 #define SCE_CSS_SINGLESTRING 14 #define SCE_CSS_IDENTIFIER2 15 #define SCE_CSS_ATTRIBUTE 16 #define SCE_CSS_IDENTIFIER3 17 #define SCE_CSS_PSEUDOELEMENT 18 #define SCE_CSS_EXTENDED_IDENTIFIER 19 #define SCE_CSS_EXTENDED_PSEUDOCLASS 20 #define SCE_CSS_EXTENDED_PSEUDOELEMENT 21 #define SCE_CSS_MEDIA 22 #define SCE_CSS_VARIABLE 23 #define SCE_POV_DEFAULT 0 #define SCE_POV_COMMENT 1 #define SCE_POV_COMMENTLINE 2 #define SCE_POV_NUMBER 3 #define SCE_POV_OPERATOR 4 #define SCE_POV_IDENTIFIER 5 #define SCE_POV_STRING 6 #define SCE_POV_STRINGEOL 7 #define SCE_POV_DIRECTIVE 8 #define SCE_POV_BADDIRECTIVE 9 #define SCE_POV_WORD2 10 #define SCE_POV_WORD3 11 #define SCE_POV_WORD4 12 #define SCE_POV_WORD5 13 #define SCE_POV_WORD6 14 #define SCE_POV_WORD7 15 #define SCE_POV_WORD8 16 #define SCE_LOUT_DEFAULT 0 #define SCE_LOUT_COMMENT 1 #define SCE_LOUT_NUMBER 2 #define SCE_LOUT_WORD 3 #define SCE_LOUT_WORD2 4 #define SCE_LOUT_WORD3 5 #define SCE_LOUT_WORD4 6 #define SCE_LOUT_STRING 7 #define SCE_LOUT_OPERATOR 8 #define SCE_LOUT_IDENTIFIER 9 #define SCE_LOUT_STRINGEOL 10 #define SCE_ESCRIPT_DEFAULT 0 #define SCE_ESCRIPT_COMMENT 1 #define SCE_ESCRIPT_COMMENTLINE 2 #define SCE_ESCRIPT_COMMENTDOC 3 #define SCE_ESCRIPT_NUMBER 4 #define SCE_ESCRIPT_WORD 5 #define SCE_ESCRIPT_STRING 6 #define SCE_ESCRIPT_OPERATOR 7 #define SCE_ESCRIPT_IDENTIFIER 8 #define SCE_ESCRIPT_BRACE 9 #define SCE_ESCRIPT_WORD2 10 #define SCE_ESCRIPT_WORD3 11 #define SCE_PS_DEFAULT 0 #define SCE_PS_COMMENT 1 #define SCE_PS_DSC_COMMENT 2 #define SCE_PS_DSC_VALUE 3 #define SCE_PS_NUMBER 4 #define SCE_PS_NAME 5 #define SCE_PS_KEYWORD 6 #define SCE_PS_LITERAL 7 #define SCE_PS_IMMEVAL 8 #define SCE_PS_PAREN_ARRAY 9 #define SCE_PS_PAREN_DICT 10 #define SCE_PS_PAREN_PROC 11 #define SCE_PS_TEXT 12 #define SCE_PS_HEXSTRING 13 #define SCE_PS_BASE85STRING 14 #define SCE_PS_BADSTRINGCHAR 15 #define SCE_NSIS_DEFAULT 0 #define SCE_NSIS_COMMENT 1 #define SCE_NSIS_STRINGDQ 2 #define SCE_NSIS_STRINGLQ 3 #define SCE_NSIS_STRINGRQ 4 #define SCE_NSIS_FUNCTION 5 #define SCE_NSIS_VARIABLE 6 #define SCE_NSIS_LABEL 7 #define SCE_NSIS_USERDEFINED 8 #define SCE_NSIS_SECTIONDEF 9 #define SCE_NSIS_SUBSECTIONDEF 10 #define SCE_NSIS_IFDEFINEDEF 11 #define SCE_NSIS_MACRODEF 12 #define SCE_NSIS_STRINGVAR 13 #define SCE_NSIS_NUMBER 14 #define SCE_NSIS_SECTIONGROUP 15 #define SCE_NSIS_PAGEEX 16 #define SCE_NSIS_FUNCTIONDEF 17 #define SCE_NSIS_COMMENTBOX 18 #define SCE_MMIXAL_LEADWS 0 #define SCE_MMIXAL_COMMENT 1 #define SCE_MMIXAL_LABEL 2 #define SCE_MMIXAL_OPCODE 3 #define SCE_MMIXAL_OPCODE_PRE 4 #define SCE_MMIXAL_OPCODE_VALID 5 #define SCE_MMIXAL_OPCODE_UNKNOWN 6 #define SCE_MMIXAL_OPCODE_POST 7 #define SCE_MMIXAL_OPERANDS 8 #define SCE_MMIXAL_NUMBER 9 #define SCE_MMIXAL_REF 10 #define SCE_MMIXAL_CHAR 11 #define SCE_MMIXAL_STRING 12 #define SCE_MMIXAL_REGISTER 13 #define SCE_MMIXAL_HEX 14 #define SCE_MMIXAL_OPERATOR 15 #define SCE_MMIXAL_SYMBOL 16 #define SCE_MMIXAL_INCLUDE 17 #define SCE_CLW_DEFAULT 0 #define SCE_CLW_LABEL 1 #define SCE_CLW_COMMENT 2 #define SCE_CLW_STRING 3 #define SCE_CLW_USER_IDENTIFIER 4 #define SCE_CLW_INTEGER_CONSTANT 5 #define SCE_CLW_REAL_CONSTANT 6 #define SCE_CLW_PICTURE_STRING 7 #define SCE_CLW_KEYWORD 8 #define SCE_CLW_COMPILER_DIRECTIVE 9 #define SCE_CLW_RUNTIME_EXPRESSIONS 10 #define SCE_CLW_BUILTIN_PROCEDURES_FUNCTION 11 #define SCE_CLW_STRUCTURE_DATA_TYPE 12 #define SCE_CLW_ATTRIBUTE 13 #define SCE_CLW_STANDARD_EQUATE 14 #define SCE_CLW_ERROR 15 #define SCE_CLW_DEPRECATED 16 #define SCE_LOT_DEFAULT 0 #define SCE_LOT_HEADER 1 #define SCE_LOT_BREAK 2 #define SCE_LOT_SET 3 #define SCE_LOT_PASS 4 #define SCE_LOT_FAIL 5 #define SCE_LOT_ABORT 6 #define SCE_YAML_DEFAULT 0 #define SCE_YAML_COMMENT 1 #define SCE_YAML_IDENTIFIER 2 #define SCE_YAML_KEYWORD 3 #define SCE_YAML_NUMBER 4 #define SCE_YAML_REFERENCE 5 #define SCE_YAML_DOCUMENT 6 #define SCE_YAML_TEXT 7 #define SCE_YAML_ERROR 8 #define SCE_YAML_OPERATOR 9 #define SCE_TEX_DEFAULT 0 #define SCE_TEX_SPECIAL 1 #define SCE_TEX_GROUP 2 #define SCE_TEX_SYMBOL 3 #define SCE_TEX_COMMAND 4 #define SCE_TEX_TEXT 5 #define SCE_METAPOST_DEFAULT 0 #define SCE_METAPOST_SPECIAL 1 #define SCE_METAPOST_GROUP 2 #define SCE_METAPOST_SYMBOL 3 #define SCE_METAPOST_COMMAND 4 #define SCE_METAPOST_TEXT 5 #define SCE_METAPOST_EXTRA 6 #define SCE_ERLANG_DEFAULT 0 #define SCE_ERLANG_COMMENT 1 #define SCE_ERLANG_VARIABLE 2 #define SCE_ERLANG_NUMBER 3 #define SCE_ERLANG_KEYWORD 4 #define SCE_ERLANG_STRING 5 #define SCE_ERLANG_OPERATOR 6 #define SCE_ERLANG_ATOM 7 #define SCE_ERLANG_FUNCTION_NAME 8 #define SCE_ERLANG_CHARACTER 9 #define SCE_ERLANG_MACRO 10 #define SCE_ERLANG_RECORD 11 #define SCE_ERLANG_PREPROC 12 #define SCE_ERLANG_NODE_NAME 13 #define SCE_ERLANG_COMMENT_FUNCTION 14 #define SCE_ERLANG_COMMENT_MODULE 15 #define SCE_ERLANG_COMMENT_DOC 16 #define SCE_ERLANG_COMMENT_DOC_MACRO 17 #define SCE_ERLANG_ATOM_QUOTED 18 #define SCE_ERLANG_MACRO_QUOTED 19 #define SCE_ERLANG_RECORD_QUOTED 20 #define SCE_ERLANG_NODE_NAME_QUOTED 21 #define SCE_ERLANG_BIFS 22 #define SCE_ERLANG_MODULES 23 #define SCE_ERLANG_MODULES_ATT 24 #define SCE_ERLANG_UNKNOWN 31 #define SCE_MSSQL_DEFAULT 0 #define SCE_MSSQL_COMMENT 1 #define SCE_MSSQL_LINE_COMMENT 2 #define SCE_MSSQL_NUMBER 3 #define SCE_MSSQL_STRING 4 #define SCE_MSSQL_OPERATOR 5 #define SCE_MSSQL_IDENTIFIER 6 #define SCE_MSSQL_VARIABLE 7 #define SCE_MSSQL_COLUMN_NAME 8 #define SCE_MSSQL_STATEMENT 9 #define SCE_MSSQL_DATATYPE 10 #define SCE_MSSQL_SYSTABLE 11 #define SCE_MSSQL_GLOBAL_VARIABLE 12 #define SCE_MSSQL_FUNCTION 13 #define SCE_MSSQL_STORED_PROCEDURE 14 #define SCE_MSSQL_DEFAULT_PREF_DATATYPE 15 #define SCE_MSSQL_COLUMN_NAME_2 16 #define SCE_V_DEFAULT 0 #define SCE_V_COMMENT 1 #define SCE_V_COMMENTLINE 2 #define SCE_V_COMMENTLINEBANG 3 #define SCE_V_NUMBER 4 #define SCE_V_WORD 5 #define SCE_V_STRING 6 #define SCE_V_WORD2 7 #define SCE_V_WORD3 8 #define SCE_V_PREPROCESSOR 9 #define SCE_V_OPERATOR 10 #define SCE_V_IDENTIFIER 11 #define SCE_V_STRINGEOL 12 #define SCE_V_USER 19 #define SCE_KIX_DEFAULT 0 #define SCE_KIX_COMMENT 1 #define SCE_KIX_STRING1 2 #define SCE_KIX_STRING2 3 #define SCE_KIX_NUMBER 4 #define SCE_KIX_VAR 5 #define SCE_KIX_MACRO 6 #define SCE_KIX_KEYWORD 7 #define SCE_KIX_FUNCTIONS 8 #define SCE_KIX_OPERATOR 9 #define SCE_KIX_IDENTIFIER 31 #define SCE_GC_DEFAULT 0 #define SCE_GC_COMMENTLINE 1 #define SCE_GC_COMMENTBLOCK 2 #define SCE_GC_GLOBAL 3 #define SCE_GC_EVENT 4 #define SCE_GC_ATTRIBUTE 5 #define SCE_GC_CONTROL 6 #define SCE_GC_COMMAND 7 #define SCE_GC_STRING 8 #define SCE_GC_OPERATOR 9 #define SCE_SN_DEFAULT 0 #define SCE_SN_CODE 1 #define SCE_SN_COMMENTLINE 2 #define SCE_SN_COMMENTLINEBANG 3 #define SCE_SN_NUMBER 4 #define SCE_SN_WORD 5 #define SCE_SN_STRING 6 #define SCE_SN_WORD2 7 #define SCE_SN_WORD3 8 #define SCE_SN_PREPROCESSOR 9 #define SCE_SN_OPERATOR 10 #define SCE_SN_IDENTIFIER 11 #define SCE_SN_STRINGEOL 12 #define SCE_SN_REGEXTAG 13 #define SCE_SN_SIGNAL 14 #define SCE_SN_USER 19 #define SCE_AU3_DEFAULT 0 #define SCE_AU3_COMMENT 1 #define SCE_AU3_COMMENTBLOCK 2 #define SCE_AU3_NUMBER 3 #define SCE_AU3_FUNCTION 4 #define SCE_AU3_KEYWORD 5 #define SCE_AU3_MACRO 6 #define SCE_AU3_STRING 7 #define SCE_AU3_OPERATOR 8 #define SCE_AU3_VARIABLE 9 #define SCE_AU3_SENT 10 #define SCE_AU3_PREPROCESSOR 11 #define SCE_AU3_SPECIAL 12 #define SCE_AU3_EXPAND 13 #define SCE_AU3_COMOBJ 14 #define SCE_AU3_UDF 15 #define SCE_APDL_DEFAULT 0 #define SCE_APDL_COMMENT 1 #define SCE_APDL_COMMENTBLOCK 2 #define SCE_APDL_NUMBER 3 #define SCE_APDL_STRING 4 #define SCE_APDL_OPERATOR 5 #define SCE_APDL_WORD 6 #define SCE_APDL_PROCESSOR 7 #define SCE_APDL_COMMAND 8 #define SCE_APDL_SLASHCOMMAND 9 #define SCE_APDL_STARCOMMAND 10 #define SCE_APDL_ARGUMENT 11 #define SCE_APDL_FUNCTION 12 #define SCE_SH_DEFAULT 0 #define SCE_SH_ERROR 1 #define SCE_SH_COMMENTLINE 2 #define SCE_SH_NUMBER 3 #define SCE_SH_WORD 4 #define SCE_SH_STRING 5 #define SCE_SH_CHARACTER 6 #define SCE_SH_OPERATOR 7 #define SCE_SH_IDENTIFIER 8 #define SCE_SH_SCALAR 9 #define SCE_SH_PARAM 10 #define SCE_SH_BACKTICKS 11 #define SCE_SH_HERE_DELIM 12 #define SCE_SH_HERE_Q 13 #define SCE_ASN1_DEFAULT 0 #define SCE_ASN1_COMMENT 1 #define SCE_ASN1_IDENTIFIER 2 #define SCE_ASN1_STRING 3 #define SCE_ASN1_OID 4 #define SCE_ASN1_SCALAR 5 #define SCE_ASN1_KEYWORD 6 #define SCE_ASN1_ATTRIBUTE 7 #define SCE_ASN1_DESCRIPTOR 8 #define SCE_ASN1_TYPE 9 #define SCE_ASN1_OPERATOR 10 #define SCE_VHDL_DEFAULT 0 #define SCE_VHDL_COMMENT 1 #define SCE_VHDL_COMMENTLINEBANG 2 #define SCE_VHDL_NUMBER 3 #define SCE_VHDL_STRING 4 #define SCE_VHDL_OPERATOR 5 #define SCE_VHDL_IDENTIFIER 6 #define SCE_VHDL_STRINGEOL 7 #define SCE_VHDL_KEYWORD 8 #define SCE_VHDL_STDOPERATOR 9 #define SCE_VHDL_ATTRIBUTE 10 #define SCE_VHDL_STDFUNCTION 11 #define SCE_VHDL_STDPACKAGE 12 #define SCE_VHDL_STDTYPE 13 #define SCE_VHDL_USERWORD 14 #define SCE_CAML_DEFAULT 0 #define SCE_CAML_IDENTIFIER 1 #define SCE_CAML_TAGNAME 2 #define SCE_CAML_KEYWORD 3 #define SCE_CAML_KEYWORD2 4 #define SCE_CAML_KEYWORD3 5 #define SCE_CAML_LINENUM 6 #define SCE_CAML_OPERATOR 7 #define SCE_CAML_NUMBER 8 #define SCE_CAML_CHAR 9 #define SCE_CAML_WHITE 10 #define SCE_CAML_STRING 11 #define SCE_CAML_COMMENT 12 #define SCE_CAML_COMMENT1 13 #define SCE_CAML_COMMENT2 14 #define SCE_CAML_COMMENT3 15 #define SCE_HA_DEFAULT 0 #define SCE_HA_IDENTIFIER 1 #define SCE_HA_KEYWORD 2 #define SCE_HA_NUMBER 3 #define SCE_HA_STRING 4 #define SCE_HA_CHARACTER 5 #define SCE_HA_CLASS 6 #define SCE_HA_MODULE 7 #define SCE_HA_CAPITAL 8 #define SCE_HA_DATA 9 #define SCE_HA_IMPORT 10 #define SCE_HA_OPERATOR 11 #define SCE_HA_INSTANCE 12 #define SCE_HA_COMMENTLINE 13 #define SCE_HA_COMMENTBLOCK 14 #define SCE_HA_COMMENTBLOCK2 15 #define SCE_HA_COMMENTBLOCK3 16 #define SCE_T3_DEFAULT 0 #define SCE_T3_X_DEFAULT 1 #define SCE_T3_PREPROCESSOR 2 #define SCE_T3_BLOCK_COMMENT 3 #define SCE_T3_LINE_COMMENT 4 #define SCE_T3_OPERATOR 5 #define SCE_T3_KEYWORD 6 #define SCE_T3_NUMBER 7 #define SCE_T3_IDENTIFIER 8 #define SCE_T3_S_STRING 9 #define SCE_T3_D_STRING 10 #define SCE_T3_X_STRING 11 #define SCE_T3_LIB_DIRECTIVE 12 #define SCE_T3_MSG_PARAM 13 #define SCE_T3_HTML_TAG 14 #define SCE_T3_HTML_DEFAULT 15 #define SCE_T3_HTML_STRING 16 #define SCE_T3_USER1 17 #define SCE_T3_USER2 18 #define SCE_T3_USER3 19 #define SCE_T3_BRACE 20 #define SCE_REBOL_DEFAULT 0 #define SCE_REBOL_COMMENTLINE 1 #define SCE_REBOL_COMMENTBLOCK 2 #define SCE_REBOL_PREFACE 3 #define SCE_REBOL_OPERATOR 4 #define SCE_REBOL_CHARACTER 5 #define SCE_REBOL_QUOTEDSTRING 6 #define SCE_REBOL_BRACEDSTRING 7 #define SCE_REBOL_NUMBER 8 #define SCE_REBOL_PAIR 9 #define SCE_REBOL_TUPLE 10 #define SCE_REBOL_BINARY 11 #define SCE_REBOL_MONEY 12 #define SCE_REBOL_ISSUE 13 #define SCE_REBOL_TAG 14 #define SCE_REBOL_FILE 15 #define SCE_REBOL_EMAIL 16 #define SCE_REBOL_URL 17 #define SCE_REBOL_DATE 18 #define SCE_REBOL_TIME 19 #define SCE_REBOL_IDENTIFIER 20 #define SCE_REBOL_WORD 21 #define SCE_REBOL_WORD2 22 #define SCE_REBOL_WORD3 23 #define SCE_REBOL_WORD4 24 #define SCE_REBOL_WORD5 25 #define SCE_REBOL_WORD6 26 #define SCE_REBOL_WORD7 27 #define SCE_REBOL_WORD8 28 #define SCE_SQL_DEFAULT 0 #define SCE_SQL_COMMENT 1 #define SCE_SQL_COMMENTLINE 2 #define SCE_SQL_COMMENTDOC 3 #define SCE_SQL_NUMBER 4 #define SCE_SQL_WORD 5 #define SCE_SQL_STRING 6 #define SCE_SQL_CHARACTER 7 #define SCE_SQL_SQLPLUS 8 #define SCE_SQL_SQLPLUS_PROMPT 9 #define SCE_SQL_OPERATOR 10 #define SCE_SQL_IDENTIFIER 11 #define SCE_SQL_SQLPLUS_COMMENT 13 #define SCE_SQL_COMMENTLINEDOC 15 #define SCE_SQL_WORD2 16 #define SCE_SQL_COMMENTDOCKEYWORD 17 #define SCE_SQL_COMMENTDOCKEYWORDERROR 18 #define SCE_SQL_USER1 19 #define SCE_SQL_USER2 20 #define SCE_SQL_USER3 21 #define SCE_SQL_USER4 22 #define SCE_SQL_QUOTEDIDENTIFIER 23 #define SCE_ST_DEFAULT 0 #define SCE_ST_STRING 1 #define SCE_ST_NUMBER 2 #define SCE_ST_COMMENT 3 #define SCE_ST_SYMBOL 4 #define SCE_ST_BINARY 5 #define SCE_ST_BOOL 6 #define SCE_ST_SELF 7 #define SCE_ST_SUPER 8 #define SCE_ST_NIL 9 #define SCE_ST_GLOBAL 10 #define SCE_ST_RETURN 11 #define SCE_ST_SPECIAL 12 #define SCE_ST_KWSEND 13 #define SCE_ST_ASSIGN 14 #define SCE_ST_CHARACTER 15 #define SCE_ST_SPEC_SEL 16 #define SCE_FS_DEFAULT 0 #define SCE_FS_COMMENT 1 #define SCE_FS_COMMENTLINE 2 #define SCE_FS_COMMENTDOC 3 #define SCE_FS_COMMENTLINEDOC 4 #define SCE_FS_COMMENTDOCKEYWORD 5 #define SCE_FS_COMMENTDOCKEYWORDERROR 6 #define SCE_FS_KEYWORD 7 #define SCE_FS_KEYWORD2 8 #define SCE_FS_KEYWORD3 9 #define SCE_FS_KEYWORD4 10 #define SCE_FS_NUMBER 11 #define SCE_FS_STRING 12 #define SCE_FS_PREPROCESSOR 13 #define SCE_FS_OPERATOR 14 #define SCE_FS_IDENTIFIER 15 #define SCE_FS_DATE 16 #define SCE_FS_STRINGEOL 17 #define SCE_FS_CONSTANT 18 #define SCE_FS_WORDOPERATOR 19 #define SCE_FS_DISABLEDCODE 20 #define SCE_FS_DEFAULT_C 21 #define SCE_FS_COMMENTDOC_C 22 #define SCE_FS_COMMENTLINEDOC_C 23 #define SCE_FS_KEYWORD_C 24 #define SCE_FS_KEYWORD2_C 25 #define SCE_FS_NUMBER_C 26 #define SCE_FS_STRING_C 27 #define SCE_FS_PREPROCESSOR_C 28 #define SCE_FS_OPERATOR_C 29 #define SCE_FS_IDENTIFIER_C 30 #define SCE_FS_STRINGEOL_C 31 #define SCE_CSOUND_DEFAULT 0 #define SCE_CSOUND_COMMENT 1 #define SCE_CSOUND_NUMBER 2 #define SCE_CSOUND_OPERATOR 3 #define SCE_CSOUND_INSTR 4 #define SCE_CSOUND_IDENTIFIER 5 #define SCE_CSOUND_OPCODE 6 #define SCE_CSOUND_HEADERSTMT 7 #define SCE_CSOUND_USERKEYWORD 8 #define SCE_CSOUND_COMMENTBLOCK 9 #define SCE_CSOUND_PARAM 10 #define SCE_CSOUND_ARATE_VAR 11 #define SCE_CSOUND_KRATE_VAR 12 #define SCE_CSOUND_IRATE_VAR 13 #define SCE_CSOUND_GLOBAL_VAR 14 #define SCE_CSOUND_STRINGEOL 15 #define SCE_INNO_DEFAULT 0 #define SCE_INNO_COMMENT 1 #define SCE_INNO_KEYWORD 2 #define SCE_INNO_PARAMETER 3 #define SCE_INNO_SECTION 4 #define SCE_INNO_PREPROC 5 #define SCE_INNO_INLINE_EXPANSION 6 #define SCE_INNO_COMMENT_PASCAL 7 #define SCE_INNO_KEYWORD_PASCAL 8 #define SCE_INNO_KEYWORD_USER 9 #define SCE_INNO_STRING_DOUBLE 10 #define SCE_INNO_STRING_SINGLE 11 #define SCE_INNO_IDENTIFIER 12 #define SCE_OPAL_SPACE 0 #define SCE_OPAL_COMMENT_BLOCK 1 #define SCE_OPAL_COMMENT_LINE 2 #define SCE_OPAL_INTEGER 3 #define SCE_OPAL_KEYWORD 4 #define SCE_OPAL_SORT 5 #define SCE_OPAL_STRING 6 #define SCE_OPAL_PAR 7 #define SCE_OPAL_BOOL_CONST 8 #define SCE_OPAL_DEFAULT 32 #define SCE_SPICE_DEFAULT 0 #define SCE_SPICE_IDENTIFIER 1 #define SCE_SPICE_KEYWORD 2 #define SCE_SPICE_KEYWORD2 3 #define SCE_SPICE_KEYWORD3 4 #define SCE_SPICE_NUMBER 5 #define SCE_SPICE_DELIMITER 6 #define SCE_SPICE_VALUE 7 #define SCE_SPICE_COMMENTLINE 8 #define SCE_CMAKE_DEFAULT 0 #define SCE_CMAKE_COMMENT 1 #define SCE_CMAKE_STRINGDQ 2 #define SCE_CMAKE_STRINGLQ 3 #define SCE_CMAKE_STRINGRQ 4 #define SCE_CMAKE_COMMANDS 5 #define SCE_CMAKE_PARAMETERS 6 #define SCE_CMAKE_VARIABLE 7 #define SCE_CMAKE_USERDEFINED 8 #define SCE_CMAKE_WHILEDEF 9 #define SCE_CMAKE_FOREACHDEF 10 #define SCE_CMAKE_IFDEFINEDEF 11 #define SCE_CMAKE_MACRODEF 12 #define SCE_CMAKE_STRINGVAR 13 #define SCE_CMAKE_NUMBER 14 #define SCE_GAP_DEFAULT 0 #define SCE_GAP_IDENTIFIER 1 #define SCE_GAP_KEYWORD 2 #define SCE_GAP_KEYWORD2 3 #define SCE_GAP_KEYWORD3 4 #define SCE_GAP_KEYWORD4 5 #define SCE_GAP_STRING 6 #define SCE_GAP_CHAR 7 #define SCE_GAP_OPERATOR 8 #define SCE_GAP_COMMENT 9 #define SCE_GAP_NUMBER 10 #define SCE_GAP_STRINGEOL 11 #define SCE_PLM_DEFAULT 0 #define SCE_PLM_COMMENT 1 #define SCE_PLM_STRING 2 #define SCE_PLM_NUMBER 3 #define SCE_PLM_IDENTIFIER 4 #define SCE_PLM_OPERATOR 5 #define SCE_PLM_CONTROL 6 #define SCE_PLM_KEYWORD 7 #define SCE_4GL_DEFAULT 0 #define SCE_4GL_NUMBER 1 #define SCE_4GL_WORD 2 #define SCE_4GL_STRING 3 #define SCE_4GL_CHARACTER 4 #define SCE_4GL_PREPROCESSOR 5 #define SCE_4GL_OPERATOR 6 #define SCE_4GL_IDENTIFIER 7 #define SCE_4GL_BLOCK 8 #define SCE_4GL_END 9 #define SCE_4GL_COMMENT1 10 #define SCE_4GL_COMMENT2 11 #define SCE_4GL_COMMENT3 12 #define SCE_4GL_COMMENT4 13 #define SCE_4GL_COMMENT5 14 #define SCE_4GL_COMMENT6 15 #define SCE_4GL_DEFAULT_ 16 #define SCE_4GL_NUMBER_ 17 #define SCE_4GL_WORD_ 18 #define SCE_4GL_STRING_ 19 #define SCE_4GL_CHARACTER_ 20 #define SCE_4GL_PREPROCESSOR_ 21 #define SCE_4GL_OPERATOR_ 22 #define SCE_4GL_IDENTIFIER_ 23 #define SCE_4GL_BLOCK_ 24 #define SCE_4GL_END_ 25 #define SCE_4GL_COMMENT1_ 26 #define SCE_4GL_COMMENT2_ 27 #define SCE_4GL_COMMENT3_ 28 #define SCE_4GL_COMMENT4_ 29 #define SCE_4GL_COMMENT5_ 30 #define SCE_4GL_COMMENT6_ 31 #define SCE_ABAQUS_DEFAULT 0 #define SCE_ABAQUS_COMMENT 1 #define SCE_ABAQUS_COMMENTBLOCK 2 #define SCE_ABAQUS_NUMBER 3 #define SCE_ABAQUS_STRING 4 #define SCE_ABAQUS_OPERATOR 5 #define SCE_ABAQUS_WORD 6 #define SCE_ABAQUS_PROCESSOR 7 #define SCE_ABAQUS_COMMAND 8 #define SCE_ABAQUS_SLASHCOMMAND 9 #define SCE_ABAQUS_STARCOMMAND 10 #define SCE_ABAQUS_ARGUMENT 11 #define SCE_ABAQUS_FUNCTION 12 #define SCE_ASY_DEFAULT 0 #define SCE_ASY_COMMENT 1 #define SCE_ASY_COMMENTLINE 2 #define SCE_ASY_NUMBER 3 #define SCE_ASY_WORD 4 #define SCE_ASY_STRING 5 #define SCE_ASY_CHARACTER 6 #define SCE_ASY_OPERATOR 7 #define SCE_ASY_IDENTIFIER 8 #define SCE_ASY_STRINGEOL 9 #define SCE_ASY_COMMENTLINEDOC 10 #define SCE_ASY_WORD2 11 #define SCE_R_DEFAULT 0 #define SCE_R_COMMENT 1 #define SCE_R_KWORD 2 #define SCE_R_BASEKWORD 3 #define SCE_R_OTHERKWORD 4 #define SCE_R_NUMBER 5 #define SCE_R_STRING 6 #define SCE_R_STRING2 7 #define SCE_R_OPERATOR 8 #define SCE_R_IDENTIFIER 9 #define SCE_R_INFIX 10 #define SCE_R_INFIXEOL 11 #define SCE_MAGIK_DEFAULT 0 #define SCE_MAGIK_COMMENT 1 #define SCE_MAGIK_HYPER_COMMENT 16 #define SCE_MAGIK_STRING 2 #define SCE_MAGIK_CHARACTER 3 #define SCE_MAGIK_NUMBER 4 #define SCE_MAGIK_IDENTIFIER 5 #define SCE_MAGIK_OPERATOR 6 #define SCE_MAGIK_FLOW 7 #define SCE_MAGIK_CONTAINER 8 #define SCE_MAGIK_BRACKET_BLOCK 9 #define SCE_MAGIK_BRACE_BLOCK 10 #define SCE_MAGIK_SQBRACKET_BLOCK 11 #define SCE_MAGIK_UNKNOWN_KEYWORD 12 #define SCE_MAGIK_KEYWORD 13 #define SCE_MAGIK_PRAGMA 14 #define SCE_MAGIK_SYMBOL 15 #define SCE_POWERSHELL_DEFAULT 0 #define SCE_POWERSHELL_COMMENT 1 #define SCE_POWERSHELL_STRING 2 #define SCE_POWERSHELL_CHARACTER 3 #define SCE_POWERSHELL_NUMBER 4 #define SCE_POWERSHELL_VARIABLE 5 #define SCE_POWERSHELL_OPERATOR 6 #define SCE_POWERSHELL_IDENTIFIER 7 #define SCE_POWERSHELL_KEYWORD 8 #define SCE_POWERSHELL_CMDLET 9 #define SCE_POWERSHELL_ALIAS 10 #define SCE_POWERSHELL_FUNCTION 11 #define SCE_POWERSHELL_USER1 12 #define SCE_POWERSHELL_COMMENTSTREAM 13 #define SCE_MYSQL_DEFAULT 0 #define SCE_MYSQL_COMMENT 1 #define SCE_MYSQL_COMMENTLINE 2 #define SCE_MYSQL_VARIABLE 3 #define SCE_MYSQL_SYSTEMVARIABLE 4 #define SCE_MYSQL_KNOWNSYSTEMVARIABLE 5 #define SCE_MYSQL_NUMBER 6 #define SCE_MYSQL_MAJORKEYWORD 7 #define SCE_MYSQL_KEYWORD 8 #define SCE_MYSQL_DATABASEOBJECT 9 #define SCE_MYSQL_PROCEDUREKEYWORD 10 #define SCE_MYSQL_STRING 11 #define SCE_MYSQL_SQSTRING 12 #define SCE_MYSQL_DQSTRING 13 #define SCE_MYSQL_OPERATOR 14 #define SCE_MYSQL_FUNCTION 15 #define SCE_MYSQL_IDENTIFIER 16 #define SCE_MYSQL_QUOTEDIDENTIFIER 17 #define SCE_MYSQL_USER1 18 #define SCE_MYSQL_USER2 19 #define SCE_MYSQL_USER3 20 #define SCE_MYSQL_HIDDENCOMMAND 21 #define SCE_PO_DEFAULT 0 #define SCE_PO_COMMENT 1 #define SCE_PO_MSGID 2 #define SCE_PO_MSGID_TEXT 3 #define SCE_PO_MSGSTR 4 #define SCE_PO_MSGSTR_TEXT 5 #define SCE_PO_MSGCTXT 6 #define SCE_PO_MSGCTXT_TEXT 7 #define SCE_PO_FUZZY 8 #define SCE_PAS_DEFAULT 0 #define SCE_PAS_IDENTIFIER 1 #define SCE_PAS_COMMENT 2 #define SCE_PAS_COMMENT2 3 #define SCE_PAS_COMMENTLINE 4 #define SCE_PAS_PREPROCESSOR 5 #define SCE_PAS_PREPROCESSOR2 6 #define SCE_PAS_NUMBER 7 #define SCE_PAS_HEXNUMBER 8 #define SCE_PAS_WORD 9 #define SCE_PAS_STRING 10 #define SCE_PAS_STRINGEOL 11 #define SCE_PAS_CHARACTER 12 #define SCE_PAS_OPERATOR 13 #define SCE_PAS_ASM 14 #define SCE_SORCUS_DEFAULT 0 #define SCE_SORCUS_COMMAND 1 #define SCE_SORCUS_PARAMETER 2 #define SCE_SORCUS_COMMENTLINE 3 #define SCE_SORCUS_STRING 4 #define SCE_SORCUS_STRINGEOL 5 #define SCE_SORCUS_IDENTIFIER 6 #define SCE_SORCUS_OPERATOR 7 #define SCE_SORCUS_NUMBER 8 #define SCE_SORCUS_CONSTANT 9 #define SCE_POWERPRO_DEFAULT 0 #define SCE_POWERPRO_COMMENTBLOCK 1 #define SCE_POWERPRO_COMMENTLINE 2 #define SCE_POWERPRO_NUMBER 3 #define SCE_POWERPRO_WORD 4 #define SCE_POWERPRO_WORD2 5 #define SCE_POWERPRO_WORD3 6 #define SCE_POWERPRO_WORD4 7 #define SCE_POWERPRO_DOUBLEQUOTEDSTRING 8 #define SCE_POWERPRO_SINGLEQUOTEDSTRING 9 #define SCE_POWERPRO_LINECONTINUE 10 #define SCE_POWERPRO_OPERATOR 11 #define SCE_POWERPRO_IDENTIFIER 12 #define SCE_POWERPRO_STRINGEOL 13 #define SCE_POWERPRO_VERBATIM 14 #define SCE_POWERPRO_ALTQUOTE 15 #define SCE_POWERPRO_FUNCTION 16 #define SCE_SML_DEFAULT 0 #define SCE_SML_IDENTIFIER 1 #define SCE_SML_TAGNAME 2 #define SCE_SML_KEYWORD 3 #define SCE_SML_KEYWORD2 4 #define SCE_SML_KEYWORD3 5 #define SCE_SML_LINENUM 6 #define SCE_SML_OPERATOR 7 #define SCE_SML_NUMBER 8 #define SCE_SML_CHAR 9 #define SCE_SML_STRING 11 #define SCE_SML_COMMENT 12 #define SCE_SML_COMMENT1 13 #define SCE_SML_COMMENT2 14 #define SCE_SML_COMMENT3 15 #define SCE_MARKDOWN_DEFAULT 0 #define SCE_MARKDOWN_LINE_BEGIN 1 #define SCE_MARKDOWN_STRONG1 2 #define SCE_MARKDOWN_STRONG2 3 #define SCE_MARKDOWN_EM1 4 #define SCE_MARKDOWN_EM2 5 #define SCE_MARKDOWN_HEADER1 6 #define SCE_MARKDOWN_HEADER2 7 #define SCE_MARKDOWN_HEADER3 8 #define SCE_MARKDOWN_HEADER4 9 #define SCE_MARKDOWN_HEADER5 10 #define SCE_MARKDOWN_HEADER6 11 #define SCE_MARKDOWN_PRECHAR 12 #define SCE_MARKDOWN_ULIST_ITEM 13 #define SCE_MARKDOWN_OLIST_ITEM 14 #define SCE_MARKDOWN_BLOCKQUOTE 15 #define SCE_MARKDOWN_STRIKEOUT 16 #define SCE_MARKDOWN_HRULE 17 #define SCE_MARKDOWN_LINK 18 #define SCE_MARKDOWN_CODE 19 #define SCE_MARKDOWN_CODE2 20 #define SCE_MARKDOWN_CODEBK 21 #define SCE_TXT2TAGS_DEFAULT 0 #define SCE_TXT2TAGS_LINE_BEGIN 1 #define SCE_TXT2TAGS_STRONG1 2 #define SCE_TXT2TAGS_STRONG2 3 #define SCE_TXT2TAGS_EM1 4 #define SCE_TXT2TAGS_EM2 5 #define SCE_TXT2TAGS_HEADER1 6 #define SCE_TXT2TAGS_HEADER2 7 #define SCE_TXT2TAGS_HEADER3 8 #define SCE_TXT2TAGS_HEADER4 9 #define SCE_TXT2TAGS_HEADER5 10 #define SCE_TXT2TAGS_HEADER6 11 #define SCE_TXT2TAGS_PRECHAR 12 #define SCE_TXT2TAGS_ULIST_ITEM 13 #define SCE_TXT2TAGS_OLIST_ITEM 14 #define SCE_TXT2TAGS_BLOCKQUOTE 15 #define SCE_TXT2TAGS_STRIKEOUT 16 #define SCE_TXT2TAGS_HRULE 17 #define SCE_TXT2TAGS_LINK 18 #define SCE_TXT2TAGS_CODE 19 #define SCE_TXT2TAGS_CODE2 20 #define SCE_TXT2TAGS_CODEBK 21 #define SCE_TXT2TAGS_COMMENT 22 #define SCE_TXT2TAGS_OPTION 23 #define SCE_TXT2TAGS_PREPROC 24 #define SCE_TXT2TAGS_POSTPROC 25 #define SCE_A68K_DEFAULT 0 #define SCE_A68K_COMMENT 1 #define SCE_A68K_NUMBER_DEC 2 #define SCE_A68K_NUMBER_BIN 3 #define SCE_A68K_NUMBER_HEX 4 #define SCE_A68K_STRING1 5 #define SCE_A68K_OPERATOR 6 #define SCE_A68K_CPUINSTRUCTION 7 #define SCE_A68K_EXTINSTRUCTION 8 #define SCE_A68K_REGISTER 9 #define SCE_A68K_DIRECTIVE 10 #define SCE_A68K_MACRO_ARG 11 #define SCE_A68K_LABEL 12 #define SCE_A68K_STRING2 13 #define SCE_A68K_IDENTIFIER 14 #define SCE_A68K_MACRO_DECLARATION 15 #define SCE_A68K_COMMENT_WORD 16 #define SCE_A68K_COMMENT_SPECIAL 17 #define SCE_A68K_COMMENT_DOXYGEN 18 #define SCE_MODULA_DEFAULT 0 #define SCE_MODULA_COMMENT 1 #define SCE_MODULA_DOXYCOMM 2 #define SCE_MODULA_DOXYKEY 3 #define SCE_MODULA_KEYWORD 4 #define SCE_MODULA_RESERVED 5 #define SCE_MODULA_NUMBER 6 #define SCE_MODULA_BASENUM 7 #define SCE_MODULA_FLOAT 8 #define SCE_MODULA_STRING 9 #define SCE_MODULA_STRSPEC 10 #define SCE_MODULA_CHAR 11 #define SCE_MODULA_CHARSPEC 12 #define SCE_MODULA_PROC 13 #define SCE_MODULA_PRAGMA 14 #define SCE_MODULA_PRGKEY 15 #define SCE_MODULA_OPERATOR 16 #define SCE_MODULA_BADSTR 17 #define SCE_COFFEESCRIPT_DEFAULT 0 #define SCE_COFFEESCRIPT_COMMENT 1 #define SCE_COFFEESCRIPT_COMMENTLINE 2 #define SCE_COFFEESCRIPT_COMMENTDOC 3 #define SCE_COFFEESCRIPT_NUMBER 4 #define SCE_COFFEESCRIPT_WORD 5 #define SCE_COFFEESCRIPT_STRING 6 #define SCE_COFFEESCRIPT_CHARACTER 7 #define SCE_COFFEESCRIPT_UUID 8 #define SCE_COFFEESCRIPT_PREPROCESSOR 9 #define SCE_COFFEESCRIPT_OPERATOR 10 #define SCE_COFFEESCRIPT_IDENTIFIER 11 #define SCE_COFFEESCRIPT_STRINGEOL 12 #define SCE_COFFEESCRIPT_VERBATIM 13 #define SCE_COFFEESCRIPT_REGEX 14 #define SCE_COFFEESCRIPT_COMMENTLINEDOC 15 #define SCE_COFFEESCRIPT_WORD2 16 #define SCE_COFFEESCRIPT_COMMENTDOCKEYWORD 17 #define SCE_COFFEESCRIPT_COMMENTDOCKEYWORDERROR 18 #define SCE_COFFEESCRIPT_GLOBALCLASS 19 #define SCE_COFFEESCRIPT_STRINGRAW 20 #define SCE_COFFEESCRIPT_TRIPLEVERBATIM 21 #define SCE_COFFEESCRIPT_HASHQUOTEDSTRING 22 #define SCE_COFFEESCRIPT_COMMENTBLOCK 22 #define SCE_COFFEESCRIPT_VERBOSE_REGEX 23 #define SCE_COFFEESCRIPT_VERBOSE_REGEX_COMMENT 24 #define SCE_AVS_DEFAULT 0 #define SCE_AVS_COMMENTBLOCK 1 #define SCE_AVS_COMMENTBLOCKN 2 #define SCE_AVS_COMMENTLINE 3 #define SCE_AVS_NUMBER 4 #define SCE_AVS_OPERATOR 5 #define SCE_AVS_IDENTIFIER 6 #define SCE_AVS_STRING 7 #define SCE_AVS_TRIPLESTRING 8 #define SCE_AVS_KEYWORD 9 #define SCE_AVS_FILTER 10 #define SCE_AVS_PLUGIN 11 #define SCE_AVS_FUNCTION 12 #define SCE_AVS_CLIPPROP 13 #define SCE_AVS_USERDFN 14 #define SCE_ECL_DEFAULT 0 #define SCE_ECL_COMMENT 1 #define SCE_ECL_COMMENTLINE 2 #define SCE_ECL_NUMBER 3 #define SCE_ECL_STRING 4 #define SCE_ECL_WORD0 5 #define SCE_ECL_OPERATOR 6 #define SCE_ECL_CHARACTER 7 #define SCE_ECL_UUID 8 #define SCE_ECL_PREPROCESSOR 9 #define SCE_ECL_UNKNOWN 10 #define SCE_ECL_IDENTIFIER 11 #define SCE_ECL_STRINGEOL 12 #define SCE_ECL_VERBATIM 13 #define SCE_ECL_REGEX 14 #define SCE_ECL_COMMENTLINEDOC 15 #define SCE_ECL_WORD1 16 #define SCE_ECL_COMMENTDOCKEYWORD 17 #define SCE_ECL_COMMENTDOCKEYWORDERROR 18 #define SCE_ECL_WORD2 19 #define SCE_ECL_WORD3 20 #define SCE_ECL_WORD4 21 #define SCE_ECL_WORD5 22 #define SCE_ECL_COMMENTDOC 23 #define SCE_ECL_ADDED 24 #define SCE_ECL_DELETED 25 #define SCE_ECL_CHANGED 26 #define SCE_ECL_MOVED 27 /* --Autogenerated -- end of section automatically generated from Scintilla.iface */ #endif Wx-Scintilla-0.38/wx-scintilla/src/scintilla/include/ScintillaWidget.h000444001750001750 265611727344243 26501 0ustar00azawawiazawawi000000000000/* Scintilla source code edit control */ /** @file ScintillaWidget.h ** Definition of Scintilla widget for GTK+. ** Only needed by GTK+ code but is harmless on other platforms. **/ /* Copyright 1998-2001 by Neil Hodgson * The License.txt file describes the conditions under which this software may be distributed. */ #ifndef SCINTILLAWIDGET_H #define SCINTILLAWIDGET_H #if defined(GTK) #ifdef __cplusplus extern "C" { #endif #define SCINTILLA(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, scintilla_get_type (), ScintillaObject) #define SCINTILLA_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, scintilla_get_type (), ScintillaClass) #define IS_SCINTILLA(obj) GTK_CHECK_TYPE (obj, scintilla_get_type ()) typedef struct _ScintillaObject ScintillaObject; typedef struct _ScintillaClass ScintillaClass; struct _ScintillaObject { GtkContainer cont; void *pscin; }; struct _ScintillaClass { GtkContainerClass parent_class; void (* command) (ScintillaObject *ttt); void (* notify) (ScintillaObject *ttt); }; GType scintilla_get_type (void); GtkWidget* scintilla_new (void); void scintilla_set_id (ScintillaObject *sci, uptr_t id); sptr_t scintilla_send_message (ScintillaObject *sci,unsigned int iMessage, uptr_t wParam, sptr_t lParam); void scintilla_release_resources(void); #define SCINTILLA_NOTIFY "sci-notify" #ifdef __cplusplus } #endif #endif #endif Wx-Scintilla-0.38/wx-scintilla/src/scintilla/include/Scintilla.h000444001750001750 10142411727344243 25366 0ustar00azawawiazawawi000000000000/* Scintilla source code edit control */ /** @file Scintilla.h ** Interface to the edit control. **/ /* Copyright 1998-2003 by Neil Hodgson * The License.txt file describes the conditions under which this software may be distributed. */ /* Most of this file is automatically generated from the Scintilla.iface interface definition * file which contains any comments about the definitions. HFacer.py does the generation. */ #ifndef SCINTILLA_H #define SCINTILLA_H #ifdef __cplusplus extern "C" { #endif #if defined(_WIN32) /* Return false on failure: */ int Scintilla_RegisterClasses(void *hInstance); int Scintilla_ReleaseResources(); #endif int Scintilla_LinkLexers(); #ifdef __cplusplus } #endif /* Here should be placed typedefs for uptr_t, an unsigned integer type large enough to * hold a pointer and sptr_t, a signed integer large enough to hold a pointer. * May need to be changed for 64 bit platforms. */ #if defined(_WIN32) #include #endif #ifdef MAXULONG_PTR typedef ULONG_PTR uptr_t; typedef LONG_PTR sptr_t; #else typedef unsigned long uptr_t; typedef long sptr_t; #endif typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, sptr_t lParam); /* ++Autogenerated -- start of section automatically generated from Scintilla.iface */ #define INVALID_POSITION -1 #define SCI_START 2000 #define SCI_OPTIONAL_START 3000 #define SCI_LEXER_START 4000 #define SCI_ADDTEXT 2001 #define SCI_ADDSTYLEDTEXT 2002 #define SCI_INSERTTEXT 2003 #define SCI_CLEARALL 2004 #define SCI_CLEARDOCUMENTSTYLE 2005 #define SCI_GETLENGTH 2006 #define SCI_GETCHARAT 2007 #define SCI_GETCURRENTPOS 2008 #define SCI_GETANCHOR 2009 #define SCI_GETSTYLEAT 2010 #define SCI_REDO 2011 #define SCI_SETUNDOCOLLECTION 2012 #define SCI_SELECTALL 2013 #define SCI_SETSAVEPOINT 2014 #define SCI_GETSTYLEDTEXT 2015 #define SCI_CANREDO 2016 #define SCI_MARKERLINEFROMHANDLE 2017 #define SCI_MARKERDELETEHANDLE 2018 #define SCI_GETUNDOCOLLECTION 2019 #define SCWS_INVISIBLE 0 #define SCWS_VISIBLEALWAYS 1 #define SCWS_VISIBLEAFTERINDENT 2 #define SCI_GETVIEWWS 2020 #define SCI_SETVIEWWS 2021 #define SCI_POSITIONFROMPOINT 2022 #define SCI_POSITIONFROMPOINTCLOSE 2023 #define SCI_GOTOLINE 2024 #define SCI_GOTOPOS 2025 #define SCI_SETANCHOR 2026 #define SCI_GETCURLINE 2027 #define SCI_GETENDSTYLED 2028 #define SC_EOL_CRLF 0 #define SC_EOL_CR 1 #define SC_EOL_LF 2 #define SCI_CONVERTEOLS 2029 #define SCI_GETEOLMODE 2030 #define SCI_SETEOLMODE 2031 #define SCI_STARTSTYLING 2032 #define SCI_SETSTYLING 2033 #define SCI_GETBUFFEREDDRAW 2034 #define SCI_SETBUFFEREDDRAW 2035 #define SCI_SETTABWIDTH 2036 #define SCI_GETTABWIDTH 2121 #define SC_CP_UTF8 65001 #define SCI_SETCODEPAGE 2037 #define MARKER_MAX 31 #define SC_MARK_CIRCLE 0 #define SC_MARK_ROUNDRECT 1 #define SC_MARK_ARROW 2 #define SC_MARK_SMALLRECT 3 #define SC_MARK_SHORTARROW 4 #define SC_MARK_EMPTY 5 #define SC_MARK_ARROWDOWN 6 #define SC_MARK_MINUS 7 #define SC_MARK_PLUS 8 #define SC_MARK_VLINE 9 #define SC_MARK_LCORNER 10 #define SC_MARK_TCORNER 11 #define SC_MARK_BOXPLUS 12 #define SC_MARK_BOXPLUSCONNECTED 13 #define SC_MARK_BOXMINUS 14 #define SC_MARK_BOXMINUSCONNECTED 15 #define SC_MARK_LCORNERCURVE 16 #define SC_MARK_TCORNERCURVE 17 #define SC_MARK_CIRCLEPLUS 18 #define SC_MARK_CIRCLEPLUSCONNECTED 19 #define SC_MARK_CIRCLEMINUS 20 #define SC_MARK_CIRCLEMINUSCONNECTED 21 #define SC_MARK_BACKGROUND 22 #define SC_MARK_DOTDOTDOT 23 #define SC_MARK_ARROWS 24 #define SC_MARK_PIXMAP 25 #define SC_MARK_FULLRECT 26 #define SC_MARK_LEFTRECT 27 #define SC_MARK_AVAILABLE 28 #define SC_MARK_UNDERLINE 29 #define SC_MARK_RGBAIMAGE 30 #define SC_MARK_CHARACTER 10000 #define SC_MARKNUM_FOLDEREND 25 #define SC_MARKNUM_FOLDEROPENMID 26 #define SC_MARKNUM_FOLDERMIDTAIL 27 #define SC_MARKNUM_FOLDERTAIL 28 #define SC_MARKNUM_FOLDERSUB 29 #define SC_MARKNUM_FOLDER 30 #define SC_MARKNUM_FOLDEROPEN 31 #define SC_MASK_FOLDERS 0xFE000000 #define SCI_MARKERDEFINE 2040 #define SCI_MARKERSETFORE 2041 #define SCI_MARKERSETBACK 2042 #define SCI_MARKERSETBACKSELECTED 2292 #define SCI_MARKERENABLEHIGHLIGHT 2293 #define SCI_MARKERADD 2043 #define SCI_MARKERDELETE 2044 #define SCI_MARKERDELETEALL 2045 #define SCI_MARKERGET 2046 #define SCI_MARKERNEXT 2047 #define SCI_MARKERPREVIOUS 2048 #define SCI_MARKERDEFINEPIXMAP 2049 #define SCI_MARKERADDSET 2466 #define SCI_MARKERSETALPHA 2476 #define SC_MARGIN_SYMBOL 0 #define SC_MARGIN_NUMBER 1 #define SC_MARGIN_BACK 2 #define SC_MARGIN_FORE 3 #define SC_MARGIN_TEXT 4 #define SC_MARGIN_RTEXT 5 #define SCI_SETMARGINTYPEN 2240 #define SCI_GETMARGINTYPEN 2241 #define SCI_SETMARGINWIDTHN 2242 #define SCI_GETMARGINWIDTHN 2243 #define SCI_SETMARGINMASKN 2244 #define SCI_GETMARGINMASKN 2245 #define SCI_SETMARGINSENSITIVEN 2246 #define SCI_GETMARGINSENSITIVEN 2247 #define SCI_SETMARGINCURSORN 2248 #define SCI_GETMARGINCURSORN 2249 #define STYLE_DEFAULT 32 #define STYLE_LINENUMBER 33 #define STYLE_BRACELIGHT 34 #define STYLE_BRACEBAD 35 #define STYLE_CONTROLCHAR 36 #define STYLE_INDENTGUIDE 37 #define STYLE_CALLTIP 38 #define STYLE_LASTPREDEFINED 39 #define STYLE_MAX 255 #define SC_CHARSET_ANSI 0 #define SC_CHARSET_DEFAULT 1 #define SC_CHARSET_BALTIC 186 #define SC_CHARSET_CHINESEBIG5 136 #define SC_CHARSET_EASTEUROPE 238 #define SC_CHARSET_GB2312 134 #define SC_CHARSET_GREEK 161 #define SC_CHARSET_HANGUL 129 #define SC_CHARSET_MAC 77 #define SC_CHARSET_OEM 255 #define SC_CHARSET_RUSSIAN 204 #define SC_CHARSET_CYRILLIC 1251 #define SC_CHARSET_SHIFTJIS 128 #define SC_CHARSET_SYMBOL 2 #define SC_CHARSET_TURKISH 162 #define SC_CHARSET_JOHAB 130 #define SC_CHARSET_HEBREW 177 #define SC_CHARSET_ARABIC 178 #define SC_CHARSET_VIETNAMESE 163 #define SC_CHARSET_THAI 222 #define SC_CHARSET_8859_15 1000 #define SCI_STYLECLEARALL 2050 #define SCI_STYLESETFORE 2051 #define SCI_STYLESETBACK 2052 #define SCI_STYLESETBOLD 2053 #define SCI_STYLESETITALIC 2054 #define SCI_STYLESETSIZE 2055 #define SCI_STYLESETFONT 2056 #define SCI_STYLESETEOLFILLED 2057 #define SCI_STYLERESETDEFAULT 2058 #define SCI_STYLESETUNDERLINE 2059 #define SC_CASE_MIXED 0 #define SC_CASE_UPPER 1 #define SC_CASE_LOWER 2 #define SCI_STYLEGETFORE 2481 #define SCI_STYLEGETBACK 2482 #define SCI_STYLEGETBOLD 2483 #define SCI_STYLEGETITALIC 2484 #define SCI_STYLEGETSIZE 2485 #define SCI_STYLEGETFONT 2486 #define SCI_STYLEGETEOLFILLED 2487 #define SCI_STYLEGETUNDERLINE 2488 #define SCI_STYLEGETCASE 2489 #define SCI_STYLEGETCHARACTERSET 2490 #define SCI_STYLEGETVISIBLE 2491 #define SCI_STYLEGETCHANGEABLE 2492 #define SCI_STYLEGETHOTSPOT 2493 #define SCI_STYLESETCASE 2060 #define SC_FONT_SIZE_MULTIPLIER 100 #define SCI_STYLESETSIZEFRACTIONAL 2061 #define SCI_STYLEGETSIZEFRACTIONAL 2062 #define SC_WEIGHT_NORMAL 400 #define SC_WEIGHT_SEMIBOLD 600 #define SC_WEIGHT_BOLD 700 #define SCI_STYLESETWEIGHT 2063 #define SCI_STYLEGETWEIGHT 2064 #define SCI_STYLESETCHARACTERSET 2066 #define SCI_STYLESETHOTSPOT 2409 #define SCI_SETSELFORE 2067 #define SCI_SETSELBACK 2068 #define SCI_GETSELALPHA 2477 #define SCI_SETSELALPHA 2478 #define SCI_GETSELEOLFILLED 2479 #define SCI_SETSELEOLFILLED 2480 #define SCI_SETCARETFORE 2069 #define SCI_ASSIGNCMDKEY 2070 #define SCI_CLEARCMDKEY 2071 #define SCI_CLEARALLCMDKEYS 2072 #define SCI_SETSTYLINGEX 2073 #define SCI_STYLESETVISIBLE 2074 #define SCI_GETCARETPERIOD 2075 #define SCI_SETCARETPERIOD 2076 #define SCI_SETWORDCHARS 2077 #define SCI_BEGINUNDOACTION 2078 #define SCI_ENDUNDOACTION 2079 #define INDIC_PLAIN 0 #define INDIC_SQUIGGLE 1 #define INDIC_TT 2 #define INDIC_DIAGONAL 3 #define INDIC_STRIKE 4 #define INDIC_HIDDEN 5 #define INDIC_BOX 6 #define INDIC_ROUNDBOX 7 #define INDIC_STRAIGHTBOX 8 #define INDIC_DASH 9 #define INDIC_DOTS 10 #define INDIC_SQUIGGLELOW 11 #define INDIC_DOTBOX 12 #define INDIC_MAX 31 #define INDIC_CONTAINER 8 #define INDIC0_MASK 0x20 #define INDIC1_MASK 0x40 #define INDIC2_MASK 0x80 #define INDICS_MASK 0xE0 #define SCI_INDICSETSTYLE 2080 #define SCI_INDICGETSTYLE 2081 #define SCI_INDICSETFORE 2082 #define SCI_INDICGETFORE 2083 #define SCI_INDICSETUNDER 2510 #define SCI_INDICGETUNDER 2511 #define SCI_SETWHITESPACEFORE 2084 #define SCI_SETWHITESPACEBACK 2085 #define SCI_SETWHITESPACESIZE 2086 #define SCI_GETWHITESPACESIZE 2087 #define SCI_SETSTYLEBITS 2090 #define SCI_GETSTYLEBITS 2091 #define SCI_SETLINESTATE 2092 #define SCI_GETLINESTATE 2093 #define SCI_GETMAXLINESTATE 2094 #define SCI_GETCARETLINEVISIBLE 2095 #define SCI_SETCARETLINEVISIBLE 2096 #define SCI_GETCARETLINEBACK 2097 #define SCI_SETCARETLINEBACK 2098 #define SCI_STYLESETCHANGEABLE 2099 #define SCI_AUTOCSHOW 2100 #define SCI_AUTOCCANCEL 2101 #define SCI_AUTOCACTIVE 2102 #define SCI_AUTOCPOSSTART 2103 #define SCI_AUTOCCOMPLETE 2104 #define SCI_AUTOCSTOPS 2105 #define SCI_AUTOCSETSEPARATOR 2106 #define SCI_AUTOCGETSEPARATOR 2107 #define SCI_AUTOCSELECT 2108 #define SCI_AUTOCSETCANCELATSTART 2110 #define SCI_AUTOCGETCANCELATSTART 2111 #define SCI_AUTOCSETFILLUPS 2112 #define SCI_AUTOCSETCHOOSESINGLE 2113 #define SCI_AUTOCGETCHOOSESINGLE 2114 #define SCI_AUTOCSETIGNORECASE 2115 #define SCI_AUTOCGETIGNORECASE 2116 #define SCI_USERLISTSHOW 2117 #define SCI_AUTOCSETAUTOHIDE 2118 #define SCI_AUTOCGETAUTOHIDE 2119 #define SCI_AUTOCSETDROPRESTOFWORD 2270 #define SCI_AUTOCGETDROPRESTOFWORD 2271 #define SCI_REGISTERIMAGE 2405 #define SCI_CLEARREGISTEREDIMAGES 2408 #define SCI_AUTOCGETTYPESEPARATOR 2285 #define SCI_AUTOCSETTYPESEPARATOR 2286 #define SCI_AUTOCSETMAXWIDTH 2208 #define SCI_AUTOCGETMAXWIDTH 2209 #define SCI_AUTOCSETMAXHEIGHT 2210 #define SCI_AUTOCGETMAXHEIGHT 2211 #define SCI_SETINDENT 2122 #define SCI_GETINDENT 2123 #define SCI_SETUSETABS 2124 #define SCI_GETUSETABS 2125 #define SCI_SETLINEINDENTATION 2126 #define SCI_GETLINEINDENTATION 2127 #define SCI_GETLINEINDENTPOSITION 2128 #define SCI_GETCOLUMN 2129 #define SCI_COUNTCHARACTERS 2633 #define SCI_SETHSCROLLBAR 2130 #define SCI_GETHSCROLLBAR 2131 #define SC_IV_NONE 0 #define SC_IV_REAL 1 #define SC_IV_LOOKFORWARD 2 #define SC_IV_LOOKBOTH 3 #define SCI_SETINDENTATIONGUIDES 2132 #define SCI_GETINDENTATIONGUIDES 2133 #define SCI_SETHIGHLIGHTGUIDE 2134 #define SCI_GETHIGHLIGHTGUIDE 2135 #define SCI_GETLINEENDPOSITION 2136 #define SCI_GETCODEPAGE 2137 #define SCI_GETCARETFORE 2138 #define SCI_GETREADONLY 2140 #define SCI_SETCURRENTPOS 2141 #define SCI_SETSELECTIONSTART 2142 #define SCI_GETSELECTIONSTART 2143 #define SCI_SETSELECTIONEND 2144 #define SCI_GETSELECTIONEND 2145 #define SCI_SETEMPTYSELECTION 2556 #define SCI_SETPRINTMAGNIFICATION 2146 #define SCI_GETPRINTMAGNIFICATION 2147 #define SC_PRINT_NORMAL 0 #define SC_PRINT_INVERTLIGHT 1 #define SC_PRINT_BLACKONWHITE 2 #define SC_PRINT_COLOURONWHITE 3 #define SC_PRINT_COLOURONWHITEDEFAULTBG 4 #define SCI_SETPRINTCOLOURMODE 2148 #define SCI_GETPRINTCOLOURMODE 2149 #define SCFIND_WHOLEWORD 2 #define SCFIND_MATCHCASE 4 #define SCFIND_WORDSTART 0x00100000 #define SCFIND_REGEXP 0x00200000 #define SCFIND_POSIX 0x00400000 #define SCI_FINDTEXT 2150 #define SCI_FORMATRANGE 2151 #define SCI_GETFIRSTVISIBLELINE 2152 #define SCI_GETLINE 2153 #define SCI_GETLINECOUNT 2154 #define SCI_SETMARGINLEFT 2155 #define SCI_GETMARGINLEFT 2156 #define SCI_SETMARGINRIGHT 2157 #define SCI_GETMARGINRIGHT 2158 #define SCI_GETMODIFY 2159 #define SCI_SETSEL 2160 #define SCI_GETSELTEXT 2161 #define SCI_GETTEXTRANGE 2162 #define SCI_HIDESELECTION 2163 #define SCI_POINTXFROMPOSITION 2164 #define SCI_POINTYFROMPOSITION 2165 #define SCI_LINEFROMPOSITION 2166 #define SCI_POSITIONFROMLINE 2167 #define SCI_LINESCROLL 2168 #define SCI_SCROLLCARET 2169 #define SCI_REPLACESEL 2170 #define SCI_SETREADONLY 2171 #define SCI_NULL 2172 #define SCI_CANPASTE 2173 #define SCI_CANUNDO 2174 #define SCI_EMPTYUNDOBUFFER 2175 #define SCI_UNDO 2176 #define SCI_CUT 2177 #define SCI_COPY 2178 #define SCI_PASTE 2179 #define SCI_CLEAR 2180 #define SCI_SETTEXT 2181 #define SCI_GETTEXT 2182 #define SCI_GETTEXTLENGTH 2183 #define SCI_GETDIRECTFUNCTION 2184 #define SCI_GETDIRECTPOINTER 2185 #define SCI_SETOVERTYPE 2186 #define SCI_GETOVERTYPE 2187 #define SCI_SETCARETWIDTH 2188 #define SCI_GETCARETWIDTH 2189 #define SCI_SETTARGETSTART 2190 #define SCI_GETTARGETSTART 2191 #define SCI_SETTARGETEND 2192 #define SCI_GETTARGETEND 2193 #define SCI_REPLACETARGET 2194 #define SCI_REPLACETARGETRE 2195 #define SCI_SEARCHINTARGET 2197 #define SCI_SETSEARCHFLAGS 2198 #define SCI_GETSEARCHFLAGS 2199 #define SCI_CALLTIPSHOW 2200 #define SCI_CALLTIPCANCEL 2201 #define SCI_CALLTIPACTIVE 2202 #define SCI_CALLTIPPOSSTART 2203 #define SCI_CALLTIPSETHLT 2204 #define SCI_CALLTIPSETBACK 2205 #define SCI_CALLTIPSETFORE 2206 #define SCI_CALLTIPSETFOREHLT 2207 #define SCI_CALLTIPUSESTYLE 2212 #define SCI_CALLTIPSETPOSITION 2213 #define SCI_VISIBLEFROMDOCLINE 2220 #define SCI_DOCLINEFROMVISIBLE 2221 #define SCI_WRAPCOUNT 2235 #define SC_FOLDLEVELBASE 0x400 #define SC_FOLDLEVELWHITEFLAG 0x1000 #define SC_FOLDLEVELHEADERFLAG 0x2000 #define SC_FOLDLEVELNUMBERMASK 0x0FFF #define SCI_SETFOLDLEVEL 2222 #define SCI_GETFOLDLEVEL 2223 #define SCI_GETLASTCHILD 2224 #define SCI_GETFOLDPARENT 2225 #define SCI_SHOWLINES 2226 #define SCI_HIDELINES 2227 #define SCI_GETLINEVISIBLE 2228 #define SCI_GETALLLINESVISIBLE 2236 #define SCI_SETFOLDEXPANDED 2229 #define SCI_GETFOLDEXPANDED 2230 #define SCI_TOGGLEFOLD 2231 #define SCI_ENSUREVISIBLE 2232 #define SC_FOLDFLAG_LINEBEFORE_EXPANDED 0x0002 #define SC_FOLDFLAG_LINEBEFORE_CONTRACTED 0x0004 #define SC_FOLDFLAG_LINEAFTER_EXPANDED 0x0008 #define SC_FOLDFLAG_LINEAFTER_CONTRACTED 0x0010 #define SC_FOLDFLAG_LEVELNUMBERS 0x0040 #define SCI_SETFOLDFLAGS 2233 #define SCI_ENSUREVISIBLEENFORCEPOLICY 2234 #define SCI_SETTABINDENTS 2260 #define SCI_GETTABINDENTS 2261 #define SCI_SETBACKSPACEUNINDENTS 2262 #define SCI_GETBACKSPACEUNINDENTS 2263 #define SC_TIME_FOREVER 10000000 #define SCI_SETMOUSEDWELLTIME 2264 #define SCI_GETMOUSEDWELLTIME 2265 #define SCI_WORDSTARTPOSITION 2266 #define SCI_WORDENDPOSITION 2267 #define SC_WRAP_NONE 0 #define SC_WRAP_WORD 1 #define SC_WRAP_CHAR 2 #define SCI_SETWRAPMODE 2268 #define SCI_GETWRAPMODE 2269 #define SC_WRAPVISUALFLAG_NONE 0x0000 #define SC_WRAPVISUALFLAG_END 0x0001 #define SC_WRAPVISUALFLAG_START 0x0002 #define SCI_SETWRAPVISUALFLAGS 2460 #define SCI_GETWRAPVISUALFLAGS 2461 #define SC_WRAPVISUALFLAGLOC_DEFAULT 0x0000 #define SC_WRAPVISUALFLAGLOC_END_BY_TEXT 0x0001 #define SC_WRAPVISUALFLAGLOC_START_BY_TEXT 0x0002 #define SCI_SETWRAPVISUALFLAGSLOCATION 2462 #define SCI_GETWRAPVISUALFLAGSLOCATION 2463 #define SCI_SETWRAPSTARTINDENT 2464 #define SCI_GETWRAPSTARTINDENT 2465 #define SC_WRAPINDENT_FIXED 0 #define SC_WRAPINDENT_SAME 1 #define SC_WRAPINDENT_INDENT 2 #define SCI_SETWRAPINDENTMODE 2472 #define SCI_GETWRAPINDENTMODE 2473 #define SC_CACHE_NONE 0 #define SC_CACHE_CARET 1 #define SC_CACHE_PAGE 2 #define SC_CACHE_DOCUMENT 3 #define SCI_SETLAYOUTCACHE 2272 #define SCI_GETLAYOUTCACHE 2273 #define SCI_SETSCROLLWIDTH 2274 #define SCI_GETSCROLLWIDTH 2275 #define SCI_SETSCROLLWIDTHTRACKING 2516 #define SCI_GETSCROLLWIDTHTRACKING 2517 #define SCI_TEXTWIDTH 2276 #define SCI_SETENDATLASTLINE 2277 #define SCI_GETENDATLASTLINE 2278 #define SCI_TEXTHEIGHT 2279 #define SCI_SETVSCROLLBAR 2280 #define SCI_GETVSCROLLBAR 2281 #define SCI_APPENDTEXT 2282 #define SCI_GETTWOPHASEDRAW 2283 #define SCI_SETTWOPHASEDRAW 2284 #define SC_EFF_QUALITY_MASK 0xF #define SC_EFF_QUALITY_DEFAULT 0 #define SC_EFF_QUALITY_NON_ANTIALIASED 1 #define SC_EFF_QUALITY_ANTIALIASED 2 #define SC_EFF_QUALITY_LCD_OPTIMIZED 3 #define SCI_SETFONTQUALITY 2611 #define SCI_GETFONTQUALITY 2612 #define SCI_SETFIRSTVISIBLELINE 2613 #define SC_MULTIPASTE_ONCE 0 #define SC_MULTIPASTE_EACH 1 #define SCI_SETMULTIPASTE 2614 #define SCI_GETMULTIPASTE 2615 #define SCI_GETTAG 2616 #define SCI_TARGETFROMSELECTION 2287 #define SCI_LINESJOIN 2288 #define SCI_LINESSPLIT 2289 #define SCI_SETFOLDMARGINCOLOUR 2290 #define SCI_SETFOLDMARGINHICOLOUR 2291 #define SCI_LINEDOWN 2300 #define SCI_LINEDOWNEXTEND 2301 #define SCI_LINEUP 2302 #define SCI_LINEUPEXTEND 2303 #define SCI_CHARLEFT 2304 #define SCI_CHARLEFTEXTEND 2305 #define SCI_CHARRIGHT 2306 #define SCI_CHARRIGHTEXTEND 2307 #define SCI_WORDLEFT 2308 #define SCI_WORDLEFTEXTEND 2309 #define SCI_WORDRIGHT 2310 #define SCI_WORDRIGHTEXTEND 2311 #define SCI_HOME 2312 #define SCI_HOMEEXTEND 2313 #define SCI_LINEEND 2314 #define SCI_LINEENDEXTEND 2315 #define SCI_DOCUMENTSTART 2316 #define SCI_DOCUMENTSTARTEXTEND 2317 #define SCI_DOCUMENTEND 2318 #define SCI_DOCUMENTENDEXTEND 2319 #define SCI_PAGEUP 2320 #define SCI_PAGEUPEXTEND 2321 #define SCI_PAGEDOWN 2322 #define SCI_PAGEDOWNEXTEND 2323 #define SCI_EDITTOGGLEOVERTYPE 2324 #define SCI_CANCEL 2325 #define SCI_DELETEBACK 2326 #define SCI_TAB 2327 #define SCI_BACKTAB 2328 #define SCI_NEWLINE 2329 #define SCI_FORMFEED 2330 #define SCI_VCHOME 2331 #define SCI_VCHOMEEXTEND 2332 #define SCI_ZOOMIN 2333 #define SCI_ZOOMOUT 2334 #define SCI_DELWORDLEFT 2335 #define SCI_DELWORDRIGHT 2336 #define SCI_DELWORDRIGHTEND 2518 #define SCI_LINECUT 2337 #define SCI_LINEDELETE 2338 #define SCI_LINETRANSPOSE 2339 #define SCI_LINEDUPLICATE 2404 #define SCI_LOWERCASE 2340 #define SCI_UPPERCASE 2341 #define SCI_LINESCROLLDOWN 2342 #define SCI_LINESCROLLUP 2343 #define SCI_DELETEBACKNOTLINE 2344 #define SCI_HOMEDISPLAY 2345 #define SCI_HOMEDISPLAYEXTEND 2346 #define SCI_LINEENDDISPLAY 2347 #define SCI_LINEENDDISPLAYEXTEND 2348 #define SCI_HOMEWRAP 2349 #define SCI_HOMEWRAPEXTEND 2450 #define SCI_LINEENDWRAP 2451 #define SCI_LINEENDWRAPEXTEND 2452 #define SCI_VCHOMEWRAP 2453 #define SCI_VCHOMEWRAPEXTEND 2454 #define SCI_LINECOPY 2455 #define SCI_MOVECARETINSIDEVIEW 2401 #define SCI_LINELENGTH 2350 #define SCI_BRACEHIGHLIGHT 2351 #define SCI_BRACEHIGHLIGHTINDICATOR 2498 #define SCI_BRACEBADLIGHT 2352 #define SCI_BRACEBADLIGHTINDICATOR 2499 #define SCI_BRACEMATCH 2353 #define SCI_GETVIEWEOL 2355 #define SCI_SETVIEWEOL 2356 #define SCI_GETDOCPOINTER 2357 #define SCI_SETDOCPOINTER 2358 #define SCI_SETMODEVENTMASK 2359 #define EDGE_NONE 0 #define EDGE_LINE 1 #define EDGE_BACKGROUND 2 #define SCI_GETEDGECOLUMN 2360 #define SCI_SETEDGECOLUMN 2361 #define SCI_GETEDGEMODE 2362 #define SCI_SETEDGEMODE 2363 #define SCI_GETEDGECOLOUR 2364 #define SCI_SETEDGECOLOUR 2365 #define SCI_SEARCHANCHOR 2366 #define SCI_SEARCHNEXT 2367 #define SCI_SEARCHPREV 2368 #define SCI_LINESONSCREEN 2370 #define SCI_USEPOPUP 2371 #define SCI_SELECTIONISRECTANGLE 2372 #define SCI_SETZOOM 2373 #define SCI_GETZOOM 2374 #define SCI_CREATEDOCUMENT 2375 #define SCI_ADDREFDOCUMENT 2376 #define SCI_RELEASEDOCUMENT 2377 #define SCI_GETMODEVENTMASK 2378 #define SCI_SETFOCUS 2380 #define SCI_GETFOCUS 2381 #define SC_STATUS_OK 0 #define SC_STATUS_FAILURE 1 #define SC_STATUS_BADALLOC 2 #define SCI_SETSTATUS 2382 #define SCI_GETSTATUS 2383 #define SCI_SETMOUSEDOWNCAPTURES 2384 #define SCI_GETMOUSEDOWNCAPTURES 2385 #define SC_CURSORNORMAL -1 #define SC_CURSORARROW 2 #define SC_CURSORWAIT 4 #define SC_CURSORREVERSEARROW 7 #define SCI_SETCURSOR 2386 #define SCI_GETCURSOR 2387 #define SCI_SETCONTROLCHARSYMBOL 2388 #define SCI_GETCONTROLCHARSYMBOL 2389 #define SCI_WORDPARTLEFT 2390 #define SCI_WORDPARTLEFTEXTEND 2391 #define SCI_WORDPARTRIGHT 2392 #define SCI_WORDPARTRIGHTEXTEND 2393 #define VISIBLE_SLOP 0x01 #define VISIBLE_STRICT 0x04 #define SCI_SETVISIBLEPOLICY 2394 #define SCI_DELLINELEFT 2395 #define SCI_DELLINERIGHT 2396 #define SCI_SETXOFFSET 2397 #define SCI_GETXOFFSET 2398 #define SCI_CHOOSECARETX 2399 #define SCI_GRABFOCUS 2400 #define CARET_SLOP 0x01 #define CARET_STRICT 0x04 #define CARET_JUMPS 0x10 #define CARET_EVEN 0x08 #define SCI_SETXCARETPOLICY 2402 #define SCI_SETYCARETPOLICY 2403 #define SCI_SETPRINTWRAPMODE 2406 #define SCI_GETPRINTWRAPMODE 2407 #define SCI_SETHOTSPOTACTIVEFORE 2410 #define SCI_GETHOTSPOTACTIVEFORE 2494 #define SCI_SETHOTSPOTACTIVEBACK 2411 #define SCI_GETHOTSPOTACTIVEBACK 2495 #define SCI_SETHOTSPOTACTIVEUNDERLINE 2412 #define SCI_GETHOTSPOTACTIVEUNDERLINE 2496 #define SCI_SETHOTSPOTSINGLELINE 2421 #define SCI_GETHOTSPOTSINGLELINE 2497 #define SCI_PARADOWN 2413 #define SCI_PARADOWNEXTEND 2414 #define SCI_PARAUP 2415 #define SCI_PARAUPEXTEND 2416 #define SCI_POSITIONBEFORE 2417 #define SCI_POSITIONAFTER 2418 #define SCI_COPYRANGE 2419 #define SCI_COPYTEXT 2420 #define SC_SEL_STREAM 0 #define SC_SEL_RECTANGLE 1 #define SC_SEL_LINES 2 #define SC_SEL_THIN 3 #define SCI_SETSELECTIONMODE 2422 #define SCI_GETSELECTIONMODE 2423 #define SCI_GETLINESELSTARTPOSITION 2424 #define SCI_GETLINESELENDPOSITION 2425 #define SCI_LINEDOWNRECTEXTEND 2426 #define SCI_LINEUPRECTEXTEND 2427 #define SCI_CHARLEFTRECTEXTEND 2428 #define SCI_CHARRIGHTRECTEXTEND 2429 #define SCI_HOMERECTEXTEND 2430 #define SCI_VCHOMERECTEXTEND 2431 #define SCI_LINEENDRECTEXTEND 2432 #define SCI_PAGEUPRECTEXTEND 2433 #define SCI_PAGEDOWNRECTEXTEND 2434 #define SCI_STUTTEREDPAGEUP 2435 #define SCI_STUTTEREDPAGEUPEXTEND 2436 #define SCI_STUTTEREDPAGEDOWN 2437 #define SCI_STUTTEREDPAGEDOWNEXTEND 2438 #define SCI_WORDLEFTEND 2439 #define SCI_WORDLEFTENDEXTEND 2440 #define SCI_WORDRIGHTEND 2441 #define SCI_WORDRIGHTENDEXTEND 2442 #define SCI_SETWHITESPACECHARS 2443 #define SCI_SETCHARSDEFAULT 2444 #define SCI_AUTOCGETCURRENT 2445 #define SCI_AUTOCGETCURRENTTEXT 2610 #define SCI_ALLOCATE 2446 #define SCI_TARGETASUTF8 2447 #define SCI_SETLENGTHFORENCODE 2448 #define SCI_ENCODEDFROMUTF8 2449 #define SCI_FINDCOLUMN 2456 #define SCI_GETCARETSTICKY 2457 #define SCI_SETCARETSTICKY 2458 #define SC_CARETSTICKY_OFF 0 #define SC_CARETSTICKY_ON 1 #define SC_CARETSTICKY_WHITESPACE 2 #define SCI_TOGGLECARETSTICKY 2459 #define SCI_SETPASTECONVERTENDINGS 2467 #define SCI_GETPASTECONVERTENDINGS 2468 #define SCI_SELECTIONDUPLICATE 2469 #define SC_ALPHA_TRANSPARENT 0 #define SC_ALPHA_OPAQUE 255 #define SC_ALPHA_NOALPHA 256 #define SCI_SETCARETLINEBACKALPHA 2470 #define SCI_GETCARETLINEBACKALPHA 2471 #define CARETSTYLE_INVISIBLE 0 #define CARETSTYLE_LINE 1 #define CARETSTYLE_BLOCK 2 #define SCI_SETCARETSTYLE 2512 #define SCI_GETCARETSTYLE 2513 #define SCI_SETINDICATORCURRENT 2500 #define SCI_GETINDICATORCURRENT 2501 #define SCI_SETINDICATORVALUE 2502 #define SCI_GETINDICATORVALUE 2503 #define SCI_INDICATORFILLRANGE 2504 #define SCI_INDICATORCLEARRANGE 2505 #define SCI_INDICATORALLONFOR 2506 #define SCI_INDICATORVALUEAT 2507 #define SCI_INDICATORSTART 2508 #define SCI_INDICATOREND 2509 #define SCI_SETPOSITIONCACHE 2514 #define SCI_GETPOSITIONCACHE 2515 #define SCI_COPYALLOWLINE 2519 #define SCI_GETCHARACTERPOINTER 2520 #define SCI_SETKEYSUNICODE 2521 #define SCI_GETKEYSUNICODE 2522 #define SCI_INDICSETALPHA 2523 #define SCI_INDICGETALPHA 2524 #define SCI_INDICSETOUTLINEALPHA 2558 #define SCI_INDICGETOUTLINEALPHA 2559 #define SCI_SETEXTRAASCENT 2525 #define SCI_GETEXTRAASCENT 2526 #define SCI_SETEXTRADESCENT 2527 #define SCI_GETEXTRADESCENT 2528 #define SCI_MARKERSYMBOLDEFINED 2529 #define SCI_MARGINSETTEXT 2530 #define SCI_MARGINGETTEXT 2531 #define SCI_MARGINSETSTYLE 2532 #define SCI_MARGINGETSTYLE 2533 #define SCI_MARGINSETSTYLES 2534 #define SCI_MARGINGETSTYLES 2535 #define SCI_MARGINTEXTCLEARALL 2536 #define SCI_MARGINSETSTYLEOFFSET 2537 #define SCI_MARGINGETSTYLEOFFSET 2538 #define SC_MARGINOPTION_NONE 0 #define SC_MARGINOPTION_SUBLINESELECT 1 #define SCI_SETMARGINOPTIONS 2539 #define SCI_GETMARGINOPTIONS 2557 #define SCI_ANNOTATIONSETTEXT 2540 #define SCI_ANNOTATIONGETTEXT 2541 #define SCI_ANNOTATIONSETSTYLE 2542 #define SCI_ANNOTATIONGETSTYLE 2543 #define SCI_ANNOTATIONSETSTYLES 2544 #define SCI_ANNOTATIONGETSTYLES 2545 #define SCI_ANNOTATIONGETLINES 2546 #define SCI_ANNOTATIONCLEARALL 2547 #define ANNOTATION_HIDDEN 0 #define ANNOTATION_STANDARD 1 #define ANNOTATION_BOXED 2 #define SCI_ANNOTATIONSETVISIBLE 2548 #define SCI_ANNOTATIONGETVISIBLE 2549 #define SCI_ANNOTATIONSETSTYLEOFFSET 2550 #define SCI_ANNOTATIONGETSTYLEOFFSET 2551 #define UNDO_MAY_COALESCE 1 #define SCI_ADDUNDOACTION 2560 #define SCI_CHARPOSITIONFROMPOINT 2561 #define SCI_CHARPOSITIONFROMPOINTCLOSE 2562 #define SCI_SETMULTIPLESELECTION 2563 #define SCI_GETMULTIPLESELECTION 2564 #define SCI_SETADDITIONALSELECTIONTYPING 2565 #define SCI_GETADDITIONALSELECTIONTYPING 2566 #define SCI_SETADDITIONALCARETSBLINK 2567 #define SCI_GETADDITIONALCARETSBLINK 2568 #define SCI_SETADDITIONALCARETSVISIBLE 2608 #define SCI_GETADDITIONALCARETSVISIBLE 2609 #define SCI_GETSELECTIONS 2570 #define SCI_CLEARSELECTIONS 2571 #define SCI_SETSELECTION 2572 #define SCI_ADDSELECTION 2573 #define SCI_SETMAINSELECTION 2574 #define SCI_GETMAINSELECTION 2575 #define SCI_SETSELECTIONNCARET 2576 #define SCI_GETSELECTIONNCARET 2577 #define SCI_SETSELECTIONNANCHOR 2578 #define SCI_GETSELECTIONNANCHOR 2579 #define SCI_SETSELECTIONNCARETVIRTUALSPACE 2580 #define SCI_GETSELECTIONNCARETVIRTUALSPACE 2581 #define SCI_SETSELECTIONNANCHORVIRTUALSPACE 2582 #define SCI_GETSELECTIONNANCHORVIRTUALSPACE 2583 #define SCI_SETSELECTIONNSTART 2584 #define SCI_GETSELECTIONNSTART 2585 #define SCI_SETSELECTIONNEND 2586 #define SCI_GETSELECTIONNEND 2587 #define SCI_SETRECTANGULARSELECTIONCARET 2588 #define SCI_GETRECTANGULARSELECTIONCARET 2589 #define SCI_SETRECTANGULARSELECTIONANCHOR 2590 #define SCI_GETRECTANGULARSELECTIONANCHOR 2591 #define SCI_SETRECTANGULARSELECTIONCARETVIRTUALSPACE 2592 #define SCI_GETRECTANGULARSELECTIONCARETVIRTUALSPACE 2593 #define SCI_SETRECTANGULARSELECTIONANCHORVIRTUALSPACE 2594 #define SCI_GETRECTANGULARSELECTIONANCHORVIRTUALSPACE 2595 #define SCVS_NONE 0 #define SCVS_RECTANGULARSELECTION 1 #define SCVS_USERACCESSIBLE 2 #define SCI_SETVIRTUALSPACEOPTIONS 2596 #define SCI_GETVIRTUALSPACEOPTIONS 2597 #define SCI_SETRECTANGULARSELECTIONMODIFIER 2598 #define SCI_GETRECTANGULARSELECTIONMODIFIER 2599 #define SCI_SETADDITIONALSELFORE 2600 #define SCI_SETADDITIONALSELBACK 2601 #define SCI_SETADDITIONALSELALPHA 2602 #define SCI_GETADDITIONALSELALPHA 2603 #define SCI_SETADDITIONALCARETFORE 2604 #define SCI_GETADDITIONALCARETFORE 2605 #define SCI_ROTATESELECTION 2606 #define SCI_SWAPMAINANCHORCARET 2607 #define SCI_CHANGELEXERSTATE 2617 #define SCI_CONTRACTEDFOLDNEXT 2618 #define SCI_VERTICALCENTRECARET 2619 #define SCI_MOVESELECTEDLINESUP 2620 #define SCI_MOVESELECTEDLINESDOWN 2621 #define SCI_SETIDENTIFIER 2622 #define SCI_GETIDENTIFIER 2623 #define SCI_RGBAIMAGESETWIDTH 2624 #define SCI_RGBAIMAGESETHEIGHT 2625 #define SCI_MARKERDEFINERGBAIMAGE 2626 #define SCI_REGISTERRGBAIMAGE 2627 #define SCI_SCROLLTOSTART 2628 #define SCI_SCROLLTOEND 2629 #define SC_TECHNOLOGY_DEFAULT 0 #define SC_TECHNOLOGY_DIRECTWRITE 1 #define SCI_SETTECHNOLOGY 2630 #define SCI_GETTECHNOLOGY 2631 #define SCI_CREATELOADER 2632 #define SCI_STARTRECORD 3001 #define SCI_STOPRECORD 3002 #define SCI_SETLEXER 4001 #define SCI_GETLEXER 4002 #define SCI_COLOURISE 4003 #define SCI_SETPROPERTY 4004 #define KEYWORDSET_MAX 8 #define SCI_SETKEYWORDS 4005 #define SCI_SETLEXERLANGUAGE 4006 #define SCI_LOADLEXERLIBRARY 4007 #define SCI_GETPROPERTY 4008 #define SCI_GETPROPERTYEXPANDED 4009 #define SCI_GETPROPERTYINT 4010 #define SCI_GETSTYLEBITSNEEDED 4011 #define SCI_GETLEXERLANGUAGE 4012 #define SCI_PRIVATELEXERCALL 4013 #define SCI_PROPERTYNAMES 4014 #define SC_TYPE_BOOLEAN 0 #define SC_TYPE_INTEGER 1 #define SC_TYPE_STRING 2 #define SCI_PROPERTYTYPE 4015 #define SCI_DESCRIBEPROPERTY 4016 #define SCI_DESCRIBEKEYWORDSETS 4017 #define SC_MOD_INSERTTEXT 0x1 #define SC_MOD_DELETETEXT 0x2 #define SC_MOD_CHANGESTYLE 0x4 #define SC_MOD_CHANGEFOLD 0x8 #define SC_PERFORMED_USER 0x10 #define SC_PERFORMED_UNDO 0x20 #define SC_PERFORMED_REDO 0x40 #define SC_MULTISTEPUNDOREDO 0x80 #define SC_LASTSTEPINUNDOREDO 0x100 #define SC_MOD_CHANGEMARKER 0x200 #define SC_MOD_BEFOREINSERT 0x400 #define SC_MOD_BEFOREDELETE 0x800 #define SC_MULTILINEUNDOREDO 0x1000 #define SC_STARTACTION 0x2000 #define SC_MOD_CHANGEINDICATOR 0x4000 #define SC_MOD_CHANGELINESTATE 0x8000 #define SC_MOD_CHANGEMARGIN 0x10000 #define SC_MOD_CHANGEANNOTATION 0x20000 #define SC_MOD_CONTAINER 0x40000 #define SC_MOD_LEXERSTATE 0x80000 #define SC_MODEVENTMASKALL 0xFFFFF #define SC_UPDATE_CONTENT 0x1 #define SC_UPDATE_SELECTION 0x2 #define SC_UPDATE_V_SCROLL 0x4 #define SC_UPDATE_H_SCROLL 0x8 #define SCEN_CHANGE 768 #define SCEN_SETFOCUS 512 #define SCEN_KILLFOCUS 256 #define SCK_DOWN 300 #define SCK_UP 301 #define SCK_LEFT 302 #define SCK_RIGHT 303 #define SCK_HOME 304 #define SCK_END 305 #define SCK_PRIOR 306 #define SCK_NEXT 307 #define SCK_DELETE 308 #define SCK_INSERT 309 #define SCK_ESCAPE 7 #define SCK_BACK 8 #define SCK_TAB 9 #define SCK_RETURN 13 #define SCK_ADD 310 #define SCK_SUBTRACT 311 #define SCK_DIVIDE 312 #define SCK_WIN 313 #define SCK_RWIN 314 #define SCK_MENU 315 #define SCMOD_NORM 0 #define SCMOD_SHIFT 1 #define SCMOD_CTRL 2 #define SCMOD_ALT 4 #define SCMOD_SUPER 8 #define SCMOD_META 16 #define SCN_STYLENEEDED 2000 #define SCN_CHARADDED 2001 #define SCN_SAVEPOINTREACHED 2002 #define SCN_SAVEPOINTLEFT 2003 #define SCN_MODIFYATTEMPTRO 2004 #define SCN_KEY 2005 #define SCN_DOUBLECLICK 2006 #define SCN_UPDATEUI 2007 #define SCN_MODIFIED 2008 #define SCN_MACRORECORD 2009 #define SCN_MARGINCLICK 2010 #define SCN_NEEDSHOWN 2011 #define SCN_PAINTED 2013 #define SCN_USERLISTSELECTION 2014 #define SCN_URIDROPPED 2015 #define SCN_DWELLSTART 2016 #define SCN_DWELLEND 2017 #define SCN_ZOOM 2018 #define SCN_HOTSPOTCLICK 2019 #define SCN_HOTSPOTDOUBLECLICK 2020 #define SCN_CALLTIPCLICK 2021 #define SCN_AUTOCSELECTION 2022 #define SCN_INDICATORCLICK 2023 #define SCN_INDICATORRELEASE 2024 #define SCN_AUTOCCANCELLED 2025 #define SCN_AUTOCCHARDELETED 2026 #define SCN_HOTSPOTRELEASECLICK 2027 /* --Autogenerated -- end of section automatically generated from Scintilla.iface */ /* These structures are defined to be exactly the same shape as the Win32 * CHARRANGE, TEXTRANGE, FINDTEXTEX, FORMATRANGE, and NMHDR structs. * So older code that treats Scintilla as a RichEdit will work. */ #ifdef SCI_NAMESPACE namespace Scintilla { #endif struct Sci_CharacterRange { long cpMin; long cpMax; }; struct Sci_TextRange { struct Sci_CharacterRange chrg; char *lpstrText; }; struct Sci_TextToFind { struct Sci_CharacterRange chrg; char *lpstrText; struct Sci_CharacterRange chrgText; }; #define CharacterRange Sci_CharacterRange #define TextRange Sci_TextRange #define TextToFind Sci_TextToFind typedef void *Sci_SurfaceID; struct Sci_Rectangle { int left; int top; int right; int bottom; }; /* This structure is used in printing and requires some of the graphics types * from Platform.h. Not needed by most client code. */ struct Sci_RangeToFormat { Sci_SurfaceID hdc; Sci_SurfaceID hdcTarget; struct Sci_Rectangle rc; struct Sci_Rectangle rcPage; struct Sci_CharacterRange chrg; }; #define RangeToFormat Sci_RangeToFormat struct Sci_NotifyHeader { /* Compatible with Windows NMHDR. * hwndFrom is really an environment specific window handle or pointer * but most clients of Scintilla.h do not have this type visible. */ void *hwndFrom; uptr_t idFrom; unsigned int code; }; #define NotifyHeader Sci_NotifyHeader struct SCNotification { struct Sci_NotifyHeader nmhdr; int position; /* SCN_STYLENEEDED, SCN_DOUBLECLICK, SCN_MODIFIED, SCN_MARGINCLICK, */ /* SCN_NEEDSHOWN, SCN_DWELLSTART, SCN_DWELLEND, SCN_CALLTIPCLICK, */ /* SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK, SCN_HOTSPOTRELEASECLICK, */ /* SCN_INDICATORCLICK, SCN_INDICATORRELEASE, */ /* SCN_USERLISTSELECTION, SCN_AUTOCSELECTION */ int ch; /* SCN_CHARADDED, SCN_KEY */ int modifiers; /* SCN_KEY, SCN_DOUBLECLICK, SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK, */ /* SCN_HOTSPOTRELEASECLICK, SCN_INDICATORCLICK, SCN_INDICATORRELEASE, */ int modificationType; /* SCN_MODIFIED */ const char *text; /* SCN_MODIFIED, SCN_USERLISTSELECTION, SCN_AUTOCSELECTION, SCN_URIDROPPED */ int length; /* SCN_MODIFIED */ int linesAdded; /* SCN_MODIFIED */ int message; /* SCN_MACRORECORD */ uptr_t wParam; /* SCN_MACRORECORD */ sptr_t lParam; /* SCN_MACRORECORD */ int line; /* SCN_MODIFIED */ int foldLevelNow; /* SCN_MODIFIED */ int foldLevelPrev; /* SCN_MODIFIED */ int margin; /* SCN_MARGINCLICK */ int listType; /* SCN_USERLISTSELECTION */ int x; /* SCN_DWELLSTART, SCN_DWELLEND */ int y; /* SCN_DWELLSTART, SCN_DWELLEND */ int token; /* SCN_MODIFIED with SC_MOD_CONTAINER */ int annotationLinesAdded; /* SCN_MODIFIED with SC_MOD_CHANGEANNOTATION */ int updated; /* SCN_UPDATEUI */ }; #ifdef SCI_NAMESPACE } #endif #ifdef INCLUDE_DEPRECATED_FEATURES #define SC_CP_DBCS 1 #define SCI_SETUSEPALETTE 2039 #define SCI_GETUSEPALETTE 2139 #endif #endif Wx-Scintilla-0.38/wx-scintilla/src/scintilla/include/ILexer.h000444001750001750 560011727344243 24573 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file ILexer.h ** Interface between Scintilla and lexers. **/ // Copyright 1998-2010 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #ifndef ILEXER_H #define ILEXER_H #ifdef SCI_NAMESPACE namespace Scintilla { #endif #ifdef _WIN32 #define SCI_METHOD __stdcall #else #define SCI_METHOD #endif enum { dvOriginal=0 }; class IDocument { public: virtual int SCI_METHOD Version() const = 0; virtual void SCI_METHOD SetErrorStatus(int status) = 0; virtual int SCI_METHOD Length() const = 0; virtual void SCI_METHOD GetCharRange(char *buffer, int position, int lengthRetrieve) const = 0; virtual char SCI_METHOD StyleAt(int position) const = 0; virtual int SCI_METHOD LineFromPosition(int position) const = 0; virtual int SCI_METHOD LineStart(int line) const = 0; virtual int SCI_METHOD GetLevel(int line) const = 0; virtual int SCI_METHOD SetLevel(int line, int level) = 0; virtual int SCI_METHOD GetLineState(int line) const = 0; virtual int SCI_METHOD SetLineState(int line, int state) = 0; virtual void SCI_METHOD StartStyling(int position, char mask) = 0; virtual bool SCI_METHOD SetStyleFor(int length, char style) = 0; virtual bool SCI_METHOD SetStyles(int length, const char *styles) = 0; virtual void SCI_METHOD DecorationSetCurrentIndicator(int indicator) = 0; virtual void SCI_METHOD DecorationFillRange(int position, int value, int fillLength) = 0; virtual void SCI_METHOD ChangeLexerState(int start, int end) = 0; virtual int SCI_METHOD CodePage() const = 0; virtual bool SCI_METHOD IsDBCSLeadByte(char ch) const = 0; virtual const char * SCI_METHOD BufferPointer() = 0; virtual int SCI_METHOD GetLineIndentation(int line) = 0; }; enum { lvOriginal=0 }; class ILexer { public: virtual int SCI_METHOD Version() const = 0; virtual void SCI_METHOD Release() = 0; virtual const char * SCI_METHOD PropertyNames() = 0; virtual int SCI_METHOD PropertyType(const char *name) = 0; virtual const char * SCI_METHOD DescribeProperty(const char *name) = 0; virtual int SCI_METHOD PropertySet(const char *key, const char *val) = 0; virtual const char * SCI_METHOD DescribeWordListSets() = 0; virtual int SCI_METHOD WordListSet(int n, const char *wl) = 0; virtual void SCI_METHOD Lex(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess) = 0; virtual void SCI_METHOD Fold(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess) = 0; virtual void * SCI_METHOD PrivateCall(int operation, void *pointer) = 0; }; class ILoader { public: virtual int SCI_METHOD Release() = 0; // Returns a status code from SC_STATUS_* virtual int SCI_METHOD AddData(char *data, int length) = 0; virtual void * SCI_METHOD ConvertToDocument() = 0; }; #ifdef SCI_NAMESPACE } #endif #endif Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src000755001750001750 011727344243 22240 5ustar00azawawiazawawi000000000000Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexCoffeeScript.cxx000444001750001750 4446711727344243 26205 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexCoffeeScript.cxx ** Lexer for CoffeeScript. **/ // Copyright 1998-2011 by Neil Hodgson // Based on the Scintilla C++ Lexer // Written by Eric Promislow in 2011 for the Komodo IDE // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "Platform.h" #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static bool IsSpaceEquiv(int state) { return (state <= SCE_C_COMMENTDOC // including SCE_C_DEFAULT, SCE_C_COMMENT, SCE_C_COMMENTLINE || state == SCE_C_COMMENTLINEDOC || state == SCE_C_COMMENTDOCKEYWORD || state == SCE_C_COMMENTDOCKEYWORDERROR || state == SCE_COFFEESCRIPT_COMMENTBLOCK || state == SCE_COFFEESCRIPT_VERBOSE_REGEX || state == SCE_COFFEESCRIPT_VERBOSE_REGEX_COMMENT || state == SCE_C_WORD || state == SCE_C_REGEX); } // Preconditions: sc.currentPos points to a character after '+' or '-'. // The test for pos reaching 0 should be redundant, // and is in only for safety measures. // Limitation: this code will give the incorrect answer for code like // a = b+++/ptn/... // Putting a space between the '++' post-inc operator and the '+' binary op // fixes this, and is highly recommended for readability anyway. static bool FollowsPostfixOperator(StyleContext &sc, Accessor &styler) { int pos = (int) sc.currentPos; while (--pos > 0) { char ch = styler[pos]; if (ch == '+' || ch == '-') { return styler[pos - 1] == ch; } } return false; } static bool followsReturnKeyword(StyleContext &sc, Accessor &styler) { // Don't look at styles, so no need to flush. int pos = (int) sc.currentPos; int currentLine = styler.GetLine(pos); int lineStartPos = styler.LineStart(currentLine); char ch; while (--pos > lineStartPos) { ch = styler.SafeGetCharAt(pos); if (ch != ' ' && ch != '\t') { break; } } const char *retBack = "nruter"; const char *s = retBack; while (*s && pos >= lineStartPos && styler.SafeGetCharAt(pos) == *s) { s++; pos--; } return !*s; } static void ColouriseCoffeeScriptDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { WordList &keywords = *keywordlists[0]; WordList &keywords2 = *keywordlists[1]; WordList &keywords3 = *keywordlists[2]; WordList &keywords4 = *keywordlists[3]; // property styling.within.preprocessor // For C++ code, determines whether all preprocessor code is styled in the preprocessor style (0, the default) // or only from the initial # to the end of the command word(1). bool stylingWithinPreprocessor = styler.GetPropertyInt("styling.within.preprocessor") != 0; CharacterSet setOKBeforeRE(CharacterSet::setNone, "([{=,:;!%^&*|?~+-"); CharacterSet setCouldBePostOp(CharacterSet::setNone, "+-"); CharacterSet setDoxygen(CharacterSet::setAlpha, "$@\\&<>#{}[]"); CharacterSet setWordStart(CharacterSet::setAlpha, "_", 0x80, true); CharacterSet setWord(CharacterSet::setAlphaNum, "._", 0x80, true); // property lexer.cpp.allow.dollars // Set to 0 to disallow the '$' character in identifiers with the cpp lexer. if (styler.GetPropertyInt("lexer.cpp.allow.dollars", 1) != 0) { setWordStart.Add('$'); setWord.Add('$'); } int chPrevNonWhite = ' '; int visibleChars = 0; bool lastWordWasUUID = false; int styleBeforeDCKeyword = SCE_C_DEFAULT; bool continuationLine = false; bool isIncludePreprocessor = false; if (initStyle == SCE_C_PREPROCESSOR) { // Set continuationLine if last character of previous line is '\' int lineCurrent = styler.GetLine(startPos); if (lineCurrent > 0) { int chBack = styler.SafeGetCharAt(startPos-1, 0); int chBack2 = styler.SafeGetCharAt(startPos-2, 0); int lineEndChar = '!'; if (chBack2 == '\r' && chBack == '\n') { lineEndChar = styler.SafeGetCharAt(startPos-3, 0); } else if (chBack == '\n' || chBack == '\r') { lineEndChar = chBack2; } continuationLine = lineEndChar == '\\'; } } // look back to set chPrevNonWhite properly for better regex colouring int endPos = startPos + length; if (startPos > 0) { unsigned int back = startPos; styler.Flush(); while (back > 0 && IsSpaceEquiv(styler.StyleAt(--back))) ; if (styler.StyleAt(back) == SCE_C_OPERATOR) { chPrevNonWhite = styler.SafeGetCharAt(back); } if (startPos != back) { initStyle = styler.StyleAt(back); } startPos = back; } StyleContext sc(startPos, endPos - startPos, initStyle, styler); for (; sc.More(); sc.Forward()) { if (sc.atLineStart) { // Reset states to begining of colourise so no surprises // if different sets of lines lexed. visibleChars = 0; lastWordWasUUID = false; isIncludePreprocessor = false; } // Handle line continuation generically. if (sc.ch == '\\') { if (sc.chNext == '\n' || sc.chNext == '\r') { sc.Forward(); if (sc.ch == '\r' && sc.chNext == '\n') { sc.Forward(); } continuationLine = true; continue; } } // Determine if the current state should terminate. switch (sc.state) { case SCE_C_OPERATOR: sc.SetState(SCE_C_DEFAULT); break; case SCE_C_NUMBER: // We accept almost anything because of hex. and number suffixes if (!setWord.Contains(sc.ch)) { sc.SetState(SCE_C_DEFAULT); } break; case SCE_C_IDENTIFIER: if (!setWord.Contains(sc.ch) || (sc.ch == '.') || (sc.ch == '$')) { char s[1000]; sc.GetCurrent(s, sizeof(s)); if (keywords.InList(s)) { lastWordWasUUID = strcmp(s, "uuid") == 0; sc.ChangeState(SCE_C_WORD); } else if (keywords2.InList(s)) { sc.ChangeState(SCE_C_WORD2); } else if (keywords4.InList(s)) { sc.ChangeState(SCE_C_GLOBALCLASS); } sc.SetState(SCE_C_DEFAULT); } break; case SCE_C_PREPROCESSOR: if (sc.atLineStart && !continuationLine) { sc.SetState(SCE_C_DEFAULT); } else if (stylingWithinPreprocessor) { if (IsASpace(sc.ch)) { sc.SetState(SCE_C_DEFAULT); } } else { if (sc.Match('/', '*') || sc.Match('/', '/')) { sc.SetState(SCE_C_DEFAULT); } } break; case SCE_C_COMMENT: if (sc.Match('*', '/')) { sc.Forward(); sc.ForwardSetState(SCE_C_DEFAULT); } break; case SCE_C_COMMENTDOC: if (sc.Match('*', '/')) { sc.Forward(); sc.ForwardSetState(SCE_C_DEFAULT); } else if (sc.ch == '@' || sc.ch == '\\') { // JavaDoc and Doxygen support // Verify that we have the conditions to mark a comment-doc-keyword if ((IsASpace(sc.chPrev) || sc.chPrev == '*') && (!IsASpace(sc.chNext))) { styleBeforeDCKeyword = SCE_C_COMMENTDOC; sc.SetState(SCE_C_COMMENTDOCKEYWORD); } } break; case SCE_C_COMMENTLINE: if (sc.atLineStart) { sc.SetState(SCE_C_DEFAULT); } break; case SCE_C_COMMENTLINEDOC: if (sc.atLineStart) { sc.SetState(SCE_C_DEFAULT); } else if (sc.ch == '@' || sc.ch == '\\') { // JavaDoc and Doxygen support // Verify that we have the conditions to mark a comment-doc-keyword if ((IsASpace(sc.chPrev) || sc.chPrev == '/' || sc.chPrev == '!') && (!IsASpace(sc.chNext))) { styleBeforeDCKeyword = SCE_C_COMMENTLINEDOC; sc.SetState(SCE_C_COMMENTDOCKEYWORD); } } break; case SCE_C_COMMENTDOCKEYWORD: if ((styleBeforeDCKeyword == SCE_C_COMMENTDOC) && sc.Match('*', '/')) { sc.ChangeState(SCE_C_COMMENTDOCKEYWORDERROR); sc.Forward(); sc.ForwardSetState(SCE_C_DEFAULT); } else if (!setDoxygen.Contains(sc.ch)) { char s[100]; sc.GetCurrent(s, sizeof(s)); if (!IsASpace(sc.ch) || !keywords3.InList(s + 1)) { sc.ChangeState(SCE_C_COMMENTDOCKEYWORDERROR); } sc.SetState(styleBeforeDCKeyword); } break; case SCE_C_STRING: if (isIncludePreprocessor) { if (sc.ch == '>') { sc.ForwardSetState(SCE_C_DEFAULT); isIncludePreprocessor = false; } } else if (sc.ch == '\\') { if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') { sc.Forward(); } } else if (sc.ch == '\"') { sc.ForwardSetState(SCE_C_DEFAULT); } break; case SCE_C_CHARACTER: if (sc.ch == '\\') { if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') { sc.Forward(); } } else if (sc.ch == '\'') { sc.ForwardSetState(SCE_C_DEFAULT); } break; case SCE_C_REGEX: if (sc.atLineStart) { sc.SetState(SCE_C_DEFAULT); } else if (sc.ch == '/') { sc.Forward(); while ((sc.ch < 0x80) && islower(sc.ch)) sc.Forward(); // gobble regex flags sc.SetState(SCE_C_DEFAULT); } else if (sc.ch == '\\') { // Gobble up the quoted character if (sc.chNext == '\\' || sc.chNext == '/') { sc.Forward(); } } break; case SCE_C_STRINGEOL: if (sc.atLineStart) { sc.SetState(SCE_C_DEFAULT); } break; case SCE_C_VERBATIM: if (sc.ch == '\"') { if (sc.chNext == '\"') { sc.Forward(); } else { sc.ForwardSetState(SCE_C_DEFAULT); } } break; case SCE_C_UUID: if (sc.ch == '\r' || sc.ch == '\n' || sc.ch == ')') { sc.SetState(SCE_C_DEFAULT); } break; case SCE_COFFEESCRIPT_COMMENTBLOCK: if (sc.Match("###")) { sc.ChangeState(SCE_C_COMMENT); sc.Forward(); sc.Forward(); sc.ForwardSetState(SCE_C_DEFAULT); } else if (sc.ch == '\\') { sc.Forward(); } break; case SCE_COFFEESCRIPT_VERBOSE_REGEX: if (sc.Match("///")) { sc.Forward(); sc.Forward(); sc.ChangeState(SCE_C_REGEX); sc.ForwardSetState(SCE_C_DEFAULT); } else if (sc.Match('#')) { sc.ChangeState(SCE_C_REGEX); sc.SetState(SCE_COFFEESCRIPT_VERBOSE_REGEX_COMMENT); } else if (sc.ch == '\\') { sc.Forward(); } break; case SCE_COFFEESCRIPT_VERBOSE_REGEX_COMMENT: if (sc.atLineStart) { sc.ChangeState(SCE_C_COMMENT); sc.SetState(SCE_COFFEESCRIPT_VERBOSE_REGEX); } break; } // Determine if a new state should be entered. if (sc.state == SCE_C_DEFAULT) { if (sc.Match('@', '\"')) { sc.SetState(SCE_C_VERBATIM); sc.Forward(); } else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) { if (lastWordWasUUID) { sc.SetState(SCE_C_UUID); lastWordWasUUID = false; } else { sc.SetState(SCE_C_NUMBER); } } else if (setWordStart.Contains(sc.ch) || (sc.ch == '@') || (sc.ch == '$')) { if (lastWordWasUUID) { sc.SetState(SCE_C_UUID); lastWordWasUUID = false; } else { sc.SetState(SCE_C_IDENTIFIER); } } else if (sc.Match('/', '*')) { if (sc.Match("/**") || sc.Match("/*!")) { // Support of Qt/Doxygen doc. style sc.SetState(SCE_C_COMMENTDOC); } else { sc.SetState(SCE_C_COMMENT); } sc.Forward(); // Eat the * so it isn't used for the end of the comment } else if (sc.Match("///")) { sc.SetState(SCE_COFFEESCRIPT_VERBOSE_REGEX); } else if (sc.ch == '/' && (setOKBeforeRE.Contains(chPrevNonWhite) || followsReturnKeyword(sc, styler)) && (!setCouldBePostOp.Contains(chPrevNonWhite) || !FollowsPostfixOperator(sc, styler))) { sc.SetState(SCE_C_REGEX); // JavaScript's RegEx } else if (sc.ch == '\"') { sc.SetState(SCE_C_STRING); isIncludePreprocessor = false; // ensure that '>' won't end the string } else if (isIncludePreprocessor && sc.ch == '<') { sc.SetState(SCE_C_STRING); } else if (sc.ch == '\'') { sc.SetState(SCE_C_CHARACTER); } else if (sc.ch == '#') { if (sc.Match("###")) { sc.SetState(SCE_COFFEESCRIPT_COMMENTBLOCK); } else { sc.SetState(SCE_C_COMMENTLINE); } } else if (isoperator(static_cast(sc.ch))) { sc.SetState(SCE_C_OPERATOR); } } if (!IsASpace(sc.ch) && !IsSpaceEquiv(sc.state)) { chPrevNonWhite = sc.ch; visibleChars++; } continuationLine = false; } // Change temporary coffeescript states into standard C ones. switch (sc.state) { case SCE_COFFEESCRIPT_COMMENTBLOCK: sc.ChangeState(SCE_C_COMMENT); break; case SCE_COFFEESCRIPT_VERBOSE_REGEX: sc.ChangeState(SCE_C_REGEX); break; case SCE_COFFEESCRIPT_VERBOSE_REGEX_COMMENT: sc.ChangeState(SCE_C_COMMENTLINE); break; } sc.Complete(); } static bool IsCommentLine(int line, Accessor &styler) { int pos = styler.LineStart(line); int eol_pos = styler.LineStart(line + 1) - 1; for (int i = pos; i < eol_pos; i++) { char ch = styler[i]; if (ch == '#') return true; else if (ch == '/' && i < eol_pos - 1 && styler[i + 1] == '*') return true; else if (ch != ' ' && ch != '\t') return false; } return false; } static void FoldCoffeeScriptDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) { // A simplified version of FoldPyDoc const int maxPos = startPos + length; const int maxLines = styler.GetLine(maxPos - 1); // Requested last line const int docLines = styler.GetLine(styler.Length() - 1); // Available last line // property fold.coffeescript.comment const bool foldComment = styler.GetPropertyInt("fold.coffeescript.comment") != 0; const bool foldCompact = styler.GetPropertyInt("fold.compact") != 0; // Backtrack to previous non-blank line so we can determine indent level // for any white space lines // and so we can fix any preceding fold level (which is why we go back // at least one line in all cases) int spaceFlags = 0; int lineCurrent = styler.GetLine(startPos); int indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, NULL); while (lineCurrent > 0) { lineCurrent--; indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, NULL); if (!(indentCurrent & SC_FOLDLEVELWHITEFLAG) && !IsCommentLine(lineCurrent, styler)) break; } int indentCurrentLevel = indentCurrent & SC_FOLDLEVELNUMBERMASK; // Set up initial loop state int prevComment = 0; if (lineCurrent >= 1) prevComment = foldComment && IsCommentLine(lineCurrent - 1, styler); // Process all characters to end of requested range // or comment that hangs over the end of the range. Cap processing in all cases // to end of document (in case of comment at end). while ((lineCurrent <= docLines) && ((lineCurrent <= maxLines) || prevComment)) { // Gather info int lev = indentCurrent; int lineNext = lineCurrent + 1; int indentNext = indentCurrent; if (lineNext <= docLines) { // Information about next line is only available if not at end of document indentNext = styler.IndentAmount(lineNext, &spaceFlags, NULL); } const int comment = foldComment && IsCommentLine(lineCurrent, styler); const int comment_start = (comment && !prevComment && (lineNext <= docLines) && IsCommentLine(lineNext, styler) && (lev > SC_FOLDLEVELBASE)); const int comment_continue = (comment && prevComment); if (!comment) indentCurrentLevel = indentCurrent & SC_FOLDLEVELNUMBERMASK; if (indentNext & SC_FOLDLEVELWHITEFLAG) indentNext = SC_FOLDLEVELWHITEFLAG | indentCurrentLevel; if (comment_start) { // Place fold point at start of a block of comments lev |= SC_FOLDLEVELHEADERFLAG; } else if (comment_continue) { // Add level to rest of lines in the block lev = lev + 1; } // Skip past any blank lines for next indent level info; we skip also // comments (all comments, not just those starting in column 0) // which effectively folds them into surrounding code rather // than screwing up folding. while ((lineNext < docLines) && ((indentNext & SC_FOLDLEVELWHITEFLAG) || (lineNext <= docLines && IsCommentLine(lineNext, styler)))) { lineNext++; indentNext = styler.IndentAmount(lineNext, &spaceFlags, NULL); } const int levelAfterComments = indentNext & SC_FOLDLEVELNUMBERMASK; const int levelBeforeComments = Platform::Maximum(indentCurrentLevel,levelAfterComments); // Now set all the indent levels on the lines we skipped // Do this from end to start. Once we encounter one line // which is indented more than the line after the end of // the comment-block, use the level of the block before int skipLine = lineNext; int skipLevel = levelAfterComments; while (--skipLine > lineCurrent) { int skipLineIndent = styler.IndentAmount(skipLine, &spaceFlags, NULL); if (foldCompact) { if ((skipLineIndent & SC_FOLDLEVELNUMBERMASK) > levelAfterComments) skipLevel = levelBeforeComments; int whiteFlag = skipLineIndent & SC_FOLDLEVELWHITEFLAG; styler.SetLevel(skipLine, skipLevel | whiteFlag); } else { if ((skipLineIndent & SC_FOLDLEVELNUMBERMASK) > levelAfterComments && !(skipLineIndent & SC_FOLDLEVELWHITEFLAG) && !IsCommentLine(skipLine, styler)) skipLevel = levelBeforeComments; styler.SetLevel(skipLine, skipLevel); } } // Set fold header on non-comment line if (!comment && !(indentCurrent & SC_FOLDLEVELWHITEFLAG)) { if ((indentCurrent & SC_FOLDLEVELNUMBERMASK) < (indentNext & SC_FOLDLEVELNUMBERMASK)) lev |= SC_FOLDLEVELHEADERFLAG; } // Keep track of block comment state of previous line prevComment = comment_start || comment_continue; // Set fold level for this line and move to next line styler.SetLevel(lineCurrent, lev); indentCurrent = indentNext; lineCurrent = lineNext; } } static const char *const csWordLists[] = { "Keywords", 0, }; LexerModule lmCoffeeScript(SCLEX_COFFEESCRIPT, ColouriseCoffeeScriptDoc, "coffeescript", FoldCoffeeScriptDoc, csWordLists); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/AutoComplete.cxx000444001750001750 774611727344243 25540 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file AutoComplete.cxx ** Defines the auto completion list box. **/ // Copyright 1998-2003 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include "Platform.h" #include "CharacterSet.h" #include "AutoComplete.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif AutoComplete::AutoComplete() : active(false), separator(' '), typesep('?'), ignoreCase(false), chooseSingle(false), lb(0), posStart(0), startLen(0), cancelAtStartPos(true), autoHide(true), dropRestOfWord(false) { lb = ListBox::Allocate(); stopChars[0] = '\0'; fillUpChars[0] = '\0'; } AutoComplete::~AutoComplete() { if (lb) { lb->Destroy(); delete lb; lb = 0; } } bool AutoComplete::Active() const { return active; } void AutoComplete::Start(Window &parent, int ctrlID, int position, Point location, int startLen_, int lineHeight, bool unicodeMode, int technology) { if (active) { Cancel(); } lb->Create(parent, ctrlID, location, lineHeight, unicodeMode, technology); lb->Clear(); active = true; startLen = startLen_; posStart = position; } void AutoComplete::SetStopChars(const char *stopChars_) { strncpy(stopChars, stopChars_, sizeof(stopChars)); stopChars[sizeof(stopChars) - 1] = '\0'; } bool AutoComplete::IsStopChar(char ch) { return ch && strchr(stopChars, ch); } void AutoComplete::SetFillUpChars(const char *fillUpChars_) { strncpy(fillUpChars, fillUpChars_, sizeof(fillUpChars)); fillUpChars[sizeof(fillUpChars) - 1] = '\0'; } bool AutoComplete::IsFillUpChar(char ch) { return ch && strchr(fillUpChars, ch); } void AutoComplete::SetSeparator(char separator_) { separator = separator_; } char AutoComplete::GetSeparator() const { return separator; } void AutoComplete::SetTypesep(char separator_) { typesep = separator_; } char AutoComplete::GetTypesep() const { return typesep; } void AutoComplete::SetList(const char *list) { lb->SetList(list, separator, typesep); } void AutoComplete::Show(bool show) { lb->Show(show); if (show) lb->Select(0); } void AutoComplete::Cancel() { if (lb->Created()) { lb->Clear(); lb->Destroy(); active = false; } } void AutoComplete::Move(int delta) { int count = lb->Length(); int current = lb->GetSelection(); current += delta; if (current >= count) current = count - 1; if (current < 0) current = 0; lb->Select(current); } void AutoComplete::Select(const char *word) { size_t lenWord = strlen(word); int location = -1; const int maxItemLen=1000; int start = 0; // lower bound of the api array block to search int end = lb->Length() - 1; // upper bound of the api array block to search while ((start <= end) && (location == -1)) { // Binary searching loop int pivot = (start + end) / 2; char item[maxItemLen]; lb->GetValue(pivot, item, maxItemLen); int cond; if (ignoreCase) cond = CompareNCaseInsensitive(word, item, lenWord); else cond = strncmp(word, item, lenWord); if (!cond) { // Find first match while (pivot > start) { lb->GetValue(pivot-1, item, maxItemLen); if (ignoreCase) cond = CompareNCaseInsensitive(word, item, lenWord); else cond = strncmp(word, item, lenWord); if (0 != cond) break; --pivot; } location = pivot; if (ignoreCase) { // Check for exact-case match for (; pivot <= end; pivot++) { lb->GetValue(pivot, item, maxItemLen); if (!strncmp(word, item, lenWord)) { location = pivot; break; } if (CompareNCaseInsensitive(word, item, lenWord)) break; } } } else if (cond < 0) { end = pivot - 1; } else if (cond > 0) { start = pivot + 1; } } if (location == -1 && autoHide) Cancel(); else lb->Select(location); } Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexCPP.cxx000444001750001750 11421711727344243 24262 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexCPP.cxx ** Lexer for C++, C, Java, and JavaScript. ** Further folding features and configuration properties added by "Udo Lechner" **/ // Copyright 1998-2005 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #include "OptionSet.h" #include "SparseState.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static bool IsSpaceEquiv(int state) { return (state <= SCE_C_COMMENTDOC) || // including SCE_C_DEFAULT, SCE_C_COMMENT, SCE_C_COMMENTLINE (state == SCE_C_COMMENTLINEDOC) || (state == SCE_C_COMMENTDOCKEYWORD) || (state == SCE_C_COMMENTDOCKEYWORDERROR); } // Preconditions: sc.currentPos points to a character after '+' or '-'. // The test for pos reaching 0 should be redundant, // and is in only for safety measures. // Limitation: this code will give the incorrect answer for code like // a = b+++/ptn/... // Putting a space between the '++' post-inc operator and the '+' binary op // fixes this, and is highly recommended for readability anyway. static bool FollowsPostfixOperator(StyleContext &sc, LexAccessor &styler) { int pos = (int) sc.currentPos; while (--pos > 0) { char ch = styler[pos]; if (ch == '+' || ch == '-') { return styler[pos - 1] == ch; } } return false; } static bool followsReturnKeyword(StyleContext &sc, LexAccessor &styler) { // Don't look at styles, so no need to flush. int pos = (int) sc.currentPos; int currentLine = styler.GetLine(pos); int lineStartPos = styler.LineStart(currentLine); char ch; while (--pos > lineStartPos) { ch = styler.SafeGetCharAt(pos); if (ch != ' ' && ch != '\t') { break; } } const char *retBack = "nruter"; const char *s = retBack; while (*s && pos >= lineStartPos && styler.SafeGetCharAt(pos) == *s) { s++; pos--; } return !*s; } static std::string GetRestOfLine(LexAccessor &styler, int start, bool allowSpace) { std::string restOfLine; int i =0; char ch = styler.SafeGetCharAt(start, '\n'); while ((ch != '\r') && (ch != '\n')) { if (allowSpace || (ch != ' ')) restOfLine += ch; i++; ch = styler.SafeGetCharAt(start + i, '\n'); } return restOfLine; } static bool IsStreamCommentStyle(int style) { return style == SCE_C_COMMENT || style == SCE_C_COMMENTDOC || style == SCE_C_COMMENTDOCKEYWORD || style == SCE_C_COMMENTDOCKEYWORDERROR; } static std::vector Tokenize(const std::string &s) { // Break into space separated tokens std::string word; std::vector tokens; for (const char *cp = s.c_str(); *cp; cp++) { if ((*cp == ' ') || (*cp == '\t')) { if (!word.empty()) { tokens.push_back(word); word = ""; } } else { word += *cp; } } if (!word.empty()) { tokens.push_back(word); } return tokens; } struct PPDefinition { int line; std::string key; std::string value; PPDefinition(int line_, const std::string &key_, const std::string &value_) : line(line_), key(key_), value(value_) { } }; class LinePPState { int state; int ifTaken; int level; bool ValidLevel() const { return level >= 0 && level < 32; } int maskLevel() const { return 1 << level; } public: LinePPState() : state(0), ifTaken(0), level(-1) { } bool IsInactive() const { return state != 0; } bool CurrentIfTaken() { return (ifTaken & maskLevel()) != 0; } void StartSection(bool on) { level++; if (ValidLevel()) { if (on) { state &= ~maskLevel(); ifTaken |= maskLevel(); } else { state |= maskLevel(); ifTaken &= ~maskLevel(); } } } void EndSection() { if (ValidLevel()) { state &= ~maskLevel(); ifTaken &= ~maskLevel(); } level--; } void InvertCurrentLevel() { if (ValidLevel()) { state ^= maskLevel(); ifTaken |= maskLevel(); } } }; // Hold the preprocessor state for each line seen. // Currently one entry per line but could become sparse with just one entry per preprocessor line. class PPStates { std::vector vlls; public: LinePPState ForLine(int line) { if ((line > 0) && (vlls.size() > static_cast(line))) { return vlls[line]; } else { return LinePPState(); } } void Add(int line, LinePPState lls) { vlls.resize(line+1); vlls[line] = lls; } }; // An individual named option for use in an OptionSet // Options used for LexerCPP struct OptionsCPP { bool stylingWithinPreprocessor; bool identifiersAllowDollars; bool trackPreprocessor; bool updatePreprocessor; bool triplequotedStrings; bool hashquotedStrings; bool fold; bool foldSyntaxBased; bool foldComment; bool foldCommentMultiline; bool foldCommentExplicit; std::string foldExplicitStart; std::string foldExplicitEnd; bool foldExplicitAnywhere; bool foldPreprocessor; bool foldCompact; bool foldAtElse; OptionsCPP() { stylingWithinPreprocessor = false; identifiersAllowDollars = true; trackPreprocessor = true; updatePreprocessor = true; triplequotedStrings = false; hashquotedStrings = false; fold = false; foldSyntaxBased = true; foldComment = false; foldCommentMultiline = true; foldCommentExplicit = true; foldExplicitStart = ""; foldExplicitEnd = ""; foldExplicitAnywhere = false; foldPreprocessor = false; foldCompact = false; foldAtElse = false; } }; static const char *const cppWordLists[] = { "Primary keywords and identifiers", "Secondary keywords and identifiers", "Documentation comment keywords", "Global classes and typedefs", "Preprocessor definitions", 0, }; struct OptionSetCPP : public OptionSet { OptionSetCPP() { DefineProperty("styling.within.preprocessor", &OptionsCPP::stylingWithinPreprocessor, "For C++ code, determines whether all preprocessor code is styled in the " "preprocessor style (0, the default) or only from the initial # to the end " "of the command word(1)."); DefineProperty("lexer.cpp.allow.dollars", &OptionsCPP::identifiersAllowDollars, "Set to 0 to disallow the '$' character in identifiers with the cpp lexer."); DefineProperty("lexer.cpp.track.preprocessor", &OptionsCPP::trackPreprocessor, "Set to 1 to interpret #if/#else/#endif to grey out code that is not active."); DefineProperty("lexer.cpp.update.preprocessor", &OptionsCPP::updatePreprocessor, "Set to 1 to update preprocessor definitions when #define found."); DefineProperty("lexer.cpp.triplequoted.strings", &OptionsCPP::triplequotedStrings, "Set to 1 to enable highlighting of triple-quoted strings."); DefineProperty("lexer.cpp.hashquoted.strings", &OptionsCPP::hashquotedStrings, "Set to 1 to enable highlighting of hash-quoted strings."); DefineProperty("fold", &OptionsCPP::fold); DefineProperty("fold.cpp.syntax.based", &OptionsCPP::foldSyntaxBased, "Set this property to 0 to disable syntax based folding."); DefineProperty("fold.comment", &OptionsCPP::foldComment, "This option enables folding multi-line comments and explicit fold points when using the C++ lexer. " "Explicit fold points allows adding extra folding by placing a //{ comment at the start and a //} " "at the end of a section that should fold."); DefineProperty("fold.cpp.comment.multiline", &OptionsCPP::foldCommentMultiline, "Set this property to 0 to disable folding multi-line comments when fold.comment=1."); DefineProperty("fold.cpp.comment.explicit", &OptionsCPP::foldCommentExplicit, "Set this property to 0 to disable folding explicit fold points when fold.comment=1."); DefineProperty("fold.cpp.explicit.start", &OptionsCPP::foldExplicitStart, "The string to use for explicit fold start points, replacing the standard //{."); DefineProperty("fold.cpp.explicit.end", &OptionsCPP::foldExplicitEnd, "The string to use for explicit fold end points, replacing the standard //}."); DefineProperty("fold.cpp.explicit.anywhere", &OptionsCPP::foldExplicitAnywhere, "Set this property to 1 to enable explicit fold points anywhere, not just in line comments."); DefineProperty("fold.preprocessor", &OptionsCPP::foldPreprocessor, "This option enables folding preprocessor directives when using the C++ lexer. " "Includes C#'s explicit #region and #endregion folding directives."); DefineProperty("fold.compact", &OptionsCPP::foldCompact); DefineProperty("fold.at.else", &OptionsCPP::foldAtElse, "This option enables C++ folding on a \"} else {\" line of an if statement."); DefineWordListSets(cppWordLists); } }; class LexerCPP : public ILexer { bool caseSensitive; CharacterSet setWord; CharacterSet setNegationOp; CharacterSet setArithmethicOp; CharacterSet setRelOp; CharacterSet setLogicalOp; PPStates vlls; std::vector ppDefineHistory; WordList keywords; WordList keywords2; WordList keywords3; WordList keywords4; WordList ppDefinitions; std::map preprocessorDefinitionsStart; OptionsCPP options; OptionSetCPP osCPP; SparseState rawStringTerminators; enum { activeFlag = 0x40 }; public: LexerCPP(bool caseSensitive_) : caseSensitive(caseSensitive_), setWord(CharacterSet::setAlphaNum, "._", 0x80, true), setNegationOp(CharacterSet::setNone, "!"), setArithmethicOp(CharacterSet::setNone, "+-/*%"), setRelOp(CharacterSet::setNone, "=!<>"), setLogicalOp(CharacterSet::setNone, "|&") { } ~LexerCPP() { } void SCI_METHOD Release() { delete this; } int SCI_METHOD Version() const { return lvOriginal; } const char * SCI_METHOD PropertyNames() { return osCPP.PropertyNames(); } int SCI_METHOD PropertyType(const char *name) { return osCPP.PropertyType(name); } const char * SCI_METHOD DescribeProperty(const char *name) { return osCPP.DescribeProperty(name); } int SCI_METHOD PropertySet(const char *key, const char *val); const char * SCI_METHOD DescribeWordListSets() { return osCPP.DescribeWordListSets(); } int SCI_METHOD WordListSet(int n, const char *wl); void SCI_METHOD Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess); void SCI_METHOD Fold(unsigned int startPos, int length, int initStyle, IDocument *pAccess); void * SCI_METHOD PrivateCall(int, void *) { return 0; } static ILexer *LexerFactoryCPP() { return new LexerCPP(true); } static ILexer *LexerFactoryCPPInsensitive() { return new LexerCPP(false); } static int MaskActive(int style) { return style & ~activeFlag; } void EvaluateTokens(std::vector &tokens); bool EvaluateExpression(const std::string &expr, const std::map &preprocessorDefinitions); }; int SCI_METHOD LexerCPP::PropertySet(const char *key, const char *val) { if (osCPP.PropertySet(&options, key, val)) { return 0; } return -1; } int SCI_METHOD LexerCPP::WordListSet(int n, const char *wl) { WordList *wordListN = 0; switch (n) { case 0: wordListN = &keywords; break; case 1: wordListN = &keywords2; break; case 2: wordListN = &keywords3; break; case 3: wordListN = &keywords4; break; case 4: wordListN = &ppDefinitions; break; } int firstModification = -1; if (wordListN) { WordList wlNew; wlNew.Set(wl); if (*wordListN != wlNew) { wordListN->Set(wl); firstModification = 0; if (n == 4) { // Rebuild preprocessorDefinitions preprocessorDefinitionsStart.clear(); for (int nDefinition = 0; nDefinition < ppDefinitions.len; nDefinition++) { char *cpDefinition = ppDefinitions.words[nDefinition]; char *cpEquals = strchr(cpDefinition, '='); if (cpEquals) { std::string name(cpDefinition, cpEquals - cpDefinition); std::string val(cpEquals+1); preprocessorDefinitionsStart[name] = val; } else { std::string name(cpDefinition); std::string val("1"); preprocessorDefinitionsStart[name] = val; } } } } } return firstModification; } // Functor used to truncate history struct After { int line; After(int line_) : line(line_) {} bool operator()(PPDefinition &p) const { return p.line > line; } }; void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess) { LexAccessor styler(pAccess); CharacterSet setOKBeforeRE(CharacterSet::setNone, "([{=,:;!%^&*|?~+-"); CharacterSet setCouldBePostOp(CharacterSet::setNone, "+-"); CharacterSet setDoxygen(CharacterSet::setAlpha, "$@\\&<>#{}[]"); CharacterSet setWordStart(CharacterSet::setAlpha, "_", 0x80, true); if (options.identifiersAllowDollars) { setWordStart.Add('$'); setWord.Add('$'); } int chPrevNonWhite = ' '; int visibleChars = 0; bool lastWordWasUUID = false; int styleBeforeDCKeyword = SCE_C_DEFAULT; bool continuationLine = false; bool isIncludePreprocessor = false; int lineCurrent = styler.GetLine(startPos); if ((initStyle == SCE_C_PREPROCESSOR) || (initStyle == SCE_C_COMMENTLINE) || (initStyle == SCE_C_COMMENTLINEDOC)) { // Set continuationLine if last character of previous line is '\' if (lineCurrent > 0) { int chBack = styler.SafeGetCharAt(startPos-1, 0); int chBack2 = styler.SafeGetCharAt(startPos-2, 0); int lineEndChar = '!'; if (chBack2 == '\r' && chBack == '\n') { lineEndChar = styler.SafeGetCharAt(startPos-3, 0); } else if (chBack == '\n' || chBack == '\r') { lineEndChar = chBack2; } continuationLine = lineEndChar == '\\'; } } // look back to set chPrevNonWhite properly for better regex colouring if (startPos > 0) { int back = startPos; while (--back && IsSpaceEquiv(styler.StyleAt(back))) ; if (styler.StyleAt(back) == SCE_C_OPERATOR) { chPrevNonWhite = styler.SafeGetCharAt(back); } } StyleContext sc(startPos, length, initStyle, styler, 0x7f); LinePPState preproc = vlls.ForLine(lineCurrent); bool definitionsChanged = false; // Truncate ppDefineHistory before current line if (!options.updatePreprocessor) ppDefineHistory.clear(); std::vector::iterator itInvalid = std::find_if(ppDefineHistory.begin(), ppDefineHistory.end(), After(lineCurrent-1)); if (itInvalid != ppDefineHistory.end()) { ppDefineHistory.erase(itInvalid, ppDefineHistory.end()); definitionsChanged = true; } std::map preprocessorDefinitions = preprocessorDefinitionsStart; for (std::vector::iterator itDef = ppDefineHistory.begin(); itDef != ppDefineHistory.end(); ++itDef) { preprocessorDefinitions[itDef->key] = itDef->value; } std::string rawStringTerminator = rawStringTerminators.ValueAt(lineCurrent-1); SparseState rawSTNew(lineCurrent); int activitySet = preproc.IsInactive() ? activeFlag : 0; for (; sc.More(); sc.Forward()) { if (sc.atLineStart) { if ((sc.state == SCE_C_STRING) || (sc.state == SCE_C_CHARACTER)) { // Prevent SCE_C_STRINGEOL from leaking back to previous line which // ends with a line continuation by locking in the state upto this position. sc.SetState(sc.state); } // Reset states to begining of colourise so no surprises // if different sets of lines lexed. visibleChars = 0; lastWordWasUUID = false; isIncludePreprocessor = false; if (preproc.IsInactive()) { activitySet = activeFlag; sc.SetState(sc.state | activitySet); } if (activitySet) { if (sc.ch == '#') { if (sc.Match("#else") || sc.Match("#end") || sc.Match("#if")) { //activitySet = 0; } } } } if (sc.atLineEnd) { lineCurrent++; vlls.Add(lineCurrent, preproc); if (rawStringTerminator != "") { rawSTNew.Set(lineCurrent-1, rawStringTerminator); } } // Handle line continuation generically. if (sc.ch == '\\') { if (sc.chNext == '\n' || sc.chNext == '\r') { lineCurrent++; vlls.Add(lineCurrent, preproc); sc.Forward(); if (sc.ch == '\r' && sc.chNext == '\n') { sc.Forward(); } continuationLine = true; continue; } } const bool atLineEndBeforeSwitch = sc.atLineEnd; // Determine if the current state should terminate. switch (MaskActive(sc.state)) { case SCE_C_OPERATOR: sc.SetState(SCE_C_DEFAULT|activitySet); break; case SCE_C_NUMBER: // We accept almost anything because of hex. and number suffixes if (!(setWord.Contains(sc.ch) || ((sc.ch == '+' || sc.ch == '-') && (sc.chPrev == 'e' || sc.chPrev == 'E')))) { sc.SetState(SCE_C_DEFAULT|activitySet); } break; case SCE_C_IDENTIFIER: if (!setWord.Contains(sc.ch) || (sc.ch == '.')) { char s[1000]; if (caseSensitive) { sc.GetCurrent(s, sizeof(s)); } else { sc.GetCurrentLowered(s, sizeof(s)); } if (keywords.InList(s)) { lastWordWasUUID = strcmp(s, "uuid") == 0; sc.ChangeState(SCE_C_WORD|activitySet); } else if (keywords2.InList(s)) { sc.ChangeState(SCE_C_WORD2|activitySet); } else if (keywords4.InList(s)) { sc.ChangeState(SCE_C_GLOBALCLASS|activitySet); } const bool literalString = sc.ch == '\"'; if (literalString || sc.ch == '\'') { size_t lenS = strlen(s); const bool raw = literalString && sc.chPrev == 'R'; if (raw) s[lenS--] = '\0'; bool valid = (lenS == 0) || ((lenS == 1) && ((s[0] == 'L') || (s[0] == 'u') || (s[0] == 'U'))) || ((lenS == 2) && literalString && (s[0] == 'u') && (s[1] == '8')); if (valid) { if (literalString) sc.ChangeState((raw ? SCE_C_STRINGRAW : SCE_C_STRING)|activitySet); else sc.ChangeState(SCE_C_CHARACTER|activitySet); } } sc.SetState(SCE_C_DEFAULT|activitySet); } break; case SCE_C_PREPROCESSOR: if (sc.atLineStart && !continuationLine) { sc.SetState(SCE_C_DEFAULT|activitySet); } else if (options.stylingWithinPreprocessor) { if (IsASpace(sc.ch)) { sc.SetState(SCE_C_DEFAULT|activitySet); } } else { if (sc.Match('/', '*') || sc.Match('/', '/')) { sc.SetState(SCE_C_DEFAULT|activitySet); } } break; case SCE_C_COMMENT: if (sc.Match('*', '/')) { sc.Forward(); sc.ForwardSetState(SCE_C_DEFAULT|activitySet); } break; case SCE_C_COMMENTDOC: if (sc.Match('*', '/')) { sc.Forward(); sc.ForwardSetState(SCE_C_DEFAULT|activitySet); } else if (sc.ch == '@' || sc.ch == '\\') { // JavaDoc and Doxygen support // Verify that we have the conditions to mark a comment-doc-keyword if ((IsASpace(sc.chPrev) || sc.chPrev == '*') && (!IsASpace(sc.chNext))) { styleBeforeDCKeyword = SCE_C_COMMENTDOC; sc.SetState(SCE_C_COMMENTDOCKEYWORD|activitySet); } } break; case SCE_C_COMMENTLINE: if (sc.atLineStart && !continuationLine) { sc.SetState(SCE_C_DEFAULT|activitySet); } break; case SCE_C_COMMENTLINEDOC: if (sc.atLineStart && !continuationLine) { sc.SetState(SCE_C_DEFAULT|activitySet); } else if (sc.ch == '@' || sc.ch == '\\') { // JavaDoc and Doxygen support // Verify that we have the conditions to mark a comment-doc-keyword if ((IsASpace(sc.chPrev) || sc.chPrev == '/' || sc.chPrev == '!') && (!IsASpace(sc.chNext))) { styleBeforeDCKeyword = SCE_C_COMMENTLINEDOC; sc.SetState(SCE_C_COMMENTDOCKEYWORD|activitySet); } } break; case SCE_C_COMMENTDOCKEYWORD: if ((styleBeforeDCKeyword == SCE_C_COMMENTDOC) && sc.Match('*', '/')) { sc.ChangeState(SCE_C_COMMENTDOCKEYWORDERROR); sc.Forward(); sc.ForwardSetState(SCE_C_DEFAULT|activitySet); } else if (!setDoxygen.Contains(sc.ch)) { char s[100]; if (caseSensitive) { sc.GetCurrent(s, sizeof(s)); } else { sc.GetCurrentLowered(s, sizeof(s)); } if (!IsASpace(sc.ch) || !keywords3.InList(s + 1)) { sc.ChangeState(SCE_C_COMMENTDOCKEYWORDERROR|activitySet); } sc.SetState(styleBeforeDCKeyword|activitySet); } break; case SCE_C_STRING: if (sc.atLineEnd) { sc.ChangeState(SCE_C_STRINGEOL|activitySet); } else if (isIncludePreprocessor) { if (sc.ch == '>') { sc.ForwardSetState(SCE_C_DEFAULT|activitySet); isIncludePreprocessor = false; } } else if (sc.ch == '\\') { if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') { sc.Forward(); } } else if (sc.ch == '\"') { sc.ForwardSetState(SCE_C_DEFAULT|activitySet); } break; case SCE_C_HASHQUOTEDSTRING: if (sc.ch == '\\') { if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') { sc.Forward(); } } else if (sc.ch == '\"') { sc.ForwardSetState(SCE_C_DEFAULT|activitySet); } break; case SCE_C_STRINGRAW: if (sc.Match(rawStringTerminator.c_str())) { for (size_t termPos=rawStringTerminator.size(); termPos; termPos--) sc.Forward(); sc.SetState(SCE_C_DEFAULT|activitySet); rawStringTerminator = ""; } break; case SCE_C_CHARACTER: if (sc.atLineEnd) { sc.ChangeState(SCE_C_STRINGEOL|activitySet); } else if (sc.ch == '\\') { if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') { sc.Forward(); } } else if (sc.ch == '\'') { sc.ForwardSetState(SCE_C_DEFAULT|activitySet); } break; case SCE_C_REGEX: if (sc.atLineStart) { sc.SetState(SCE_C_DEFAULT|activitySet); } else if (sc.ch == '/') { sc.Forward(); while ((sc.ch < 0x80) && islower(sc.ch)) sc.Forward(); // gobble regex flags sc.SetState(SCE_C_DEFAULT|activitySet); } else if (sc.ch == '\\') { // Gobble up the quoted character if (sc.chNext == '\\' || sc.chNext == '/') { sc.Forward(); } } break; case SCE_C_STRINGEOL: if (sc.atLineStart) { sc.SetState(SCE_C_DEFAULT|activitySet); } break; case SCE_C_VERBATIM: if (sc.ch == '\"') { if (sc.chNext == '\"') { sc.Forward(); } else { sc.ForwardSetState(SCE_C_DEFAULT|activitySet); } } break; case SCE_C_TRIPLEVERBATIM: if (sc.Match("\"\"\"")) { while (sc.Match('"')) { sc.Forward(); } sc.SetState(SCE_C_DEFAULT|activitySet); } break; case SCE_C_UUID: if (sc.ch == '\r' || sc.ch == '\n' || sc.ch == ')') { sc.SetState(SCE_C_DEFAULT|activitySet); } } if (sc.atLineEnd && !atLineEndBeforeSwitch) { // State exit processing consumed characters up to end of line. lineCurrent++; vlls.Add(lineCurrent, preproc); } // Determine if a new state should be entered. if (MaskActive(sc.state) == SCE_C_DEFAULT) { if (sc.Match('@', '\"')) { sc.SetState(SCE_C_VERBATIM|activitySet); sc.Forward(); } else if (options.triplequotedStrings && sc.Match("\"\"\"")) { sc.SetState(SCE_C_TRIPLEVERBATIM|activitySet); sc.Forward(2); } else if (options.hashquotedStrings && sc.Match('#', '\"')) { sc.SetState(SCE_C_HASHQUOTEDSTRING|activitySet); sc.Forward(); } else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) { if (lastWordWasUUID) { sc.SetState(SCE_C_UUID|activitySet); lastWordWasUUID = false; } else { sc.SetState(SCE_C_NUMBER|activitySet); } } else if (setWordStart.Contains(sc.ch) || (sc.ch == '@')) { if (lastWordWasUUID) { sc.SetState(SCE_C_UUID|activitySet); lastWordWasUUID = false; } else { sc.SetState(SCE_C_IDENTIFIER|activitySet); } } else if (sc.Match('/', '*')) { if (sc.Match("/**") || sc.Match("/*!")) { // Support of Qt/Doxygen doc. style sc.SetState(SCE_C_COMMENTDOC|activitySet); } else { sc.SetState(SCE_C_COMMENT|activitySet); } sc.Forward(); // Eat the * so it isn't used for the end of the comment } else if (sc.Match('/', '/')) { if ((sc.Match("///") && !sc.Match("////")) || sc.Match("//!")) // Support of Qt/Doxygen doc. style sc.SetState(SCE_C_COMMENTLINEDOC|activitySet); else sc.SetState(SCE_C_COMMENTLINE|activitySet); } else if (sc.ch == '/' && (setOKBeforeRE.Contains(chPrevNonWhite) || followsReturnKeyword(sc, styler)) && (!setCouldBePostOp.Contains(chPrevNonWhite) || !FollowsPostfixOperator(sc, styler))) { sc.SetState(SCE_C_REGEX|activitySet); // JavaScript's RegEx } else if (sc.ch == '\"') { if (sc.chPrev == 'R') { styler.Flush(); if (MaskActive(styler.StyleAt(sc.currentPos - 1)) == SCE_C_STRINGRAW) { sc.SetState(SCE_C_STRINGRAW|activitySet); rawStringTerminator = ")"; for (int termPos = sc.currentPos + 1;; termPos++) { char chTerminator = styler.SafeGetCharAt(termPos, '('); if (chTerminator == '(') break; rawStringTerminator += chTerminator; } rawStringTerminator += '\"'; } else { sc.SetState(SCE_C_STRING|activitySet); } } else { sc.SetState(SCE_C_STRING|activitySet); } isIncludePreprocessor = false; // ensure that '>' won't end the string } else if (isIncludePreprocessor && sc.ch == '<') { sc.SetState(SCE_C_STRING|activitySet); } else if (sc.ch == '\'') { sc.SetState(SCE_C_CHARACTER|activitySet); } else if (sc.ch == '#' && visibleChars == 0) { // Preprocessor commands are alone on their line sc.SetState(SCE_C_PREPROCESSOR|activitySet); // Skip whitespace between # and preprocessor word do { sc.Forward(); } while ((sc.ch == ' ' || sc.ch == '\t') && sc.More()); if (sc.atLineEnd) { sc.SetState(SCE_C_DEFAULT|activitySet); } else if (sc.Match("include")) { isIncludePreprocessor = true; } else { if (options.trackPreprocessor) { if (sc.Match("ifdef") || sc.Match("ifndef")) { bool isIfDef = sc.Match("ifdef"); int i = isIfDef ? 5 : 6; std::string restOfLine = GetRestOfLine(styler, sc.currentPos + i + 1, false); bool foundDef = preprocessorDefinitions.find(restOfLine) != preprocessorDefinitions.end(); preproc.StartSection(isIfDef == foundDef); } else if (sc.Match("if")) { std::string restOfLine = GetRestOfLine(styler, sc.currentPos + 2, true); bool ifGood = EvaluateExpression(restOfLine, preprocessorDefinitions); preproc.StartSection(ifGood); } else if (sc.Match("else")) { if (!preproc.CurrentIfTaken()) { preproc.InvertCurrentLevel(); activitySet = preproc.IsInactive() ? activeFlag : 0; if (!activitySet) sc.ChangeState(SCE_C_PREPROCESSOR|activitySet); } else if (!preproc.IsInactive()) { preproc.InvertCurrentLevel(); activitySet = preproc.IsInactive() ? activeFlag : 0; if (!activitySet) sc.ChangeState(SCE_C_PREPROCESSOR|activitySet); } } else if (sc.Match("elif")) { // Ensure only one chosen out of #if .. #elif .. #elif .. #else .. #endif if (!preproc.CurrentIfTaken()) { // Similar to #if std::string restOfLine = GetRestOfLine(styler, sc.currentPos + 2, true); bool ifGood = EvaluateExpression(restOfLine, preprocessorDefinitions); if (ifGood) { preproc.InvertCurrentLevel(); activitySet = preproc.IsInactive() ? activeFlag : 0; if (!activitySet) sc.ChangeState(SCE_C_PREPROCESSOR|activitySet); } } else if (!preproc.IsInactive()) { preproc.InvertCurrentLevel(); activitySet = preproc.IsInactive() ? activeFlag : 0; if (!activitySet) sc.ChangeState(SCE_C_PREPROCESSOR|activitySet); } } else if (sc.Match("endif")) { preproc.EndSection(); activitySet = preproc.IsInactive() ? activeFlag : 0; sc.ChangeState(SCE_C_PREPROCESSOR|activitySet); } else if (sc.Match("define")) { if (options.updatePreprocessor && !preproc.IsInactive()) { std::string restOfLine = GetRestOfLine(styler, sc.currentPos + 6, true); if (restOfLine.find(")") == std::string::npos) { // Don't handle macros with arguments std::vector tokens = Tokenize(restOfLine); std::string key; std::string value("1"); if (tokens.size() >= 1) { key = tokens[0]; if (tokens.size() >= 2) { value = tokens[1]; } preprocessorDefinitions[key] = value; ppDefineHistory.push_back(PPDefinition(lineCurrent, key, value)); definitionsChanged = true; } } } } } } } else if (isoperator(static_cast(sc.ch))) { sc.SetState(SCE_C_OPERATOR|activitySet); } } if (!IsASpace(sc.ch) && !IsSpaceEquiv(sc.state)) { chPrevNonWhite = sc.ch; visibleChars++; } continuationLine = false; } const bool rawStringsChanged = rawStringTerminators.Merge(rawSTNew, lineCurrent); if (definitionsChanged || rawStringsChanged) styler.ChangeLexerState(startPos, startPos + length); sc.Complete(); } // Store both the current line's fold level and the next lines in the // level store to make it easy to pick up with each increment // and to make it possible to fiddle the current level for "} else {". void SCI_METHOD LexerCPP::Fold(unsigned int startPos, int length, int initStyle, IDocument *pAccess) { if (!options.fold) return; LexAccessor styler(pAccess); unsigned int endPos = startPos + length; int visibleChars = 0; int lineCurrent = styler.GetLine(startPos); int levelCurrent = SC_FOLDLEVELBASE; if (lineCurrent > 0) levelCurrent = styler.LevelAt(lineCurrent-1) >> 16; int levelMinCurrent = levelCurrent; int levelNext = levelCurrent; char chNext = styler[startPos]; int styleNext = MaskActive(styler.StyleAt(startPos)); int style = MaskActive(initStyle); const bool userDefinedFoldMarkers = !options.foldExplicitStart.empty() && !options.foldExplicitEnd.empty(); for (unsigned int i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); int stylePrev = style; style = styleNext; styleNext = MaskActive(styler.StyleAt(i + 1)); bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); if (options.foldComment && options.foldCommentMultiline && IsStreamCommentStyle(style)) { if (!IsStreamCommentStyle(stylePrev) && (stylePrev != SCE_C_COMMENTLINEDOC)) { levelNext++; } else if (!IsStreamCommentStyle(styleNext) && (styleNext != SCE_C_COMMENTLINEDOC) && !atEOL) { // Comments don't end at end of line and the next character may be unstyled. levelNext--; } } if (options.foldComment && options.foldCommentExplicit && ((style == SCE_C_COMMENTLINE) || options.foldExplicitAnywhere)) { if (userDefinedFoldMarkers) { if (styler.Match(i, options.foldExplicitStart.c_str())) { levelNext++; } else if (styler.Match(i, options.foldExplicitEnd.c_str())) { levelNext--; } } else { if ((ch == '/') && (chNext == '/')) { char chNext2 = styler.SafeGetCharAt(i + 2); if (chNext2 == '{') { levelNext++; } else if (chNext2 == '}') { levelNext--; } } } } if (options.foldPreprocessor && (style == SCE_C_PREPROCESSOR)) { if (ch == '#') { unsigned int j = i + 1; while ((j < endPos) && IsASpaceOrTab(styler.SafeGetCharAt(j))) { j++; } if (styler.Match(j, "region") || styler.Match(j, "if")) { levelNext++; } else if (styler.Match(j, "end")) { levelNext--; } } } if (options.foldSyntaxBased && (style == SCE_C_OPERATOR)) { if (ch == '{') { // Measure the minimum before a '{' to allow // folding on "} else {" if (levelMinCurrent > levelNext) { levelMinCurrent = levelNext; } levelNext++; } else if (ch == '}') { levelNext--; } } if (!IsASpace(ch)) visibleChars++; if (atEOL || (i == endPos-1)) { int levelUse = levelCurrent; if (options.foldSyntaxBased && options.foldAtElse) { levelUse = levelMinCurrent; } int lev = levelUse | levelNext << 16; if (visibleChars == 0 && options.foldCompact) lev |= SC_FOLDLEVELWHITEFLAG; if (levelUse < levelNext) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) { styler.SetLevel(lineCurrent, lev); } lineCurrent++; levelCurrent = levelNext; levelMinCurrent = levelCurrent; if (atEOL && (i == static_cast(styler.Length()-1))) { // There is an empty line at end of file so give it same level and empty styler.SetLevel(lineCurrent, (levelCurrent | levelCurrent << 16) | SC_FOLDLEVELWHITEFLAG); } visibleChars = 0; } } } void LexerCPP::EvaluateTokens(std::vector &tokens) { // Evaluate defined() statements to either 0 or 1 for (size_t i=0; (i+2)) tokens.erase(tokens.begin() + i + 1, tokens.begin() + i + 4); val = "1"; } tokens[i] = val; } else { i++; } } // Find bracketed subexpressions and recurse on them std::vector::iterator itBracket = std::find(tokens.begin(), tokens.end(), "("); std::vector::iterator itEndBracket = std::find(tokens.begin(), tokens.end(), ")"); while ((itBracket != tokens.end()) && (itEndBracket != tokens.end()) && (itEndBracket > itBracket)) { std::vector inBracket(itBracket + 1, itEndBracket); EvaluateTokens(inBracket); // The insertion is done before the removal because there were failures with the opposite approach tokens.insert(itBracket, inBracket.begin(), inBracket.end()); itBracket = std::find(tokens.begin(), tokens.end(), "("); itEndBracket = std::find(tokens.begin(), tokens.end(), ")"); tokens.erase(itBracket, itEndBracket + 1); itBracket = std::find(tokens.begin(), tokens.end(), "("); itEndBracket = std::find(tokens.begin(), tokens.end(), ")"); } // Evaluate logical negations for (size_t j=0; (j+1)::iterator itInsert = tokens.erase(tokens.begin() + j, tokens.begin() + j + 2); tokens.insert(itInsert, isTrue ? "1" : "0"); } else { j++; } } // Evaluate expressions in precedence order enum precedence { precArithmetic, precRelative, precLogical }; for (int prec=precArithmetic; prec <= precLogical; prec++) { // Looking at 3 tokens at a time so end at 2 before end for (size_t k=0; (k+2)") result = valA > valB; else if (tokens[k+1] == ">=") result = valA >= valB; else if (tokens[k+1] == "==") result = valA == valB; else if (tokens[k+1] == "!=") result = valA != valB; else if (tokens[k+1] == "||") result = valA || valB; else if (tokens[k+1] == "&&") result = valA && valB; char sResult[30]; sprintf(sResult, "%d", result); std::vector::iterator itInsert = tokens.erase(tokens.begin() + k, tokens.begin() + k + 3); tokens.insert(itInsert, sResult); } else { k++; } } } } bool LexerCPP::EvaluateExpression(const std::string &expr, const std::map &preprocessorDefinitions) { // Break into tokens, replacing with definitions std::string word; std::vector tokens; const char *cp = expr.c_str(); for (;;) { if (setWord.Contains(*cp)) { word += *cp; } else { std::map::const_iterator it = preprocessorDefinitions.find(word); if (it != preprocessorDefinitions.end()) { tokens.push_back(it->second); } else if (!word.empty() && ((word[0] >= '0' && word[0] <= '9') || (word == "defined"))) { tokens.push_back(word); } word = ""; if (!*cp) { break; } if ((*cp != ' ') && (*cp != '\t')) { std::string op(cp, 1); if (setRelOp.Contains(*cp)) { if (setRelOp.Contains(cp[1])) { op += cp[1]; cp++; } } else if (setLogicalOp.Contains(*cp)) { if (setLogicalOp.Contains(cp[1])) { op += cp[1]; cp++; } } tokens.push_back(op); } } cp++; } EvaluateTokens(tokens); // "0" or "" -> false else true bool isFalse = tokens.empty() || ((tokens.size() == 1) && ((tokens[0] == "") || tokens[0] == "0")); return !isFalse; } LexerModule lmCPP(SCLEX_CPP, LexerCPP::LexerFactoryCPP, "cpp", cppWordLists); LexerModule lmCPPNoCase(SCLEX_CPPNOCASE, LexerCPP::LexerFactoryCPPInsensitive, "cppnocase", cppWordLists); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexOpal.cxx000444001750001750 2405011727344243 24506 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexOpal.cxx ** Lexer for OPAL (functional language similar to Haskell) ** Written by Sebastian Pipping **/ #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif inline static void getRange( unsigned int start, unsigned int end, Accessor & styler, char * s, unsigned int len ) { unsigned int i = 0; while( ( i < end - start + 1 ) && ( i < len - 1 ) ) { s[i] = static_cast( styler[ start + i ] ); i++; } s[ i ] = '\0'; } inline bool HandleString( unsigned int & cur, unsigned int one_too_much, Accessor & styler ) { char ch; // Wait for string to close bool even_backslash_count = true; // Without gaps in between cur++; // Skip initial quote for( ; ; ) { if( cur >= one_too_much ) { styler.ColourTo( cur - 1, SCE_OPAL_STRING ); return false; // STOP } ch = styler.SafeGetCharAt( cur ); if( ( ch == '\015' ) || ( ch == '\012' ) ) // Deny multi-line strings { styler.ColourTo( cur - 1, SCE_OPAL_STRING ); styler.StartSegment( cur ); return true; } else { if( even_backslash_count ) { if( ch == '"' ) { styler.ColourTo( cur, SCE_OPAL_STRING ); cur++; if( cur >= one_too_much ) { return false; // STOP } else { styler.StartSegment( cur ); return true; } } else if( ch == '\\' ) { even_backslash_count = false; } } else { even_backslash_count = true; } } cur++; } } inline bool HandleCommentBlock( unsigned int & cur, unsigned int one_too_much, Accessor & styler, bool could_fail ) { char ch; if( could_fail ) { cur++; if( cur >= one_too_much ) { styler.ColourTo( cur - 1, SCE_OPAL_DEFAULT ); return false; // STOP } ch = styler.SafeGetCharAt( cur ); if( ch != '*' ) { styler.ColourTo( cur - 1, SCE_OPAL_DEFAULT ); styler.StartSegment( cur ); return true; } } // Wait for comment close cur++; bool star_found = false; for( ; ; ) { if( cur >= one_too_much ) { styler.ColourTo( cur - 1, SCE_OPAL_COMMENT_BLOCK ); return false; // STOP } ch = styler.SafeGetCharAt( cur ); if( star_found ) { if( ch == '/' ) { styler.ColourTo( cur, SCE_OPAL_COMMENT_BLOCK ); cur++; if( cur >= one_too_much ) { return false; // STOP } else { styler.StartSegment( cur ); return true; } } else if( ch != '*' ) { star_found = false; } } else if( ch == '*' ) { star_found = true; } cur++; } } inline bool HandleCommentLine( unsigned int & cur, unsigned int one_too_much, Accessor & styler, bool could_fail ) { char ch; if( could_fail ) { cur++; if( cur >= one_too_much ) { styler.ColourTo( cur - 1, SCE_OPAL_DEFAULT ); return false; // STOP } ch = styler.SafeGetCharAt( cur ); if( ch != '-' ) { styler.ColourTo( cur - 1, SCE_OPAL_DEFAULT ); styler.StartSegment( cur ); return true; } cur++; if( cur >= one_too_much ) { styler.ColourTo( cur - 1, SCE_OPAL_DEFAULT ); return false; // STOP } ch = styler.SafeGetCharAt( cur ); if( ( ch != ' ' ) && ( ch != '\t' ) ) { styler.ColourTo( cur - 1, SCE_OPAL_DEFAULT ); styler.StartSegment( cur ); return true; } } // Wait for end of line bool fifteen_found = false; for( ; ; ) { cur++; if( cur >= one_too_much ) { styler.ColourTo( cur - 1, SCE_OPAL_COMMENT_LINE ); return false; // STOP } ch = styler.SafeGetCharAt( cur ); if( fifteen_found ) { /* if( ch == '\012' ) { // One newline on Windows (015, 012) } else { // One newline on MAC (015) and another char } */ cur--; styler.ColourTo( cur - 1, SCE_OPAL_COMMENT_LINE ); styler.StartSegment( cur ); return true; } else { if( ch == '\015' ) { fifteen_found = true; } else if( ch == '\012' ) { // One newline on Linux (012) styler.ColourTo( cur - 1, SCE_OPAL_COMMENT_LINE ); styler.StartSegment( cur ); return true; } } } } inline bool HandlePar( unsigned int & cur, Accessor & styler ) { styler.ColourTo( cur, SCE_OPAL_PAR ); cur++; styler.StartSegment( cur ); return true; } inline bool HandleSpace( unsigned int & cur, unsigned int one_too_much, Accessor & styler ) { char ch; cur++; for( ; ; ) { if( cur >= one_too_much ) { styler.ColourTo( cur - 1, SCE_OPAL_SPACE ); return false; } ch = styler.SafeGetCharAt( cur ); switch( ch ) { case ' ': case '\t': case '\015': case '\012': cur++; break; default: styler.ColourTo( cur - 1, SCE_OPAL_SPACE ); styler.StartSegment( cur ); return true; } } } inline bool HandleInteger( unsigned int & cur, unsigned int one_too_much, Accessor & styler ) { char ch; for( ; ; ) { cur++; if( cur >= one_too_much ) { styler.ColourTo( cur - 1, SCE_OPAL_INTEGER ); return false; // STOP } ch = styler.SafeGetCharAt( cur ); if( !( isascii( ch ) && isdigit( ch ) ) ) { styler.ColourTo( cur - 1, SCE_OPAL_INTEGER ); styler.StartSegment( cur ); return true; } } } inline bool HandleWord( unsigned int & cur, unsigned int one_too_much, Accessor & styler, WordList * keywordlists[] ) { char ch; const unsigned int beg = cur; cur++; for( ; ; ) { ch = styler.SafeGetCharAt( cur ); if( ( ch != '_' ) && ( ch != '-' ) && !( isascii( ch ) && ( islower( ch ) || isupper( ch ) || isdigit( ch ) ) ) ) break; cur++; if( cur >= one_too_much ) { break; } } const int ide_len = cur - beg + 1; char * ide = new char[ ide_len ]; getRange( beg, cur, styler, ide, ide_len ); WordList & keywords = *keywordlists[ 0 ]; WordList & classwords = *keywordlists[ 1 ]; if( keywords.InList( ide ) ) // Keyword { delete [] ide; styler.ColourTo( cur - 1, SCE_OPAL_KEYWORD ); if( cur >= one_too_much ) { return false; // STOP } else { styler.StartSegment( cur ); return true; } } else if( classwords.InList( ide ) ) // Sort { delete [] ide; styler.ColourTo( cur - 1, SCE_OPAL_SORT ); if( cur >= one_too_much ) { return false; // STOP } else { styler.StartSegment( cur ); return true; } } else if( !strcmp( ide, "true" ) || !strcmp( ide, "false" ) ) // Bool const { delete [] ide; styler.ColourTo( cur - 1, SCE_OPAL_BOOL_CONST ); if( cur >= one_too_much ) { return false; // STOP } else { styler.StartSegment( cur ); return true; } } else // Unknown keyword { delete [] ide; styler.ColourTo( cur - 1, SCE_OPAL_DEFAULT ); if( cur >= one_too_much ) { return false; // STOP } else { styler.StartSegment( cur ); return true; } } } inline bool HandleSkip( unsigned int & cur, unsigned int one_too_much, Accessor & styler ) { cur++; styler.ColourTo( cur - 1, SCE_OPAL_DEFAULT ); if( cur >= one_too_much ) { return false; // STOP } else { styler.StartSegment( cur ); return true; } } static void ColouriseOpalDoc( unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor & styler ) { styler.StartAt( startPos ); styler.StartSegment( startPos ); unsigned int & cur = startPos; const unsigned int one_too_much = startPos + length; int state = initStyle; for( ; ; ) { switch( state ) { case SCE_OPAL_KEYWORD: case SCE_OPAL_SORT: if( !HandleWord( cur, one_too_much, styler, keywordlists ) ) return; state = SCE_OPAL_DEFAULT; break; case SCE_OPAL_INTEGER: if( !HandleInteger( cur, one_too_much, styler ) ) return; state = SCE_OPAL_DEFAULT; break; case SCE_OPAL_COMMENT_BLOCK: if( !HandleCommentBlock( cur, one_too_much, styler, false ) ) return; state = SCE_OPAL_DEFAULT; break; case SCE_OPAL_COMMENT_LINE: if( !HandleCommentLine( cur, one_too_much, styler, false ) ) return; state = SCE_OPAL_DEFAULT; break; case SCE_OPAL_STRING: if( !HandleString( cur, one_too_much, styler ) ) return; state = SCE_OPAL_DEFAULT; break; default: // SCE_OPAL_DEFAULT: { char ch = styler.SafeGetCharAt( cur ); switch( ch ) { // String case '"': if( !HandleString( cur, one_too_much, styler ) ) return; break; // Comment block case '/': if( !HandleCommentBlock( cur, one_too_much, styler, true ) ) return; break; // Comment line case '-': if( !HandleCommentLine( cur, one_too_much, styler, true ) ) return; break; // Par case '(': case ')': case '[': case ']': case '{': case '}': if( !HandlePar( cur, styler ) ) return; break; // Whitespace case ' ': case '\t': case '\015': case '\012': if( !HandleSpace( cur, one_too_much, styler ) ) return; break; default: { // Integer if( isascii( ch ) && isdigit( ch ) ) { if( !HandleInteger( cur, one_too_much, styler ) ) return; } // Keyword else if( isascii( ch ) && ( islower( ch ) || isupper( ch ) ) ) { if( !HandleWord( cur, one_too_much, styler, keywordlists ) ) return; } // Skip else { if( !HandleSkip( cur, one_too_much, styler ) ) return; } } } break; } } } } static const char * const opalWordListDesc[] = { "Keywords", "Sorts", 0 }; LexerModule lmOpal(SCLEX_OPAL, ColouriseOpalDoc, "opal", NULL, opalWordListDesc); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexBash.cxx000444001750001750 5112611727344243 24474 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexBash.cxx ** Lexer for Bash. **/ // Copyright 2004-2010 by Neil Hodgson // Adapted from LexPerl by Kein-Hong Man 2004 // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif #define HERE_DELIM_MAX 256 // define this if you want 'invalid octals' to be marked as errors // usually, this is not a good idea, permissive lexing is better #undef PEDANTIC_OCTAL #define BASH_BASE_ERROR 65 #define BASH_BASE_DECIMAL 66 #define BASH_BASE_HEX 67 #ifdef PEDANTIC_OCTAL #define BASH_BASE_OCTAL 68 #define BASH_BASE_OCTAL_ERROR 69 #endif // state constants for parts of a bash command segment #define BASH_CMD_BODY 0 #define BASH_CMD_START 1 #define BASH_CMD_WORD 2 #define BASH_CMD_TEST 3 #define BASH_CMD_ARITH 4 #define BASH_CMD_DELIM 5 static inline int translateBashDigit(int ch) { if (ch >= '0' && ch <= '9') { return ch - '0'; } else if (ch >= 'a' && ch <= 'z') { return ch - 'a' + 10; } else if (ch >= 'A' && ch <= 'Z') { return ch - 'A' + 36; } else if (ch == '@') { return 62; } else if (ch == '_') { return 63; } return BASH_BASE_ERROR; } static inline int getBashNumberBase(char *s) { int i = 0; int base = 0; while (*s) { base = base * 10 + (*s++ - '0'); i++; } if (base > 64 || i > 2) { return BASH_BASE_ERROR; } return base; } static int opposite(int ch) { if (ch == '(') return ')'; if (ch == '[') return ']'; if (ch == '{') return '}'; if (ch == '<') return '>'; return ch; } static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { WordList &keywords = *keywordlists[0]; WordList cmdDelimiter, bashStruct, bashStruct_in; cmdDelimiter.Set("| || |& & && ; ;; ( ) { }"); bashStruct.Set("if elif fi while until else then do done esac eval"); bashStruct_in.Set("for case select"); CharacterSet setWordStart(CharacterSet::setAlpha, "_"); // note that [+-] are often parts of identifiers in shell scripts CharacterSet setWord(CharacterSet::setAlphaNum, "._+-"); CharacterSet setBashOperator(CharacterSet::setNone, "^&%()-+=|{}[]:;>,*/(ch); Delimiter[DelimiterLength] = '\0'; } ~HereDocCls() { delete []Delimiter; } }; HereDocCls HereDoc; class QuoteCls { // Class to manage quote pairs (simplified vs LexPerl) public: int Count; int Up, Down; QuoteCls() { Count = 0; Up = '\0'; Down = '\0'; } void Open(int u) { Count++; Up = u; Down = opposite(Up); } void Start(int u) { Count = 0; Open(u); } }; QuoteCls Quote; int numBase = 0; int digit; unsigned int endPos = startPos + length; int cmdState = BASH_CMD_START; int testExprType = 0; // Always backtracks to the start of a line that is not a continuation // of the previous line (i.e. start of a bash command segment) int ln = styler.GetLine(startPos); for (;;) { startPos = styler.LineStart(ln); if (ln == 0 || styler.GetLineState(ln) == BASH_CMD_START) break; ln--; } initStyle = SCE_SH_DEFAULT; StyleContext sc(startPos, endPos - startPos, initStyle, styler); for (; sc.More(); sc.Forward()) { // handle line continuation, updates per-line stored state if (sc.atLineStart) { ln = styler.GetLine(sc.currentPos); if (sc.state == SCE_SH_STRING || sc.state == SCE_SH_BACKTICKS || sc.state == SCE_SH_CHARACTER || sc.state == SCE_SH_HERE_Q || sc.state == SCE_SH_COMMENTLINE || sc.state == SCE_SH_PARAM) { // force backtrack while retaining cmdState styler.SetLineState(ln, BASH_CMD_BODY); } else { if (ln > 0) { if ((sc.GetRelative(-3) == '\\' && sc.GetRelative(-2) == '\r' && sc.chPrev == '\n') || sc.GetRelative(-2) == '\\') { // handle '\' line continuation // retain last line's state } else cmdState = BASH_CMD_START; } styler.SetLineState(ln, cmdState); } } // controls change of cmdState at the end of a non-whitespace element // states BODY|TEST|ARITH persist until the end of a command segment // state WORD persist, but ends with 'in' or 'do' construct keywords int cmdStateNew = BASH_CMD_BODY; if (cmdState == BASH_CMD_TEST || cmdState == BASH_CMD_ARITH || cmdState == BASH_CMD_WORD) cmdStateNew = cmdState; int stylePrev = sc.state; // Determine if the current state should terminate. switch (sc.state) { case SCE_SH_OPERATOR: sc.SetState(SCE_SH_DEFAULT); if (cmdState == BASH_CMD_DELIM) // if command delimiter, start new command cmdStateNew = BASH_CMD_START; else if (sc.chPrev == '\\') // propagate command state if line continued cmdStateNew = cmdState; break; case SCE_SH_WORD: // "." never used in Bash variable names but used in file names if (!setWord.Contains(sc.ch)) { char s[500]; char s2[10]; sc.GetCurrent(s, sizeof(s)); // allow keywords ending in a whitespace or command delimiter s2[0] = static_cast(sc.ch); s2[1] = '\0'; bool keywordEnds = IsASpace(sc.ch) || cmdDelimiter.InList(s2); // 'in' or 'do' may be construct keywords if (cmdState == BASH_CMD_WORD) { if (strcmp(s, "in") == 0 && keywordEnds) cmdStateNew = BASH_CMD_BODY; else if (strcmp(s, "do") == 0 && keywordEnds) cmdStateNew = BASH_CMD_START; else sc.ChangeState(SCE_SH_IDENTIFIER); sc.SetState(SCE_SH_DEFAULT); break; } // a 'test' keyword starts a test expression if (strcmp(s, "test") == 0) { if (cmdState == BASH_CMD_START && keywordEnds) { cmdStateNew = BASH_CMD_TEST; testExprType = 0; } else sc.ChangeState(SCE_SH_IDENTIFIER); } // detect bash construct keywords else if (bashStruct.InList(s)) { if (cmdState == BASH_CMD_START && keywordEnds) cmdStateNew = BASH_CMD_START; else sc.ChangeState(SCE_SH_IDENTIFIER); } // 'for'|'case'|'select' needs 'in'|'do' to be highlighted later else if (bashStruct_in.InList(s)) { if (cmdState == BASH_CMD_START && keywordEnds) cmdStateNew = BASH_CMD_WORD; else sc.ChangeState(SCE_SH_IDENTIFIER); } // disambiguate option items and file test operators else if (s[0] == '-') { if (cmdState != BASH_CMD_TEST) sc.ChangeState(SCE_SH_IDENTIFIER); } // disambiguate keywords and identifiers else if (cmdState != BASH_CMD_START || !(keywords.InList(s) && keywordEnds)) { sc.ChangeState(SCE_SH_IDENTIFIER); } sc.SetState(SCE_SH_DEFAULT); } break; case SCE_SH_IDENTIFIER: if (sc.chPrev == '\\') { // for escaped chars sc.ForwardSetState(SCE_SH_DEFAULT); } else if (!setWord.Contains(sc.ch)) { sc.SetState(SCE_SH_DEFAULT); } break; case SCE_SH_NUMBER: digit = translateBashDigit(sc.ch); if (numBase == BASH_BASE_DECIMAL) { if (sc.ch == '#') { char s[10]; sc.GetCurrent(s, sizeof(s)); numBase = getBashNumberBase(s); if (numBase != BASH_BASE_ERROR) break; } else if (IsADigit(sc.ch)) break; } else if (numBase == BASH_BASE_HEX) { if (IsADigit(sc.ch, 16)) break; #ifdef PEDANTIC_OCTAL } else if (numBase == BASH_BASE_OCTAL || numBase == BASH_BASE_OCTAL_ERROR) { if (digit <= 7) break; if (digit <= 9) { numBase = BASH_BASE_OCTAL_ERROR; break; } #endif } else if (numBase == BASH_BASE_ERROR) { if (digit <= 9) break; } else { // DD#DDDD number style handling if (digit != BASH_BASE_ERROR) { if (numBase <= 36) { // case-insensitive if base<=36 if (digit >= 36) digit -= 26; } if (digit < numBase) break; if (digit <= 9) { numBase = BASH_BASE_ERROR; break; } } } // fallthrough when number is at an end or error if (numBase == BASH_BASE_ERROR #ifdef PEDANTIC_OCTAL || numBase == BASH_BASE_OCTAL_ERROR #endif ) { sc.ChangeState(SCE_SH_ERROR); } sc.SetState(SCE_SH_DEFAULT); break; case SCE_SH_COMMENTLINE: if (sc.atLineEnd && sc.chPrev != '\\') { sc.SetState(SCE_SH_DEFAULT); } break; case SCE_SH_HERE_DELIM: // From Bash info: // --------------- // Specifier format is: <<[-]WORD // Optional '-' is for removal of leading tabs from here-doc. // Whitespace acceptable after <<[-] operator // if (HereDoc.State == 0) { // '<<' encountered HereDoc.Quote = sc.chNext; HereDoc.Quoted = false; HereDoc.DelimiterLength = 0; HereDoc.Delimiter[HereDoc.DelimiterLength] = '\0'; if (sc.chNext == '\'' || sc.chNext == '\"') { // a quoted here-doc delimiter (' or ") sc.Forward(); HereDoc.Quoted = true; HereDoc.State = 1; } else if (!HereDoc.Indent && sc.chNext == '-') { // <<- indent case HereDoc.Indent = true; } else if (setHereDoc.Contains(sc.chNext)) { // an unquoted here-doc delimiter, no special handling // TODO check what exactly bash considers part of the delim HereDoc.State = 1; } else if (sc.chNext == '<') { // HERE string <<< sc.Forward(); sc.ForwardSetState(SCE_SH_DEFAULT); } else if (IsASpace(sc.chNext)) { // eat whitespace } else if (setLeftShift.Contains(sc.chNext)) { // left shift << or <<= operator cases sc.ChangeState(SCE_SH_OPERATOR); sc.ForwardSetState(SCE_SH_DEFAULT); } else { // symbols terminates; deprecated zero-length delimiter HereDoc.State = 1; } } else if (HereDoc.State == 1) { // collect the delimiter if (setHereDoc2.Contains(sc.ch) || sc.chPrev == '\\') { HereDoc.Append(sc.ch); } else if (HereDoc.Quoted && sc.ch == HereDoc.Quote) { // closing quote => end of delimiter sc.ForwardSetState(SCE_SH_DEFAULT); } else if (sc.ch == '\\') { // skip escape prefix } else { sc.SetState(SCE_SH_DEFAULT); } if (HereDoc.DelimiterLength >= HERE_DELIM_MAX - 1) { // force blowup sc.SetState(SCE_SH_ERROR); HereDoc.State = 0; } } break; case SCE_SH_HERE_Q: // HereDoc.State == 2 if (sc.atLineStart) { sc.SetState(SCE_SH_HERE_Q); int prefixws = 0; while (IsASpace(sc.ch) && !sc.atLineEnd) { // whitespace prefix sc.Forward(); prefixws++; } if (prefixws > 0) sc.SetState(SCE_SH_HERE_Q); while (!sc.atLineEnd) { sc.Forward(); } char s[HERE_DELIM_MAX]; sc.GetCurrent(s, sizeof(s)); if (sc.LengthCurrent() == 0) break; if (s[strlen(s) - 1] == '\r') s[strlen(s) - 1] = '\0'; if (strcmp(HereDoc.Delimiter, s) == 0) { if ((prefixws == 0) || // indentation rule (prefixws > 0 && HereDoc.Indent)) { sc.SetState(SCE_SH_DEFAULT); break; } } } break; case SCE_SH_SCALAR: // variable names if (!setParam.Contains(sc.ch)) { if (sc.LengthCurrent() == 1) { // Special variable: $(, $_ etc. sc.ForwardSetState(SCE_SH_DEFAULT); } else { sc.SetState(SCE_SH_DEFAULT); } } break; case SCE_SH_STRING: // delimited styles case SCE_SH_CHARACTER: case SCE_SH_BACKTICKS: case SCE_SH_PARAM: if (sc.ch == '\\' && Quote.Up != '\\') { sc.Forward(); } else if (sc.ch == Quote.Down) { Quote.Count--; if (Quote.Count == 0) { sc.ForwardSetState(SCE_SH_DEFAULT); } } else if (sc.ch == Quote.Up) { Quote.Count++; } break; } // Must check end of HereDoc state 1 before default state is handled if (HereDoc.State == 1 && sc.atLineEnd) { // Begin of here-doc (the line after the here-doc delimiter): // Lexically, the here-doc starts from the next line after the >>, but the // first line of here-doc seem to follow the style of the last EOL sequence HereDoc.State = 2; if (HereDoc.Quoted) { if (sc.state == SCE_SH_HERE_DELIM) { // Missing quote at end of string! We are stricter than bash. // Colour here-doc anyway while marking this bit as an error. sc.ChangeState(SCE_SH_ERROR); } // HereDoc.Quote always == '\'' } sc.SetState(SCE_SH_HERE_Q); } // update cmdState about the current command segment if (stylePrev != SCE_SH_DEFAULT && sc.state == SCE_SH_DEFAULT) { cmdState = cmdStateNew; } // Determine if a new state should be entered. if (sc.state == SCE_SH_DEFAULT) { if (sc.ch == '\\') { // Bash can escape any non-newline as a literal sc.SetState(SCE_SH_IDENTIFIER); if (sc.chNext == '\r' || sc.chNext == '\n') sc.SetState(SCE_SH_OPERATOR); } else if (IsADigit(sc.ch)) { sc.SetState(SCE_SH_NUMBER); numBase = BASH_BASE_DECIMAL; if (sc.ch == '0') { // hex,octal if (sc.chNext == 'x' || sc.chNext == 'X') { numBase = BASH_BASE_HEX; sc.Forward(); } else if (IsADigit(sc.chNext)) { #ifdef PEDANTIC_OCTAL numBase = BASH_BASE_OCTAL; #else numBase = BASH_BASE_HEX; #endif } } } else if (setWordStart.Contains(sc.ch)) { sc.SetState(SCE_SH_WORD); } else if (sc.ch == '#') { sc.SetState(SCE_SH_COMMENTLINE); } else if (sc.ch == '\"') { sc.SetState(SCE_SH_STRING); Quote.Start(sc.ch); } else if (sc.ch == '\'') { sc.SetState(SCE_SH_CHARACTER); Quote.Start(sc.ch); } else if (sc.ch == '`') { sc.SetState(SCE_SH_BACKTICKS); Quote.Start(sc.ch); } else if (sc.ch == '$') { if (sc.Match("$((")) { sc.SetState(SCE_SH_OPERATOR); // handle '((' later continue; } sc.SetState(SCE_SH_SCALAR); sc.Forward(); if (sc.ch == '{') { sc.ChangeState(SCE_SH_PARAM); } else if (sc.ch == '\'') { sc.ChangeState(SCE_SH_CHARACTER); } else if (sc.ch == '"') { sc.ChangeState(SCE_SH_STRING); } else if (sc.ch == '(' || sc.ch == '`') { sc.ChangeState(SCE_SH_BACKTICKS); } else { continue; // scalar has no delimiter pair } // fallthrough, open delim for $[{'"(`] Quote.Start(sc.ch); } else if (sc.Match('<', '<')) { sc.SetState(SCE_SH_HERE_DELIM); HereDoc.State = 0; HereDoc.Indent = false; } else if (sc.ch == '-' && // one-char file test operators setSingleCharOp.Contains(sc.chNext) && !setWord.Contains(sc.GetRelative(2)) && IsASpace(sc.chPrev)) { sc.SetState(SCE_SH_WORD); sc.Forward(); } else if (setBashOperator.Contains(sc.ch)) { char s[10]; bool isCmdDelim = false; sc.SetState(SCE_SH_OPERATOR); // handle opening delimiters for test/arithmetic expressions - ((,[[,[ if (cmdState == BASH_CMD_START || cmdState == BASH_CMD_BODY) { if (sc.Match('(', '(')) { cmdState = BASH_CMD_ARITH; sc.Forward(); } else if (sc.Match('[', '[') && IsASpace(sc.GetRelative(2))) { cmdState = BASH_CMD_TEST; testExprType = 1; sc.Forward(); } else if (sc.ch == '[' && IsASpace(sc.chNext)) { cmdState = BASH_CMD_TEST; testExprType = 2; } } // special state -- for ((x;y;z)) in ... looping if (cmdState == BASH_CMD_WORD && sc.Match('(', '(')) { cmdState = BASH_CMD_ARITH; sc.Forward(); continue; } // handle command delimiters in command START|BODY|WORD state, also TEST if 'test' if (cmdState == BASH_CMD_START || cmdState == BASH_CMD_BODY || cmdState == BASH_CMD_WORD || (cmdState == BASH_CMD_TEST && testExprType == 0)) { s[0] = static_cast(sc.ch); if (setBashOperator.Contains(sc.chNext)) { s[1] = static_cast(sc.chNext); s[2] = '\0'; isCmdDelim = cmdDelimiter.InList(s); if (isCmdDelim) sc.Forward(); } if (!isCmdDelim) { s[1] = '\0'; isCmdDelim = cmdDelimiter.InList(s); } if (isCmdDelim) { cmdState = BASH_CMD_DELIM; continue; } } // handle closing delimiters for test/arithmetic expressions - )),]],] if (cmdState == BASH_CMD_ARITH && sc.Match(')', ')')) { cmdState = BASH_CMD_BODY; sc.Forward(); } else if (cmdState == BASH_CMD_TEST && IsASpace(sc.chPrev)) { if (sc.Match(']', ']') && testExprType == 1) { sc.Forward(); cmdState = BASH_CMD_BODY; } else if (sc.ch == ']' && testExprType == 2) { cmdState = BASH_CMD_BODY; } } } }// sc.state } sc.Complete(); } static bool IsCommentLine(int line, Accessor &styler) { int pos = styler.LineStart(line); int eol_pos = styler.LineStart(line + 1) - 1; for (int i = pos; i < eol_pos; i++) { char ch = styler[i]; if (ch == '#') return true; else if (ch != ' ' && ch != '\t') return false; } return false; } static void FoldBashDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) { bool foldComment = styler.GetPropertyInt("fold.comment") != 0; bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; unsigned int endPos = startPos + length; int visibleChars = 0; int lineCurrent = styler.GetLine(startPos); int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; int levelCurrent = levelPrev; char chNext = styler[startPos]; int styleNext = styler.StyleAt(startPos); for (unsigned int i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); int style = styleNext; styleNext = styler.StyleAt(i + 1); bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); // Comment folding if (foldComment && atEOL && IsCommentLine(lineCurrent, styler)) { if (!IsCommentLine(lineCurrent - 1, styler) && IsCommentLine(lineCurrent + 1, styler)) levelCurrent++; else if (IsCommentLine(lineCurrent - 1, styler) && !IsCommentLine(lineCurrent + 1, styler)) levelCurrent--; } if (style == SCE_SH_OPERATOR) { if (ch == '{') { levelCurrent++; } else if (ch == '}') { levelCurrent--; } } // Here Document folding if (style == SCE_SH_HERE_DELIM) { if (ch == '<' && chNext == '<') { levelCurrent++; } } else if (style == SCE_SH_HERE_Q && styler.StyleAt(i+1) == SCE_PL_DEFAULT) { levelCurrent--; } if (atEOL) { int lev = levelPrev; if (visibleChars == 0 && foldCompact) lev |= SC_FOLDLEVELWHITEFLAG; if ((levelCurrent > levelPrev) && (visibleChars > 0)) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) { styler.SetLevel(lineCurrent, lev); } lineCurrent++; levelPrev = levelCurrent; visibleChars = 0; } if (!isspacechar(ch)) visibleChars++; } // Fill in the real level of the next line, keeping the current flags as they will be filled in later int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; styler.SetLevel(lineCurrent, levelPrev | flagsNext); } static const char * const bashWordListDesc[] = { "Keywords", 0 }; LexerModule lmBash(SCLEX_BASH, ColouriseBashDoc, "bash", FoldBashDoc, bashWordListDesc); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexSpice.cxx000444001750001750 1557011727344243 24665 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexSpice.cxx ** Lexer for Spice **/ // Copyright 2006 by Fabien Proriol // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif /* * Interface */ static void ColouriseDocument( unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler); static const char * const spiceWordListDesc[] = { "Keywords", // SPICE command "Keywords2", // SPICE functions "Keywords3", // SPICE params 0 }; LexerModule lmSpice(SCLEX_SPICE, ColouriseDocument, "spice", NULL, spiceWordListDesc); /* * Implementation */ static void ColouriseComment(StyleContext& sc, bool& apostropheStartsAttribute); static void ColouriseDelimiter(StyleContext& sc, bool& apostropheStartsAttribute); static void ColouriseNumber(StyleContext& sc, bool& apostropheStartsAttribute); static void ColouriseWhiteSpace(StyleContext& sc, bool& apostropheStartsAttribute); static void ColouriseWord(StyleContext& sc, WordList& keywords, WordList& keywords2, WordList& keywords3, bool& apostropheStartsAttribute); static inline bool IsDelimiterCharacter(int ch); static inline bool IsNumberStartCharacter(int ch); static inline bool IsNumberCharacter(int ch); static inline bool IsSeparatorOrDelimiterCharacter(int ch); static inline bool IsWordStartCharacter(int ch); static inline bool IsWordCharacter(int ch); static void ColouriseComment(StyleContext& sc, bool&) { sc.SetState(SCE_SPICE_COMMENTLINE); while (!sc.atLineEnd) { sc.Forward(); } } static void ColouriseDelimiter(StyleContext& sc, bool& apostropheStartsAttribute) { apostropheStartsAttribute = sc.Match (')'); sc.SetState(SCE_SPICE_DELIMITER); sc.ForwardSetState(SCE_SPICE_DEFAULT); } static void ColouriseNumber(StyleContext& sc, bool& apostropheStartsAttribute) { apostropheStartsAttribute = true; std::string number; sc.SetState(SCE_SPICE_NUMBER); // Get all characters up to a delimiter or a separator, including points, but excluding // double points (ranges). while (!IsSeparatorOrDelimiterCharacter(sc.ch) || (sc.ch == '.' && sc.chNext != '.')) { number += static_cast(sc.ch); sc.Forward(); } // Special case: exponent with sign if ((sc.chPrev == 'e' || sc.chPrev == 'E') && (sc.ch == '+' || sc.ch == '-')) { number += static_cast(sc.ch); sc.Forward (); while (!IsSeparatorOrDelimiterCharacter(sc.ch)) { number += static_cast(sc.ch); sc.Forward(); } } sc.SetState(SCE_SPICE_DEFAULT); } static void ColouriseWhiteSpace(StyleContext& sc, bool& ) { sc.SetState(SCE_SPICE_DEFAULT); sc.ForwardSetState(SCE_SPICE_DEFAULT); } static void ColouriseWord(StyleContext& sc, WordList& keywords, WordList& keywords2, WordList& keywords3, bool& apostropheStartsAttribute) { apostropheStartsAttribute = true; sc.SetState(SCE_SPICE_IDENTIFIER); std::string word; while (!sc.atLineEnd && !IsSeparatorOrDelimiterCharacter(sc.ch)) { word += static_cast(tolower(sc.ch)); sc.Forward(); } if (keywords.InList(word.c_str())) { sc.ChangeState(SCE_SPICE_KEYWORD); if (word != "all") { apostropheStartsAttribute = false; } } else if (keywords2.InList(word.c_str())) { sc.ChangeState(SCE_SPICE_KEYWORD2); if (word != "all") { apostropheStartsAttribute = false; } } else if (keywords3.InList(word.c_str())) { sc.ChangeState(SCE_SPICE_KEYWORD3); if (word != "all") { apostropheStartsAttribute = false; } } sc.SetState(SCE_SPICE_DEFAULT); } // // ColouriseDocument // static void ColouriseDocument( unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { WordList &keywords = *keywordlists[0]; WordList &keywords2 = *keywordlists[1]; WordList &keywords3 = *keywordlists[2]; StyleContext sc(startPos, length, initStyle, styler); int lineCurrent = styler.GetLine(startPos); bool apostropheStartsAttribute = (styler.GetLineState(lineCurrent) & 1) != 0; while (sc.More()) { if (sc.atLineEnd) { // Go to the next line sc.Forward(); lineCurrent++; // Remember the line state for future incremental lexing styler.SetLineState(lineCurrent, apostropheStartsAttribute); // Don't continue any styles on the next line sc.SetState(SCE_SPICE_DEFAULT); } // Comments if ((sc.Match('*') && sc.atLineStart) || sc.Match('*','~')) { ColouriseComment(sc, apostropheStartsAttribute); // Whitespace } else if (IsASpace(sc.ch)) { ColouriseWhiteSpace(sc, apostropheStartsAttribute); // Delimiters } else if (IsDelimiterCharacter(sc.ch)) { ColouriseDelimiter(sc, apostropheStartsAttribute); // Numbers } else if (IsADigit(sc.ch) || sc.ch == '#') { ColouriseNumber(sc, apostropheStartsAttribute); // Keywords or identifiers } else { ColouriseWord(sc, keywords, keywords2, keywords3, apostropheStartsAttribute); } } sc.Complete(); } static inline bool IsDelimiterCharacter(int ch) { switch (ch) { case '&': case '\'': case '(': case ')': case '*': case '+': case ',': case '-': case '.': case '/': case ':': case ';': case '<': case '=': case '>': case '|': return true; default: return false; } } static inline bool IsNumberCharacter(int ch) { return IsNumberStartCharacter(ch) || ch == '_' || ch == '.' || ch == '#' || (ch >= 'a' && ch <= 'f') || (ch >= 'A' && ch <= 'F'); } static inline bool IsNumberStartCharacter(int ch) { return IsADigit(ch); } static inline bool IsSeparatorOrDelimiterCharacter(int ch) { return IsASpace(ch) || IsDelimiterCharacter(ch); } static inline bool IsWordCharacter(int ch) { return IsWordStartCharacter(ch) || IsADigit(ch); } static inline bool IsWordStartCharacter(int ch) { return (isascii(ch) && isalpha(ch)) || ch == '_'; } Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexForth.cxx000444001750001750 1331011727344243 24672 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexForth.cxx ** Lexer for FORTH **/ // Copyright 1998-2003 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static inline bool IsAWordChar(int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_' || ch == '?' || ch == '"' || ch == '@' || ch == '!' || ch == '[' || ch == ']' || ch == '/' || ch == '+' || ch == '-' || ch == '*' || ch == '<' || ch == '>' || ch == '=' || ch == ';' || ch == '(' || ch == ')' ); } static inline bool IsAWordStart(int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '.'); } static inline bool IsANumChar(int ch) { return (ch < 0x80) && (isxdigit(ch) || ch == '.' || ch == 'e' || ch == 'E' ); } static inline bool IsASpaceChar(int ch) { return (ch < 0x80) && isspace(ch); } static void ColouriseForthDoc(unsigned int startPos, int length, int initStyle, WordList *keywordLists[], Accessor &styler) { WordList &control = *keywordLists[0]; WordList &keyword = *keywordLists[1]; WordList &defword = *keywordLists[2]; WordList &preword1 = *keywordLists[3]; WordList &preword2 = *keywordLists[4]; WordList &strings = *keywordLists[5]; StyleContext sc(startPos, length, initStyle, styler); for (; sc.More(); sc.Forward()) { // Determine if the current state should terminate. if (sc.state == SCE_FORTH_COMMENT) { if (sc.atLineEnd) { sc.SetState(SCE_FORTH_DEFAULT); } }else if (sc.state == SCE_FORTH_COMMENT_ML) { if (sc.ch == ')') { sc.ForwardSetState(SCE_FORTH_DEFAULT); } }else if (sc.state == SCE_FORTH_IDENTIFIER || sc.state == SCE_FORTH_NUMBER) { // handle numbers here too, because what we thought was a number might // turn out to be a keyword e.g. 2DUP if (IsASpaceChar(sc.ch) ) { char s[100]; sc.GetCurrentLowered(s, sizeof(s)); int newState = sc.state == SCE_FORTH_NUMBER ? SCE_FORTH_NUMBER : SCE_FORTH_DEFAULT; if (control.InList(s)) { sc.ChangeState(SCE_FORTH_CONTROL); } else if (keyword.InList(s)) { sc.ChangeState(SCE_FORTH_KEYWORD); } else if (defword.InList(s)) { sc.ChangeState(SCE_FORTH_DEFWORD); } else if (preword1.InList(s)) { sc.ChangeState(SCE_FORTH_PREWORD1); } else if (preword2.InList(s)) { sc.ChangeState(SCE_FORTH_PREWORD2); } else if (strings.InList(s)) { sc.ChangeState(SCE_FORTH_STRING); newState = SCE_FORTH_STRING; } sc.SetState(newState); } if (sc.state == SCE_FORTH_NUMBER) { if (IsASpaceChar(sc.ch)) { sc.SetState(SCE_FORTH_DEFAULT); } else if (!IsANumChar(sc.ch)) { sc.ChangeState(SCE_FORTH_IDENTIFIER); } } }else if (sc.state == SCE_FORTH_STRING) { if (sc.ch == '\"') { sc.ForwardSetState(SCE_FORTH_DEFAULT); } }else if (sc.state == SCE_FORTH_LOCALE) { if (sc.ch == '}') { sc.ForwardSetState(SCE_FORTH_DEFAULT); } }else if (sc.state == SCE_FORTH_DEFWORD) { if (IsASpaceChar(sc.ch)) { sc.SetState(SCE_FORTH_DEFAULT); } } // Determine if a new state should be entered. if (sc.state == SCE_FORTH_DEFAULT) { if (sc.ch == '\\'){ sc.SetState(SCE_FORTH_COMMENT); } else if (sc.ch == '(' && (sc.atLineStart || IsASpaceChar(sc.chPrev)) && (sc.atLineEnd || IsASpaceChar(sc.chNext))) { sc.SetState(SCE_FORTH_COMMENT_ML); } else if ( (sc.ch == '$' && (isascii(sc.chNext) && isxdigit(sc.chNext))) ) { // number starting with $ is a hex number sc.SetState(SCE_FORTH_NUMBER); while(sc.More() && isascii(sc.chNext) && isxdigit(sc.chNext)) sc.Forward(); } else if ( (sc.ch == '%' && (isascii(sc.chNext) && (sc.chNext == '0' || sc.chNext == '1'))) ) { // number starting with % is binary sc.SetState(SCE_FORTH_NUMBER); while(sc.More() && isascii(sc.chNext) && (sc.chNext == '0' || sc.chNext == '1')) sc.Forward(); } else if ( isascii(sc.ch) && (isxdigit(sc.ch) || ((sc.ch == '.' || sc.ch == '-') && isascii(sc.chNext) && isxdigit(sc.chNext)) ) ){ sc.SetState(SCE_FORTH_NUMBER); } else if (IsAWordStart(sc.ch)) { sc.SetState(SCE_FORTH_IDENTIFIER); } else if (sc.ch == '{') { sc.SetState(SCE_FORTH_LOCALE); } else if (sc.ch == ':' && isascii(sc.chNext) && isspace(sc.chNext)) { // highlight word definitions e.g. : GCD ( n n -- n ) ..... ; // ^ ^^^ sc.SetState(SCE_FORTH_DEFWORD); while(sc.More() && isascii(sc.chNext) && isspace(sc.chNext)) sc.Forward(); } else if (sc.ch == ';' && (sc.atLineStart || IsASpaceChar(sc.chPrev)) && (sc.atLineEnd || IsASpaceChar(sc.chNext)) ) { // mark the ';' that ends a word sc.SetState(SCE_FORTH_DEFWORD); sc.ForwardSetState(SCE_FORTH_DEFAULT); } } } sc.Complete(); } static void FoldForthDoc(unsigned int, int, int, WordList *[], Accessor &) { } static const char * const forthWordLists[] = { "control keywords", "keywords", "definition words", "prewords with one argument", "prewords with two arguments", "string definition keywords", 0, }; LexerModule lmForth(SCLEX_FORTH, ColouriseForthDoc, "forth", FoldForthDoc, forthWordLists); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexerBase.cxx000444001750001750 366211727344243 25002 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexerSimple.cxx ** A simple lexer with no state. **/ // Copyright 1998-2010 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "PropSetSimple.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "LexerModule.h" #include "LexerBase.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif LexerBase::LexerBase() { for (int wl = 0; wl < numWordLists; wl++) keyWordLists[wl] = new WordList; keyWordLists[numWordLists] = 0; } LexerBase::~LexerBase() { for (int wl = 0; wl < numWordLists; wl++) { delete keyWordLists[wl]; keyWordLists[wl] = 0; } keyWordLists[numWordLists] = 0; } void SCI_METHOD LexerBase::Release() { delete this; } int SCI_METHOD LexerBase::Version() const { return lvOriginal; } const char * SCI_METHOD LexerBase::PropertyNames() { return ""; } int SCI_METHOD LexerBase::PropertyType(const char *) { return SC_TYPE_BOOLEAN; } const char * SCI_METHOD LexerBase::DescribeProperty(const char *) { return ""; } int SCI_METHOD LexerBase::PropertySet(const char *key, const char *val) { const char *valOld = props.Get(key); if (strcmp(val, valOld) != 0) { props.Set(key, val); return 0; } else { return -1; } } const char * SCI_METHOD LexerBase::DescribeWordListSets() { return ""; } int SCI_METHOD LexerBase::WordListSet(int n, const char *wl) { if (n < numWordLists) { WordList wlNew; wlNew.Set(wl); if (*keyWordLists[n] != wlNew) { keyWordLists[n]->Set(wl); return 0; } } return -1; } void * SCI_METHOD LexerBase::PrivateCall(int, void *) { return 0; } Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexAsm.cxx000444001750001750 3266611727344243 24347 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexAsm.cxx ** Lexer for Assembler, just for the MASM syntax ** Written by The Black Horus ** Enhancements and NASM stuff by Kein-Hong Man, 2003-10 ** SCE_ASM_COMMENTBLOCK and SCE_ASM_CHARACTER are for future GNU as colouring ** Converted to lexer object and added further folding features/properties by "Udo Lechner" **/ // Copyright 1998-2003 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #include "OptionSet.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static inline bool IsAWordChar(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_' || ch == '?'); } static inline bool IsAWordStart(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '.' || ch == '%' || ch == '@' || ch == '$' || ch == '?'); } static inline bool IsAsmOperator(const int ch) { if ((ch < 0x80) && (isalnum(ch))) return false; // '.' left out as it is used to make up numbers if (ch == '*' || ch == '/' || ch == '-' || ch == '+' || ch == '(' || ch == ')' || ch == '=' || ch == '^' || ch == '[' || ch == ']' || ch == '<' || ch == '&' || ch == '>' || ch == ',' || ch == '|' || ch == '~' || ch == '%' || ch == ':') return true; return false; } static bool IsStreamCommentStyle(int style) { return style == SCE_ASM_COMMENTDIRECTIVE || style == SCE_ASM_COMMENTBLOCK; } static inline int LowerCase(int c) { if (c >= 'A' && c <= 'Z') return 'a' + c - 'A'; return c; } // An individual named option for use in an OptionSet // Options used for LexerAsm struct OptionsAsm { std::string delimiter; bool fold; bool foldSyntaxBased; bool foldCommentMultiline; bool foldCommentExplicit; std::string foldExplicitStart; std::string foldExplicitEnd; bool foldExplicitAnywhere; bool foldCompact; OptionsAsm() { delimiter = ""; fold = false; foldSyntaxBased = true; foldCommentMultiline = false; foldCommentExplicit = false; foldExplicitStart = ""; foldExplicitEnd = ""; foldExplicitAnywhere = false; foldCompact = true; } }; static const char * const asmWordListDesc[] = { "CPU instructions", "FPU instructions", "Registers", "Directives", "Directive operands", "Extended instructions", "Directives4Foldstart", "Directives4Foldend", 0 }; struct OptionSetAsm : public OptionSet { OptionSetAsm() { DefineProperty("lexer.asm.comment.delimiter", &OptionsAsm::delimiter, "Character used for COMMENT directive's delimiter, replacing the standard \"~\"."); DefineProperty("fold", &OptionsAsm::fold); DefineProperty("fold.asm.syntax.based", &OptionsAsm::foldSyntaxBased, "Set this property to 0 to disable syntax based folding."); DefineProperty("fold.asm.comment.multiline", &OptionsAsm::foldCommentMultiline, "Set this property to 1 to enable folding multi-line comments."); DefineProperty("fold.asm.comment.explicit", &OptionsAsm::foldCommentExplicit, "This option enables folding explicit fold points when using the Asm lexer. " "Explicit fold points allows adding extra folding by placing a ;{ comment at the start and a ;} " "at the end of a section that should fold."); DefineProperty("fold.asm.explicit.start", &OptionsAsm::foldExplicitStart, "The string to use for explicit fold start points, replacing the standard ;{."); DefineProperty("fold.asm.explicit.end", &OptionsAsm::foldExplicitEnd, "The string to use for explicit fold end points, replacing the standard ;}."); DefineProperty("fold.asm.explicit.anywhere", &OptionsAsm::foldExplicitAnywhere, "Set this property to 1 to enable explicit fold points anywhere, not just in line comments."); DefineProperty("fold.compact", &OptionsAsm::foldCompact); DefineWordListSets(asmWordListDesc); } }; class LexerAsm : public ILexer { WordList cpuInstruction; WordList mathInstruction; WordList registers; WordList directive; WordList directiveOperand; WordList extInstruction; WordList directives4foldstart; WordList directives4foldend; OptionsAsm options; OptionSetAsm osAsm; public: LexerAsm() { } ~LexerAsm() { } void SCI_METHOD Release() { delete this; } int SCI_METHOD Version() const { return lvOriginal; } const char * SCI_METHOD PropertyNames() { return osAsm.PropertyNames(); } int SCI_METHOD PropertyType(const char *name) { return osAsm.PropertyType(name); } const char * SCI_METHOD DescribeProperty(const char *name) { return osAsm.DescribeProperty(name); } int SCI_METHOD PropertySet(const char *key, const char *val); const char * SCI_METHOD DescribeWordListSets() { return osAsm.DescribeWordListSets(); } int SCI_METHOD WordListSet(int n, const char *wl); void SCI_METHOD Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess); void SCI_METHOD Fold(unsigned int startPos, int length, int initStyle, IDocument *pAccess); void * SCI_METHOD PrivateCall(int, void *) { return 0; } static ILexer *LexerFactoryAsm() { return new LexerAsm(); } }; int SCI_METHOD LexerAsm::PropertySet(const char *key, const char *val) { if (osAsm.PropertySet(&options, key, val)) { return 0; } return -1; } int SCI_METHOD LexerAsm::WordListSet(int n, const char *wl) { WordList *wordListN = 0; switch (n) { case 0: wordListN = &cpuInstruction; break; case 1: wordListN = &mathInstruction; break; case 2: wordListN = ®isters; break; case 3: wordListN = &directive; break; case 4: wordListN = &directiveOperand; break; case 5: wordListN = &extInstruction; break; case 6: wordListN = &directives4foldstart; break; case 7: wordListN = &directives4foldend; break; } int firstModification = -1; if (wordListN) { WordList wlNew; wlNew.Set(wl); if (*wordListN != wlNew) { wordListN->Set(wl); firstModification = 0; } } return firstModification; } void SCI_METHOD LexerAsm::Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess) { LexAccessor styler(pAccess); // Do not leak onto next line if (initStyle == SCE_ASM_STRINGEOL) initStyle = SCE_ASM_DEFAULT; StyleContext sc(startPos, length, initStyle, styler); for (; sc.More(); sc.Forward()) { // Prevent SCE_ASM_STRINGEOL from leaking back to previous line if (sc.atLineStart && (sc.state == SCE_ASM_STRING)) { sc.SetState(SCE_ASM_STRING); } else if (sc.atLineStart && (sc.state == SCE_ASM_CHARACTER)) { sc.SetState(SCE_ASM_CHARACTER); } // Handle line continuation generically. if (sc.ch == '\\') { if (sc.chNext == '\n' || sc.chNext == '\r') { sc.Forward(); if (sc.ch == '\r' && sc.chNext == '\n') { sc.Forward(); } continue; } } // Determine if the current state should terminate. if (sc.state == SCE_ASM_OPERATOR) { if (!IsAsmOperator(sc.ch)) { sc.SetState(SCE_ASM_DEFAULT); } } else if (sc.state == SCE_ASM_NUMBER) { if (!IsAWordChar(sc.ch)) { sc.SetState(SCE_ASM_DEFAULT); } } else if (sc.state == SCE_ASM_IDENTIFIER) { if (!IsAWordChar(sc.ch) ) { char s[100]; sc.GetCurrentLowered(s, sizeof(s)); bool IsDirective = false; if (cpuInstruction.InList(s)) { sc.ChangeState(SCE_ASM_CPUINSTRUCTION); } else if (mathInstruction.InList(s)) { sc.ChangeState(SCE_ASM_MATHINSTRUCTION); } else if (registers.InList(s)) { sc.ChangeState(SCE_ASM_REGISTER); } else if (directive.InList(s)) { sc.ChangeState(SCE_ASM_DIRECTIVE); IsDirective = true; } else if (directiveOperand.InList(s)) { sc.ChangeState(SCE_ASM_DIRECTIVEOPERAND); } else if (extInstruction.InList(s)) { sc.ChangeState(SCE_ASM_EXTINSTRUCTION); } sc.SetState(SCE_ASM_DEFAULT); if (IsDirective && !strcmp(s, "comment")) { char delimiter = options.delimiter.empty() ? '~' : options.delimiter.c_str()[0]; while (IsASpaceOrTab(sc.ch) && !sc.atLineEnd) { sc.ForwardSetState(SCE_ASM_DEFAULT); } if (sc.ch == delimiter) { sc.SetState(SCE_ASM_COMMENTDIRECTIVE); } } } } else if (sc.state == SCE_ASM_COMMENTDIRECTIVE) { char delimiter = options.delimiter.empty() ? '~' : options.delimiter.c_str()[0]; if (sc.ch == delimiter) { while (!sc.atLineEnd) { sc.Forward(); } sc.SetState(SCE_ASM_DEFAULT); } } else if (sc.state == SCE_ASM_COMMENT ) { if (sc.atLineEnd) { sc.SetState(SCE_ASM_DEFAULT); } } else if (sc.state == SCE_ASM_STRING) { if (sc.ch == '\\') { if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') { sc.Forward(); } } else if (sc.ch == '\"') { sc.ForwardSetState(SCE_ASM_DEFAULT); } else if (sc.atLineEnd) { sc.ChangeState(SCE_ASM_STRINGEOL); sc.ForwardSetState(SCE_ASM_DEFAULT); } } else if (sc.state == SCE_ASM_CHARACTER) { if (sc.ch == '\\') { if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') { sc.Forward(); } } else if (sc.ch == '\'') { sc.ForwardSetState(SCE_ASM_DEFAULT); } else if (sc.atLineEnd) { sc.ChangeState(SCE_ASM_STRINGEOL); sc.ForwardSetState(SCE_ASM_DEFAULT); } } // Determine if a new state should be entered. if (sc.state == SCE_ASM_DEFAULT) { if (sc.ch == ';'){ sc.SetState(SCE_ASM_COMMENT); } else if (isascii(sc.ch) && (isdigit(sc.ch) || (sc.ch == '.' && isascii(sc.chNext) && isdigit(sc.chNext)))) { sc.SetState(SCE_ASM_NUMBER); } else if (IsAWordStart(sc.ch)) { sc.SetState(SCE_ASM_IDENTIFIER); } else if (sc.ch == '\"') { sc.SetState(SCE_ASM_STRING); } else if (sc.ch == '\'') { sc.SetState(SCE_ASM_CHARACTER); } else if (IsAsmOperator(sc.ch)) { sc.SetState(SCE_ASM_OPERATOR); } } } sc.Complete(); } // Store both the current line's fold level and the next lines in the // level store to make it easy to pick up with each increment // and to make it possible to fiddle the current level for "else". void SCI_METHOD LexerAsm::Fold(unsigned int startPos, int length, int initStyle, IDocument *pAccess) { if (!options.fold) return; LexAccessor styler(pAccess); unsigned int endPos = startPos + length; int visibleChars = 0; int lineCurrent = styler.GetLine(startPos); int levelCurrent = SC_FOLDLEVELBASE; if (lineCurrent > 0) levelCurrent = styler.LevelAt(lineCurrent-1) >> 16; int levelNext = levelCurrent; char chNext = styler[startPos]; int styleNext = styler.StyleAt(startPos); int style = initStyle; char word[100]; int wordlen = 0; const bool userDefinedFoldMarkers = !options.foldExplicitStart.empty() && !options.foldExplicitEnd.empty(); for (unsigned int i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); int stylePrev = style; style = styleNext; styleNext = styler.StyleAt(i + 1); bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); if (options.foldCommentMultiline && IsStreamCommentStyle(style)) { if (!IsStreamCommentStyle(stylePrev)) { levelNext++; } else if (!IsStreamCommentStyle(styleNext) && !atEOL) { // Comments don't end at end of line and the next character may be unstyled. levelNext--; } } if (options.foldCommentExplicit && ((style == SCE_ASM_COMMENT) || options.foldExplicitAnywhere)) { if (userDefinedFoldMarkers) { if (styler.Match(i, options.foldExplicitStart.c_str())) { levelNext++; } else if (styler.Match(i, options.foldExplicitEnd.c_str())) { levelNext--; } } else { if (ch == ';') { if (chNext == '{') { levelNext++; } else if (chNext == '}') { levelNext--; } } } } if (options.foldSyntaxBased && (style == SCE_ASM_DIRECTIVE)) { word[wordlen++] = static_cast(LowerCase(ch)); if (wordlen == 100) { // prevent overflow word[0] = '\0'; wordlen = 1; } if (styleNext != SCE_ASM_DIRECTIVE) { // reading directive ready word[wordlen] = '\0'; wordlen = 0; if (directives4foldstart.InList(word)) { levelNext++; } else if (directives4foldend.InList(word)){ levelNext--; } } } if (!IsASpace(ch)) visibleChars++; if (atEOL || (i == endPos-1)) { int levelUse = levelCurrent; int lev = levelUse | levelNext << 16; if (visibleChars == 0 && options.foldCompact) lev |= SC_FOLDLEVELWHITEFLAG; if (levelUse < levelNext) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) { styler.SetLevel(lineCurrent, lev); } lineCurrent++; levelCurrent = levelNext; if (atEOL && (i == static_cast(styler.Length()-1))) { // There is an empty line at end of file so give it same level and empty styler.SetLevel(lineCurrent, (levelCurrent | levelCurrent << 16) | SC_FOLDLEVELWHITEFLAG); } visibleChars = 0; } } } LexerModule lmAsm(SCLEX_ASM, LexerAsm::LexerFactoryAsm, "asm", asmWordListDesc); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/SparseState.h000444001750001750 575611727344243 25021 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file SparseState.h ** Hold lexer state that may change rarely. ** This is often per-line state such as whether a particular type of section has been entered. ** A state continues until it is changed. **/ // Copyright 2011 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #ifndef SPARSESTATE_H #define SPARSESTATE_H #ifdef SCI_NAMESPACE namespace Scintilla { #endif template class SparseState { struct State { int position; T value; State(int position_, T value_) : position(position_), value(value_) { } inline bool operator<(const State &other) const { return position < other.position; } inline bool operator==(const State &other) const { return (position == other.position) && (value == other.value); } }; int positionFirst; typedef std::vector stateVector; stateVector states; typename stateVector::iterator Find(int position) { State searchValue(position, T()); return std::lower_bound(states.begin(), states.end(), searchValue); } public: SparseState(int positionFirst_=-1) { positionFirst = positionFirst_; } void Set(int position, T value) { Delete(position); if (states.empty() || (value != states[states.size()-1].value)) { states.push_back(State(position, value)); } } T ValueAt(int position) { if (states.empty()) return T(); if (position < states[0].position) return T(); typename stateVector::iterator low = Find(position); if (low == states.end()) { return states[states.size()-1].value; } else { if (low->position > position) { --low; } return low->value; } } bool Delete(int position) { typename stateVector::iterator low = Find(position); if (low != states.end()) { states.erase(low, states.end()); return true; } return false; } size_t size() const { return states.size(); } // Returns true if Merge caused a significant change bool Merge(const SparseState &other, int ignoreAfter) { // Changes caused beyond ignoreAfter are not significant Delete(ignoreAfter+1); bool different = true; bool changed = false; typename stateVector::iterator low = Find(other.positionFirst); if (static_cast(states.end() - low) == other.states.size()) { // Same number in other as after positionFirst in this different = !std::equal(low, states.end(), other.states.begin()); } if (different) { if (low != states.end()) { states.erase(low, states.end()); changed = true; } typename stateVector::const_iterator startOther = other.states.begin(); if (!states.empty() && states.back().value == startOther->value) ++startOther; if (startOther != other.states.end()) { states.insert(states.end(), startOther, other.states.end()); changed = true; } } return changed; } }; #ifdef SCI_NAMESPACE } #endif #endif Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexCSS.cxx000444001750001750 4403111727344243 24244 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexCSS.cxx ** Lexer for Cascading Style Sheets ** Written by Jakub Vrána ** Improved by Philippe Lhoste (CSS2) ** Improved by Ross McKay (SCSS mode; see http://sass-lang.com/ ) **/ // Copyright 1998-2002 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. // TODO: handle SCSS nested properties like font: { weight: bold; size: 1em; } // TODO: handle SCSS interpolation: #{} // TODO: add features for Less if somebody feels like contributing; http://lesscss.org/ // TODO: refactor this monster so that the next poor slob can read it! #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static inline bool IsAWordChar(const unsigned int ch) { /* FIXME: * The CSS spec allows "ISO 10646 characters U+00A1 and higher" to be treated as word chars. * Unfortunately, we are only getting string bytes here, and not full unicode characters. We cannot guarantee * that our byte is between U+0080 - U+00A0 (to return false), so we have to allow all characters U+0080 and higher */ return ch >= 0x80 || isalnum(ch) || ch == '-' || ch == '_'; } inline bool IsCssOperator(const int ch) { if (!((ch < 0x80) && isalnum(ch)) && (ch == '{' || ch == '}' || ch == ':' || ch == ',' || ch == ';' || ch == '.' || ch == '#' || ch == '!' || ch == '@' || /* CSS2 */ ch == '*' || ch == '>' || ch == '+' || ch == '=' || ch == '~' || ch == '|' || ch == '[' || ch == ']' || ch == '(' || ch == ')')) { return true; } return false; } // look behind (from start of document to our start position) to determine current nesting level inline int NestingLevelLookBehind(unsigned int startPos, Accessor &styler) { int ch; int nestingLevel = 0; for (unsigned int i = 0; i < startPos; i++) { ch = styler.SafeGetCharAt(i); if (ch == '{') nestingLevel++; else if (ch == '}') nestingLevel--; } return nestingLevel; } static void ColouriseCssDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { WordList &css1Props = *keywordlists[0]; WordList &pseudoClasses = *keywordlists[1]; WordList &css2Props = *keywordlists[2]; WordList &css3Props = *keywordlists[3]; WordList &pseudoElements = *keywordlists[4]; WordList &exProps = *keywordlists[5]; WordList &exPseudoClasses = *keywordlists[6]; WordList &exPseudoElements = *keywordlists[7]; StyleContext sc(startPos, length, initStyle, styler); int lastState = -1; // before operator int lastStateC = -1; // before comment int lastStateS = -1; // before single-quoted/double-quoted string int lastStateVar = -1; // before variable (SCSS) int lastStateVal = -1; // before value (SCSS) int op = ' '; // last operator int opPrev = ' '; // last operator bool insideParentheses = false; // true if currently in a CSS url() or similar construct // property lexer.css.scss.language // Set to 1 for Sassy CSS (.scss) bool isScssDocument = styler.GetPropertyInt("lexer.css.scss.language") != 0; // TODO: implement Less support bool isLessDocument = false; // SCSS and Less both support single-line comments typedef enum _CommentModes { eCommentBlock = 0, eCommentLine = 1} CommentMode; CommentMode comment_mode = eCommentBlock; bool hasSingleLineComments = isScssDocument || isLessDocument; // must keep track of nesting level in document types that support it (SCSS, Less) bool hasNesting = false; int nestingLevel = 0; if (isScssDocument || isLessDocument) { hasNesting = true; nestingLevel = NestingLevelLookBehind(startPos, styler); } // "the loop" for (; sc.More(); sc.Forward()) { if (sc.state == SCE_CSS_COMMENT && ((comment_mode == eCommentBlock && sc.Match('*', '/')) || (comment_mode == eCommentLine && sc.atLineEnd))) { if (lastStateC == -1) { // backtrack to get last state: // comments are like whitespace, so we must return to the previous state unsigned int i = startPos; for (; i > 0; i--) { if ((lastStateC = styler.StyleAt(i-1)) != SCE_CSS_COMMENT) { if (lastStateC == SCE_CSS_OPERATOR) { op = styler.SafeGetCharAt(i-1); opPrev = styler.SafeGetCharAt(i-2); while (--i) { lastState = styler.StyleAt(i-1); if (lastState != SCE_CSS_OPERATOR && lastState != SCE_CSS_COMMENT) break; } if (i == 0) lastState = SCE_CSS_DEFAULT; } break; } } if (i == 0) lastStateC = SCE_CSS_DEFAULT; } if (comment_mode == eCommentBlock) { sc.Forward(); sc.ForwardSetState(lastStateC); } else /* eCommentLine */ { sc.SetState(lastStateC); } } if (sc.state == SCE_CSS_COMMENT) continue; if (sc.state == SCE_CSS_DOUBLESTRING || sc.state == SCE_CSS_SINGLESTRING) { if (sc.ch != (sc.state == SCE_CSS_DOUBLESTRING ? '\"' : '\'')) continue; unsigned int i = sc.currentPos; while (i && styler[i-1] == '\\') i--; if ((sc.currentPos - i) % 2 == 1) continue; sc.ForwardSetState(lastStateS); } if (sc.state == SCE_CSS_OPERATOR) { if (op == ' ') { unsigned int i = startPos; op = styler.SafeGetCharAt(i-1); opPrev = styler.SafeGetCharAt(i-2); while (--i) { lastState = styler.StyleAt(i-1); if (lastState != SCE_CSS_OPERATOR && lastState != SCE_CSS_COMMENT) break; } } switch (op) { case '@': if (lastState == SCE_CSS_DEFAULT || hasNesting) sc.SetState(SCE_CSS_DIRECTIVE); break; case '>': case '+': if (lastState == SCE_CSS_TAG || lastState == SCE_CSS_CLASS || lastState == SCE_CSS_ID || lastState == SCE_CSS_PSEUDOCLASS || lastState == SCE_CSS_EXTENDED_PSEUDOCLASS || lastState == SCE_CSS_UNKNOWN_PSEUDOCLASS) sc.SetState(SCE_CSS_DEFAULT); break; case '[': if (lastState == SCE_CSS_TAG || lastState == SCE_CSS_DEFAULT || lastState == SCE_CSS_CLASS || lastState == SCE_CSS_ID || lastState == SCE_CSS_PSEUDOCLASS || lastState == SCE_CSS_EXTENDED_PSEUDOCLASS || lastState == SCE_CSS_UNKNOWN_PSEUDOCLASS) sc.SetState(SCE_CSS_ATTRIBUTE); break; case ']': if (lastState == SCE_CSS_ATTRIBUTE) sc.SetState(SCE_CSS_TAG); break; case '{': nestingLevel++; switch (lastState) { case SCE_CSS_MEDIA: sc.SetState(SCE_CSS_DEFAULT); break; case SCE_CSS_TAG: case SCE_CSS_DIRECTIVE: sc.SetState(SCE_CSS_IDENTIFIER); break; } break; case '}': if (--nestingLevel < 0) nestingLevel = 0; switch (lastState) { case SCE_CSS_DEFAULT: case SCE_CSS_VALUE: case SCE_CSS_IMPORTANT: case SCE_CSS_IDENTIFIER: case SCE_CSS_IDENTIFIER2: case SCE_CSS_IDENTIFIER3: if (hasNesting) sc.SetState(nestingLevel > 0 ? SCE_CSS_IDENTIFIER : SCE_CSS_DEFAULT); else sc.SetState(SCE_CSS_DEFAULT); break; } break; case '(': if (lastState == SCE_CSS_PSEUDOCLASS) sc.SetState(SCE_CSS_TAG); else if (lastState == SCE_CSS_EXTENDED_PSEUDOCLASS) sc.SetState(SCE_CSS_EXTENDED_PSEUDOCLASS); break; case ')': if (lastState == SCE_CSS_TAG || lastState == SCE_CSS_DEFAULT || lastState == SCE_CSS_CLASS || lastState == SCE_CSS_ID || lastState == SCE_CSS_PSEUDOCLASS || lastState == SCE_CSS_EXTENDED_PSEUDOCLASS || lastState == SCE_CSS_UNKNOWN_PSEUDOCLASS || lastState == SCE_CSS_PSEUDOELEMENT || lastState == SCE_CSS_EXTENDED_PSEUDOELEMENT) sc.SetState(SCE_CSS_TAG); break; case ':': switch (lastState) { case SCE_CSS_TAG: case SCE_CSS_DEFAULT: case SCE_CSS_CLASS: case SCE_CSS_ID: case SCE_CSS_PSEUDOCLASS: case SCE_CSS_EXTENDED_PSEUDOCLASS: case SCE_CSS_UNKNOWN_PSEUDOCLASS: case SCE_CSS_PSEUDOELEMENT: case SCE_CSS_EXTENDED_PSEUDOELEMENT: sc.SetState(SCE_CSS_PSEUDOCLASS); break; case SCE_CSS_IDENTIFIER: case SCE_CSS_IDENTIFIER2: case SCE_CSS_IDENTIFIER3: case SCE_CSS_EXTENDED_IDENTIFIER: case SCE_CSS_UNKNOWN_IDENTIFIER: case SCE_CSS_VARIABLE: sc.SetState(SCE_CSS_VALUE); lastStateVal = lastState; break; } break; case '.': if (lastState == SCE_CSS_TAG || lastState == SCE_CSS_DEFAULT || lastState == SCE_CSS_CLASS || lastState == SCE_CSS_ID || lastState == SCE_CSS_PSEUDOCLASS || lastState == SCE_CSS_EXTENDED_PSEUDOCLASS || lastState == SCE_CSS_UNKNOWN_PSEUDOCLASS) sc.SetState(SCE_CSS_CLASS); break; case '#': if (lastState == SCE_CSS_TAG || lastState == SCE_CSS_DEFAULT || lastState == SCE_CSS_CLASS || lastState == SCE_CSS_ID || lastState == SCE_CSS_PSEUDOCLASS || lastState == SCE_CSS_EXTENDED_PSEUDOCLASS || lastState == SCE_CSS_UNKNOWN_PSEUDOCLASS) sc.SetState(SCE_CSS_ID); break; case ',': case '|': case '~': if (lastState == SCE_CSS_TAG) sc.SetState(SCE_CSS_DEFAULT); break; case ';': switch (lastState) { case SCE_CSS_DIRECTIVE: if (hasNesting) { sc.SetState(nestingLevel > 0 ? SCE_CSS_IDENTIFIER : SCE_CSS_DEFAULT); } else { sc.SetState(SCE_CSS_DEFAULT); } break; case SCE_CSS_VALUE: case SCE_CSS_IMPORTANT: // data URLs can have semicolons; simplistically check for wrapping parentheses and move along if (insideParentheses) { sc.SetState(lastState); } else { if (lastStateVal == SCE_CSS_VARIABLE) { sc.SetState(SCE_CSS_DEFAULT); } else { sc.SetState(SCE_CSS_IDENTIFIER); } } break; case SCE_CSS_VARIABLE: if (lastStateVar == SCE_CSS_VALUE) { // data URLs can have semicolons; simplistically check for wrapping parentheses and move along if (insideParentheses) { sc.SetState(SCE_CSS_VALUE); } else { sc.SetState(SCE_CSS_IDENTIFIER); } } else { sc.SetState(SCE_CSS_DEFAULT); } break; } break; case '!': if (lastState == SCE_CSS_VALUE) sc.SetState(SCE_CSS_IMPORTANT); break; } } if (sc.ch == '*' && sc.state == SCE_CSS_DEFAULT) { sc.SetState(SCE_CSS_TAG); continue; } // check for inside parentheses (whether part of an "operator" or not) if (sc.ch == '(') insideParentheses = true; else if (sc.ch == ')') insideParentheses = false; // SCSS special modes if (isScssDocument) { // variable name if (sc.ch == '$') { switch (sc.state) { case SCE_CSS_DEFAULT: case SCE_CSS_VALUE: lastStateVar = sc.state; sc.SetState(SCE_CSS_VARIABLE); continue; } } if (sc.state == SCE_CSS_VARIABLE) { if (IsAWordChar(sc.ch)) { // still looking at the variable name continue; } if (lastStateVar == SCE_CSS_VALUE) { // not looking at the variable name any more, and it was part of a value sc.SetState(SCE_CSS_VALUE); } } // nested rule parent selector if (sc.ch == '&') { switch (sc.state) { case SCE_CSS_DEFAULT: case SCE_CSS_IDENTIFIER: sc.SetState(SCE_CSS_TAG); continue; } } } // nesting rules that apply to SCSS and Less if (hasNesting) { // check for nested rule selector if (sc.state == SCE_CSS_IDENTIFIER && (IsAWordChar(sc.ch) || sc.ch == ':' || sc.ch == '.' || sc.ch == '#')) { // look ahead to see whether { comes before next ; and } unsigned int endPos = startPos + length; int ch; for (unsigned int i = sc.currentPos; i < endPos; i++) { ch = styler.SafeGetCharAt(i); if (ch == ';' || ch == '}') break; if (ch == '{') { sc.SetState(SCE_CSS_DEFAULT); continue; } } } } if (IsAWordChar(sc.ch)) { if (sc.state == SCE_CSS_DEFAULT) sc.SetState(SCE_CSS_TAG); continue; } if (IsAWordChar(sc.chPrev) && ( sc.state == SCE_CSS_IDENTIFIER || sc.state == SCE_CSS_IDENTIFIER2 || sc.state == SCE_CSS_IDENTIFIER3 || sc.state == SCE_CSS_EXTENDED_IDENTIFIER || sc.state == SCE_CSS_UNKNOWN_IDENTIFIER || sc.state == SCE_CSS_PSEUDOCLASS || sc.state == SCE_CSS_PSEUDOELEMENT || sc.state == SCE_CSS_EXTENDED_PSEUDOCLASS || sc.state == SCE_CSS_EXTENDED_PSEUDOELEMENT || sc.state == SCE_CSS_UNKNOWN_PSEUDOCLASS || sc.state == SCE_CSS_IMPORTANT || sc.state == SCE_CSS_DIRECTIVE )) { char s[100]; sc.GetCurrentLowered(s, sizeof(s)); char *s2 = s; while (*s2 && !IsAWordChar(*s2)) s2++; switch (sc.state) { case SCE_CSS_IDENTIFIER: case SCE_CSS_IDENTIFIER2: case SCE_CSS_IDENTIFIER3: case SCE_CSS_EXTENDED_IDENTIFIER: case SCE_CSS_UNKNOWN_IDENTIFIER: if (css1Props.InList(s2)) sc.ChangeState(SCE_CSS_IDENTIFIER); else if (css2Props.InList(s2)) sc.ChangeState(SCE_CSS_IDENTIFIER2); else if (css3Props.InList(s2)) sc.ChangeState(SCE_CSS_IDENTIFIER3); else if (exProps.InList(s2)) sc.ChangeState(SCE_CSS_EXTENDED_IDENTIFIER); else sc.ChangeState(SCE_CSS_UNKNOWN_IDENTIFIER); break; case SCE_CSS_PSEUDOCLASS: case SCE_CSS_PSEUDOELEMENT: case SCE_CSS_EXTENDED_PSEUDOCLASS: case SCE_CSS_EXTENDED_PSEUDOELEMENT: case SCE_CSS_UNKNOWN_PSEUDOCLASS: if (op == ':' && opPrev != ':' && pseudoClasses.InList(s2)) sc.ChangeState(SCE_CSS_PSEUDOCLASS); else if (opPrev == ':' && pseudoElements.InList(s2)) sc.ChangeState(SCE_CSS_PSEUDOELEMENT); else if ((op == ':' || (op == '(' && lastState == SCE_CSS_EXTENDED_PSEUDOCLASS)) && opPrev != ':' && exPseudoClasses.InList(s2)) sc.ChangeState(SCE_CSS_EXTENDED_PSEUDOCLASS); else if (opPrev == ':' && exPseudoElements.InList(s2)) sc.ChangeState(SCE_CSS_EXTENDED_PSEUDOELEMENT); else sc.ChangeState(SCE_CSS_UNKNOWN_PSEUDOCLASS); break; case SCE_CSS_IMPORTANT: if (strcmp(s2, "important") != 0) sc.ChangeState(SCE_CSS_VALUE); break; case SCE_CSS_DIRECTIVE: if (op == '@' && strcmp(s2, "media") == 0) sc.ChangeState(SCE_CSS_MEDIA); break; } } if (sc.ch != '.' && sc.ch != ':' && sc.ch != '#' && ( sc.state == SCE_CSS_CLASS || sc.state == SCE_CSS_ID || (sc.ch != '(' && sc.ch != ')' && ( /* This line of the condition makes it possible to extend pseudo-classes with parentheses */ sc.state == SCE_CSS_PSEUDOCLASS || sc.state == SCE_CSS_PSEUDOELEMENT || sc.state == SCE_CSS_EXTENDED_PSEUDOCLASS || sc.state == SCE_CSS_EXTENDED_PSEUDOELEMENT || sc.state == SCE_CSS_UNKNOWN_PSEUDOCLASS )) )) sc.SetState(SCE_CSS_TAG); if (sc.Match('/', '*')) { lastStateC = sc.state; comment_mode = eCommentBlock; sc.SetState(SCE_CSS_COMMENT); sc.Forward(); } else if (hasSingleLineComments && sc.Match('/', '/') && !insideParentheses) { // note that we've had to treat ([...]// as the start of a URL not a comment, e.g. url(http://example.com), url(//example.com) lastStateC = sc.state; comment_mode = eCommentLine; sc.SetState(SCE_CSS_COMMENT); sc.Forward(); } else if ((sc.state == SCE_CSS_VALUE || sc.state == SCE_CSS_ATTRIBUTE) && (sc.ch == '\"' || sc.ch == '\'')) { lastStateS = sc.state; sc.SetState((sc.ch == '\"' ? SCE_CSS_DOUBLESTRING : SCE_CSS_SINGLESTRING)); } else if (IsCssOperator(sc.ch) && (sc.state != SCE_CSS_ATTRIBUTE || sc.ch == ']') && (sc.state != SCE_CSS_VALUE || sc.ch == ';' || sc.ch == '}' || sc.ch == '!') && ((sc.state != SCE_CSS_DIRECTIVE && sc.state != SCE_CSS_MEDIA) || sc.ch == ';' || sc.ch == '{') ) { if (sc.state != SCE_CSS_OPERATOR) lastState = sc.state; sc.SetState(SCE_CSS_OPERATOR); op = sc.ch; opPrev = sc.chPrev; } } sc.Complete(); } static void FoldCSSDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) { bool foldComment = styler.GetPropertyInt("fold.comment") != 0; bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; unsigned int endPos = startPos + length; int visibleChars = 0; int lineCurrent = styler.GetLine(startPos); int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; int levelCurrent = levelPrev; char chNext = styler[startPos]; bool inComment = (styler.StyleAt(startPos-1) == SCE_CSS_COMMENT); for (unsigned int i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); int style = styler.StyleAt(i); bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); if (foldComment) { if (!inComment && (style == SCE_CSS_COMMENT)) levelCurrent++; else if (inComment && (style != SCE_CSS_COMMENT)) levelCurrent--; inComment = (style == SCE_CSS_COMMENT); } if (style == SCE_CSS_OPERATOR) { if (ch == '{') { levelCurrent++; } else if (ch == '}') { levelCurrent--; } } if (atEOL) { int lev = levelPrev; if (visibleChars == 0 && foldCompact) lev |= SC_FOLDLEVELWHITEFLAG; if ((levelCurrent > levelPrev) && (visibleChars > 0)) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) { styler.SetLevel(lineCurrent, lev); } lineCurrent++; levelPrev = levelCurrent; visibleChars = 0; } if (!isspacechar(ch)) visibleChars++; } // Fill in the real level of the next line, keeping the current flags as they will be filled in later int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; styler.SetLevel(lineCurrent, levelPrev | flagsNext); } static const char * const cssWordListDesc[] = { "CSS1 Properties", "Pseudo-classes", "CSS2 Properties", "CSS3 Properties", "Pseudo-elements", "Browser-Specific CSS Properties", "Browser-Specific Pseudo-classes", "Browser-Specific Pseudo-elements", 0 }; LexerModule lmCss(SCLEX_CSS, ColouriseCssDoc, "css", FoldCSSDoc, cssWordListDesc); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexCsound.cxx000444001750001750 1462311727344243 25053 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexCsound.cxx ** Lexer for Csound (Orchestra & Score) ** Written by Georg Ritter - **/ // Copyright 1998-2003 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static inline bool IsAWordChar(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_' || ch == '?'); } static inline bool IsAWordStart(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '.' || ch == '%' || ch == '@' || ch == '$' || ch == '?'); } static inline bool IsCsoundOperator(char ch) { if (isascii(ch) && isalnum(ch)) return false; // '.' left out as it is used to make up numbers if (ch == '*' || ch == '/' || ch == '-' || ch == '+' || ch == '(' || ch == ')' || ch == '=' || ch == '^' || ch == '[' || ch == ']' || ch == '<' || ch == '&' || ch == '>' || ch == ',' || ch == '|' || ch == '~' || ch == '%' || ch == ':') return true; return false; } static void ColouriseCsoundDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { WordList &opcode = *keywordlists[0]; WordList &headerStmt = *keywordlists[1]; WordList &otherKeyword = *keywordlists[2]; // Do not leak onto next line if (initStyle == SCE_CSOUND_STRINGEOL) initStyle = SCE_CSOUND_DEFAULT; StyleContext sc(startPos, length, initStyle, styler); for (; sc.More(); sc.Forward()) { // Handle line continuation generically. if (sc.ch == '\\') { if (sc.chNext == '\n' || sc.chNext == '\r') { sc.Forward(); if (sc.ch == '\r' && sc.chNext == '\n') { sc.Forward(); } continue; } } // Determine if the current state should terminate. if (sc.state == SCE_CSOUND_OPERATOR) { if (!IsCsoundOperator(static_cast(sc.ch))) { sc.SetState(SCE_CSOUND_DEFAULT); } }else if (sc.state == SCE_CSOUND_NUMBER) { if (!IsAWordChar(sc.ch)) { sc.SetState(SCE_CSOUND_DEFAULT); } } else if (sc.state == SCE_CSOUND_IDENTIFIER) { if (!IsAWordChar(sc.ch) ) { char s[100]; sc.GetCurrent(s, sizeof(s)); if (opcode.InList(s)) { sc.ChangeState(SCE_CSOUND_OPCODE); } else if (headerStmt.InList(s)) { sc.ChangeState(SCE_CSOUND_HEADERSTMT); } else if (otherKeyword.InList(s)) { sc.ChangeState(SCE_CSOUND_USERKEYWORD); } else if (s[0] == 'p') { sc.ChangeState(SCE_CSOUND_PARAM); } else if (s[0] == 'a') { sc.ChangeState(SCE_CSOUND_ARATE_VAR); } else if (s[0] == 'k') { sc.ChangeState(SCE_CSOUND_KRATE_VAR); } else if (s[0] == 'i') { // covers both i-rate variables and i-statements sc.ChangeState(SCE_CSOUND_IRATE_VAR); } else if (s[0] == 'g') { sc.ChangeState(SCE_CSOUND_GLOBAL_VAR); } sc.SetState(SCE_CSOUND_DEFAULT); } } else if (sc.state == SCE_CSOUND_COMMENT ) { if (sc.atLineEnd) { sc.SetState(SCE_CSOUND_DEFAULT); } } else if ((sc.state == SCE_CSOUND_ARATE_VAR) || (sc.state == SCE_CSOUND_KRATE_VAR) || (sc.state == SCE_CSOUND_IRATE_VAR)) { if (!IsAWordChar(sc.ch)) { sc.SetState(SCE_CSOUND_DEFAULT); } } // Determine if a new state should be entered. if (sc.state == SCE_CSOUND_DEFAULT) { if (sc.ch == ';'){ sc.SetState(SCE_CSOUND_COMMENT); } else if (isdigit(sc.ch) || (sc.ch == '.' && isdigit(sc.chNext))) { sc.SetState(SCE_CSOUND_NUMBER); } else if (IsAWordStart(sc.ch)) { sc.SetState(SCE_CSOUND_IDENTIFIER); } else if (IsCsoundOperator(static_cast(sc.ch))) { sc.SetState(SCE_CSOUND_OPERATOR); } else if (sc.ch == 'p') { sc.SetState(SCE_CSOUND_PARAM); } else if (sc.ch == 'a') { sc.SetState(SCE_CSOUND_ARATE_VAR); } else if (sc.ch == 'k') { sc.SetState(SCE_CSOUND_KRATE_VAR); } else if (sc.ch == 'i') { // covers both i-rate variables and i-statements sc.SetState(SCE_CSOUND_IRATE_VAR); } else if (sc.ch == 'g') { sc.SetState(SCE_CSOUND_GLOBAL_VAR); } } } sc.Complete(); } static void FoldCsoundInstruments(unsigned int startPos, int length, int /* initStyle */, WordList *[], Accessor &styler) { unsigned int lengthDoc = startPos + length; int visibleChars = 0; int lineCurrent = styler.GetLine(startPos); int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; int levelCurrent = levelPrev; char chNext = styler[startPos]; int stylePrev = 0; int styleNext = styler.StyleAt(startPos); for (unsigned int i = startPos; i < lengthDoc; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); int style = styleNext; styleNext = styler.StyleAt(i + 1); bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); if ((stylePrev != SCE_CSOUND_OPCODE) && (style == SCE_CSOUND_OPCODE)) { char s[20]; unsigned int j = 0; while ((j < (sizeof(s) - 1)) && (iswordchar(styler[i + j]))) { s[j] = styler[i + j]; j++; } s[j] = '\0'; if (strcmp(s, "instr") == 0) levelCurrent++; if (strcmp(s, "endin") == 0) levelCurrent--; } if (atEOL) { int lev = levelPrev; if (visibleChars == 0) lev |= SC_FOLDLEVELWHITEFLAG; if ((levelCurrent > levelPrev) && (visibleChars > 0)) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) { styler.SetLevel(lineCurrent, lev); } lineCurrent++; levelPrev = levelCurrent; visibleChars = 0; } if (!isspacechar(ch)) visibleChars++; stylePrev = style; } // Fill in the real level of the next line, keeping the current flags as they will be filled in later int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; styler.SetLevel(lineCurrent, levelPrev | flagsNext); } static const char * const csoundWordListDesc[] = { "Opcodes", "Header Statements", "User keywords", 0 }; LexerModule lmCsound(SCLEX_CSOUND, ColouriseCsoundDoc, "csound", FoldCsoundInstruments, csoundWordListDesc); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/WordList.h000444001750001750 202111727344243 24310 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file WordList.h ** Hold a list of words. **/ // Copyright 1998-2010 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #ifndef WORDLIST_H #define WORDLIST_H #ifdef SCI_NAMESPACE namespace Scintilla { #endif /** */ class WordList { public: // Each word contains at least one character - a empty word acts as sentinel at the end. char **words; char *list; int len; bool onlyLineEnds; ///< Delimited by any white space or only line ends int starts[256]; WordList(bool onlyLineEnds_ = false) : words(0), list(0), len(0), onlyLineEnds(onlyLineEnds_) {} ~WordList() { Clear(); } operator bool() const { return len ? true : false; } bool operator!=(const WordList &other) const; void Clear(); void Set(const char *s); bool InList(const char *s) const; bool InListAbbreviated(const char *s, const char marker) const; }; #ifdef SCI_NAMESPACE } #endif #endif Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/ContractionState.cxx000444001750001750 1502711727344243 26432 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file ContractionState.cxx ** Manages visibility of lines for folding and wrapping. **/ // Copyright 1998-2007 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include "Platform.h" #include "SplitVector.h" #include "Partitioning.h" #include "RunStyles.h" #include "ContractionState.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif ContractionState::ContractionState() : visible(0), expanded(0), heights(0), displayLines(0), linesInDocument(1) { //InsertLine(0); } ContractionState::~ContractionState() { Clear(); } void ContractionState::EnsureData() { if (OneToOne()) { visible = new RunStyles(); expanded = new RunStyles(); heights = new RunStyles(); displayLines = new Partitioning(4); InsertLines(0, linesInDocument); } } void ContractionState::Clear() { delete visible; visible = 0; delete expanded; expanded = 0; delete heights; heights = 0; delete displayLines; displayLines = 0; linesInDocument = 1; } int ContractionState::LinesInDoc() const { if (OneToOne()) { return linesInDocument; } else { return displayLines->Partitions() - 1; } } int ContractionState::LinesDisplayed() const { if (OneToOne()) { return linesInDocument; } else { return displayLines->PositionFromPartition(LinesInDoc()); } } int ContractionState::DisplayFromDoc(int lineDoc) const { if (OneToOne()) { return lineDoc; } else { if (lineDoc > displayLines->Partitions()) lineDoc = displayLines->Partitions(); return displayLines->PositionFromPartition(lineDoc); } } int ContractionState::DocFromDisplay(int lineDisplay) const { if (OneToOne()) { return lineDisplay; } else { if (lineDisplay <= 0) { return 0; } if (lineDisplay > LinesDisplayed()) { return displayLines->PartitionFromPosition(LinesDisplayed()); } int lineDoc = displayLines->PartitionFromPosition(lineDisplay); PLATFORM_ASSERT(GetVisible(lineDoc)); return lineDoc; } } void ContractionState::InsertLine(int lineDoc) { if (OneToOne()) { linesInDocument++; } else { visible->InsertSpace(lineDoc, 1); visible->SetValueAt(lineDoc, 1); expanded->InsertSpace(lineDoc, 1); expanded->SetValueAt(lineDoc, 1); heights->InsertSpace(lineDoc, 1); heights->SetValueAt(lineDoc, 1); int lineDisplay = DisplayFromDoc(lineDoc); displayLines->InsertPartition(lineDoc, lineDisplay); displayLines->InsertText(lineDoc, 1); } } void ContractionState::InsertLines(int lineDoc, int lineCount) { for (int l = 0; l < lineCount; l++) { InsertLine(lineDoc + l); } Check(); } void ContractionState::DeleteLine(int lineDoc) { if (OneToOne()) { linesInDocument--; } else { if (GetVisible(lineDoc)) { displayLines->InsertText(lineDoc, -heights->ValueAt(lineDoc)); } displayLines->RemovePartition(lineDoc); visible->DeleteRange(lineDoc, 1); expanded->DeleteRange(lineDoc, 1); heights->DeleteRange(lineDoc, 1); } } void ContractionState::DeleteLines(int lineDoc, int lineCount) { for (int l = 0; l < lineCount; l++) { DeleteLine(lineDoc); } Check(); } bool ContractionState::GetVisible(int lineDoc) const { if (OneToOne()) { return true; } else { if (lineDoc >= visible->Length()) return true; return visible->ValueAt(lineDoc) == 1; } } bool ContractionState::SetVisible(int lineDocStart, int lineDocEnd, bool visible_) { if (OneToOne() && visible_) { return false; } else { EnsureData(); int delta = 0; Check(); if ((lineDocStart <= lineDocEnd) && (lineDocStart >= 0) && (lineDocEnd < LinesInDoc())) { for (int line = lineDocStart; line <= lineDocEnd; line++) { if (GetVisible(line) != visible_) { int difference = visible_ ? heights->ValueAt(line) : -heights->ValueAt(line); visible->SetValueAt(line, visible_ ? 1 : 0); displayLines->InsertText(line, difference); delta += difference; } } } else { return false; } Check(); return delta != 0; } } bool ContractionState::HiddenLines() const { if (OneToOne()) { return false; } else { return !visible->AllSameAs(1); } } bool ContractionState::GetExpanded(int lineDoc) const { if (OneToOne()) { return true; } else { Check(); return expanded->ValueAt(lineDoc) == 1; } } bool ContractionState::SetExpanded(int lineDoc, bool expanded_) { if (OneToOne() && expanded_) { return false; } else { EnsureData(); if (expanded_ != (expanded->ValueAt(lineDoc) == 1)) { expanded->SetValueAt(lineDoc, expanded_ ? 1 : 0); Check(); return true; } else { Check(); return false; } } } int ContractionState::ContractedNext(int lineDocStart) const { if (OneToOne()) { return -1; } else { Check(); if (!expanded->ValueAt(lineDocStart)) { return lineDocStart; } else { int lineDocNextChange = expanded->EndRun(lineDocStart); if (lineDocNextChange < LinesInDoc()) return lineDocNextChange; else return -1; } } } int ContractionState::GetHeight(int lineDoc) const { if (OneToOne()) { return 1; } else { return heights->ValueAt(lineDoc); } } // Set the number of display lines needed for this line. // Return true if this is a change. bool ContractionState::SetHeight(int lineDoc, int height) { if (OneToOne() && (height == 1)) { return false; } else if (lineDoc < LinesInDoc()) { EnsureData(); if (GetHeight(lineDoc) != height) { if (GetVisible(lineDoc)) { displayLines->InsertText(lineDoc, height - GetHeight(lineDoc)); } heights->SetValueAt(lineDoc, height); Check(); return true; } else { Check(); return false; } } else { return false; } } void ContractionState::ShowAll() { int lines = LinesInDoc(); Clear(); linesInDocument = lines; } // Debugging checks void ContractionState::Check() const { #ifdef CHECK_CORRECTNESS for (int vline = 0; vline < LinesDisplayed(); vline++) { const int lineDoc = DocFromDisplay(vline); PLATFORM_ASSERT(GetVisible(lineDoc)); } for (int lineDoc = 0; lineDoc < LinesInDoc(); lineDoc++) { const int displayThis = DisplayFromDoc(lineDoc); const int displayNext = DisplayFromDoc(lineDoc + 1); const int height = displayNext - displayThis; PLATFORM_ASSERT(height >= 0); if (GetVisible(lineDoc)) { PLATFORM_ASSERT(GetHeight(lineDoc) == height); } else { PLATFORM_ASSERT(0 == height); } } #endif } Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexPS.cxx000444001750001750 3214111727344243 24135 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexPS.cxx ** Lexer for PostScript ** ** Written by Nigel Hathaway . ** The License.txt file describes the conditions under which this software may be distributed. **/ #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static inline bool IsASelfDelimitingChar(const int ch) { return (ch == '[' || ch == ']' || ch == '{' || ch == '}' || ch == '/' || ch == '<' || ch == '>' || ch == '(' || ch == ')' || ch == '%'); } static inline bool IsAWhitespaceChar(const int ch) { return (ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n' || ch == '\f' || ch == '\0'); } static bool IsABaseNDigit(const int ch, const int base) { int maxdig = '9'; int letterext = -1; if (base <= 10) maxdig = '0' + base - 1; else letterext = base - 11; return ((ch >= '0' && ch <= maxdig) || (ch >= 'A' && ch <= ('A' + letterext)) || (ch >= 'a' && ch <= ('a' + letterext))); } static inline bool IsABase85Char(const int ch) { return ((ch >= '!' && ch <= 'u') || ch == 'z'); } static void ColourisePSDoc( unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { WordList &keywords1 = *keywordlists[0]; WordList &keywords2 = *keywordlists[1]; WordList &keywords3 = *keywordlists[2]; WordList &keywords4 = *keywordlists[3]; WordList &keywords5 = *keywordlists[4]; StyleContext sc(startPos, length, initStyle, styler); bool tokenizing = styler.GetPropertyInt("ps.tokenize") != 0; int pslevel = styler.GetPropertyInt("ps.level", 3); int lineCurrent = styler.GetLine(startPos); int nestTextCurrent = 0; if (lineCurrent > 0 && initStyle == SCE_PS_TEXT) nestTextCurrent = styler.GetLineState(lineCurrent - 1); int numRadix = 0; bool numHasPoint = false; bool numHasExponent = false; bool numHasSign = false; // Clear out existing tokenization if (tokenizing && length > 0) { styler.StartAt(startPos, static_cast(INDIC2_MASK)); styler.ColourTo(startPos + length-1, 0); styler.Flush(); styler.StartAt(startPos); styler.StartSegment(startPos); } for (; sc.More(); sc.Forward()) { if (sc.atLineStart) lineCurrent = styler.GetLine(sc.currentPos); // Determine if the current state should terminate. if (sc.state == SCE_PS_COMMENT || sc.state == SCE_PS_DSC_VALUE) { if (sc.atLineEnd) { sc.SetState(SCE_C_DEFAULT); } } else if (sc.state == SCE_PS_DSC_COMMENT) { if (sc.ch == ':') { sc.Forward(); if (!sc.atLineEnd) sc.SetState(SCE_PS_DSC_VALUE); else sc.SetState(SCE_C_DEFAULT); } else if (sc.atLineEnd) { sc.SetState(SCE_C_DEFAULT); } else if (IsAWhitespaceChar(sc.ch) && sc.ch != '\r') { sc.ChangeState(SCE_PS_COMMENT); } } else if (sc.state == SCE_PS_NUMBER) { if (IsASelfDelimitingChar(sc.ch) || IsAWhitespaceChar(sc.ch)) { if ((sc.chPrev == '+' || sc.chPrev == '-' || sc.chPrev == 'E' || sc.chPrev == 'e') && numRadix == 0) sc.ChangeState(SCE_PS_NAME); sc.SetState(SCE_C_DEFAULT); } else if (sc.ch == '#') { if (numHasPoint || numHasExponent || numHasSign || numRadix != 0) { sc.ChangeState(SCE_PS_NAME); } else { char szradix[5]; sc.GetCurrent(szradix, 4); numRadix = atoi(szradix); if (numRadix < 2 || numRadix > 36) sc.ChangeState(SCE_PS_NAME); } } else if ((sc.ch == 'E' || sc.ch == 'e') && numRadix == 0) { if (numHasExponent) { sc.ChangeState(SCE_PS_NAME); } else { numHasExponent = true; if (sc.chNext == '+' || sc.chNext == '-') sc.Forward(); } } else if (sc.ch == '.') { if (numHasPoint || numHasExponent || numRadix != 0) { sc.ChangeState(SCE_PS_NAME); } else { numHasPoint = true; } } else if (numRadix == 0) { if (!IsABaseNDigit(sc.ch, 10)) sc.ChangeState(SCE_PS_NAME); } else { if (!IsABaseNDigit(sc.ch, numRadix)) sc.ChangeState(SCE_PS_NAME); } } else if (sc.state == SCE_PS_NAME || sc.state == SCE_PS_KEYWORD) { if (IsASelfDelimitingChar(sc.ch) || IsAWhitespaceChar(sc.ch)) { char s[100]; sc.GetCurrent(s, sizeof(s)); if ((pslevel >= 1 && keywords1.InList(s)) || (pslevel >= 2 && keywords2.InList(s)) || (pslevel >= 3 && keywords3.InList(s)) || keywords4.InList(s) || keywords5.InList(s)) { sc.ChangeState(SCE_PS_KEYWORD); } sc.SetState(SCE_C_DEFAULT); } } else if (sc.state == SCE_PS_LITERAL || sc.state == SCE_PS_IMMEVAL) { if (IsASelfDelimitingChar(sc.ch) || IsAWhitespaceChar(sc.ch)) sc.SetState(SCE_C_DEFAULT); } else if (sc.state == SCE_PS_PAREN_ARRAY || sc.state == SCE_PS_PAREN_DICT || sc.state == SCE_PS_PAREN_PROC) { sc.SetState(SCE_C_DEFAULT); } else if (sc.state == SCE_PS_TEXT) { if (sc.ch == '(') { nestTextCurrent++; } else if (sc.ch == ')') { if (--nestTextCurrent == 0) sc.ForwardSetState(SCE_PS_DEFAULT); } else if (sc.ch == '\\') { sc.Forward(); } } else if (sc.state == SCE_PS_HEXSTRING) { if (sc.ch == '>') { sc.ForwardSetState(SCE_PS_DEFAULT); } else if (!IsABaseNDigit(sc.ch, 16) && !IsAWhitespaceChar(sc.ch)) { sc.SetState(SCE_PS_HEXSTRING); styler.ColourTo(sc.currentPos, SCE_PS_BADSTRINGCHAR); } } else if (sc.state == SCE_PS_BASE85STRING) { if (sc.Match('~', '>')) { sc.Forward(); sc.ForwardSetState(SCE_PS_DEFAULT); } else if (!IsABase85Char(sc.ch) && !IsAWhitespaceChar(sc.ch)) { sc.SetState(SCE_PS_BASE85STRING); styler.ColourTo(sc.currentPos, SCE_PS_BADSTRINGCHAR); } } // Determine if a new state should be entered. if (sc.state == SCE_C_DEFAULT) { unsigned int tokenpos = sc.currentPos; if (sc.ch == '[' || sc.ch == ']') { sc.SetState(SCE_PS_PAREN_ARRAY); } else if (sc.ch == '{' || sc.ch == '}') { sc.SetState(SCE_PS_PAREN_PROC); } else if (sc.ch == '/') { if (sc.chNext == '/') { sc.SetState(SCE_PS_IMMEVAL); sc.Forward(); } else { sc.SetState(SCE_PS_LITERAL); } } else if (sc.ch == '<') { if (sc.chNext == '<') { sc.SetState(SCE_PS_PAREN_DICT); sc.Forward(); } else if (sc.chNext == '~') { sc.SetState(SCE_PS_BASE85STRING); sc.Forward(); } else { sc.SetState(SCE_PS_HEXSTRING); } } else if (sc.ch == '>' && sc.chNext == '>') { sc.SetState(SCE_PS_PAREN_DICT); sc.Forward(); } else if (sc.ch == '>' || sc.ch == ')') { sc.SetState(SCE_C_DEFAULT); styler.ColourTo(sc.currentPos, SCE_PS_BADSTRINGCHAR); } else if (sc.ch == '(') { sc.SetState(SCE_PS_TEXT); nestTextCurrent = 1; } else if (sc.ch == '%') { if (sc.chNext == '%' && sc.atLineStart) { sc.SetState(SCE_PS_DSC_COMMENT); sc.Forward(); if (sc.chNext == '+') { sc.Forward(); sc.ForwardSetState(SCE_PS_DSC_VALUE); } } else { sc.SetState(SCE_PS_COMMENT); } } else if ((sc.ch == '+' || sc.ch == '-' || sc.ch == '.') && IsABaseNDigit(sc.chNext, 10)) { sc.SetState(SCE_PS_NUMBER); numRadix = 0; numHasPoint = (sc.ch == '.'); numHasExponent = false; numHasSign = (sc.ch == '+' || sc.ch == '-'); } else if ((sc.ch == '+' || sc.ch == '-') && sc.chNext == '.' && IsABaseNDigit(sc.GetRelative(2), 10)) { sc.SetState(SCE_PS_NUMBER); numRadix = 0; numHasPoint = false; numHasExponent = false; numHasSign = true; } else if (IsABaseNDigit(sc.ch, 10)) { sc.SetState(SCE_PS_NUMBER); numRadix = 0; numHasPoint = false; numHasExponent = false; numHasSign = false; } else if (!IsAWhitespaceChar(sc.ch)) { sc.SetState(SCE_PS_NAME); } // Mark the start of tokens if (tokenizing && sc.state != SCE_C_DEFAULT && sc.state != SCE_PS_COMMENT && sc.state != SCE_PS_DSC_COMMENT && sc.state != SCE_PS_DSC_VALUE) { styler.Flush(); styler.StartAt(tokenpos, static_cast(INDIC2_MASK)); styler.ColourTo(tokenpos, INDIC2_MASK); styler.Flush(); styler.StartAt(tokenpos); styler.StartSegment(tokenpos); } } if (sc.atLineEnd) styler.SetLineState(lineCurrent, nestTextCurrent); } sc.Complete(); } static void FoldPSDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) { bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; bool foldAtElse = styler.GetPropertyInt("fold.at.else", 0) != 0; unsigned int endPos = startPos + length; int visibleChars = 0; int lineCurrent = styler.GetLine(startPos); int levelCurrent = SC_FOLDLEVELBASE; if (lineCurrent > 0) levelCurrent = styler.LevelAt(lineCurrent-1) >> 16; int levelMinCurrent = levelCurrent; int levelNext = levelCurrent; char chNext = styler[startPos]; int styleNext = styler.StyleAt(startPos); int style; for (unsigned int i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); style = styleNext; styleNext = styler.StyleAt(i + 1); bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); //mac?? if ((style & 31) == SCE_PS_PAREN_PROC) { if (ch == '{') { // Measure the minimum before a '{' to allow // folding on "} {" if (levelMinCurrent > levelNext) { levelMinCurrent = levelNext; } levelNext++; } else if (ch == '}') { levelNext--; } } if (atEOL) { int levelUse = levelCurrent; if (foldAtElse) { levelUse = levelMinCurrent; } int lev = levelUse | levelNext << 16; if (visibleChars == 0 && foldCompact) lev |= SC_FOLDLEVELWHITEFLAG; if (levelUse < levelNext) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) { styler.SetLevel(lineCurrent, lev); } lineCurrent++; levelCurrent = levelNext; levelMinCurrent = levelCurrent; visibleChars = 0; } if (!isspacechar(ch)) visibleChars++; } } static const char * const psWordListDesc[] = { "PS Level 1 operators", "PS Level 2 operators", "PS Level 3 operators", "RIP-specific operators", "User-defined operators", 0 }; LexerModule lmPS(SCLEX_PS, ColourisePSDoc, "ps", FoldPSDoc, psWordListDesc); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexConf.cxx000444001750001750 1337611727344243 24511 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexConf.cxx ** Lexer for Apache Configuration Files. ** ** First working version contributed by Ahmad Zawawi on October 28, 2000. ** i created this lexer because i needed something pretty when dealing ** when Apache Configuration files... **/ // Copyright 1998-2001 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static void ColouriseConfDoc(unsigned int startPos, int length, int, WordList *keywordLists[], Accessor &styler) { int state = SCE_CONF_DEFAULT; char chNext = styler[startPos]; int lengthDoc = startPos + length; // create a buffer large enough to take the largest chunk... char *buffer = new char[length]; int bufferCount = 0; // this assumes that we have 2 keyword list in conf.properties WordList &directives = *keywordLists[0]; WordList ¶ms = *keywordLists[1]; // go through all provided text segment // using the hand-written state machine shown below styler.StartAt(startPos); styler.StartSegment(startPos); for (int i = startPos; i < lengthDoc; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); if (styler.IsLeadByte(ch)) { chNext = styler.SafeGetCharAt(i + 2); i++; continue; } switch(state) { case SCE_CONF_DEFAULT: if( ch == '\n' || ch == '\r' || ch == '\t' || ch == ' ') { // whitespace is simply ignored here... styler.ColourTo(i,SCE_CONF_DEFAULT); break; } else if( ch == '#' ) { // signals the start of a comment... state = SCE_CONF_COMMENT; styler.ColourTo(i,SCE_CONF_COMMENT); } else if( ch == '.' /*|| ch == '/'*/) { // signals the start of a file... state = SCE_CONF_EXTENSION; styler.ColourTo(i,SCE_CONF_EXTENSION); } else if( ch == '"') { state = SCE_CONF_STRING; styler.ColourTo(i,SCE_CONF_STRING); } else if( isascii(ch) && ispunct(ch) ) { // signals an operator... // no state jump necessary for this // simple case... styler.ColourTo(i,SCE_CONF_OPERATOR); } else if( isascii(ch) && isalpha(ch) ) { // signals the start of an identifier bufferCount = 0; buffer[bufferCount++] = static_cast(tolower(ch)); state = SCE_CONF_IDENTIFIER; } else if( isascii(ch) && isdigit(ch) ) { // signals the start of a number bufferCount = 0; buffer[bufferCount++] = ch; //styler.ColourTo(i,SCE_CONF_NUMBER); state = SCE_CONF_NUMBER; } else { // style it the default style.. styler.ColourTo(i,SCE_CONF_DEFAULT); } break; case SCE_CONF_COMMENT: // if we find a newline here, // we simply go to default state // else continue to work on it... if( ch == '\n' || ch == '\r' ) { state = SCE_CONF_DEFAULT; } else { styler.ColourTo(i,SCE_CONF_COMMENT); } break; case SCE_CONF_EXTENSION: // if we find a non-alphanumeric char, // we simply go to default state // else we're still dealing with an extension... if( (isascii(ch) && isalnum(ch)) || (ch == '_') || (ch == '-') || (ch == '$') || (ch == '/') || (ch == '.') || (ch == '*') ) { styler.ColourTo(i,SCE_CONF_EXTENSION); } else { state = SCE_CONF_DEFAULT; chNext = styler[i--]; } break; case SCE_CONF_STRING: // if we find the end of a string char, we simply go to default state // else we're still dealing with an string... if( (ch == '"' && styler.SafeGetCharAt(i-1)!='\\') || (ch == '\n') || (ch == '\r') ) { state = SCE_CONF_DEFAULT; } styler.ColourTo(i,SCE_CONF_STRING); break; case SCE_CONF_IDENTIFIER: // stay in CONF_IDENTIFIER state until we find a non-alphanumeric if( (isascii(ch) && isalnum(ch)) || (ch == '_') || (ch == '-') || (ch == '/') || (ch == '$') || (ch == '.') || (ch == '*')) { buffer[bufferCount++] = static_cast(tolower(ch)); } else { state = SCE_CONF_DEFAULT; buffer[bufferCount] = '\0'; // check if the buffer contains a keyword, and highlight it if it is a keyword... if(directives.InList(buffer)) { styler.ColourTo(i-1,SCE_CONF_DIRECTIVE ); } else if(params.InList(buffer)) { styler.ColourTo(i-1,SCE_CONF_PARAMETER ); } else if(strchr(buffer,'/') || strchr(buffer,'.')) { styler.ColourTo(i-1,SCE_CONF_EXTENSION); } else { styler.ColourTo(i-1,SCE_CONF_DEFAULT); } // push back the faulty character chNext = styler[i--]; } break; case SCE_CONF_NUMBER: // stay in CONF_NUMBER state until we find a non-numeric if( (isascii(ch) && isdigit(ch)) || ch == '.') { buffer[bufferCount++] = ch; } else { state = SCE_CONF_DEFAULT; buffer[bufferCount] = '\0'; // Colourize here... if( strchr(buffer,'.') ) { // it is an IP address... styler.ColourTo(i-1,SCE_CONF_IP); } else { // normal number styler.ColourTo(i-1,SCE_CONF_NUMBER); } // push back a character chNext = styler[i--]; } break; } } delete []buffer; } static const char * const confWordListDesc[] = { "Directives", "Parameters", 0 }; LexerModule lmConf(SCLEX_CONF, ColouriseConfDoc, "conf", 0, confWordListDesc); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/Accessor.cxx000444001750001750 440111727344243 24662 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file KeyWords.cxx ** Colourise for particular languages. **/ // Copyright 1998-2002 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "PropSetSimple.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif Accessor::Accessor(IDocument *pAccess_, PropSetSimple *pprops_) : LexAccessor(pAccess_), pprops(pprops_) { } int Accessor::GetPropertyInt(const char *key, int defaultValue) { return pprops->GetInt(key, defaultValue); } int Accessor::IndentAmount(int line, int *flags, PFNIsCommentLeader pfnIsCommentLeader) { int end = Length(); int spaceFlags = 0; // Determines the indentation level of the current line and also checks for consistent // indentation compared to the previous line. // Indentation is judged consistent when the indentation whitespace of each line lines // the same or the indentation of one line is a prefix of the other. int pos = LineStart(line); char ch = (*this)[pos]; int indent = 0; bool inPrevPrefix = line > 0; int posPrev = inPrevPrefix ? LineStart(line-1) : 0; while ((ch == ' ' || ch == '\t') && (pos < end)) { if (inPrevPrefix) { char chPrev = (*this)[posPrev++]; if (chPrev == ' ' || chPrev == '\t') { if (chPrev != ch) spaceFlags |= wsInconsistent; } else { inPrevPrefix = false; } } if (ch == ' ') { spaceFlags |= wsSpace; indent++; } else { // Tab spaceFlags |= wsTab; if (spaceFlags & wsSpace) spaceFlags |= wsSpaceTab; indent = (indent / 8 + 1) * 8; } ch = (*this)[++pos]; } *flags = spaceFlags; indent += SC_FOLDLEVELBASE; // if completely empty line or the start of a comment... if ((LineStart(line) == Length()) || (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r') || (pfnIsCommentLeader && (*pfnIsCommentLeader)(*this, pos, end-pos))) return indent | SC_FOLDLEVELWHITEFLAG; else return indent; } Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/CellBuffer.cxx000444001750001750 4456711727344243 25172 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file CellBuffer.cxx ** Manages a buffer of cells. **/ // Copyright 1998-2001 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include "Platform.h" #include "Scintilla.h" #include "SplitVector.h" #include "Partitioning.h" #include "CellBuffer.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif LineVector::LineVector() : starts(256), perLine(0) { Init(); } LineVector::~LineVector() { starts.DeleteAll(); } void LineVector::Init() { starts.DeleteAll(); if (perLine) { perLine->Init(); } } void LineVector::SetPerLine(PerLine *pl) { perLine = pl; } void LineVector::InsertText(int line, int delta) { starts.InsertText(line, delta); } void LineVector::InsertLine(int line, int position, bool lineStart) { starts.InsertPartition(line, position); if (perLine) { if ((line > 0) && lineStart) line--; perLine->InsertLine(line); } } void LineVector::SetLineStart(int line, int position) { starts.SetPartitionStartPosition(line, position); } void LineVector::RemoveLine(int line) { starts.RemovePartition(line); if (perLine) { perLine->RemoveLine(line); } } int LineVector::LineFromPosition(int pos) const { return starts.PartitionFromPosition(pos); } Action::Action() { at = startAction; position = 0; data = 0; lenData = 0; mayCoalesce = false; } Action::~Action() { Destroy(); } void Action::Create(actionType at_, int position_, char *data_, int lenData_, bool mayCoalesce_) { delete []data; position = position_; at = at_; data = data_; lenData = lenData_; mayCoalesce = mayCoalesce_; } void Action::Destroy() { delete []data; data = 0; } void Action::Grab(Action *source) { delete []data; position = source->position; at = source->at; data = source->data; lenData = source->lenData; mayCoalesce = source->mayCoalesce; // Ownership of source data transferred to this source->position = 0; source->at = startAction; source->data = 0; source->lenData = 0; source->mayCoalesce = true; } // The undo history stores a sequence of user operations that represent the user's view of the // commands executed on the text. // Each user operation contains a sequence of text insertion and text deletion actions. // All the user operations are stored in a list of individual actions with 'start' actions used // as delimiters between user operations. // Initially there is one start action in the history. // As each action is performed, it is recorded in the history. The action may either become // part of the current user operation or may start a new user operation. If it is to be part of the // current operation, then it overwrites the current last action. If it is to be part of a new // operation, it is appended after the current last action. // After writing the new action, a new start action is appended at the end of the history. // The decision of whether to start a new user operation is based upon two factors. If a // compound operation has been explicitly started by calling BeginUndoAction and no matching // EndUndoAction (these calls nest) has been called, then the action is coalesced into the current // operation. If there is no outstanding BeginUndoAction call then a new operation is started // unless it looks as if the new action is caused by the user typing or deleting a stream of text. // Sequences that look like typing or deletion are coalesced into a single user operation. UndoHistory::UndoHistory() { lenActions = 100; actions = new Action[lenActions]; maxAction = 0; currentAction = 0; undoSequenceDepth = 0; savePoint = 0; actions[currentAction].Create(startAction); } UndoHistory::~UndoHistory() { delete []actions; actions = 0; } void UndoHistory::EnsureUndoRoom() { // Have to test that there is room for 2 more actions in the array // as two actions may be created by the calling function if (currentAction >= (lenActions - 2)) { // Run out of undo nodes so extend the array int lenActionsNew = lenActions * 2; Action *actionsNew = new Action[lenActionsNew]; for (int act = 0; act <= currentAction; act++) actionsNew[act].Grab(&actions[act]); delete []actions; lenActions = lenActionsNew; actions = actionsNew; } } void UndoHistory::AppendAction(actionType at, int position, char *data, int lengthData, bool &startSequence, bool mayCoalesce) { EnsureUndoRoom(); //Platform::DebugPrintf("%% %d action %d %d %d\n", at, position, lengthData, currentAction); //Platform::DebugPrintf("^ %d action %d %d\n", actions[currentAction - 1].at, // actions[currentAction - 1].position, actions[currentAction - 1].lenData); if (currentAction < savePoint) { savePoint = -1; } int oldCurrentAction = currentAction; if (currentAction >= 1) { if (0 == undoSequenceDepth) { // Top level actions may not always be coalesced int targetAct = -1; const Action *actPrevious = &(actions[currentAction + targetAct]); // Container actions may forward the coalesce state of Scintilla Actions. while ((actPrevious->at == containerAction) && actPrevious->mayCoalesce) { targetAct--; actPrevious = &(actions[currentAction + targetAct]); } // See if current action can be coalesced into previous action // Will work if both are inserts or deletes and position is same if (currentAction == savePoint) { currentAction++; } else if (!actions[currentAction].mayCoalesce) { // Not allowed to coalesce if this set currentAction++; } else if (!mayCoalesce || !actPrevious->mayCoalesce) { currentAction++; } else if (at == containerAction || actions[currentAction].at == containerAction) { ; // A coalescible containerAction } else if ((at != actPrevious->at) && (actPrevious->at != startAction)) { currentAction++; } else if ((at == insertAction) && (position != (actPrevious->position + actPrevious->lenData))) { // Insertions must be immediately after to coalesce currentAction++; } else if (at == removeAction) { if ((lengthData == 1) || (lengthData == 2)) { if ((position + lengthData) == actPrevious->position) { ; // Backspace -> OK } else if (position == actPrevious->position) { ; // Delete -> OK } else { // Removals must be at same position to coalesce currentAction++; } } else { // Removals must be of one character to coalesce currentAction++; } } else { // Action coalesced. } } else { // Actions not at top level are always coalesced unless this is after return to top level if (!actions[currentAction].mayCoalesce) currentAction++; } } else { currentAction++; } startSequence = oldCurrentAction != currentAction; actions[currentAction].Create(at, position, data, lengthData, mayCoalesce); currentAction++; actions[currentAction].Create(startAction); maxAction = currentAction; } void UndoHistory::BeginUndoAction() { EnsureUndoRoom(); if (undoSequenceDepth == 0) { if (actions[currentAction].at != startAction) { currentAction++; actions[currentAction].Create(startAction); maxAction = currentAction; } actions[currentAction].mayCoalesce = false; } undoSequenceDepth++; } void UndoHistory::EndUndoAction() { PLATFORM_ASSERT(undoSequenceDepth > 0); EnsureUndoRoom(); undoSequenceDepth--; if (0 == undoSequenceDepth) { if (actions[currentAction].at != startAction) { currentAction++; actions[currentAction].Create(startAction); maxAction = currentAction; } actions[currentAction].mayCoalesce = false; } } void UndoHistory::DropUndoSequence() { undoSequenceDepth = 0; } void UndoHistory::DeleteUndoHistory() { for (int i = 1; i < maxAction; i++) actions[i].Destroy(); maxAction = 0; currentAction = 0; actions[currentAction].Create(startAction); savePoint = 0; } void UndoHistory::SetSavePoint() { savePoint = currentAction; } bool UndoHistory::IsSavePoint() const { return savePoint == currentAction; } bool UndoHistory::CanUndo() const { return (currentAction > 0) && (maxAction > 0); } int UndoHistory::StartUndo() { // Drop any trailing startAction if (actions[currentAction].at == startAction && currentAction > 0) currentAction--; // Count the steps in this action int act = currentAction; while (actions[act].at != startAction && act > 0) { act--; } return currentAction - act; } const Action &UndoHistory::GetUndoStep() const { return actions[currentAction]; } void UndoHistory::CompletedUndoStep() { currentAction--; } bool UndoHistory::CanRedo() const { return maxAction > currentAction; } int UndoHistory::StartRedo() { // Drop any leading startAction if (actions[currentAction].at == startAction && currentAction < maxAction) currentAction++; // Count the steps in this action int act = currentAction; while (actions[act].at != startAction && act < maxAction) { act++; } return act - currentAction; } const Action &UndoHistory::GetRedoStep() const { return actions[currentAction]; } void UndoHistory::CompletedRedoStep() { currentAction++; } CellBuffer::CellBuffer() { readOnly = false; collectingUndo = true; } CellBuffer::~CellBuffer() { } char CellBuffer::CharAt(int position) const { return substance.ValueAt(position); } void CellBuffer::GetCharRange(char *buffer, int position, int lengthRetrieve) const { if (lengthRetrieve < 0) return; if (position < 0) return; if ((position + lengthRetrieve) > substance.Length()) { Platform::DebugPrintf("Bad GetCharRange %d for %d of %d\n", position, lengthRetrieve, substance.Length()); return; } substance.GetRange(buffer, position, lengthRetrieve); } char CellBuffer::StyleAt(int position) const { return style.ValueAt(position); } void CellBuffer::GetStyleRange(unsigned char *buffer, int position, int lengthRetrieve) const { if (lengthRetrieve < 0) return; if (position < 0) return; if ((position + lengthRetrieve) > style.Length()) { Platform::DebugPrintf("Bad GetStyleRange %d for %d of %d\n", position, lengthRetrieve, style.Length()); return; } style.GetRange(reinterpret_cast(buffer), position, lengthRetrieve); } const char *CellBuffer::BufferPointer() { return substance.BufferPointer(); } // The char* returned is to an allocation owned by the undo history const char *CellBuffer::InsertString(int position, const char *s, int insertLength, bool &startSequence) { char *data = 0; // InsertString and DeleteChars are the bottleneck though which all changes occur if (!readOnly) { if (collectingUndo) { // Save into the undo/redo stack, but only the characters - not the formatting // This takes up about half load time data = new char[insertLength]; for (int i = 0; i < insertLength; i++) { data[i] = s[i]; } uh.AppendAction(insertAction, position, data, insertLength, startSequence); } BasicInsertString(position, s, insertLength); } return data; } bool CellBuffer::SetStyleAt(int position, char styleValue, char mask) { styleValue &= mask; char curVal = style.ValueAt(position); if ((curVal & mask) != styleValue) { style.SetValueAt(position, static_cast((curVal & ~mask) | styleValue)); return true; } else { return false; } } bool CellBuffer::SetStyleFor(int position, int lengthStyle, char styleValue, char mask) { bool changed = false; PLATFORM_ASSERT(lengthStyle == 0 || (lengthStyle > 0 && lengthStyle + position <= style.Length())); while (lengthStyle--) { char curVal = style.ValueAt(position); if ((curVal & mask) != styleValue) { style.SetValueAt(position, static_cast((curVal & ~mask) | styleValue)); changed = true; } position++; } return changed; } // The char* returned is to an allocation owned by the undo history const char *CellBuffer::DeleteChars(int position, int deleteLength, bool &startSequence) { // InsertString and DeleteChars are the bottleneck though which all changes occur PLATFORM_ASSERT(deleteLength > 0); char *data = 0; if (!readOnly) { if (collectingUndo) { // Save into the undo/redo stack, but only the characters - not the formatting data = new char[deleteLength]; for (int i = 0; i < deleteLength; i++) { data[i] = substance.ValueAt(position + i); } uh.AppendAction(removeAction, position, data, deleteLength, startSequence); } BasicDeleteChars(position, deleteLength); } return data; } int CellBuffer::Length() const { return substance.Length(); } void CellBuffer::Allocate(int newSize) { substance.ReAllocate(newSize); style.ReAllocate(newSize); } void CellBuffer::SetPerLine(PerLine *pl) { lv.SetPerLine(pl); } int CellBuffer::Lines() const { return lv.Lines(); } int CellBuffer::LineStart(int line) const { if (line < 0) return 0; else if (line >= Lines()) return Length(); else return lv.LineStart(line); } bool CellBuffer::IsReadOnly() const { return readOnly; } void CellBuffer::SetReadOnly(bool set) { readOnly = set; } void CellBuffer::SetSavePoint() { uh.SetSavePoint(); } bool CellBuffer::IsSavePoint() { return uh.IsSavePoint(); } // Without undo void CellBuffer::InsertLine(int line, int position, bool lineStart) { lv.InsertLine(line, position, lineStart); } void CellBuffer::RemoveLine(int line) { lv.RemoveLine(line); } void CellBuffer::BasicInsertString(int position, const char *s, int insertLength) { if (insertLength == 0) return; PLATFORM_ASSERT(insertLength > 0); substance.InsertFromArray(position, s, 0, insertLength); style.InsertValue(position, insertLength, 0); int lineInsert = lv.LineFromPosition(position) + 1; bool atLineStart = lv.LineStart(lineInsert-1) == position; // Point all the lines after the insertion point further along in the buffer lv.InsertText(lineInsert-1, insertLength); char chPrev = substance.ValueAt(position - 1); char chAfter = substance.ValueAt(position + insertLength); if (chPrev == '\r' && chAfter == '\n') { // Splitting up a crlf pair at position InsertLine(lineInsert, position, false); lineInsert++; } char ch = ' '; for (int i = 0; i < insertLength; i++) { ch = s[i]; if (ch == '\r') { InsertLine(lineInsert, (position + i) + 1, atLineStart); lineInsert++; } else if (ch == '\n') { if (chPrev == '\r') { // Patch up what was end of line lv.SetLineStart(lineInsert - 1, (position + i) + 1); } else { InsertLine(lineInsert, (position + i) + 1, atLineStart); lineInsert++; } } chPrev = ch; } // Joining two lines where last insertion is cr and following substance starts with lf if (chAfter == '\n') { if (ch == '\r') { // End of line already in buffer so drop the newly created one RemoveLine(lineInsert - 1); } } } void CellBuffer::BasicDeleteChars(int position, int deleteLength) { if (deleteLength == 0) return; if ((position == 0) && (deleteLength == substance.Length())) { // If whole buffer is being deleted, faster to reinitialise lines data // than to delete each line. lv.Init(); } else { // Have to fix up line positions before doing deletion as looking at text in buffer // to work out which lines have been removed int lineRemove = lv.LineFromPosition(position) + 1; lv.InsertText(lineRemove-1, - (deleteLength)); char chPrev = substance.ValueAt(position - 1); char chBefore = chPrev; char chNext = substance.ValueAt(position); bool ignoreNL = false; if (chPrev == '\r' && chNext == '\n') { // Move back one lv.SetLineStart(lineRemove, position); lineRemove++; ignoreNL = true; // First \n is not real deletion } char ch = chNext; for (int i = 0; i < deleteLength; i++) { chNext = substance.ValueAt(position + i + 1); if (ch == '\r') { if (chNext != '\n') { RemoveLine(lineRemove); } } else if (ch == '\n') { if (ignoreNL) { ignoreNL = false; // Further \n are real deletions } else { RemoveLine(lineRemove); } } ch = chNext; } // May have to fix up end if last deletion causes cr to be next to lf // or removes one of a crlf pair char chAfter = substance.ValueAt(position + deleteLength); if (chBefore == '\r' && chAfter == '\n') { // Using lineRemove-1 as cr ended line before start of deletion RemoveLine(lineRemove - 1); lv.SetLineStart(lineRemove - 1, position + 1); } } substance.DeleteRange(position, deleteLength); style.DeleteRange(position, deleteLength); } bool CellBuffer::SetUndoCollection(bool collectUndo) { collectingUndo = collectUndo; uh.DropUndoSequence(); return collectingUndo; } bool CellBuffer::IsCollectingUndo() const { return collectingUndo; } void CellBuffer::BeginUndoAction() { uh.BeginUndoAction(); } void CellBuffer::EndUndoAction() { uh.EndUndoAction(); } void CellBuffer::AddUndoAction(int token, bool mayCoalesce) { bool startSequence; uh.AppendAction(containerAction, token, 0, 0, startSequence, mayCoalesce); } void CellBuffer::DeleteUndoHistory() { uh.DeleteUndoHistory(); } bool CellBuffer::CanUndo() { return uh.CanUndo(); } int CellBuffer::StartUndo() { return uh.StartUndo(); } const Action &CellBuffer::GetUndoStep() const { return uh.GetUndoStep(); } void CellBuffer::PerformUndoStep() { const Action &actionStep = uh.GetUndoStep(); if (actionStep.at == insertAction) { BasicDeleteChars(actionStep.position, actionStep.lenData); } else if (actionStep.at == removeAction) { BasicInsertString(actionStep.position, actionStep.data, actionStep.lenData); } uh.CompletedUndoStep(); } bool CellBuffer::CanRedo() { return uh.CanRedo(); } int CellBuffer::StartRedo() { return uh.StartRedo(); } const Action &CellBuffer::GetRedoStep() const { return uh.GetRedoStep(); } void CellBuffer::PerformRedoStep() { const Action &actionStep = uh.GetRedoStep(); if (actionStep.at == insertAction) { BasicInsertString(actionStep.position, actionStep.data, actionStep.lenData); } else if (actionStep.at == removeAction) { BasicDeleteChars(actionStep.position, actionStep.lenData); } uh.CompletedRedoStep(); } Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexTACL.cxx000444001750001750 2640711727344243 24346 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexTAL.cxx ** Lexer for TAL ** Based on LexPascal.cxx ** Written by Laurent le Tynevez ** Updated by Simon Steele September 2002 ** Updated by Mathias Rauen May 2003 (Delphi adjustments) ** Updated by Rod Falck, Aug 2006 Converted to TACL **/ #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif inline bool isTACLoperator(char ch) { return ch == '\'' || isoperator(ch); } inline bool isTACLwordchar(char ch) { return ch == '#' || ch == '^' || ch == '|' || ch == '_' || iswordchar(ch); } inline bool isTACLwordstart(char ch) { return ch == '#' || ch == '|' || ch == '_' || iswordstart(ch); } static void getRange(unsigned int start, unsigned int end, Accessor &styler, char *s, unsigned int len) { unsigned int i = 0; while ((i < end - start + 1) && (i < len-1)) { s[i] = static_cast(tolower(styler[start + i])); i++; } s[i] = '\0'; } static bool IsStreamCommentStyle(int style) { return style == SCE_C_COMMENT || style == SCE_C_COMMENTDOC || style == SCE_C_COMMENTDOCKEYWORD || style == SCE_C_COMMENTDOCKEYWORDERROR; } static void ColourTo(Accessor &styler, unsigned int end, unsigned int attr, bool bInAsm) { if ((bInAsm) && (attr == SCE_C_OPERATOR || attr == SCE_C_NUMBER || attr == SCE_C_DEFAULT || attr == SCE_C_WORD || attr == SCE_C_IDENTIFIER)) { styler.ColourTo(end, SCE_C_REGEX); } else styler.ColourTo(end, attr); } // returns 1 if the item starts a class definition, and -1 if the word is "end", and 2 if the word is "asm" static int classifyWordTACL(unsigned int start, unsigned int end, /*WordList &keywords*/WordList *keywordlists[], Accessor &styler, bool bInAsm) { int ret = 0; WordList& keywords = *keywordlists[0]; WordList& builtins = *keywordlists[1]; WordList& commands = *keywordlists[2]; char s[100]; getRange(start, end, styler, s, sizeof(s)); char chAttr = SCE_C_IDENTIFIER; if (isdigit(s[0]) || (s[0] == '.')) { chAttr = SCE_C_NUMBER; } else { if (s[0] == '#' || keywords.InList(s)) { chAttr = SCE_C_WORD; if (strcmp(s, "asm") == 0) { ret = 2; } else if (strcmp(s, "end") == 0) { ret = -1; } } else if (s[0] == '|' || builtins.InList(s)) { chAttr = SCE_C_WORD2; } else if (commands.InList(s)) { chAttr = SCE_C_UUID; } else if (strcmp(s, "comment") == 0) { chAttr = SCE_C_COMMENTLINE; ret = 3; } } ColourTo(styler, end, chAttr, (bInAsm && ret != -1)); return ret; } static int classifyFoldPointTACL(const char* s) { int lev = 0; if (s[0] == '[') lev=1; else if (s[0] == ']') lev=-1; return lev; } static void ColouriseTACLDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { styler.StartAt(startPos); int state = initStyle; if (state == SCE_C_CHARACTER) // Does not leak onto next line state = SCE_C_DEFAULT; char chPrev = ' '; char chNext = styler[startPos]; unsigned int lengthDoc = startPos + length; bool bInClassDefinition; int currentLine = styler.GetLine(startPos); if (currentLine > 0) { styler.SetLineState(currentLine, styler.GetLineState(currentLine-1)); bInClassDefinition = (styler.GetLineState(currentLine) == 1); } else { styler.SetLineState(currentLine, 0); bInClassDefinition = false; } bool bInAsm = (state == SCE_C_REGEX); if (bInAsm) state = SCE_C_DEFAULT; styler.StartSegment(startPos); int visibleChars = 0; unsigned int i; for (i = startPos; i < lengthDoc; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); if ((ch == '\r' && chNext != '\n') || (ch == '\n')) { // Trigger on CR only (Mac style) or either on LF from CR+LF (Dos/Win) or on LF alone (Unix) // Avoid triggering two times on Dos/Win // End of line if (state == SCE_C_CHARACTER) { ColourTo(styler, i, state, bInAsm); state = SCE_C_DEFAULT; } visibleChars = 0; currentLine++; styler.SetLineState(currentLine, (bInClassDefinition ? 1 : 0)); } if (styler.IsLeadByte(ch)) { chNext = styler.SafeGetCharAt(i + 2); chPrev = ' '; i += 1; continue; } if (state == SCE_C_DEFAULT) { if (isTACLwordstart(ch)) { ColourTo(styler, i-1, state, bInAsm); state = SCE_C_IDENTIFIER; } else if (ch == '{') { ColourTo(styler, i-1, state, bInAsm); state = SCE_C_COMMENT; } else if (ch == '{' && chNext == '*') { ColourTo(styler, i-1, state, bInAsm); state = SCE_C_COMMENTDOC; } else if (ch == '=' && chNext == '=') { ColourTo(styler, i-1, state, bInAsm); state = SCE_C_COMMENTLINE; } else if (ch == '"') { ColourTo(styler, i-1, state, bInAsm); state = SCE_C_STRING; } else if (ch == '?' && visibleChars == 0) { ColourTo(styler, i-1, state, bInAsm); state = SCE_C_PREPROCESSOR; } else if (isTACLoperator(ch)) { ColourTo(styler, i-1, state, bInAsm); ColourTo(styler, i, SCE_C_OPERATOR, bInAsm); } } else if (state == SCE_C_IDENTIFIER) { if (!isTACLwordchar(ch)) { int lStateChange = classifyWordTACL(styler.GetStartSegment(), i - 1, keywordlists, styler, bInAsm); if(lStateChange == 1) { styler.SetLineState(currentLine, 1); bInClassDefinition = true; } else if(lStateChange == 2) { bInAsm = true; } else if(lStateChange == -1) { styler.SetLineState(currentLine, 0); bInClassDefinition = false; bInAsm = false; } if (lStateChange == 3) { state = SCE_C_COMMENTLINE; } else { state = SCE_C_DEFAULT; chNext = styler.SafeGetCharAt(i + 1); if (ch == '{') { state = SCE_C_COMMENT; } else if (ch == '{' && chNext == '*') { ColourTo(styler, i-1, state, bInAsm); state = SCE_C_COMMENTDOC; } else if (ch == '=' && chNext == '=') { state = SCE_C_COMMENTLINE; } else if (ch == '"') { state = SCE_C_STRING; } else if (isTACLoperator(ch)) { ColourTo(styler, i, SCE_C_OPERATOR, bInAsm); } } } } else { if (state == SCE_C_PREPROCESSOR) { if ((ch == '\r' || ch == '\n') && !(chPrev == '\\' || chPrev == '\r')) { ColourTo(styler, i-1, state, bInAsm); state = SCE_C_DEFAULT; } } else if (state == SCE_C_COMMENT) { if (ch == '}' || (ch == '\r' || ch == '\n') ) { ColourTo(styler, i, state, bInAsm); state = SCE_C_DEFAULT; } } else if (state == SCE_C_COMMENTDOC) { if (ch == '}' || (ch == '\r' || ch == '\n')) { if (((i > styler.GetStartSegment() + 2) || ( (initStyle == SCE_C_COMMENTDOC) && (styler.GetStartSegment() == static_cast(startPos))))) { ColourTo(styler, i, state, bInAsm); state = SCE_C_DEFAULT; } } } else if (state == SCE_C_COMMENTLINE) { if (ch == '\r' || ch == '\n') { ColourTo(styler, i-1, state, bInAsm); state = SCE_C_DEFAULT; } } else if (state == SCE_C_STRING) { if (ch == '"' || ch == '\r' || ch == '\n') { ColourTo(styler, i, state, bInAsm); state = SCE_C_DEFAULT; } } } if (!isspacechar(ch)) visibleChars++; chPrev = ch; } // Process to end of document if (state == SCE_C_IDENTIFIER) { classifyWordTACL(styler.GetStartSegment(), i - 1, keywordlists, styler, bInAsm); } else ColourTo(styler, lengthDoc - 1, state, bInAsm); } static void FoldTACLDoc(unsigned int startPos, int length, int initStyle, WordList *[], Accessor &styler) { bool foldComment = styler.GetPropertyInt("fold.comment") != 0; bool foldPreprocessor = styler.GetPropertyInt("fold.preprocessor") != 0; bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; unsigned int endPos = startPos + length; int visibleChars = 0; int lineCurrent = styler.GetLine(startPos); int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; int levelCurrent = levelPrev; char chNext = styler[startPos]; int styleNext = styler.StyleAt(startPos); int style = initStyle; bool section = false; int lastStart = 0; for (unsigned int i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); int stylePrev = style; style = styleNext; styleNext = styler.StyleAt(i + 1); bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); if (stylePrev == SCE_C_DEFAULT && (style == SCE_C_WORD || style == SCE_C_PREPROCESSOR)) { // Store last word start point. lastStart = i; } if (stylePrev == SCE_C_WORD || stylePrev == SCE_C_PREPROCESSOR) { if(isTACLwordchar(ch) && !isTACLwordchar(chNext)) { char s[100]; getRange(lastStart, i, styler, s, sizeof(s)); if (stylePrev == SCE_C_PREPROCESSOR && strcmp(s, "?section") == 0) { section = true; levelCurrent = 1; levelPrev = 0; } else if (stylePrev == SCE_C_WORD) levelCurrent += classifyFoldPointTACL(s); } } if (style == SCE_C_OPERATOR) { if (ch == '[') { levelCurrent++; } else if (ch == ']') { levelCurrent--; } } if (foldComment && (style == SCE_C_COMMENTLINE)) { if ((ch == '/') && (chNext == '/')) { char chNext2 = styler.SafeGetCharAt(i + 2); if (chNext2 == '{') { levelCurrent++; } else if (chNext2 == '}') { levelCurrent--; } } } if (foldPreprocessor && (style == SCE_C_PREPROCESSOR)) { if (ch == '{' && chNext == '$') { unsigned int j=i+2; // skip {$ while ((j levelPrev || section) && (visibleChars > 0)) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) { styler.SetLevel(lineCurrent, lev); } lineCurrent++; levelPrev = levelCurrent; visibleChars = 0; section = false; } if (!isspacechar(ch)) visibleChars++; } // Fill in the real level of the next line, keeping the current flags as they will be filled in later int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; styler.SetLevel(lineCurrent, levelPrev | flagsNext); } static const char * const TACLWordListDesc[] = { "Builtins", "Labels", "Commands", 0 }; LexerModule lmTACL(SCLEX_TACL, ColouriseTACLDoc, "TACL", FoldTACLDoc, TACLWordListDesc); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexA68k.cxx000444001750001750 2714411727344243 24333 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexA68k.cxx ** Lexer for Assembler, just for the MASM syntax ** Written by Martial Demolins AKA Folco **/ // Copyright 2010 Martial Demolins // The License.txt file describes the conditions under which this software // may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif // Return values for GetOperatorType #define NO_OPERATOR 0 #define OPERATOR_1CHAR 1 #define OPERATOR_2CHAR 2 /** * IsIdentifierStart * * Return true if the given char is a valid identifier first char */ static inline bool IsIdentifierStart (const int ch) { return (isalpha(ch) || (ch == '_') || (ch == '\\')); } /** * IsIdentifierChar * * Return true if the given char is a valid identifier char */ static inline bool IsIdentifierChar (const int ch) { return (isalnum(ch) || (ch == '_') || (ch == '@') || (ch == ':') || (ch == '.')); } /** * GetOperatorType * * Return: * NO_OPERATOR if char is not an operator * OPERATOR_1CHAR if the operator is one char long * OPERATOR_2CHAR if the operator is two chars long */ static inline int GetOperatorType (const int ch1, const int ch2) { int OpType = NO_OPERATOR; if ((ch1 == '+') || (ch1 == '-') || (ch1 == '*') || (ch1 == '/') || (ch1 == '#') || (ch1 == '(') || (ch1 == ')') || (ch1 == '~') || (ch1 == '&') || (ch1 == '|') || (ch1 == ',')) OpType = OPERATOR_1CHAR; else if ((ch1 == ch2) && (ch1 == '<' || ch1 == '>')) OpType = OPERATOR_2CHAR; return OpType; } /** * IsBin * * Return true if the given char is 0 or 1 */ static inline bool IsBin (const int ch) { return (ch == '0') || (ch == '1'); } /** * IsDoxygenChar * * Return true if the char may be part of a Doxygen keyword */ static inline bool IsDoxygenChar (const int ch) { return isalpha(ch) || (ch == '$') || (ch == '[') || (ch == ']') || (ch == '{') || (ch == '}'); } /** * ColouriseA68kDoc * * Main function, which colourises a 68k source */ static void ColouriseA68kDoc (unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { // Get references to keywords lists WordList &cpuInstruction = *keywordlists[0]; WordList ®isters = *keywordlists[1]; WordList &directive = *keywordlists[2]; WordList &extInstruction = *keywordlists[3]; WordList &commentSpecial = *keywordlists[4]; WordList &doxygenKeyword = *keywordlists[5]; // Instanciate a context for our source StyleContext sc(startPos, length, initStyle, styler); /************************************************************ * * Parse the text * ************************************************************/ for ( ; sc.More(); sc.Forward()) { char Buffer[100]; int OpType; // Reset style at beginning of line if (sc.atLineStart) sc.SetState(SCE_A68K_DEFAULT); /************************************************************ * * Handle current state if we are not in the "default style" * ************************************************************/ if (sc.state != SCE_A68K_DEFAULT) { // Check if current style continue. // If this case, we loop because there is nothing else to do if (((sc.state == SCE_A68K_NUMBER_DEC) && isdigit(sc.ch)) // Decimal number || ((sc.state == SCE_A68K_NUMBER_BIN) && IsBin(sc.ch)) // Binary number || ((sc.state == SCE_A68K_NUMBER_HEX) && isxdigit(sc.ch)) // Hexa number || ((sc.state == SCE_A68K_MACRO_ARG) && isdigit(sc.ch)) // Arg of macro || ((sc.state == SCE_A68K_STRING1) && (sc.ch != '\'')) // String single-quoted || ((sc.state == SCE_A68K_STRING2) && (sc.ch != '\"')) // String double-quoted || ((sc.state == SCE_A68K_MACRO_ARG) && isdigit(sc.ch)) // Macro argument // Label. ' ' and '\t' are needed to handle macro declarations || ((sc.state == SCE_A68K_LABEL) && (sc.ch != ':') && (sc.ch != ' ') && (sc.ch != '\t')) || ((sc.state == SCE_A68K_IDENTIFIER) && (sc.ch < 0x80) && IsIdentifierChar(sc.ch)) // Identifier || ((sc.state == SCE_A68K_COMMENT_DOXYGEN) && (sc.ch < 0x80) && IsDoxygenChar(sc.ch)) // Doxygen keyword || ((sc.state == SCE_A68K_COMMENT_WORD) && (sc.ch < 0x80) && isalpha(sc.ch))) // Comment current word { continue; } // Check if some states terminate at the current char: // we must include this char in the current style context else if (((sc.state == SCE_A68K_STRING1) && (sc.ch < 0x80) && (sc.ch == '\'')) // String single-quoted || ((sc.state == SCE_A68K_STRING2) && (sc.ch < 0x80) && (sc.ch == '\"')) // String double-quoted || ((sc.state == SCE_A68K_LABEL) && (sc.ch < 0x80) && (sc.ch == ':'))) // Label { sc.ForwardSetState(SCE_A68K_DEFAULT); } // Check for special words or Doxygen keywords in comments else if (sc.state == SCE_A68K_COMMENT) { if (sc.ch == '\\') { sc.SetState(SCE_A68K_COMMENT_DOXYGEN); } else if ((sc.ch < 0x80) && isalpha(sc.ch)) { sc.SetState(SCE_A68K_COMMENT_WORD); } continue; } // Check for special words in comment else if ((sc.state == SCE_A68K_COMMENT_WORD) && (sc.ch < 0x80) && !isalpha(sc.ch)) { sc.GetCurrent(Buffer, sizeof(Buffer)); if (commentSpecial.InList(Buffer)) { sc.ChangeState(SCE_A68K_COMMENT_SPECIAL); } else { sc.ChangeState(SCE_A68K_COMMENT); } sc.SetState(SCE_A68K_COMMENT); continue; } // Check for Doxygen keywords else if ((sc.state == SCE_A68K_COMMENT_DOXYGEN) && (sc.ch < 0x80) && !IsDoxygenChar(sc.ch)) { sc.GetCurrentLowered(Buffer, sizeof(Buffer)); // Buffer the string of the current context if (!doxygenKeyword.InList(Buffer)) { sc.ChangeState(SCE_A68K_COMMENT); } sc.SetState(SCE_A68K_COMMENT); continue; } // Check if we are in the case of a label which terminates without ':' // It should be a macro declaration, not a label else if ((sc.state == SCE_A68K_LABEL) && (sc.ch < 0x80) && ((sc.ch == ' ') || (sc.ch == '\t'))) { sc.ChangeState(SCE_A68K_MACRO_DECLARATION); } // Check if we are at the end of an identifier // In this case, colourise it if was a keyword. else if ((sc.state == SCE_A68K_IDENTIFIER) && !IsIdentifierChar(sc.ch)) { sc.GetCurrentLowered(Buffer, sizeof(Buffer)); // Buffer the string of the current context if (cpuInstruction.InList(Buffer)) { // And check if it belongs to a keyword list sc.ChangeState(SCE_A68K_CPUINSTRUCTION); } else if (extInstruction.InList(Buffer)) { sc.ChangeState(SCE_A68K_EXTINSTRUCTION); } else if (registers.InList(Buffer)) { sc.ChangeState(SCE_A68K_REGISTER); } else if (directive.InList(Buffer)) { sc.ChangeState(SCE_A68K_DIRECTIVE); } } // All special contexts are now handled.Come back to default style sc.SetState(SCE_A68K_DEFAULT); } /************************************************************ * * Check if we must enter a new state * ************************************************************/ // Label and macro identifiers start at the beginning of a line // We set both as a label, but if it wasn't one (no ':' at the end), // it will be changed as a macro identifier. if (sc.atLineStart && (sc.ch < 0x80) && IsIdentifierStart(sc.ch)) { sc.SetState(SCE_A68K_LABEL); } else if ((sc.ch < 0x80) && (sc.ch == ';')) { // Comment sc.SetState(SCE_A68K_COMMENT); } else if ((sc.ch < 0x80) && isdigit(sc.ch)) { // Decimal numbers haven't prefix sc.SetState(SCE_A68K_NUMBER_DEC); } else if ((sc.ch < 0x80) && (sc.ch == '%')) { // Binary numbers are prefixed with '%' sc.SetState(SCE_A68K_NUMBER_BIN); } else if ((sc.ch < 0x80) && (sc.ch == '$')) { // Hexadecimal numbers are prefixed with '$' sc.SetState(SCE_A68K_NUMBER_HEX); } else if ((sc.ch < 0x80) && (sc.ch == '\'')) { // String (single-quoted) sc.SetState(SCE_A68K_STRING1); } else if ((sc.ch < 0x80) && (sc.ch == '\"')) { // String (double-quoted) sc.SetState(SCE_A68K_STRING2); } else if ((sc.ch < 0x80) && (sc.ch == '\\') && (isdigit(sc.chNext))) { // Replacement symbols in macro sc.SetState(SCE_A68K_MACRO_ARG); } else if ((sc.ch < 0x80) && IsIdentifierStart(sc.ch)) { // An identifier: constant, label, etc... sc.SetState(SCE_A68K_IDENTIFIER); } else { if (sc.ch < 0x80) { OpType = GetOperatorType(sc.ch, sc.chNext); // Check if current char is an operator if (OpType != NO_OPERATOR) { sc.SetState(SCE_A68K_OPERATOR); if (OpType == OPERATOR_2CHAR) { // Check if the operator is 2 bytes long sc.ForwardSetState(SCE_A68K_OPERATOR); // (>> or <<) } } } } } // End of for() sc.Complete(); } // Names of the keyword lists static const char * const a68kWordListDesc[] = { "CPU instructions", "Registers", "Directives", "Extended instructions", "Comment special words", "Doxygen keywords", 0 }; LexerModule lmA68k(SCLEX_A68K, ColouriseA68kDoc, "a68k", 0, a68kWordListDesc); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexPB.cxx000444001750001750 3116211727344243 24116 0ustar00azawawiazawawi000000000000// Scintilla source code edit control // @file LexPB.cxx // Lexer for PowerBasic by Roland Walter, roland@rowalt.de (for PowerBasic see www.powerbasic.com) // // Changes: // 17.10.2003: Toggling of subs/functions now until next sub/function - this gives better results // 29.10.2003: 1. Bug: Toggling didn't work for subs/functions added in editor // 2. Own colors for PB constants and Inline Assembler SCE_B_CONSTANT and SCE_B_ASM // 3. Several smaller syntax coloring improvements and speed optimizations // 12.07.2004: 1. Toggling for macros added // 2. Further folding speed optimitations (for people dealing with very large listings) // // Necessary changes for the PB lexer in Scintilla project: // - In SciLexer.h and Scintilla.iface: // // #define SCLEX_POWERBASIC 51 //ID for PowerBasic lexer // (...) // #define SCE_B_DEFAULT 0 //in both VB and PB lexer // #define SCE_B_COMMENT 1 //in both VB and PB lexer // #define SCE_B_NUMBER 2 //in both VB and PB lexer // #define SCE_B_KEYWORD 3 //in both VB and PB lexer // #define SCE_B_STRING 4 //in both VB and PB lexer // #define SCE_B_PREPROCESSOR 5 //VB lexer only, not in PB lexer // #define SCE_B_OPERATOR 6 //in both VB and PB lexer // #define SCE_B_IDENTIFIER 7 //in both VB and PB lexer // #define SCE_B_DATE 8 //VB lexer only, not in PB lexer // #define SCE_B_CONSTANT 13 //PB lexer only, not in VB lexer // #define SCE_B_ASM 14 //PB lexer only, not in VB lexer // - Statement added to KeyWords.cxx: 'LINK_LEXER(lmPB);' // - Statement added to scintilla_vc6.mak: '$(DIR_O)\LexPB.obj: ...\src\LexPB.cxx $(LEX_HEADERS)' // // Copyright for Scintilla: 1998-2001 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static inline bool IsTypeCharacter(const int ch) { return ch == '%' || ch == '&' || ch == '@' || ch == '!' || ch == '#' || ch == '$' || ch == '?'; } static inline bool IsAWordChar(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_'); } static inline bool IsAWordStart(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '_'); } bool MatchUpperCase(Accessor &styler, int pos, const char *s) //Same as styler.Match() but uppercase comparison (a-z,A-Z and space only) { char ch; for (int i=0; *s; i++) { ch=styler.SafeGetCharAt(pos+i); if (ch > 0x60) ch -= '\x20'; if (*s != ch) return false; s++; } return true; } static void ColourisePBDoc(unsigned int startPos, int length, int initStyle,WordList *keywordlists[],Accessor &styler) { WordList &keywords = *keywordlists[0]; styler.StartAt(startPos); StyleContext sc(startPos, length, initStyle, styler); for (; sc.More(); sc.Forward()) { switch (sc.state) { case SCE_B_OPERATOR: { sc.SetState(SCE_B_DEFAULT); break; } case SCE_B_KEYWORD: { if (!IsAWordChar(sc.ch)) { if (!IsTypeCharacter(sc.ch)) { char s[100]; sc.GetCurrentLowered(s, sizeof(s)); if (keywords.InList(s)) { if (strcmp(s, "rem") == 0) { sc.ChangeState(SCE_B_COMMENT); if (sc.atLineEnd) {sc.SetState(SCE_B_DEFAULT);} } else if (strcmp(s, "asm") == 0) { sc.ChangeState(SCE_B_ASM); if (sc.atLineEnd) {sc.SetState(SCE_B_DEFAULT);} } else { sc.SetState(SCE_B_DEFAULT); } } else { sc.ChangeState(SCE_B_IDENTIFIER); sc.SetState(SCE_B_DEFAULT); } } } break; } case SCE_B_NUMBER: { if (!IsAWordChar(sc.ch)) {sc.SetState(SCE_B_DEFAULT);} break; } case SCE_B_STRING: { if (sc.ch == '\"'){sc.ForwardSetState(SCE_B_DEFAULT);} break; } case SCE_B_CONSTANT: { if (!IsAWordChar(sc.ch)) {sc.SetState(SCE_B_DEFAULT);} break; } case SCE_B_COMMENT: { if (sc.atLineEnd) {sc.SetState(SCE_B_DEFAULT);} break; } case SCE_B_ASM: { if (sc.atLineEnd) {sc.SetState(SCE_B_DEFAULT);} break; } } //switch (sc.state) // Determine if a new state should be entered: if (sc.state == SCE_B_DEFAULT) { if (sc.ch == '\'') {sc.SetState(SCE_B_COMMENT);} else if (sc.ch == '\"') {sc.SetState(SCE_B_STRING);} else if (sc.ch == '&' && tolower(sc.chNext) == 'h') {sc.SetState(SCE_B_NUMBER);} else if (sc.ch == '&' && tolower(sc.chNext) == 'b') {sc.SetState(SCE_B_NUMBER);} else if (sc.ch == '&' && tolower(sc.chNext) == 'o') {sc.SetState(SCE_B_NUMBER);} else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {sc.SetState(SCE_B_NUMBER);} else if (IsAWordStart(sc.ch)) {sc.SetState(SCE_B_KEYWORD);} else if (sc.ch == '%') {sc.SetState(SCE_B_CONSTANT);} else if (sc.ch == '$') {sc.SetState(SCE_B_CONSTANT);} else if (sc.ch == '#') {sc.SetState(SCE_B_KEYWORD);} else if (sc.ch == '!') {sc.SetState(SCE_B_ASM);} else if (isoperator(static_cast(sc.ch)) || (sc.ch == '\\')) {sc.SetState(SCE_B_OPERATOR);} } } //for (; sc.More(); sc.Forward()) sc.Complete(); } //The folding routine for PowerBasic toggles SUBs and FUNCTIONs only. This was exactly what I wanted, //nothing more. I had worked with this kind of toggling for several years when I used the great good old //GFA Basic which is dead now. After testing the feature of toggling FOR-NEXT loops, WHILE-WEND loops //and so on too I found this is more disturbing then helping (for me). So if You think in another way //you can (or must) write Your own toggling routine ;-) static void FoldPBDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) { // No folding enabled, no reason to continue... if( styler.GetPropertyInt("fold") == 0 ) return; unsigned int endPos = startPos + length; int lineCurrent = styler.GetLine(startPos); int levelCurrent = SC_FOLDLEVELBASE; if (lineCurrent > 0) levelCurrent = styler.LevelAt(lineCurrent-1) >> 16; int levelNext = levelCurrent; char chNext = styler[startPos]; bool fNewLine=true; bool fMightBeMultiLineMacro=false; bool fBeginOfCommentFound=false; for (unsigned int i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); if (fNewLine) //Begin of a new line (The Sub/Function/Macro keywords may occur at begin of line only) { fNewLine=false; fBeginOfCommentFound=false; switch (ch) { case ' ': //Most lines start with space - so check this first, the code is the same as for 'default:' case '\t': //Handle tab too { int levelUse = levelCurrent; int lev = levelUse | levelNext << 16; styler.SetLevel(lineCurrent, lev); break; } case 'F': case 'f': { switch (chNext) { case 'U': case 'u': { if( MatchUpperCase(styler,i,"FUNCTION") ) { styler.SetLevel(lineCurrent, (SC_FOLDLEVELBASE << 16) | SC_FOLDLEVELHEADERFLAG); levelNext=SC_FOLDLEVELBASE+1; } break; } } break; } case 'S': case 's': { switch (chNext) { case 'U': case 'u': { if( MatchUpperCase(styler,i,"SUB") ) { styler.SetLevel(lineCurrent, (SC_FOLDLEVELBASE << 16) | SC_FOLDLEVELHEADERFLAG); levelNext=SC_FOLDLEVELBASE+1; } break; } case 'T': case 't': { if( MatchUpperCase(styler,i,"STATIC FUNCTION") ) { styler.SetLevel(lineCurrent, (SC_FOLDLEVELBASE << 16) | SC_FOLDLEVELHEADERFLAG); levelNext=SC_FOLDLEVELBASE+1; } else if( MatchUpperCase(styler,i,"STATIC SUB") ) { styler.SetLevel(lineCurrent, (SC_FOLDLEVELBASE << 16) | SC_FOLDLEVELHEADERFLAG); levelNext=SC_FOLDLEVELBASE+1; } break; } } break; } case 'C': case 'c': { switch (chNext) { case 'A': case 'a': { if( MatchUpperCase(styler,i,"CALLBACK FUNCTION") ) { styler.SetLevel(lineCurrent, (SC_FOLDLEVELBASE << 16) | SC_FOLDLEVELHEADERFLAG); levelNext=SC_FOLDLEVELBASE+1; } break; } } break; } case 'M': case 'm': { switch (chNext) { case 'A': case 'a': { if( MatchUpperCase(styler,i,"MACRO") ) { fMightBeMultiLineMacro=true; //Set folder level at end of line, we have to check for single line macro } break; } } break; } default: { int levelUse = levelCurrent; int lev = levelUse | levelNext << 16; styler.SetLevel(lineCurrent, lev); break; } } //switch (ch) } //if( fNewLine ) switch (ch) { case '=': //To test single line macros { if (fBeginOfCommentFound==false) fMightBeMultiLineMacro=false; //The found macro is a single line macro only; break; } case '\'': //A comment starts { fBeginOfCommentFound=true; break; } case '\n': { if (fMightBeMultiLineMacro) //The current line is the begin of a multi line macro { fMightBeMultiLineMacro=false; styler.SetLevel(lineCurrent, (SC_FOLDLEVELBASE << 16) | SC_FOLDLEVELHEADERFLAG); levelNext=SC_FOLDLEVELBASE+1; } lineCurrent++; levelCurrent = levelNext; fNewLine=true; break; } case '\r': { if (chNext != '\n') { lineCurrent++; levelCurrent = levelNext; fNewLine=true; } break; } } //switch (ch) } //for (unsigned int i = startPos; i < endPos; i++) } static const char * const pbWordListDesc[] = { "Keywords", 0 }; LexerModule lmPB(SCLEX_POWERBASIC, ColourisePBDoc, "powerbasic", FoldPBDoc, pbWordListDesc); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexerSimple.h000444001750001750 150711727344242 25001 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexerSimple.h ** A simple lexer with no state. **/ // Copyright 1998-2010 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #ifndef LEXERSIMPLE_H #define LEXERSIMPLE_H #ifdef SCI_NAMESPACE namespace Scintilla { #endif // A simple lexer with no state class LexerSimple : public LexerBase { const LexerModule *module; std::string wordLists; public: LexerSimple(const LexerModule *module_); const char * SCI_METHOD DescribeWordListSets(); void SCI_METHOD Lex(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess); void SCI_METHOD Fold(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess); }; #ifdef SCI_NAMESPACE } #endif #endif Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/ViewStyle.cxx000444001750001750 3257611727344243 25111 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file ViewStyle.cxx ** Store information on how the document is to be viewed. **/ // Copyright 1998-2003 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include "Platform.h" #include "Scintilla.h" #include "SplitVector.h" #include "Partitioning.h" #include "RunStyles.h" #include "Indicator.h" #include "XPM.h" #include "LineMarker.h" #include "Style.h" #include "ViewStyle.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif MarginStyle::MarginStyle() : style(SC_MARGIN_SYMBOL), width(0), mask(0), sensitive(false), cursor(SC_CURSORREVERSEARROW) { } // A list of the fontnames - avoids wasting space in each style FontNames::FontNames() { size = 8; names = new char *[size]; max = 0; } FontNames::~FontNames() { Clear(); delete []names; names = 0; } void FontNames::Clear() { for (int i=0; i= size) { // Grow array int sizeNew = size * 2; char **namesNew = new char *[sizeNew]; for (int j=0; jRealise(surface, zoomLevel, technology); } } FontRealised *FontRealised::Find(const FontSpecification &fs) { if (!fs.fontName) return this; FontRealised *fr = this; while (fr) { if (fr->EqualTo(fs)) return fr; fr = fr->frNext; } return 0; } void FontRealised::FindMaxAscentDescent(unsigned int &maxAscent, unsigned int &maxDescent) { FontRealised *fr = this; while (fr) { if (maxAscent < fr->ascent) maxAscent = fr->ascent; if (maxDescent < fr->descent) maxDescent = fr->descent; fr = fr->frNext; } } ViewStyle::ViewStyle() { Init(); } ViewStyle::ViewStyle(const ViewStyle &source) { frFirst = NULL; Init(source.stylesSize); for (unsigned int sty=0; sty 0) maskInLine &= ~ms[margin].mask; } zoomLevel = 0; viewWhitespace = wsInvisible; whitespaceSize = 1; viewIndentationGuides = ivNone; viewEOL = false; showMarkedLines = true; extraFontFlag = 0; extraAscent = 0; extraDescent = 0; marginStyleOffset = 0; annotationVisible = ANNOTATION_HIDDEN; annotationStyleOffset = 0; braceHighlightIndicatorSet = false; braceHighlightIndicator = 0; braceBadLightIndicatorSet = false; braceBadLightIndicator = 0; } void ViewStyle::CreateFont(const FontSpecification &fs) { if (fs.fontName) { for (FontRealised *cur=frFirst; cur; cur=cur->frNext) { if (cur->EqualTo(fs)) return; if (!cur->frNext) { cur->frNext = new FontRealised(fs); return; } } frFirst = new FontRealised(fs); } } void ViewStyle::Refresh(Surface &surface) { delete frFirst; frFirst = NULL; selbar = Platform::Chrome(); selbarlight = Platform::ChromeHighlight(); for (unsigned int i=0; iRealise(surface, zoomLevel, technology); for (unsigned int k=0; kFind(styles[k]); styles[k].Copy(fr->font, *fr); } maxAscent = 1; maxDescent = 1; frFirst->FindMaxAscentDescent(maxAscent, maxDescent); maxAscent += extraAscent; maxDescent += extraDescent; lineHeight = maxAscent + maxDescent; someStylesProtected = false; someStylesForceCase = false; for (unsigned int l=0; l 0) maskInLine &= ~ms[margin].mask; } } void ViewStyle::AllocStyles(size_t sizeNew) { Style *stylesNew = new Style[sizeNew]; size_t i=0; for (; i STYLE_DEFAULT) { for (; i= stylesSize) { size_t sizeNew = stylesSize * 2; while (sizeNew <= index) sizeNew *= 2; AllocStyles(sizeNew); } } void ViewStyle::ResetDefaultStyle() { styles[STYLE_DEFAULT].Clear(ColourDesired(0,0,0), ColourDesired(0xff,0xff,0xff), Platform::DefaultFontSize() * SC_FONT_SIZE_MULTIPLIER, fontNames.Save(Platform::DefaultFont()), SC_CHARSET_DEFAULT, SC_WEIGHT_NORMAL, false, false, false, Style::caseMixed, true, true, false); } void ViewStyle::ClearStyles() { // Reset all styles to be like the default style for (unsigned int i=0; iGetHeight() > largestMarkerHeight) largestMarkerHeight = markers[m].pxpm->GetHeight(); break; case SC_MARK_RGBAIMAGE: if (markers[m].image->GetHeight() > largestMarkerHeight) largestMarkerHeight = markers[m].image->GetHeight(); break; } } } Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexBaan.cxx000444001750001750 1374611727344243 24466 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexBaan.cxx ** Lexer for Baan. ** Based heavily on LexCPP.cxx **/ // Copyright 2001- by Vamsi Potluru & Praveen Ambekar // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static inline bool IsAWordChar(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_' || ch == '$' || ch == ':'); } static inline bool IsAWordStart(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '_'); } static void ColouriseBaanDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { WordList &keywords = *keywordlists[0]; WordList &keywords2 = *keywordlists[1]; bool stylingWithinPreprocessor = styler.GetPropertyInt("styling.within.preprocessor") != 0; if (initStyle == SCE_BAAN_STRINGEOL) // Does not leak onto next line initStyle = SCE_BAAN_DEFAULT; int visibleChars = 0; StyleContext sc(startPos, length, initStyle, styler); for (; sc.More(); sc.Forward()) { if (sc.state == SCE_BAAN_OPERATOR) { sc.SetState(SCE_BAAN_DEFAULT); } else if (sc.state == SCE_BAAN_NUMBER) { if (!IsAWordChar(sc.ch)) { sc.SetState(SCE_BAAN_DEFAULT); } } else if (sc.state == SCE_BAAN_IDENTIFIER) { if (!IsAWordChar(sc.ch)) { char s[100]; sc.GetCurrentLowered(s, sizeof(s)); if (keywords.InList(s)) { sc.ChangeState(SCE_BAAN_WORD); } else if (keywords2.InList(s)) { sc.ChangeState(SCE_BAAN_WORD2); } sc.SetState(SCE_BAAN_DEFAULT); } } else if (sc.state == SCE_BAAN_PREPROCESSOR) { if (stylingWithinPreprocessor) { if (IsASpace(sc.ch)) { sc.SetState(SCE_BAAN_DEFAULT); } } else { if (sc.atLineEnd && (sc.chNext != '^')) { sc.SetState(SCE_BAAN_DEFAULT); } } } else if (sc.state == SCE_BAAN_COMMENT) { if (sc.atLineEnd) { sc.SetState(SCE_BAAN_DEFAULT); } } else if (sc.state == SCE_BAAN_COMMENTDOC) { if (sc.MatchIgnoreCase("enddllusage")) { for (unsigned int i = 0; i < 10; i++){ sc.Forward(); } sc.ForwardSetState(SCE_BAAN_DEFAULT); } } else if (sc.state == SCE_BAAN_STRING) { if (sc.ch == '\"') { sc.ForwardSetState(SCE_BAAN_DEFAULT); } else if ((sc.atLineEnd) && (sc.chNext != '^')) { sc.ChangeState(SCE_BAAN_STRINGEOL); sc.ForwardSetState(SCE_C_DEFAULT); visibleChars = 0; } } if (sc.state == SCE_BAAN_DEFAULT) { if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) { sc.SetState(SCE_BAAN_NUMBER); } else if (sc.MatchIgnoreCase("dllusage")){ sc.SetState(SCE_BAAN_COMMENTDOC); do { sc.Forward(); } while ((!sc.atLineEnd) && sc.More()); } else if (IsAWordStart(sc.ch)) { sc.SetState(SCE_BAAN_IDENTIFIER); } else if (sc.Match('|')){ sc.SetState(SCE_BAAN_COMMENT); } else if (sc.ch == '\"') { sc.SetState(SCE_BAAN_STRING); } else if (sc.ch == '#' && visibleChars == 0) { // Preprocessor commands are alone on their line sc.SetState(SCE_BAAN_PREPROCESSOR); // Skip whitespace between # and preprocessor word do { sc.Forward(); } while (IsASpace(sc.ch) && sc.More()); } else if (isoperator(static_cast(sc.ch))) { sc.SetState(SCE_BAAN_OPERATOR); } } if (sc.atLineEnd) { // Reset states to begining of colourise so no surprises // if different sets of lines lexed. visibleChars = 0; } if (!IsASpace(sc.ch)) { visibleChars++; } } sc.Complete(); } static void FoldBaanDoc(unsigned int startPos, int length, int initStyle, WordList *[], Accessor &styler) { bool foldComment = styler.GetPropertyInt("fold.comment") != 0; bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; unsigned int endPos = startPos + length; int visibleChars = 0; int lineCurrent = styler.GetLine(startPos); int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; int levelCurrent = levelPrev; char chNext = styler[startPos]; int styleNext = styler.StyleAt(startPos); int style = initStyle; for (unsigned int i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); int stylePrev = style; style = styleNext; styleNext = styler.StyleAt(i + 1); bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); if (foldComment && (style == SCE_BAAN_COMMENT || style == SCE_BAAN_COMMENTDOC)) { if (style != stylePrev) { levelCurrent++; } else if ((style != styleNext) && !atEOL) { // Comments don't end at end of line and the next character may be unstyled. levelCurrent--; } } if (style == SCE_BAAN_OPERATOR) { if (ch == '{') { levelCurrent++; } else if (ch == '}') { levelCurrent--; } } if (atEOL) { int lev = levelPrev; if (visibleChars == 0 && foldCompact) lev |= SC_FOLDLEVELWHITEFLAG; if ((levelCurrent > levelPrev) && (visibleChars > 0)) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) { styler.SetLevel(lineCurrent, lev); } lineCurrent++; levelPrev = levelCurrent; visibleChars = 0; } if (!isspacechar(ch)) visibleChars++; } // Fill in the real level of the next line, keeping the current flags as they will be filled in later int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; styler.SetLevel(lineCurrent, levelPrev | flagsNext); } LexerModule lmBaan(SCLEX_BAAN, ColouriseBaanDoc, "baan", FoldBaanDoc); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexAda.cxx000444001750001750 3054011727344243 24301 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexAda.cxx ** Lexer for Ada 95 **/ // Copyright 2002 by Sergey Koshcheyev // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif /* * Interface */ static void ColouriseDocument( unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler); static const char * const adaWordListDesc[] = { "Keywords", 0 }; LexerModule lmAda(SCLEX_ADA, ColouriseDocument, "ada", NULL, adaWordListDesc); /* * Implementation */ // Functions that have apostropheStartsAttribute as a parameter set it according to whether // an apostrophe encountered after processing the current token will start an attribute or // a character literal. static void ColouriseCharacter(StyleContext& sc, bool& apostropheStartsAttribute); static void ColouriseComment(StyleContext& sc, bool& apostropheStartsAttribute); static void ColouriseContext(StyleContext& sc, char chEnd, int stateEOL); static void ColouriseDelimiter(StyleContext& sc, bool& apostropheStartsAttribute); static void ColouriseLabel(StyleContext& sc, WordList& keywords, bool& apostropheStartsAttribute); static void ColouriseNumber(StyleContext& sc, bool& apostropheStartsAttribute); static void ColouriseString(StyleContext& sc, bool& apostropheStartsAttribute); static void ColouriseWhiteSpace(StyleContext& sc, bool& apostropheStartsAttribute); static void ColouriseWord(StyleContext& sc, WordList& keywords, bool& apostropheStartsAttribute); static inline bool IsDelimiterCharacter(int ch); static inline bool IsNumberStartCharacter(int ch); static inline bool IsNumberCharacter(int ch); static inline bool IsSeparatorOrDelimiterCharacter(int ch); static bool IsValidIdentifier(const std::string& identifier); static bool IsValidNumber(const std::string& number); static inline bool IsWordStartCharacter(int ch); static inline bool IsWordCharacter(int ch); static void ColouriseCharacter(StyleContext& sc, bool& apostropheStartsAttribute) { apostropheStartsAttribute = true; sc.SetState(SCE_ADA_CHARACTER); // Skip the apostrophe and one more character (so that '' is shown as non-terminated and ''' // is handled correctly) sc.Forward(); sc.Forward(); ColouriseContext(sc, '\'', SCE_ADA_CHARACTEREOL); } static void ColouriseContext(StyleContext& sc, char chEnd, int stateEOL) { while (!sc.atLineEnd && !sc.Match(chEnd)) { sc.Forward(); } if (!sc.atLineEnd) { sc.ForwardSetState(SCE_ADA_DEFAULT); } else { sc.ChangeState(stateEOL); } } static void ColouriseComment(StyleContext& sc, bool& /*apostropheStartsAttribute*/) { // Apostrophe meaning is not changed, but the parameter is present for uniformity sc.SetState(SCE_ADA_COMMENTLINE); while (!sc.atLineEnd) { sc.Forward(); } } static void ColouriseDelimiter(StyleContext& sc, bool& apostropheStartsAttribute) { apostropheStartsAttribute = sc.Match (')'); sc.SetState(SCE_ADA_DELIMITER); sc.ForwardSetState(SCE_ADA_DEFAULT); } static void ColouriseLabel(StyleContext& sc, WordList& keywords, bool& apostropheStartsAttribute) { apostropheStartsAttribute = false; sc.SetState(SCE_ADA_LABEL); // Skip "<<" sc.Forward(); sc.Forward(); std::string identifier; while (!sc.atLineEnd && !IsSeparatorOrDelimiterCharacter(sc.ch)) { identifier += static_cast(tolower(sc.ch)); sc.Forward(); } // Skip ">>" if (sc.Match('>', '>')) { sc.Forward(); sc.Forward(); } else { sc.ChangeState(SCE_ADA_ILLEGAL); } // If the name is an invalid identifier or a keyword, then make it invalid label if (!IsValidIdentifier(identifier) || keywords.InList(identifier.c_str())) { sc.ChangeState(SCE_ADA_ILLEGAL); } sc.SetState(SCE_ADA_DEFAULT); } static void ColouriseNumber(StyleContext& sc, bool& apostropheStartsAttribute) { apostropheStartsAttribute = true; std::string number; sc.SetState(SCE_ADA_NUMBER); // Get all characters up to a delimiter or a separator, including points, but excluding // double points (ranges). while (!IsSeparatorOrDelimiterCharacter(sc.ch) || (sc.ch == '.' && sc.chNext != '.')) { number += static_cast(sc.ch); sc.Forward(); } // Special case: exponent with sign if ((sc.chPrev == 'e' || sc.chPrev == 'E') && (sc.ch == '+' || sc.ch == '-')) { number += static_cast(sc.ch); sc.Forward (); while (!IsSeparatorOrDelimiterCharacter(sc.ch)) { number += static_cast(sc.ch); sc.Forward(); } } if (!IsValidNumber(number)) { sc.ChangeState(SCE_ADA_ILLEGAL); } sc.SetState(SCE_ADA_DEFAULT); } static void ColouriseString(StyleContext& sc, bool& apostropheStartsAttribute) { apostropheStartsAttribute = true; sc.SetState(SCE_ADA_STRING); sc.Forward(); ColouriseContext(sc, '"', SCE_ADA_STRINGEOL); } static void ColouriseWhiteSpace(StyleContext& sc, bool& /*apostropheStartsAttribute*/) { // Apostrophe meaning is not changed, but the parameter is present for uniformity sc.SetState(SCE_ADA_DEFAULT); sc.ForwardSetState(SCE_ADA_DEFAULT); } static void ColouriseWord(StyleContext& sc, WordList& keywords, bool& apostropheStartsAttribute) { apostropheStartsAttribute = true; sc.SetState(SCE_ADA_IDENTIFIER); std::string word; while (!sc.atLineEnd && !IsSeparatorOrDelimiterCharacter(sc.ch)) { word += static_cast(tolower(sc.ch)); sc.Forward(); } if (!IsValidIdentifier(word)) { sc.ChangeState(SCE_ADA_ILLEGAL); } else if (keywords.InList(word.c_str())) { sc.ChangeState(SCE_ADA_WORD); if (word != "all") { apostropheStartsAttribute = false; } } sc.SetState(SCE_ADA_DEFAULT); } // // ColouriseDocument // static void ColouriseDocument( unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { WordList &keywords = *keywordlists[0]; StyleContext sc(startPos, length, initStyle, styler); int lineCurrent = styler.GetLine(startPos); bool apostropheStartsAttribute = (styler.GetLineState(lineCurrent) & 1) != 0; while (sc.More()) { if (sc.atLineEnd) { // Go to the next line sc.Forward(); lineCurrent++; // Remember the line state for future incremental lexing styler.SetLineState(lineCurrent, apostropheStartsAttribute); // Don't continue any styles on the next line sc.SetState(SCE_ADA_DEFAULT); } // Comments if (sc.Match('-', '-')) { ColouriseComment(sc, apostropheStartsAttribute); // Strings } else if (sc.Match('"')) { ColouriseString(sc, apostropheStartsAttribute); // Characters } else if (sc.Match('\'') && !apostropheStartsAttribute) { ColouriseCharacter(sc, apostropheStartsAttribute); // Labels } else if (sc.Match('<', '<')) { ColouriseLabel(sc, keywords, apostropheStartsAttribute); // Whitespace } else if (IsASpace(sc.ch)) { ColouriseWhiteSpace(sc, apostropheStartsAttribute); // Delimiters } else if (IsDelimiterCharacter(sc.ch)) { ColouriseDelimiter(sc, apostropheStartsAttribute); // Numbers } else if (IsADigit(sc.ch) || sc.ch == '#') { ColouriseNumber(sc, apostropheStartsAttribute); // Keywords or identifiers } else { ColouriseWord(sc, keywords, apostropheStartsAttribute); } } sc.Complete(); } static inline bool IsDelimiterCharacter(int ch) { switch (ch) { case '&': case '\'': case '(': case ')': case '*': case '+': case ',': case '-': case '.': case '/': case ':': case ';': case '<': case '=': case '>': case '|': return true; default: return false; } } static inline bool IsNumberCharacter(int ch) { return IsNumberStartCharacter(ch) || ch == '_' || ch == '.' || ch == '#' || (ch >= 'a' && ch <= 'f') || (ch >= 'A' && ch <= 'F'); } static inline bool IsNumberStartCharacter(int ch) { return IsADigit(ch); } static inline bool IsSeparatorOrDelimiterCharacter(int ch) { return IsASpace(ch) || IsDelimiterCharacter(ch); } static bool IsValidIdentifier(const std::string& identifier) { // First character can't be '_', so initialize the flag to true bool lastWasUnderscore = true; size_t length = identifier.length(); // Zero-length identifiers are not valid (these can occur inside labels) if (length == 0) { return false; } // Check for valid character at the start if (!IsWordStartCharacter(identifier[0])) { return false; } // Check for only valid characters and no double underscores for (size_t i = 0; i < length; i++) { if (!IsWordCharacter(identifier[i]) || (identifier[i] == '_' && lastWasUnderscore)) { return false; } lastWasUnderscore = identifier[i] == '_'; } // Check for underscore at the end if (lastWasUnderscore == true) { return false; } // All checks passed return true; } static bool IsValidNumber(const std::string& number) { size_t hashPos = number.find("#"); bool seenDot = false; size_t i = 0; size_t length = number.length(); if (length == 0) return false; // Just in case // Decimal number if (hashPos == std::string::npos) { bool canBeSpecial = false; for (; i < length; i++) { if (number[i] == '_') { if (!canBeSpecial) { return false; } canBeSpecial = false; } else if (number[i] == '.') { if (!canBeSpecial || seenDot) { return false; } canBeSpecial = false; seenDot = true; } else if (IsADigit(number[i])) { canBeSpecial = true; } else { break; } } if (!canBeSpecial) return false; } else { // Based number bool canBeSpecial = false; int base = 0; // Parse base for (; i < length; i++) { int ch = number[i]; if (ch == '_') { if (!canBeSpecial) return false; canBeSpecial = false; } else if (IsADigit(ch)) { base = base * 10 + (ch - '0'); if (base > 16) return false; canBeSpecial = true; } else if (ch == '#' && canBeSpecial) { break; } else { return false; } } if (base < 2) return false; if (i == length) return false; i++; // Skip over '#' // Parse number canBeSpecial = false; for (; i < length; i++) { int ch = tolower(number[i]); if (ch == '_') { if (!canBeSpecial) { return false; } canBeSpecial = false; } else if (ch == '.') { if (!canBeSpecial || seenDot) { return false; } canBeSpecial = false; seenDot = true; } else if (IsADigit(ch)) { if (ch - '0' >= base) { return false; } canBeSpecial = true; } else if (ch >= 'a' && ch <= 'f') { if (ch - 'a' + 10 >= base) { return false; } canBeSpecial = true; } else if (ch == '#' && canBeSpecial) { break; } else { return false; } } if (i == length) { return false; } i++; } // Exponent (optional) if (i < length) { if (number[i] != 'e' && number[i] != 'E') return false; i++; // Move past 'E' if (i == length) { return false; } if (number[i] == '+') i++; else if (number[i] == '-') { if (seenDot) { i++; } else { return false; // Integer literals should not have negative exponents } } if (i == length) { return false; } bool canBeSpecial = false; for (; i < length; i++) { if (number[i] == '_') { if (!canBeSpecial) { return false; } canBeSpecial = false; } else if (IsADigit(number[i])) { canBeSpecial = true; } else { return false; } } if (!canBeSpecial) return false; } // if i == length, number was parsed successfully. return i == length; } static inline bool IsWordCharacter(int ch) { return IsWordStartCharacter(ch) || IsADigit(ch); } static inline bool IsWordStartCharacter(int ch) { return (isascii(ch) && isalpha(ch)) || ch == '_'; } Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/StyleContext.h000444001750001750 1061211727344243 25233 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file StyleContext.cxx ** Lexer infrastructure. **/ // Copyright 1998-2004 by Neil Hodgson // This file is in the public domain. #ifndef STYLECONTEXT_H #define STYLECONTEXT_H #ifdef SCI_NAMESPACE namespace Scintilla { #endif static inline int MakeLowerCase(int ch) { if (ch < 'A' || ch > 'Z') return ch; else return ch - 'A' + 'a'; } // All languages handled so far can treat all characters >= 0x80 as one class // which just continues the current token or starts an identifier if in default. // DBCS treated specially as the second character can be < 0x80 and hence // syntactically significant. UTF-8 avoids this as all trail bytes are >= 0x80 class StyleContext { LexAccessor &styler; unsigned int endPos; StyleContext &operator=(const StyleContext &); void GetNextChar(unsigned int pos) { chNext = static_cast(styler.SafeGetCharAt(pos+1)); if (styler.IsLeadByte(static_cast(chNext))) { chNext = chNext << 8; chNext |= static_cast(styler.SafeGetCharAt(pos+2)); } // End of line? // Trigger on CR only (Mac style) or either on LF from CR+LF (Dos/Win) // or on LF alone (Unix). Avoid triggering two times on Dos/Win. atLineEnd = (ch == '\r' && chNext != '\n') || (ch == '\n') || (currentPos >= endPos); } public: unsigned int currentPos; bool atLineStart; bool atLineEnd; int state; int chPrev; int ch; int chNext; StyleContext(unsigned int startPos, unsigned int length, int initStyle, LexAccessor &styler_, char chMask=31) : styler(styler_), endPos(startPos + length), currentPos(startPos), atLineEnd(false), state(initStyle & chMask), // Mask off all bits which aren't in the chMask. chPrev(0), ch(0), chNext(0) { styler.StartAt(startPos, chMask); styler.StartSegment(startPos); atLineStart = static_cast(styler.LineStart(styler.GetLine(startPos))) == startPos; unsigned int pos = currentPos; ch = static_cast(styler.SafeGetCharAt(pos)); if (styler.IsLeadByte(static_cast(ch))) { pos++; ch = ch << 8; ch |= static_cast(styler.SafeGetCharAt(pos)); } GetNextChar(pos); } void Complete() { styler.ColourTo(currentPos - 1, state); styler.Flush(); } bool More() const { return currentPos < endPos; } void Forward() { if (currentPos < endPos) { atLineStart = atLineEnd; chPrev = ch; currentPos++; if (ch >= 0x100) currentPos++; ch = chNext; GetNextChar(currentPos + ((ch >= 0x100) ? 1 : 0)); } else { atLineStart = false; chPrev = ' '; ch = ' '; chNext = ' '; atLineEnd = true; } } void Forward(int nb) { for (int i = 0; i < nb; i++) { Forward(); } } void ChangeState(int state_) { state = state_; } void SetState(int state_) { styler.ColourTo(currentPos - 1, state); state = state_; } void ForwardSetState(int state_) { Forward(); styler.ColourTo(currentPos - 1, state); state = state_; } int LengthCurrent() { return currentPos - styler.GetStartSegment(); } int GetRelative(int n) { return static_cast(styler.SafeGetCharAt(currentPos+n)); } bool Match(char ch0) const { return ch == static_cast(ch0); } bool Match(char ch0, char ch1) const { return (ch == static_cast(ch0)) && (chNext == static_cast(ch1)); } bool Match(const char *s) { if (ch != static_cast(*s)) return false; s++; if (!*s) return true; if (chNext != static_cast(*s)) return false; s++; for (int n=2; *s; n++) { if (*s != styler.SafeGetCharAt(currentPos+n)) return false; s++; } return true; } bool MatchIgnoreCase(const char *s) { if (MakeLowerCase(ch) != static_cast(*s)) return false; s++; if (MakeLowerCase(chNext) != static_cast(*s)) return false; s++; for (int n=2; *s; n++) { if (static_cast(*s) != MakeLowerCase(static_cast(styler.SafeGetCharAt(currentPos+n)))) return false; s++; } return true; } // Non-inline void GetCurrent(char *s, unsigned int len); void GetCurrentLowered(char *s, unsigned int len); }; #ifdef SCI_NAMESPACE } #endif #endif Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexMatlab.cxx000444001750001750 1662611727344243 25025 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexMatlab.cxx ** Lexer for Matlab. ** Written by José Fonseca ** ** Changes by Christoph Dalitz 2003/12/04: ** - added support for Octave ** - Strings can now be included both in single or double quotes **/ // Copyright 1998-2001 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static bool IsMatlabCommentChar(int c) { return (c == '%') ; } static bool IsOctaveCommentChar(int c) { return (c == '%' || c == '#') ; } static bool IsMatlabComment(Accessor &styler, int pos, int len) { return len > 0 && IsMatlabCommentChar(styler[pos]) ; } static bool IsOctaveComment(Accessor &styler, int pos, int len) { return len > 0 && IsOctaveCommentChar(styler[pos]) ; } static inline bool IsAWordChar(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '_'); } static inline bool IsAWordStart(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '_'); } static void ColouriseMatlabOctaveDoc( unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler, bool (*IsCommentChar)(int)) { WordList &keywords = *keywordlists[0]; styler.StartAt(startPos); bool transpose = false; StyleContext sc(startPos, length, initStyle, styler); for (; sc.More(); sc.Forward()) { if (sc.state == SCE_MATLAB_OPERATOR) { if (sc.chPrev == '.') { if (sc.ch == '*' || sc.ch == '/' || sc.ch == '\\' || sc.ch == '^') { sc.ForwardSetState(SCE_MATLAB_DEFAULT); transpose = false; } else if (sc.ch == '\'') { sc.ForwardSetState(SCE_MATLAB_DEFAULT); transpose = true; } else { sc.SetState(SCE_MATLAB_DEFAULT); } } else { sc.SetState(SCE_MATLAB_DEFAULT); } } else if (sc.state == SCE_MATLAB_KEYWORD) { if (!isalnum(sc.ch) && sc.ch != '_') { char s[100]; sc.GetCurrentLowered(s, sizeof(s)); if (keywords.InList(s)) { sc.SetState(SCE_MATLAB_DEFAULT); transpose = false; } else { sc.ChangeState(SCE_MATLAB_IDENTIFIER); sc.SetState(SCE_MATLAB_DEFAULT); transpose = true; } } } else if (sc.state == SCE_MATLAB_NUMBER) { if (!isdigit(sc.ch) && sc.ch != '.' && !(sc.ch == 'e' || sc.ch == 'E') && !((sc.ch == '+' || sc.ch == '-') && (sc.chPrev == 'e' || sc.chPrev == 'E'))) { sc.SetState(SCE_MATLAB_DEFAULT); transpose = true; } } else if (sc.state == SCE_MATLAB_STRING) { if (sc.ch == '\'') { if (sc.chNext == '\'') { sc.Forward(); } else { sc.ForwardSetState(SCE_MATLAB_DEFAULT); } } } else if (sc.state == SCE_MATLAB_DOUBLEQUOTESTRING) { if (sc.ch == '\\') { if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') { sc.Forward(); } } else if (sc.ch == '\"') { sc.ForwardSetState(SCE_MATLAB_DEFAULT); } } else if (sc.state == SCE_MATLAB_COMMENT || sc.state == SCE_MATLAB_COMMAND) { if (sc.atLineEnd) { sc.SetState(SCE_MATLAB_DEFAULT); transpose = false; } } if (sc.state == SCE_MATLAB_DEFAULT) { if (IsCommentChar(sc.ch)) { sc.SetState(SCE_MATLAB_COMMENT); } else if (sc.ch == '!' && sc.chNext != '=' ) { sc.SetState(SCE_MATLAB_COMMAND); } else if (sc.ch == '\'') { if (transpose) { sc.SetState(SCE_MATLAB_OPERATOR); } else { sc.SetState(SCE_MATLAB_STRING); } } else if (sc.ch == '"') { sc.SetState(SCE_MATLAB_DOUBLEQUOTESTRING); } else if (isdigit(sc.ch) || (sc.ch == '.' && isdigit(sc.chNext))) { sc.SetState(SCE_MATLAB_NUMBER); } else if (isalpha(sc.ch)) { sc.SetState(SCE_MATLAB_KEYWORD); } else if (isoperator(static_cast(sc.ch)) || sc.ch == '@' || sc.ch == '\\') { if (sc.ch == ')' || sc.ch == ']') { transpose = true; } else { transpose = false; } sc.SetState(SCE_MATLAB_OPERATOR); } else { transpose = false; } } } sc.Complete(); } static void ColouriseMatlabDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { ColouriseMatlabOctaveDoc(startPos, length, initStyle, keywordlists, styler, IsMatlabCommentChar); } static void ColouriseOctaveDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { ColouriseMatlabOctaveDoc(startPos, length, initStyle, keywordlists, styler, IsOctaveCommentChar); } static void FoldMatlabOctaveDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler, bool (*IsComment)(Accessor&, int, int)) { int endPos = startPos + length; // Backtrack to previous line in case need to fix its fold status int lineCurrent = styler.GetLine(startPos); if (startPos > 0) { if (lineCurrent > 0) { lineCurrent--; startPos = styler.LineStart(lineCurrent); } } int spaceFlags = 0; int indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, IsComment); char chNext = styler[startPos]; for (int i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); if ((ch == '\r' && chNext != '\n') || (ch == '\n') || (i == endPos)) { int lev = indentCurrent; int indentNext = styler.IndentAmount(lineCurrent + 1, &spaceFlags, IsComment); if (!(indentCurrent & SC_FOLDLEVELWHITEFLAG)) { // Only non whitespace lines can be headers if ((indentCurrent & SC_FOLDLEVELNUMBERMASK) < (indentNext & SC_FOLDLEVELNUMBERMASK)) { lev |= SC_FOLDLEVELHEADERFLAG; } else if (indentNext & SC_FOLDLEVELWHITEFLAG) { // Line after is blank so check the next - maybe should continue further? int spaceFlags2 = 0; int indentNext2 = styler.IndentAmount(lineCurrent + 2, &spaceFlags2, IsComment); if ((indentCurrent & SC_FOLDLEVELNUMBERMASK) < (indentNext2 & SC_FOLDLEVELNUMBERMASK)) { lev |= SC_FOLDLEVELHEADERFLAG; } } } indentCurrent = indentNext; styler.SetLevel(lineCurrent, lev); lineCurrent++; } } } static void FoldMatlabDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { FoldMatlabOctaveDoc(startPos, length, initStyle, keywordlists, styler, IsMatlabComment); } static void FoldOctaveDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { FoldMatlabOctaveDoc(startPos, length, initStyle, keywordlists, styler, IsOctaveComment); } static const char * const matlabWordListDesc[] = { "Keywords", 0 }; static const char * const octaveWordListDesc[] = { "Keywords", 0 }; LexerModule lmMatlab(SCLEX_MATLAB, ColouriseMatlabDoc, "matlab", FoldMatlabDoc, matlabWordListDesc); LexerModule lmOctave(SCLEX_OCTAVE, ColouriseOctaveDoc, "octave", FoldOctaveDoc, octaveWordListDesc); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexRebol.cxx000444001750001750 2544211727344243 24664 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexRebol.cxx ** Lexer for REBOL. ** Written by Pascal Hurni, inspired from LexLua by Paul Winwood & Marcos E. Wurzius & Philippe Lhoste ** ** History: ** 2005-04-07 First release. ** 2005-04-10 Closing parens and brackets go now in default style ** String and comment nesting should be more safe **/ // Copyright 2005 by Pascal Hurni // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static inline bool IsAWordChar(const int ch) { return (isalnum(ch) || ch == '?' || ch == '!' || ch == '.' || ch == '\'' || ch == '+' || ch == '-' || ch == '*' || ch == '&' || ch == '|' || ch == '=' || ch == '_' || ch == '~'); } static inline bool IsAWordStart(const int ch, const int ch2) { return ((ch == '+' || ch == '-' || ch == '.') && !isdigit(ch2)) || (isalpha(ch) || ch == '?' || ch == '!' || ch == '\'' || ch == '*' || ch == '&' || ch == '|' || ch == '=' || ch == '_' || ch == '~'); } static inline bool IsAnOperator(const int ch, const int ch2, const int ch3) { // One char operators if (IsASpaceOrTab(ch2)) { return ch == '+' || ch == '-' || ch == '*' || ch == '/' || ch == '<' || ch == '>' || ch == '=' || ch == '?'; } // Two char operators if (IsASpaceOrTab(ch3)) { return (ch == '*' && ch2 == '*') || (ch == '/' && ch2 == '/') || (ch == '<' && (ch2 == '=' || ch2 == '>')) || (ch == '>' && ch2 == '=') || (ch == '=' && (ch2 == '=' || ch2 == '?')) || (ch == '?' && ch2 == '?'); } return false; } static inline bool IsBinaryStart(const int ch, const int ch2, const int ch3, const int ch4) { return (ch == '#' && ch2 == '{') || (IsADigit(ch) && ch2 == '#' && ch3 == '{' ) || (IsADigit(ch) && IsADigit(ch2) && ch3 == '#' && ch4 == '{' ); } static void ColouriseRebolDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { WordList &keywords = *keywordlists[0]; WordList &keywords2 = *keywordlists[1]; WordList &keywords3 = *keywordlists[2]; WordList &keywords4 = *keywordlists[3]; WordList &keywords5 = *keywordlists[4]; WordList &keywords6 = *keywordlists[5]; WordList &keywords7 = *keywordlists[6]; WordList &keywords8 = *keywordlists[7]; int currentLine = styler.GetLine(startPos); // Initialize the braced string {.. { ... } ..} nesting level, if we are inside such a string. int stringLevel = 0; if (initStyle == SCE_REBOL_BRACEDSTRING || initStyle == SCE_REBOL_COMMENTBLOCK) { stringLevel = styler.GetLineState(currentLine - 1); } bool blockComment = initStyle == SCE_REBOL_COMMENTBLOCK; int dotCount = 0; // Do not leak onto next line if (initStyle == SCE_REBOL_COMMENTLINE) { initStyle = SCE_REBOL_DEFAULT; } StyleContext sc(startPos, length, initStyle, styler); if (startPos == 0) { sc.SetState(SCE_REBOL_PREFACE); } for (; sc.More(); sc.Forward()) { //--- What to do at line end ? if (sc.atLineEnd) { // Can be either inside a {} string or simply at eol if (sc.state != SCE_REBOL_BRACEDSTRING && sc.state != SCE_REBOL_COMMENTBLOCK && sc.state != SCE_REBOL_BINARY && sc.state != SCE_REBOL_PREFACE) sc.SetState(SCE_REBOL_DEFAULT); // Update the line state, so it can be seen by next line currentLine = styler.GetLine(sc.currentPos); switch (sc.state) { case SCE_REBOL_BRACEDSTRING: case SCE_REBOL_COMMENTBLOCK: // Inside a braced string, we set the line state styler.SetLineState(currentLine, stringLevel); break; default: // Reset the line state styler.SetLineState(currentLine, 0); break; } // continue with next char continue; } //--- What to do on white-space ? if (IsASpaceOrTab(sc.ch)) { // Return to default if any of these states if (sc.state == SCE_REBOL_OPERATOR || sc.state == SCE_REBOL_CHARACTER || sc.state == SCE_REBOL_NUMBER || sc.state == SCE_REBOL_PAIR || sc.state == SCE_REBOL_TUPLE || sc.state == SCE_REBOL_FILE || sc.state == SCE_REBOL_DATE || sc.state == SCE_REBOL_TIME || sc.state == SCE_REBOL_MONEY || sc.state == SCE_REBOL_ISSUE || sc.state == SCE_REBOL_URL || sc.state == SCE_REBOL_EMAIL) { sc.SetState(SCE_REBOL_DEFAULT); } } //--- Specialize state ? // URL, Email look like identifier if (sc.state == SCE_REBOL_IDENTIFIER) { if (sc.ch == ':' && !IsASpace(sc.chNext)) { sc.ChangeState(SCE_REBOL_URL); } else if (sc.ch == '@') { sc.ChangeState(SCE_REBOL_EMAIL); } else if (sc.ch == '$') { sc.ChangeState(SCE_REBOL_MONEY); } } // Words look like identifiers if (sc.state == SCE_REBOL_IDENTIFIER || (sc.state >= SCE_REBOL_WORD && sc.state <= SCE_REBOL_WORD8)) { // Keywords ? if (!IsAWordChar(sc.ch) || sc.Match('/')) { char s[100]; sc.GetCurrentLowered(s, sizeof(s)); blockComment = strcmp(s, "comment") == 0; if (keywords8.InList(s)) { sc.ChangeState(SCE_REBOL_WORD8); } else if (keywords7.InList(s)) { sc.ChangeState(SCE_REBOL_WORD7); } else if (keywords6.InList(s)) { sc.ChangeState(SCE_REBOL_WORD6); } else if (keywords5.InList(s)) { sc.ChangeState(SCE_REBOL_WORD5); } else if (keywords4.InList(s)) { sc.ChangeState(SCE_REBOL_WORD4); } else if (keywords3.InList(s)) { sc.ChangeState(SCE_REBOL_WORD3); } else if (keywords2.InList(s)) { sc.ChangeState(SCE_REBOL_WORD2); } else if (keywords.InList(s)) { sc.ChangeState(SCE_REBOL_WORD); } // Keep same style if there are refinements if (!sc.Match('/')) { sc.SetState(SCE_REBOL_DEFAULT); } } // special numbers } else if (sc.state == SCE_REBOL_NUMBER) { switch (sc.ch) { case 'x': sc.ChangeState(SCE_REBOL_PAIR); break; case ':': sc.ChangeState(SCE_REBOL_TIME); break; case '-': case '/': sc.ChangeState(SCE_REBOL_DATE); break; case '.': if (++dotCount >= 2) sc.ChangeState(SCE_REBOL_TUPLE); break; } } //--- Determine if the current state should terminate if (sc.state == SCE_REBOL_QUOTEDSTRING || sc.state == SCE_REBOL_CHARACTER) { if (sc.ch == '^' && sc.chNext == '\"') { sc.Forward(); } else if (sc.ch == '\"') { sc.ForwardSetState(SCE_REBOL_DEFAULT); } } else if (sc.state == SCE_REBOL_BRACEDSTRING || sc.state == SCE_REBOL_COMMENTBLOCK) { if (sc.ch == '}') { if (--stringLevel == 0) { sc.ForwardSetState(SCE_REBOL_DEFAULT); } } else if (sc.ch == '{') { stringLevel++; } } else if (sc.state == SCE_REBOL_BINARY) { if (sc.ch == '}') { sc.ForwardSetState(SCE_REBOL_DEFAULT); } } else if (sc.state == SCE_REBOL_TAG) { if (sc.ch == '>') { sc.ForwardSetState(SCE_REBOL_DEFAULT); } } else if (sc.state == SCE_REBOL_PREFACE) { if (sc.MatchIgnoreCase("rebol")) { int i; for (i=5; IsASpaceOrTab(styler.SafeGetCharAt(sc.currentPos+i, 0)); i++); if (sc.GetRelative(i) == '[') sc.SetState(SCE_REBOL_DEFAULT); } } //--- Parens and bracket changes to default style when the current is a number if (sc.state == SCE_REBOL_NUMBER || sc.state == SCE_REBOL_PAIR || sc.state == SCE_REBOL_TUPLE || sc.state == SCE_REBOL_MONEY || sc.state == SCE_REBOL_ISSUE || sc.state == SCE_REBOL_EMAIL || sc.state == SCE_REBOL_URL || sc.state == SCE_REBOL_DATE || sc.state == SCE_REBOL_TIME) { if (sc.ch == '(' || sc.ch == '[' || sc.ch == ')' || sc.ch == ']') { sc.SetState(SCE_REBOL_DEFAULT); } } //--- Determine if a new state should be entered. if (sc.state == SCE_REBOL_DEFAULT) { if (IsAnOperator(sc.ch, sc.chNext, sc.GetRelative(2))) { sc.SetState(SCE_REBOL_OPERATOR); } else if (IsBinaryStart(sc.ch, sc.chNext, sc.GetRelative(2), sc.GetRelative(3))) { sc.SetState(SCE_REBOL_BINARY); } else if (IsAWordStart(sc.ch, sc.chNext)) { sc.SetState(SCE_REBOL_IDENTIFIER); } else if (IsADigit(sc.ch) || sc.ch == '+' || sc.ch == '-' || /*Decimal*/ sc.ch == '.' || sc.ch == ',') { dotCount = 0; sc.SetState(SCE_REBOL_NUMBER); } else if (sc.ch == '\"') { sc.SetState(SCE_REBOL_QUOTEDSTRING); } else if (sc.ch == '{') { sc.SetState(blockComment ? SCE_REBOL_COMMENTBLOCK : SCE_REBOL_BRACEDSTRING); ++stringLevel; } else if (sc.ch == ';') { sc.SetState(SCE_REBOL_COMMENTLINE); } else if (sc.ch == '$') { sc.SetState(SCE_REBOL_MONEY); } else if (sc.ch == '%') { sc.SetState(SCE_REBOL_FILE); } else if (sc.ch == '<') { sc.SetState(SCE_REBOL_TAG); } else if (sc.ch == '#' && sc.chNext == '"') { sc.SetState(SCE_REBOL_CHARACTER); sc.Forward(); } else if (sc.ch == '#' && sc.chNext != '"' && sc.chNext != '{' ) { sc.SetState(SCE_REBOL_ISSUE); } } } sc.Complete(); } static void FoldRebolDoc(unsigned int startPos, int length, int /* initStyle */, WordList *[], Accessor &styler) { unsigned int lengthDoc = startPos + length; int visibleChars = 0; int lineCurrent = styler.GetLine(startPos); int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; int levelCurrent = levelPrev; char chNext = styler[startPos]; int styleNext = styler.StyleAt(startPos); for (unsigned int i = startPos; i < lengthDoc; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); int style = styleNext; styleNext = styler.StyleAt(i + 1); bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); if (style == SCE_REBOL_DEFAULT) { if (ch == '[') { levelCurrent++; } else if (ch == ']') { levelCurrent--; } } if (atEOL) { int lev = levelPrev; if (visibleChars == 0) lev |= SC_FOLDLEVELWHITEFLAG; if ((levelCurrent > levelPrev) && (visibleChars > 0)) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) { styler.SetLevel(lineCurrent, lev); } lineCurrent++; levelPrev = levelCurrent; visibleChars = 0; } if (!isspacechar(ch)) visibleChars++; } // Fill in the real level of the next line, keeping the current flags as they will be filled in later int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; styler.SetLevel(lineCurrent, levelPrev | flagsNext); } static const char * const rebolWordListDesc[] = { "Keywords", 0 }; LexerModule lmREBOL(SCLEX_REBOL, ColouriseRebolDoc, "rebol", FoldRebolDoc, rebolWordListDesc); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/CharClassify.cxx000444001750001750 240711727344243 25477 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file CharClassify.cxx ** Character classifications used by Document and RESearch. **/ // Copyright 2006 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include #include "CharClassify.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif // Shut up annoying Visual C++ warnings: #ifdef _MSC_VER #pragma warning(disable: 4514) #endif CharClassify::CharClassify() { SetDefaultCharClasses(true); } void CharClassify::SetDefaultCharClasses(bool includeWordClass) { // Initialize all char classes to default values for (int ch = 0; ch < 256; ch++) { if (ch == '\r' || ch == '\n') charClass[ch] = ccNewLine; else if (ch < 0x20 || ch == ' ') charClass[ch] = ccSpace; else if (includeWordClass && (ch >= 0x80 || isalnum(ch) || ch == '_')) charClass[ch] = ccWord; else charClass[ch] = ccPunctuation; } } void CharClassify::SetCharClasses(const unsigned char *chars, cc newCharClass) { // Apply the newCharClass to the specifed chars if (chars) { while (*chars) { charClass[*chars] = static_cast(newCharClass); chars++; } } } Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexFlagship.cxx000444001750001750 3051511727344243 25353 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexFlagShip.cxx ** Lexer for Harbour and FlagShip. ** (Syntactically compatible to other xBase dialects, like Clipper, dBase, Clip, FoxPro etc.) **/ // Copyright 2005 by Randy Butler // Copyright 2010 by Xavi (Harbour) // Copyright 1998-2003 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif // Extended to accept accented characters static inline bool IsAWordChar(int ch) { return ch >= 0x80 || (isalnum(ch) || ch == '_'); } static void ColouriseFlagShipDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { WordList &keywords = *keywordlists[0]; WordList &keywords2 = *keywordlists[1]; WordList &keywords3 = *keywordlists[2]; WordList &keywords4 = *keywordlists[3]; WordList &keywords5 = *keywordlists[4]; // property lexer.flagship.styling.within.preprocessor // For Harbour code, determines whether all preprocessor code is styled in the preprocessor style (0) or only from the // initial # to the end of the command word(1, the default). It also determines how to present text, dump, and disabled code. bool stylingWithinPreprocessor = styler.GetPropertyInt("lexer.flagship.styling.within.preprocessor", 1) != 0; CharacterSet setDoxygen(CharacterSet::setAlpha, "$@\\&<>#{}[]"); int visibleChars = 0; int closeStringChar = 0; int styleBeforeDCKeyword = SCE_FS_DEFAULT; bool bEnableCode = initStyle < SCE_FS_DISABLEDCODE; StyleContext sc(startPos, length, initStyle, styler); for (; sc.More(); sc.Forward()) { // Determine if the current state should terminate. switch (sc.state) { case SCE_FS_OPERATOR: case SCE_FS_OPERATOR_C: case SCE_FS_WORDOPERATOR: sc.SetState(bEnableCode ? SCE_FS_DEFAULT : SCE_FS_DEFAULT_C); break; case SCE_FS_IDENTIFIER: case SCE_FS_IDENTIFIER_C: if (!IsAWordChar(sc.ch)) { char s[64]; sc.GetCurrentLowered(s, sizeof(s)); if (keywords.InList(s)) { sc.ChangeState(bEnableCode ? SCE_FS_KEYWORD : SCE_FS_KEYWORD_C); } else if (keywords2.InList(s)) { sc.ChangeState(bEnableCode ? SCE_FS_KEYWORD2 : SCE_FS_KEYWORD2_C); } else if (bEnableCode && keywords3.InList(s)) { sc.ChangeState(SCE_FS_KEYWORD3); } else if (bEnableCode && keywords4.InList(s)) { sc.ChangeState(SCE_FS_KEYWORD4); }// Else, it is really an identifier... sc.SetState(bEnableCode ? SCE_FS_DEFAULT : SCE_FS_DEFAULT_C); } break; case SCE_FS_NUMBER: if (!IsAWordChar(sc.ch) && !(sc.ch == '.' && IsADigit(sc.chNext))) { sc.SetState(SCE_FS_DEFAULT); } break; case SCE_FS_NUMBER_C: if (!IsAWordChar(sc.ch) && sc.ch != '.') { sc.SetState(SCE_FS_DEFAULT_C); } break; case SCE_FS_CONSTANT: if (!IsAWordChar(sc.ch)) { sc.SetState(SCE_FS_DEFAULT); } break; case SCE_FS_STRING: case SCE_FS_STRING_C: if (sc.ch == closeStringChar) { sc.ForwardSetState(bEnableCode ? SCE_FS_DEFAULT : SCE_FS_DEFAULT_C); } else if (sc.atLineEnd) { sc.ChangeState(bEnableCode ? SCE_FS_STRINGEOL : SCE_FS_STRINGEOL_C); } break; case SCE_FS_STRINGEOL: case SCE_FS_STRINGEOL_C: if (sc.atLineStart) { sc.SetState(bEnableCode ? SCE_FS_DEFAULT : SCE_FS_DEFAULT_C); } break; case SCE_FS_COMMENTDOC: case SCE_FS_COMMENTDOC_C: if (sc.Match('*', '/')) { sc.Forward(); sc.ForwardSetState(bEnableCode ? SCE_FS_DEFAULT : SCE_FS_DEFAULT_C); } else if (sc.ch == '@' || sc.ch == '\\') { // JavaDoc and Doxygen support // Verify that we have the conditions to mark a comment-doc-keyword if ((IsASpace(sc.chPrev) || sc.chPrev == '*') && (!IsASpace(sc.chNext))) { styleBeforeDCKeyword = bEnableCode ? SCE_FS_COMMENTDOC : SCE_FS_COMMENTDOC_C; sc.SetState(SCE_FS_COMMENTDOCKEYWORD); } } break; case SCE_FS_COMMENT: case SCE_FS_COMMENTLINE: if (sc.atLineStart) { sc.SetState(SCE_FS_DEFAULT); } break; case SCE_FS_COMMENTLINEDOC: case SCE_FS_COMMENTLINEDOC_C: if (sc.atLineStart) { sc.SetState(bEnableCode ? SCE_FS_DEFAULT : SCE_FS_DEFAULT_C); } else if (sc.ch == '@' || sc.ch == '\\') { // JavaDoc and Doxygen support // Verify that we have the conditions to mark a comment-doc-keyword if ((IsASpace(sc.chPrev) || sc.chPrev == '/' || sc.chPrev == '!') && (!IsASpace(sc.chNext))) { styleBeforeDCKeyword = bEnableCode ? SCE_FS_COMMENTLINEDOC : SCE_FS_COMMENTLINEDOC_C; sc.SetState(SCE_FS_COMMENTDOCKEYWORD); } } break; case SCE_FS_COMMENTDOCKEYWORD: if ((styleBeforeDCKeyword == SCE_FS_COMMENTDOC || styleBeforeDCKeyword == SCE_FS_COMMENTDOC_C) && sc.Match('*', '/')) { sc.ChangeState(SCE_FS_COMMENTDOCKEYWORDERROR); sc.Forward(); sc.ForwardSetState(bEnableCode ? SCE_FS_DEFAULT : SCE_FS_DEFAULT_C); } else if (!setDoxygen.Contains(sc.ch)) { char s[64]; sc.GetCurrentLowered(s, sizeof(s)); if (!IsASpace(sc.ch) || !keywords5.InList(s + 1)) { sc.ChangeState(SCE_FS_COMMENTDOCKEYWORDERROR); } sc.SetState(styleBeforeDCKeyword); } break; case SCE_FS_PREPROCESSOR: case SCE_FS_PREPROCESSOR_C: if (sc.atLineEnd) { if (!(sc.chPrev == ';' || sc.GetRelative(-2) == ';')) { sc.SetState(bEnableCode ? SCE_FS_DEFAULT : SCE_FS_DEFAULT_C); } } else if (stylingWithinPreprocessor) { if (IsASpaceOrTab(sc.ch)) { sc.SetState(bEnableCode ? SCE_FS_DEFAULT : SCE_FS_DEFAULT_C); } } else if (sc.Match('/', '*') || sc.Match('/', '/') || sc.Match('&', '&')) { sc.SetState(bEnableCode ? SCE_FS_DEFAULT : SCE_FS_DEFAULT_C); } break; case SCE_FS_DISABLEDCODE: if (sc.ch == '#' && visibleChars == 0) { sc.SetState(bEnableCode ? SCE_FS_PREPROCESSOR : SCE_FS_PREPROCESSOR_C); do { // Skip whitespace between # and preprocessor word sc.Forward(); } while (IsASpaceOrTab(sc.ch) && sc.More()); if (sc.MatchIgnoreCase("pragma")) { sc.Forward(6); do { // Skip more whitespace until keyword sc.Forward(); } while (IsASpaceOrTab(sc.ch) && sc.More()); if (sc.MatchIgnoreCase("enddump") || sc.MatchIgnoreCase("__endtext")) { bEnableCode = true; sc.SetState(SCE_FS_DISABLEDCODE); sc.Forward(sc.ch == '_' ? 8 : 6); sc.ForwardSetState(SCE_FS_DEFAULT); } else { sc.ChangeState(SCE_FS_DISABLEDCODE); } } else { sc.ChangeState(SCE_FS_DISABLEDCODE); } } break; case SCE_FS_DATE: if (sc.ch == '}') { sc.ForwardSetState(SCE_FS_DEFAULT); } else if (sc.atLineEnd) { sc.ChangeState(SCE_FS_STRINGEOL); } } // Determine if a new state should be entered. if (sc.state == SCE_FS_DEFAULT || sc.state == SCE_FS_DEFAULT_C) { if (bEnableCode && (sc.MatchIgnoreCase(".and.") || sc.MatchIgnoreCase(".not."))) { sc.SetState(SCE_FS_WORDOPERATOR); sc.Forward(4); } else if (bEnableCode && sc.MatchIgnoreCase(".or.")) { sc.SetState(SCE_FS_WORDOPERATOR); sc.Forward(3); } else if (bEnableCode && (sc.MatchIgnoreCase(".t.") || sc.MatchIgnoreCase(".f.") || (!IsAWordChar(sc.GetRelative(3)) && sc.MatchIgnoreCase("nil")))) { sc.SetState(SCE_FS_CONSTANT); sc.Forward(2); } else if (sc.Match('/', '*')) { sc.SetState(bEnableCode ? SCE_FS_COMMENTDOC : SCE_FS_COMMENTDOC_C); sc.Forward(); } else if (bEnableCode && sc.Match('&', '&')) { sc.SetState(SCE_FS_COMMENTLINE); sc.Forward(); } else if (sc.Match('/', '/')) { sc.SetState(bEnableCode ? SCE_FS_COMMENTLINEDOC : SCE_FS_COMMENTLINEDOC_C); sc.Forward(); } else if (bEnableCode && sc.ch == '*' && visibleChars == 0) { sc.SetState(SCE_FS_COMMENT); } else if (sc.ch == '\"' || sc.ch == '\'') { sc.SetState(bEnableCode ? SCE_FS_STRING : SCE_FS_STRING_C); closeStringChar = sc.ch; } else if (closeStringChar == '>' && sc.ch == '<') { sc.SetState(bEnableCode ? SCE_FS_STRING : SCE_FS_STRING_C); } else if (sc.ch == '#' && visibleChars == 0) { sc.SetState(bEnableCode ? SCE_FS_PREPROCESSOR : SCE_FS_PREPROCESSOR_C); do { // Skip whitespace between # and preprocessor word sc.Forward(); } while (IsASpaceOrTab(sc.ch) && sc.More()); if (sc.atLineEnd) { sc.SetState(bEnableCode ? SCE_FS_DEFAULT : SCE_FS_DEFAULT_C); } else if (sc.MatchIgnoreCase("include")) { if (stylingWithinPreprocessor) { closeStringChar = '>'; } } else if (sc.MatchIgnoreCase("pragma")) { sc.Forward(6); do { // Skip more whitespace until keyword sc.Forward(); } while (IsASpaceOrTab(sc.ch) && sc.More()); if (sc.MatchIgnoreCase("begindump") || sc.MatchIgnoreCase("__cstream")) { bEnableCode = false; if (stylingWithinPreprocessor) { sc.SetState(SCE_FS_DISABLEDCODE); sc.Forward(8); sc.ForwardSetState(SCE_FS_DEFAULT_C); } else { sc.SetState(SCE_FS_DISABLEDCODE); } } else if (sc.MatchIgnoreCase("enddump") || sc.MatchIgnoreCase("__endtext")) { bEnableCode = true; sc.SetState(SCE_FS_DISABLEDCODE); sc.Forward(sc.ch == '_' ? 8 : 6); sc.ForwardSetState(SCE_FS_DEFAULT); } } } else if (bEnableCode && sc.ch == '{') { int p = 0; int chSeek; unsigned int endPos(startPos + length); do { // Skip whitespace chSeek = sc.GetRelative(++p); } while (IsASpaceOrTab(chSeek) && (sc.currentPos + p < endPos)); if (chSeek == '^') { sc.SetState(SCE_FS_DATE); } else { sc.SetState(SCE_FS_OPERATOR); } } else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) { sc.SetState(bEnableCode ? SCE_FS_NUMBER : SCE_FS_NUMBER_C); } else if (IsAWordChar(sc.ch)) { sc.SetState(bEnableCode ? SCE_FS_IDENTIFIER : SCE_FS_IDENTIFIER_C); } else if (isoperator(static_cast(sc.ch)) || (bEnableCode && sc.ch == '@')) { sc.SetState(bEnableCode ? SCE_FS_OPERATOR : SCE_FS_OPERATOR_C); } } if (sc.atLineEnd) { visibleChars = 0; closeStringChar = 0; } if (!IsASpace(sc.ch)) { visibleChars++; } } sc.Complete(); } static void FoldFlagShipDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) { int endPos = startPos + length; // Backtrack to previous line in case need to fix its fold status int lineCurrent = styler.GetLine(startPos); if (startPos > 0 && lineCurrent > 0) { lineCurrent--; startPos = styler.LineStart(lineCurrent); } int spaceFlags = 0; int indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags); char chNext = styler[startPos]; for (int i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); if ((ch == '\r' && chNext != '\n') || (ch == '\n') || (i == endPos-1)) { int lev = indentCurrent; int indentNext = styler.IndentAmount(lineCurrent + 1, &spaceFlags); if (!(indentCurrent & SC_FOLDLEVELWHITEFLAG)) { if ((indentCurrent & SC_FOLDLEVELNUMBERMASK) < (indentNext & SC_FOLDLEVELNUMBERMASK)) { lev |= SC_FOLDLEVELHEADERFLAG; } else if (indentNext & SC_FOLDLEVELWHITEFLAG) { int spaceFlags2 = 0; int indentNext2 = styler.IndentAmount(lineCurrent + 2, &spaceFlags2); if ((indentCurrent & SC_FOLDLEVELNUMBERMASK) < (indentNext2 & SC_FOLDLEVELNUMBERMASK)) { lev |= SC_FOLDLEVELHEADERFLAG; } } } indentCurrent = indentNext; styler.SetLevel(lineCurrent, lev); lineCurrent++; } } } static const char * const FSWordListDesc[] = { "Keywords Commands", "Std Library Functions", "Procedure, return, exit", "Class (oop)", "Doxygen keywords", 0 }; LexerModule lmFlagShip(SCLEX_FLAGSHIP, ColouriseFlagShipDoc, "flagship", FoldFlagShipDoc, FSWordListDesc); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexSpecman.cxx000444001750001750 2214511727344243 25204 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexSpecman.cxx ** Lexer for Specman E language. ** Written by Avi Yegudin, based on C++ lexer by Neil Hodgson **/ // Copyright 1998-2002 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static inline bool IsAWordChar(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_' || ch == '\''); } static inline bool IsANumberChar(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '\''); } static inline bool IsAWordStart(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '`'); } static void ColouriseSpecmanDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler, bool caseSensitive) { WordList &keywords = *keywordlists[0]; WordList &keywords2 = *keywordlists[1]; WordList &keywords3 = *keywordlists[2]; WordList &keywords4 = *keywordlists[3]; // Do not leak onto next line if (initStyle == SCE_SN_STRINGEOL) initStyle = SCE_SN_CODE; int visibleChars = 0; StyleContext sc(startPos, length, initStyle, styler); for (; sc.More(); sc.Forward()) { if (sc.atLineStart && (sc.state == SCE_SN_STRING)) { // Prevent SCE_SN_STRINGEOL from leaking back to previous line sc.SetState(SCE_SN_STRING); } // Handle line continuation generically. if (sc.ch == '\\') { if (sc.chNext == '\n' || sc.chNext == '\r') { sc.Forward(); if (sc.ch == '\r' && sc.chNext == '\n') { sc.Forward(); } continue; } } // Determine if the current state should terminate. if (sc.state == SCE_SN_OPERATOR) { sc.SetState(SCE_SN_CODE); } else if (sc.state == SCE_SN_NUMBER) { if (!IsANumberChar(sc.ch)) { sc.SetState(SCE_SN_CODE); } } else if (sc.state == SCE_SN_IDENTIFIER) { if (!IsAWordChar(sc.ch) || (sc.ch == '.')) { char s[100]; if (caseSensitive) { sc.GetCurrent(s, sizeof(s)); } else { sc.GetCurrentLowered(s, sizeof(s)); } if (keywords.InList(s)) { sc.ChangeState(SCE_SN_WORD); } else if (keywords2.InList(s)) { sc.ChangeState(SCE_SN_WORD2); } else if (keywords3.InList(s)) { sc.ChangeState(SCE_SN_WORD3); } else if (keywords4.InList(s)) { sc.ChangeState(SCE_SN_USER); } sc.SetState(SCE_SN_CODE); } } else if (sc.state == SCE_SN_PREPROCESSOR) { if (IsASpace(sc.ch)) { sc.SetState(SCE_SN_CODE); } } else if (sc.state == SCE_SN_DEFAULT) { if (sc.Match('<', '\'')) { sc.Forward(); sc.ForwardSetState(SCE_SN_CODE); } } else if (sc.state == SCE_SN_COMMENTLINE || sc.state == SCE_SN_COMMENTLINEBANG) { if (sc.atLineEnd) { sc.SetState(SCE_SN_CODE); visibleChars = 0; } } else if (sc.state == SCE_SN_STRING) { if (sc.ch == '\\') { if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') { sc.Forward(); } } else if (sc.ch == '\"') { sc.ForwardSetState(SCE_SN_CODE); } else if (sc.atLineEnd) { sc.ChangeState(SCE_SN_STRINGEOL); sc.ForwardSetState(SCE_SN_CODE); visibleChars = 0; } } else if (sc.state == SCE_SN_SIGNAL) { if (sc.atLineEnd) { sc.ChangeState(SCE_SN_STRINGEOL); sc.ForwardSetState(SCE_SN_CODE); visibleChars = 0; } else if (sc.ch == '\\') { if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') { sc.Forward(); } } else if (sc.ch == '\'') { sc.ForwardSetState(SCE_SN_CODE); } } else if (sc.state == SCE_SN_REGEXTAG) { if (!IsADigit(sc.ch)) { sc.SetState(SCE_SN_CODE); } } // Determine if a new state should be entered. if (sc.state == SCE_SN_CODE) { if (sc.ch == '$' && IsADigit(sc.chNext)) { sc.SetState(SCE_SN_REGEXTAG); sc.Forward(); } else if (IsADigit(sc.ch)) { sc.SetState(SCE_SN_NUMBER); } else if (IsAWordStart(sc.ch)) { sc.SetState(SCE_SN_IDENTIFIER); } else if (sc.Match('\'', '>')) { sc.SetState(SCE_SN_DEFAULT); sc.Forward(); // Eat the * so it isn't used for the end of the comment } else if (sc.Match('/', '/')) { if (sc.Match("//!")) // Nice to have a different comment style sc.SetState(SCE_SN_COMMENTLINEBANG); else sc.SetState(SCE_SN_COMMENTLINE); } else if (sc.Match('-', '-')) { if (sc.Match("--!")) // Nice to have a different comment style sc.SetState(SCE_SN_COMMENTLINEBANG); else sc.SetState(SCE_SN_COMMENTLINE); } else if (sc.ch == '\"') { sc.SetState(SCE_SN_STRING); } else if (sc.ch == '\'') { sc.SetState(SCE_SN_SIGNAL); } else if (sc.ch == '#' && visibleChars == 0) { // Preprocessor commands are alone on their line sc.SetState(SCE_SN_PREPROCESSOR); // Skip whitespace between # and preprocessor word do { sc.Forward(); } while ((sc.ch == ' ' || sc.ch == '\t') && sc.More()); if (sc.atLineEnd) { sc.SetState(SCE_SN_CODE); } } else if (isoperator(static_cast(sc.ch)) || sc.ch == '@') { sc.SetState(SCE_SN_OPERATOR); } } if (sc.atLineEnd) { // Reset states to begining of colourise so no surprises // if different sets of lines lexed. visibleChars = 0; } if (!IsASpace(sc.ch)) { visibleChars++; } } sc.Complete(); } // Store both the current line's fold level and the next lines in the // level store to make it easy to pick up with each increment // and to make it possible to fiddle the current level for "} else {". static void FoldNoBoxSpecmanDoc(unsigned int startPos, int length, int, Accessor &styler) { bool foldComment = styler.GetPropertyInt("fold.comment") != 0; bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; bool foldAtElse = styler.GetPropertyInt("fold.at.else", 0) != 0; unsigned int endPos = startPos + length; int visibleChars = 0; int lineCurrent = styler.GetLine(startPos); int levelCurrent = SC_FOLDLEVELBASE; if (lineCurrent > 0) levelCurrent = styler.LevelAt(lineCurrent-1) >> 16; int levelMinCurrent = levelCurrent; int levelNext = levelCurrent; char chNext = styler[startPos]; int styleNext = styler.StyleAt(startPos); int style; for (unsigned int i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); //int stylePrev = style; style = styleNext; styleNext = styler.StyleAt(i + 1); bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); if (foldComment && (style == SCE_SN_COMMENTLINE)) { if (((ch == '/') && (chNext == '/')) || ((ch == '-') && (chNext == '-'))) { char chNext2 = styler.SafeGetCharAt(i + 2); if (chNext2 == '{') { levelNext++; } else if (chNext2 == '}') { levelNext--; } } } if (style == SCE_SN_OPERATOR) { if (ch == '{') { // Measure the minimum before a '{' to allow // folding on "} else {" if (levelMinCurrent > levelNext) { levelMinCurrent = levelNext; } levelNext++; } else if (ch == '}') { levelNext--; } } if (atEOL) { int levelUse = levelCurrent; if (foldAtElse) { levelUse = levelMinCurrent; } int lev = levelUse | levelNext << 16; if (visibleChars == 0 && foldCompact) lev |= SC_FOLDLEVELWHITEFLAG; if (levelUse < levelNext) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) { styler.SetLevel(lineCurrent, lev); } lineCurrent++; levelCurrent = levelNext; levelMinCurrent = levelCurrent; visibleChars = 0; } if (!isspacechar(ch)) visibleChars++; } } static void FoldSpecmanDoc(unsigned int startPos, int length, int initStyle, WordList *[], Accessor &styler) { FoldNoBoxSpecmanDoc(startPos, length, initStyle, styler); } static const char * const specmanWordLists[] = { "Primary keywords and identifiers", "Secondary keywords and identifiers", "Sequence keywords and identifiers", "User defined keywords and identifiers", "Unused", 0, }; static void ColouriseSpecmanDocSensitive(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { ColouriseSpecmanDoc(startPos, length, initStyle, keywordlists, styler, true); } LexerModule lmSpecman(SCLEX_SPECMAN, ColouriseSpecmanDocSensitive, "specman", FoldSpecmanDoc, specmanWordLists); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexSmalltalk.cxx000444001750001750 2215411727344243 25542 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexSmalltalk.cxx ** Lexer for Smalltalk language. ** Written by Sergey Philippov, sphilippov-at-gmail-dot-com **/ // Copyright 1998-2002 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif /* | lexTable classificationBlock charClasses | charClasses := #(#DecDigit #Letter #Special #Upper #BinSel). lexTable := ByteArray new: 128. classificationBlock := [ :charClass :chars | | flag | flag := 1 bitShift: (charClasses indexOf: charClass) - 1. chars do: [ :char | lexTable at: char codePoint + 1 put: ((lexTable at: char codePoint + 1) bitOr: flag)]]. classificationBlock value: #DecDigit value: '0123456789'; value: #Letter value: '_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; value: #Special value: '()[]{};.^:'; value: #BinSel value: '~@%&*-+=|\/,<>?!'; value: #Upper value: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'. ((String new: 500) streamContents: [ :stream | stream crLf; nextPutAll: 'static int ClassificationTable[256] = {'. lexTable keysAndValuesDo: [ :index :value | ((index - 1) rem: 16) == 0 ifTrue: [ stream crLf; tab] ifFalse: [ stream space]. stream print: value. index ~= 256 ifTrue: [ stream nextPut: $,]]. stream crLf; nextPutAll: '};'; crLf. charClasses keysAndValuesDo: [ :index :name | stream crLf; nextPutAll: ( ('static inline bool is<1s>(int ch) {return (ch > 0) && (ch %< 0x80) && ((ClassificationTable[ch] & <2p>) != 0);}') expandMacrosWith: name with: (1 bitShift: (index - 1))) ]]) edit */ // autogenerated {{{{ static int ClassificationTable[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 16, 16, 0, 4, 4, 16, 16, 16, 16, 4, 16, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 16, 16, 16, 16, 16, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 4, 16, 4, 4, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 16, 4, 16, 0, }; static inline bool isDecDigit(int ch) {return (ch > 0) && (ch < 0x80) && ((ClassificationTable[ch] & 1) != 0);} static inline bool isLetter(int ch) {return (ch > 0) && (ch < 0x80) && ((ClassificationTable[ch] & 2) != 0);} static inline bool isSpecial(int ch) {return (ch > 0) && (ch < 0x80) && ((ClassificationTable[ch] & 4) != 0);} static inline bool isUpper(int ch) {return (ch > 0) && (ch < 0x80) && ((ClassificationTable[ch] & 8) != 0);} static inline bool isBinSel(int ch) {return (ch > 0) && (ch < 0x80) && ((ClassificationTable[ch] & 16) != 0);} // autogenerated }}}} static inline bool isAlphaNumeric(int ch) { return isDecDigit(ch) || isLetter(ch); } static inline bool isDigitOfRadix(int ch, int radix) { if (isDecDigit(ch)) return (ch - '0') < radix; else if (!isUpper(ch)) return false; else return (ch - 'A' + 10) < radix; } static inline void skipComment(StyleContext& sc) { while (sc.More() && sc.ch != '\"') sc.Forward(); } static inline void skipString(StyleContext& sc) { while (sc.More()) { if (sc.ch == '\'') { if (sc.chNext != '\'') return; sc.Forward(); } sc.Forward(); } } static void handleHash(StyleContext& sc) { if (isSpecial(sc.chNext)) { sc.SetState(SCE_ST_SPECIAL); return; } sc.SetState(SCE_ST_SYMBOL); sc.Forward(); if (sc.ch == '\'') { sc.Forward(); skipString(sc); } else { if (isLetter(sc.ch)) { while (isAlphaNumeric(sc.chNext) || sc.chNext == ':') sc.Forward(); } else if (isBinSel(sc.ch)) { while (isBinSel(sc.chNext)) sc.Forward(); } } } static inline void handleSpecial(StyleContext& sc) { if (sc.ch == ':' && sc.chNext == '=') { sc.SetState(SCE_ST_ASSIGN); sc.Forward(); } else { if (sc.ch == '^') sc.SetState(SCE_ST_RETURN); else sc.SetState(SCE_ST_SPECIAL); } } static inline void skipInt(StyleContext& sc, int radix) { while (isDigitOfRadix(sc.chNext, radix)) sc.Forward(); } static void handleNumeric(StyleContext& sc) { char num[256]; int nl; int radix; sc.SetState(SCE_ST_NUMBER); num[0] = static_cast(sc.ch); nl = 1; while (isDecDigit(sc.chNext)) { num[nl++] = static_cast(sc.chNext); sc.Forward(); if (nl+1 == sizeof(num)/sizeof(num[0])) // overrun check break; } if (sc.chNext == 'r') { num[nl] = 0; if (num[0] == '-') radix = atoi(num + 1); else radix = atoi(num); sc.Forward(); if (sc.chNext == '-') sc.Forward(); skipInt(sc, radix); } else radix = 10; if (sc.chNext != '.' || !isDigitOfRadix(sc.GetRelative(2), radix)) return; sc.Forward(); skipInt(sc, radix); if (sc.chNext == 's') { // ScaledDecimal sc.Forward(); while (isDecDigit(sc.chNext)) sc.Forward(); return; } else if (sc.chNext != 'e' && sc.chNext != 'd' && sc.chNext != 'q') return; sc.Forward(); if (sc.chNext == '+' || sc.chNext == '-') sc.Forward(); skipInt(sc, radix); } static inline void handleBinSel(StyleContext& sc) { sc.SetState(SCE_ST_BINARY); while (isBinSel(sc.chNext)) sc.Forward(); } static void handleLetter(StyleContext& sc, WordList* specialSelectorList) { char ident[256]; int il; int state; bool doubleColonPresent; sc.SetState(SCE_ST_DEFAULT); ident[0] = static_cast(sc.ch); il = 1; while (isAlphaNumeric(sc.chNext)) { ident[il++] = static_cast(sc.chNext); sc.Forward(); if (il+2 == sizeof(ident)/sizeof(ident[0])) // overrun check break; } if (sc.chNext == ':') { doubleColonPresent = true; ident[il++] = ':'; sc.Forward(); } else doubleColonPresent = false; ident[il] = 0; if (specialSelectorList->InList(ident)) state = SCE_ST_SPEC_SEL; else if (doubleColonPresent) state = SCE_ST_KWSEND; else if (isUpper(ident[0])) state = SCE_ST_GLOBAL; else { if (!strcmp(ident, "self")) state = SCE_ST_SELF; else if (!strcmp(ident, "super")) state = SCE_ST_SUPER; else if (!strcmp(ident, "nil")) state = SCE_ST_NIL; else if (!strcmp(ident, "true") || !strcmp(ident, "false")) state = SCE_ST_BOOL; else state = SCE_ST_DEFAULT; } sc.ChangeState(state); } static void colorizeSmalltalkDoc(unsigned int startPos, int length, int initStyle, WordList *wordLists[], Accessor &styler) { StyleContext sc(startPos, length, initStyle, styler); if (initStyle == SCE_ST_COMMENT) { skipComment(sc); if (sc.More()) sc.Forward(); } else if (initStyle == SCE_ST_STRING) { skipString(sc); if (sc.More()) sc.Forward(); } for (; sc.More(); sc.Forward()) { int ch; ch = sc.ch; if (ch == '\"') { sc.SetState(SCE_ST_COMMENT); sc.Forward(); skipComment(sc); } else if (ch == '\'') { sc.SetState(SCE_ST_STRING); sc.Forward(); skipString(sc); } else if (ch == '#') handleHash(sc); else if (ch == '$') { sc.SetState(SCE_ST_CHARACTER); sc.Forward(); } else if (isSpecial(ch)) handleSpecial(sc); else if (isDecDigit(ch)) handleNumeric(sc); else if (isLetter(ch)) handleLetter(sc, wordLists[0]); else if (isBinSel(ch)) { if (ch == '-' && isDecDigit(sc.chNext)) handleNumeric(sc); else handleBinSel(sc); } else sc.SetState(SCE_ST_DEFAULT); } sc.Complete(); } static const char* const smalltalkWordListDesc[] = { "Special selectors", 0 }; LexerModule lmSmalltalk(SCLEX_SMALLTALK, colorizeSmalltalkDoc, "smalltalk", NULL, smalltalkWordListDesc); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/XPM.cxx000444001750001750 2332211727344243 23607 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file XPM.cxx ** Define a class that holds data in the X Pixmap (XPM) format. **/ // Copyright 1998-2003 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include "Platform.h" #include "XPM.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static const char *NextField(const char *s) { // In case there are leading spaces in the string while (*s && *s == ' ') { s++; } while (*s && *s != ' ') { s++; } while (*s && *s == ' ') { s++; } return s; } // Data lines in XPM can be terminated either with NUL or " static size_t MeasureLength(const char *s) { size_t i = 0; while (s[i] && (s[i] != '\"')) i++; return i; } ColourDesired XPM::ColourDesiredFromCode(int ch) const { return *colourCodeTable[ch]; } ColourDesired XPM::ColourFromCode(int ch) const { return *colourCodeTable[ch]; } void XPM::FillRun(Surface *surface, int code, int startX, int y, int x) { if ((code != codeTransparent) && (startX != x)) { PRectangle rc(startX, y, x, y+1); surface->FillRectangle(rc, ColourFromCode(code)); } } XPM::XPM(const char *textForm) : data(0), codes(0), colours(0), lines(0) { Init(textForm); } XPM::XPM(const char *const *linesForm) : data(0), codes(0), colours(0), lines(0) { Init(linesForm); } XPM::~XPM() { Clear(); } void XPM::Init(const char *textForm) { Clear(); // Test done is two parts to avoid possibility of overstepping the memory // if memcmp implemented strangely. Must be 4 bytes at least at destination. if ((0 == memcmp(textForm, "/* X", 4)) && (0 == memcmp(textForm, "/* XPM */", 9))) { // Build the lines form out of the text form const char **linesForm = LinesFormFromTextForm(textForm); if (linesForm != 0) { Init(linesForm); delete []linesForm; } } else { // It is really in line form Init(reinterpret_cast(textForm)); } } void XPM::Init(const char *const *linesForm) { Clear(); height = 1; width = 1; nColours = 1; data = NULL; codeTransparent = ' '; codes = NULL; colours = NULL; lines = NULL; if (!linesForm) return; const char *line0 = linesForm[0]; width = atoi(line0); line0 = NextField(line0); height = atoi(line0); line0 = NextField(line0); nColours = atoi(line0); line0 = NextField(line0); if (atoi(line0) != 1) { // Only one char per pixel is supported return; } codes = new char[nColours]; colours = new ColourDesired[nColours]; int strings = 1+height+nColours; lines = new char *[strings]; size_t allocation = 0; for (int i=0; i(codes[c])] = &(colours[c]); } } void XPM::Clear() { delete []data; data = 0; delete []codes; codes = 0; delete []colours; colours = 0; delete []lines; lines = 0; } void XPM::Draw(Surface *surface, PRectangle &rc) { if (!data || !codes || !colours || !lines) { return; } // Centre the pixmap int startY = rc.top + (rc.Height() - height) / 2; int startX = rc.left + (rc.Width() - width) / 2; for (int y=0; y= width) || (y<0) || (y >= height)) { colour = 0; transparent = true; return; } int code = lines[y+nColours+1][x]; transparent = code == codeTransparent; if (transparent) { colour = 0; } else { colour = ColourDesiredFromCode(code).AsLong(); } } const char **XPM::LinesFormFromTextForm(const char *textForm) { // Build the lines form out of the text form const char **linesForm = 0; int countQuotes = 0; int strings=1; int j=0; for (; countQuotes < (2*strings) && textForm[j] != '\0'; j++) { if (textForm[j] == '\"') { if (countQuotes == 0) { // First field: width, height, number of colors, chars per pixel const char *line0 = textForm + j + 1; // Skip width line0 = NextField(line0); // Add 1 line for each pixel of height strings += atoi(line0); line0 = NextField(line0); // Add 1 line for each colour strings += atoi(line0); linesForm = new const char *[strings]; if (linesForm == 0) { break; // Memory error! } } if (countQuotes / 2 >= strings) { break; // Bad height or number of colors! } if ((countQuotes & 1) == 0) { linesForm[countQuotes / 2] = textForm + j + 1; } countQuotes++; } } if (textForm[j] == '\0' || countQuotes / 2 > strings) { // Malformed XPM! Height + number of colors too high or too low delete []linesForm; linesForm = 0; } return linesForm; } // In future, may want to minimize search time by sorting and using a binary search. XPMSet::XPMSet() : set(0), len(0), maximum(0), height(-1), width(-1) { } XPMSet::~XPMSet() { Clear(); } void XPMSet::Clear() { for (int i = 0; i < len; i++) { delete set[i]; } delete []set; set = 0; len = 0; maximum = 0; height = -1; width = -1; } void XPMSet::Add(int ident, const char *textForm) { // Invalidate cached dimensions height = -1; width = -1; // Replace if this id already present for (int i = 0; i < len; i++) { if (set[i]->GetId() == ident) { set[i]->Init(textForm); return; } } // Not present, so add to end XPM *pxpm = new XPM(textForm); if (pxpm) { pxpm->SetId(ident); if (len == maximum) { maximum += 64; XPM **setNew = new XPM *[maximum]; for (int i = 0; i < len; i++) { setNew[i] = set[i]; } delete []set; set = setNew; } set[len] = pxpm; len++; } } XPM *XPMSet::Get(int ident) { for (int i = 0; i < len; i++) { if (set[i]->GetId() == ident) { return set[i]; } } return 0; } int XPMSet::GetHeight() { if (height < 0) { for (int i = 0; i < len; i++) { if (height < set[i]->GetHeight()) { height = set[i]->GetHeight(); } } } return (height > 0) ? height : 0; } int XPMSet::GetWidth() { if (width < 0) { for (int i = 0; i < len; i++) { if (width < set[i]->GetWidth()) { width = set[i]->GetWidth(); } } } return (width > 0) ? width : 0; } RGBAImage::RGBAImage(int width_, int height_, const unsigned char *pixels_) : height(height_), width(width_) { if (pixels_) { pixelBytes.assign(pixels_, pixels_ + CountBytes()); } else { pixelBytes.resize(CountBytes()); } } RGBAImage::RGBAImage(const XPM &xpm) { height = xpm.GetHeight(); width = xpm.GetWidth(); pixelBytes.resize(CountBytes()); for (int y=0; ysecond; it->second = 0; } images.clear(); height = -1; width = -1; } /// Add an image. void RGBAImageSet::Add(int ident, RGBAImage *image) { ImageMap::iterator it=images.find(ident); if (it == images.end()) { images[ident] = image; } else { delete it->second; it->second = image; } height = -1; width = -1; } /// Get image by id. RGBAImage *RGBAImageSet::Get(int ident) { ImageMap::iterator it = images.find(ident); if (it != images.end()) { return it->second; } return NULL; } /// Give the largest height of the set. int RGBAImageSet::GetHeight() const { if (height < 0) { for (ImageMap::const_iterator it=images.begin(); it != images.end(); ++it) { if (height < it->second->GetHeight()) { height = it->second->GetHeight(); } } } return (height > 0) ? height : 0; } /// Give the largest width of the set. int RGBAImageSet::GetWidth() const { if (width < 0) { for (ImageMap::const_iterator it=images.begin(); it != images.end(); ++it) { if (width < it->second->GetWidth()) { width = it->second->GetWidth(); } } } return (width > 0) ? width : 0; } Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexerNoExceptions.h000444001750001750 215111727344243 26163 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexerNoExceptions.h ** A simple lexer with no state. **/ // Copyright 1998-2010 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #ifndef LexerNoExceptions_H #define LexerNoExceptions_H #ifdef SCI_NAMESPACE namespace Scintilla { #endif // A simple lexer with no state class LexerNoExceptions : public LexerBase { public: // TODO Also need to prevent exceptions in constructor and destructor int SCI_METHOD PropertySet(const char *key, const char *val); int SCI_METHOD WordListSet(int n, const char *wl); void SCI_METHOD Lex(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess); void SCI_METHOD Fold(unsigned int startPos, int lengthDoc, int initStyle, IDocument *); virtual void Lexer(unsigned int startPos, int length, int initStyle, IDocument *pAccess, Accessor &styler) = 0; virtual void Folder(unsigned int startPos, int length, int initStyle, IDocument *pAccess, Accessor &styler) = 0; }; #ifdef SCI_NAMESPACE } #endif #endif Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexLout.cxx000444001750001750 1415011727344243 24536 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexLout.cxx ** Lexer for the Basser Lout (>= version 3) typesetting language **/ // Copyright 2003 by Kein-Hong Man // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static inline bool IsAWordChar(const int ch) { return (ch < 0x80) && (isalpha(ch) || ch == '@' || ch == '_'); } static inline bool IsAnOther(const int ch) { return (ch < 0x80) && (ch == '{' || ch == '}' || ch == '!' || ch == '$' || ch == '%' || ch == '&' || ch == '\'' || ch == '(' || ch == ')' || ch == '*' || ch == '+' || ch == ',' || ch == '-' || ch == '.' || ch == '/' || ch == ':' || ch == ';' || ch == '<' || ch == '=' || ch == '>' || ch == '?' || ch == '[' || ch == ']' || ch == '^' || ch == '`' || ch == '|' || ch == '~'); } static void ColouriseLoutDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { WordList &keywords = *keywordlists[0]; WordList &keywords2 = *keywordlists[1]; WordList &keywords3 = *keywordlists[2]; int visibleChars = 0; int firstWordInLine = 0; int leadingAtSign = 0; StyleContext sc(startPos, length, initStyle, styler); for (; sc.More(); sc.Forward()) { if (sc.atLineStart && (sc.state == SCE_LOUT_STRING)) { // Prevent SCE_LOUT_STRINGEOL from leaking back to previous line sc.SetState(SCE_LOUT_STRING); } // Determine if the current state should terminate. if (sc.state == SCE_LOUT_COMMENT) { if (sc.atLineEnd) { sc.SetState(SCE_LOUT_DEFAULT); visibleChars = 0; } } else if (sc.state == SCE_LOUT_NUMBER) { if (!IsADigit(sc.ch) && sc.ch != '.') { sc.SetState(SCE_LOUT_DEFAULT); } } else if (sc.state == SCE_LOUT_STRING) { if (sc.ch == '\\') { if (sc.chNext == '\"' || sc.chNext == '\\') { sc.Forward(); } } else if (sc.ch == '\"') { sc.ForwardSetState(SCE_LOUT_DEFAULT); } else if (sc.atLineEnd) { sc.ChangeState(SCE_LOUT_STRINGEOL); sc.ForwardSetState(SCE_LOUT_DEFAULT); visibleChars = 0; } } else if (sc.state == SCE_LOUT_IDENTIFIER) { if (!IsAWordChar(sc.ch)) { char s[100]; sc.GetCurrent(s, sizeof(s)); if (leadingAtSign) { if (keywords.InList(s)) { sc.ChangeState(SCE_LOUT_WORD); } else { sc.ChangeState(SCE_LOUT_WORD4); } } else if (firstWordInLine && keywords3.InList(s)) { sc.ChangeState(SCE_LOUT_WORD3); } sc.SetState(SCE_LOUT_DEFAULT); } } else if (sc.state == SCE_LOUT_OPERATOR) { if (!IsAnOther(sc.ch)) { char s[100]; sc.GetCurrent(s, sizeof(s)); if (keywords2.InList(s)) { sc.ChangeState(SCE_LOUT_WORD2); } sc.SetState(SCE_LOUT_DEFAULT); } } // Determine if a new state should be entered. if (sc.state == SCE_LOUT_DEFAULT) { if (sc.ch == '#') { sc.SetState(SCE_LOUT_COMMENT); } else if (sc.ch == '\"') { sc.SetState(SCE_LOUT_STRING); } else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) { sc.SetState(SCE_LOUT_NUMBER); } else if (IsAWordChar(sc.ch)) { firstWordInLine = (visibleChars == 0); leadingAtSign = (sc.ch == '@'); sc.SetState(SCE_LOUT_IDENTIFIER); } else if (IsAnOther(sc.ch)) { sc.SetState(SCE_LOUT_OPERATOR); } } if (sc.atLineEnd) { // Reset states to begining of colourise so no surprises // if different sets of lines lexed. visibleChars = 0; } if (!IsASpace(sc.ch)) { visibleChars++; } } sc.Complete(); } static void FoldLoutDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) { unsigned int endPos = startPos + length; int visibleChars = 0; int lineCurrent = styler.GetLine(startPos); int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; int levelCurrent = levelPrev; char chNext = styler[startPos]; bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; int styleNext = styler.StyleAt(startPos); char s[10]; for (unsigned int i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); int style = styleNext; styleNext = styler.StyleAt(i + 1); bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); if (style == SCE_LOUT_WORD) { if (ch == '@') { for (unsigned int j = 0; j < 8; j++) { if (!IsAWordChar(styler[i + j])) { break; } s[j] = styler[i + j]; s[j + 1] = '\0'; } if (strcmp(s, "@Begin") == 0) { levelCurrent++; } else if (strcmp(s, "@End") == 0) { levelCurrent--; } } } else if (style == SCE_LOUT_OPERATOR) { if (ch == '{') { levelCurrent++; } else if (ch == '}') { levelCurrent--; } } if (atEOL) { int lev = levelPrev; if (visibleChars == 0 && foldCompact) { lev |= SC_FOLDLEVELWHITEFLAG; } if ((levelCurrent > levelPrev) && (visibleChars > 0)) { lev |= SC_FOLDLEVELHEADERFLAG; } if (lev != styler.LevelAt(lineCurrent)) { styler.SetLevel(lineCurrent, lev); } lineCurrent++; levelPrev = levelCurrent; visibleChars = 0; } if (!isspacechar(ch)) visibleChars++; } // Fill in the real level of the next line, keeping the current flags as they will be filled in later int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; styler.SetLevel(lineCurrent, levelPrev | flagsNext); } static const char * const loutWordLists[] = { "Predefined identifiers", "Predefined delimiters", "Predefined keywords", 0, }; LexerModule lmLout(SCLEX_LOUT, ColouriseLoutDoc, "lout", FoldLoutDoc, loutWordLists); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexPython.cxx000444001750001750 4600711727344243 25102 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexPython.cxx ** Lexer for Python. **/ // Copyright 1998-2002 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif /* kwCDef, kwCTypeName only used for Cython */ enum kwType { kwOther, kwClass, kwDef, kwImport, kwCDef, kwCTypeName, kwCPDef }; static const int indicatorWhitespace = 1; static bool IsPyComment(Accessor &styler, int pos, int len) { return len > 0 && styler[pos] == '#'; } enum literalsAllowed { litNone=0, litU=1, litB=2}; static bool IsPyStringTypeChar(int ch, literalsAllowed allowed) { return ((allowed & litB) && (ch == 'b' || ch == 'B')) || ((allowed & litU) && (ch == 'u' || ch == 'U')); } static bool IsPyStringStart(int ch, int chNext, int chNext2, literalsAllowed allowed) { if (ch == '\'' || ch == '"') return true; if (IsPyStringTypeChar(ch, allowed)) { if (chNext == '"' || chNext == '\'') return true; if ((chNext == 'r' || chNext == 'R') && (chNext2 == '"' || chNext2 == '\'')) return true; } if ((ch == 'r' || ch == 'R') && (chNext == '"' || chNext == '\'')) return true; return false; } /* Return the state to use for the string starting at i; *nextIndex will be set to the first index following the quote(s) */ static int GetPyStringState(Accessor &styler, int i, unsigned int *nextIndex, literalsAllowed allowed) { char ch = styler.SafeGetCharAt(i); char chNext = styler.SafeGetCharAt(i + 1); // Advance beyond r, u, or ur prefix (or r, b, or br in Python 3.0), but bail if there are any unexpected chars if (ch == 'r' || ch == 'R') { i++; ch = styler.SafeGetCharAt(i); chNext = styler.SafeGetCharAt(i + 1); } else if (IsPyStringTypeChar(ch, allowed)) { if (chNext == 'r' || chNext == 'R') i += 2; else i += 1; ch = styler.SafeGetCharAt(i); chNext = styler.SafeGetCharAt(i + 1); } if (ch != '"' && ch != '\'') { *nextIndex = i + 1; return SCE_P_DEFAULT; } if (ch == chNext && ch == styler.SafeGetCharAt(i + 2)) { *nextIndex = i + 3; if (ch == '"') return SCE_P_TRIPLEDOUBLE; else return SCE_P_TRIPLE; } else { *nextIndex = i + 1; if (ch == '"') return SCE_P_STRING; else return SCE_P_CHARACTER; } } static inline bool IsAWordChar(int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_'); } static inline bool IsAWordStart(int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '_'); } static void ColourisePyDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { int endPos = startPos + length; // Backtrack to previous line in case need to fix its tab whinging int lineCurrent = styler.GetLine(startPos); if (startPos > 0) { if (lineCurrent > 0) { lineCurrent--; // Look for backslash-continued lines while (lineCurrent > 0) { int eolPos = styler.LineStart(lineCurrent) - 1; int eolStyle = styler.StyleAt(eolPos); if (eolStyle == SCE_P_STRING || eolStyle == SCE_P_CHARACTER || eolStyle == SCE_P_STRINGEOL) { lineCurrent -= 1; } else { break; } } startPos = styler.LineStart(lineCurrent); } initStyle = startPos == 0 ? SCE_P_DEFAULT : styler.StyleAt(startPos - 1); } WordList &keywords = *keywordlists[0]; WordList &keywords2 = *keywordlists[1]; // property tab.timmy.whinge.level // For Python code, checks whether indenting is consistent. // The default, 0 turns off indentation checking, // 1 checks whether each line is potentially inconsistent with the previous line, // 2 checks whether any space characters occur before a tab character in the indentation, // 3 checks whether any spaces are in the indentation, and // 4 checks for any tab characters in the indentation. // 1 is a good level to use. const int whingeLevel = styler.GetPropertyInt("tab.timmy.whinge.level"); // property lexer.python.literals.binary // Set to 0 to not recognise Python 3 binary and octal literals: 0b1011 0o712. bool base2or8Literals = styler.GetPropertyInt("lexer.python.literals.binary", 1) != 0; // property lexer.python.strings.u // Set to 0 to not recognise Python Unicode literals u"x" as used before Python 3. literalsAllowed allowedLiterals = (styler.GetPropertyInt("lexer.python.strings.u", 1)) ? litU : litNone; // property lexer.python.strings.b // Set to 0 to not recognise Python 3 bytes literals b"x". if (styler.GetPropertyInt("lexer.python.strings.b", 1)) allowedLiterals = static_cast(allowedLiterals | litB); // property lexer.python.strings.over.newline // Set to 1 to allow strings to span newline characters. bool stringsOverNewline = styler.GetPropertyInt("lexer.python.strings.over.newline") != 0; // property lexer.python.keywords2.no.sub.identifiers // When enabled, it will not style keywords2 items that are used as a sub-identifier. // Example: when set, will not highlight "foo.open" when "open" is a keywords2 item. const bool keywords2NoSubIdentifiers = styler.GetPropertyInt("lexer.python.keywords2.no.sub.identifiers") != 0; initStyle = initStyle & 31; if (initStyle == SCE_P_STRINGEOL) { initStyle = SCE_P_DEFAULT; } kwType kwLast = kwOther; int spaceFlags = 0; styler.IndentAmount(lineCurrent, &spaceFlags, IsPyComment); bool base_n_number = false; StyleContext sc(startPos, endPos - startPos, initStyle, styler); bool indentGood = true; int startIndicator = sc.currentPos; bool inContinuedString = false; for (; sc.More(); sc.Forward()) { if (sc.atLineStart) { styler.IndentAmount(lineCurrent, &spaceFlags, IsPyComment); indentGood = true; if (whingeLevel == 1) { indentGood = (spaceFlags & wsInconsistent) == 0; } else if (whingeLevel == 2) { indentGood = (spaceFlags & wsSpaceTab) == 0; } else if (whingeLevel == 3) { indentGood = (spaceFlags & wsSpace) == 0; } else if (whingeLevel == 4) { indentGood = (spaceFlags & wsTab) == 0; } if (!indentGood) { styler.IndicatorFill(startIndicator, sc.currentPos, indicatorWhitespace, 0); startIndicator = sc.currentPos; } } if (sc.atLineEnd) { if ((sc.state == SCE_P_DEFAULT) || (sc.state == SCE_P_TRIPLE) || (sc.state == SCE_P_TRIPLEDOUBLE)) { // Perform colourisation of white space and triple quoted strings at end of each line to allow // tab marking to work inside white space and triple quoted strings sc.SetState(sc.state); } lineCurrent++; if ((sc.state == SCE_P_STRING) || (sc.state == SCE_P_CHARACTER)) { if (inContinuedString || stringsOverNewline) { inContinuedString = false; } else { sc.ChangeState(SCE_P_STRINGEOL); sc.ForwardSetState(SCE_P_DEFAULT); } } if (!sc.More()) break; } bool needEOLCheck = false; // Check for a state end if (sc.state == SCE_P_OPERATOR) { kwLast = kwOther; sc.SetState(SCE_P_DEFAULT); } else if (sc.state == SCE_P_NUMBER) { if (!IsAWordChar(sc.ch) && !(!base_n_number && ((sc.ch == '+' || sc.ch == '-') && (sc.chPrev == 'e' || sc.chPrev == 'E')))) { sc.SetState(SCE_P_DEFAULT); } } else if (sc.state == SCE_P_IDENTIFIER) { if ((sc.ch == '.') || (!IsAWordChar(sc.ch))) { char s[100]; sc.GetCurrent(s, sizeof(s)); int style = SCE_P_IDENTIFIER; if ((kwLast == kwImport) && (strcmp(s, "as") == 0)) { style = SCE_P_WORD; } else if (keywords.InList(s)) { style = SCE_P_WORD; } else if (kwLast == kwClass) { style = SCE_P_CLASSNAME; } else if (kwLast == kwDef) { style = SCE_P_DEFNAME; } else if (kwLast == kwCDef || kwLast == kwCPDef) { int pos = sc.currentPos; unsigned char ch = styler.SafeGetCharAt(pos, '\0'); while (ch != '\0') { if (ch == '(') { style = SCE_P_DEFNAME; break; } else if (ch == ':') { style = SCE_P_CLASSNAME; break; } else if (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r') { pos++; ch = styler.SafeGetCharAt(pos, '\0'); } else { break; } } } else if (keywords2.InList(s)) { if (keywords2NoSubIdentifiers) { // We don't want to highlight keywords2 // that are used as a sub-identifier, // i.e. not open in "foo.open". int pos = styler.GetStartSegment() - 1; if (pos < 0 || (styler.SafeGetCharAt(pos, '\0') != '.')) style = SCE_P_WORD2; } else { style = SCE_P_WORD2; } } sc.ChangeState(style); sc.SetState(SCE_P_DEFAULT); if (style == SCE_P_WORD) { if (0 == strcmp(s, "class")) kwLast = kwClass; else if (0 == strcmp(s, "def")) kwLast = kwDef; else if (0 == strcmp(s, "import")) kwLast = kwImport; else if (0 == strcmp(s, "cdef")) kwLast = kwCDef; else if (0 == strcmp(s, "cpdef")) kwLast = kwCPDef; else if (0 == strcmp(s, "cimport")) kwLast = kwImport; else if (kwLast != kwCDef && kwLast != kwCPDef) kwLast = kwOther; } else if (kwLast != kwCDef && kwLast != kwCPDef) { kwLast = kwOther; } } } else if ((sc.state == SCE_P_COMMENTLINE) || (sc.state == SCE_P_COMMENTBLOCK)) { if (sc.ch == '\r' || sc.ch == '\n') { sc.SetState(SCE_P_DEFAULT); } } else if (sc.state == SCE_P_DECORATOR) { if (!IsAWordChar(sc.ch)) { sc.SetState(SCE_P_DEFAULT); } } else if ((sc.state == SCE_P_STRING) || (sc.state == SCE_P_CHARACTER)) { if (sc.ch == '\\') { if ((sc.chNext == '\r') && (sc.GetRelative(2) == '\n')) { sc.Forward(); } if (sc.chNext == '\n' || sc.chNext == '\r') { inContinuedString = true; } else { // Don't roll over the newline. sc.Forward(); } } else if ((sc.state == SCE_P_STRING) && (sc.ch == '\"')) { sc.ForwardSetState(SCE_P_DEFAULT); needEOLCheck = true; } else if ((sc.state == SCE_P_CHARACTER) && (sc.ch == '\'')) { sc.ForwardSetState(SCE_P_DEFAULT); needEOLCheck = true; } } else if (sc.state == SCE_P_TRIPLE) { if (sc.ch == '\\') { sc.Forward(); } else if (sc.Match("\'\'\'")) { sc.Forward(); sc.Forward(); sc.ForwardSetState(SCE_P_DEFAULT); needEOLCheck = true; } } else if (sc.state == SCE_P_TRIPLEDOUBLE) { if (sc.ch == '\\') { sc.Forward(); } else if (sc.Match("\"\"\"")) { sc.Forward(); sc.Forward(); sc.ForwardSetState(SCE_P_DEFAULT); needEOLCheck = true; } } if (!indentGood && !IsASpaceOrTab(sc.ch)) { styler.IndicatorFill(startIndicator, sc.currentPos, indicatorWhitespace, 1); startIndicator = sc.currentPos; indentGood = true; } // One cdef or cpdef line, clear kwLast only at end of line if ((kwLast == kwCDef || kwLast == kwCPDef) && sc.atLineEnd) { kwLast = kwOther; } // State exit code may have moved on to end of line if (needEOLCheck && sc.atLineEnd) { lineCurrent++; styler.IndentAmount(lineCurrent, &spaceFlags, IsPyComment); if (!sc.More()) break; } // Check for a new state starting character if (sc.state == SCE_P_DEFAULT) { if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) { if (sc.ch == '0' && (sc.chNext == 'x' || sc.chNext == 'X')) { base_n_number = true; sc.SetState(SCE_P_NUMBER); } else if (sc.ch == '0' && (sc.chNext == 'o' || sc.chNext == 'O' || sc.chNext == 'b' || sc.chNext == 'B')) { if (base2or8Literals) { base_n_number = true; sc.SetState(SCE_P_NUMBER); } else { sc.SetState(SCE_P_NUMBER); sc.ForwardSetState(SCE_P_IDENTIFIER); } } else { base_n_number = false; sc.SetState(SCE_P_NUMBER); } } else if ((isascii(sc.ch) && isoperator(static_cast(sc.ch))) || sc.ch == '`') { sc.SetState(SCE_P_OPERATOR); } else if (sc.ch == '#') { sc.SetState(sc.chNext == '#' ? SCE_P_COMMENTBLOCK : SCE_P_COMMENTLINE); } else if (sc.ch == '@') { sc.SetState(SCE_P_DECORATOR); } else if (IsPyStringStart(sc.ch, sc.chNext, sc.GetRelative(2), allowedLiterals)) { unsigned int nextIndex = 0; sc.SetState(GetPyStringState(styler, sc.currentPos, &nextIndex, allowedLiterals)); while (nextIndex > (sc.currentPos + 1) && sc.More()) { sc.Forward(); } } else if (IsAWordStart(sc.ch)) { sc.SetState(SCE_P_IDENTIFIER); } } } styler.IndicatorFill(startIndicator, sc.currentPos, indicatorWhitespace, 0); sc.Complete(); } static bool IsCommentLine(int line, Accessor &styler) { int pos = styler.LineStart(line); int eol_pos = styler.LineStart(line + 1) - 1; for (int i = pos; i < eol_pos; i++) { char ch = styler[i]; if (ch == '#') return true; else if (ch != ' ' && ch != '\t') return false; } return false; } static bool IsQuoteLine(int line, Accessor &styler) { int style = styler.StyleAt(styler.LineStart(line)) & 31; return ((style == SCE_P_TRIPLE) || (style == SCE_P_TRIPLEDOUBLE)); } static void FoldPyDoc(unsigned int startPos, int length, int /*initStyle - unused*/, WordList *[], Accessor &styler) { const int maxPos = startPos + length; const int maxLines = (maxPos == styler.Length()) ? styler.GetLine(maxPos) : styler.GetLine(maxPos - 1); // Requested last line const int docLines = styler.GetLine(styler.Length()); // Available last line // property fold.quotes.python // This option enables folding multi-line quoted strings when using the Python lexer. const bool foldQuotes = styler.GetPropertyInt("fold.quotes.python") != 0; const bool foldCompact = styler.GetPropertyInt("fold.compact") != 0; // Backtrack to previous non-blank line so we can determine indent level // for any white space lines (needed esp. within triple quoted strings) // and so we can fix any preceding fold level (which is why we go back // at least one line in all cases) int spaceFlags = 0; int lineCurrent = styler.GetLine(startPos); int indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, NULL); while (lineCurrent > 0) { lineCurrent--; indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, NULL); if (!(indentCurrent & SC_FOLDLEVELWHITEFLAG) && (!IsCommentLine(lineCurrent, styler)) && (!IsQuoteLine(lineCurrent, styler))) break; } int indentCurrentLevel = indentCurrent & SC_FOLDLEVELNUMBERMASK; // Set up initial loop state startPos = styler.LineStart(lineCurrent); int prev_state = SCE_P_DEFAULT & 31; if (lineCurrent >= 1) prev_state = styler.StyleAt(startPos - 1) & 31; int prevQuote = foldQuotes && ((prev_state == SCE_P_TRIPLE) || (prev_state == SCE_P_TRIPLEDOUBLE)); // Process all characters to end of requested range or end of any triple quote //that hangs over the end of the range. Cap processing in all cases // to end of document (in case of unclosed quote at end). while ((lineCurrent <= docLines) && ((lineCurrent <= maxLines) || prevQuote)) { // Gather info int lev = indentCurrent; int lineNext = lineCurrent + 1; int indentNext = indentCurrent; int quote = false; if (lineNext <= docLines) { // Information about next line is only available if not at end of document indentNext = styler.IndentAmount(lineNext, &spaceFlags, NULL); int lookAtPos = (styler.LineStart(lineNext) == styler.Length()) ? styler.Length() - 1 : styler.LineStart(lineNext); int style = styler.StyleAt(lookAtPos) & 31; quote = foldQuotes && ((style == SCE_P_TRIPLE) || (style == SCE_P_TRIPLEDOUBLE)); } const int quote_start = (quote && !prevQuote); const int quote_continue = (quote && prevQuote); if (!quote || !prevQuote) indentCurrentLevel = indentCurrent & SC_FOLDLEVELNUMBERMASK; if (quote) indentNext = indentCurrentLevel; if (indentNext & SC_FOLDLEVELWHITEFLAG) indentNext = SC_FOLDLEVELWHITEFLAG | indentCurrentLevel; if (quote_start) { // Place fold point at start of triple quoted string lev |= SC_FOLDLEVELHEADERFLAG; } else if (quote_continue || prevQuote) { // Add level to rest of lines in the string lev = lev + 1; } // Skip past any blank lines for next indent level info; we skip also // comments (all comments, not just those starting in column 0) // which effectively folds them into surrounding code rather // than screwing up folding. while (!quote && (lineNext < docLines) && ((indentNext & SC_FOLDLEVELWHITEFLAG) || (lineNext <= docLines && IsCommentLine(lineNext, styler)))) { lineNext++; indentNext = styler.IndentAmount(lineNext, &spaceFlags, NULL); } const int levelAfterComments = indentNext & SC_FOLDLEVELNUMBERMASK; const int levelBeforeComments = Maximum(indentCurrentLevel,levelAfterComments); // Now set all the indent levels on the lines we skipped // Do this from end to start. Once we encounter one line // which is indented more than the line after the end of // the comment-block, use the level of the block before int skipLine = lineNext; int skipLevel = levelAfterComments; while (--skipLine > lineCurrent) { int skipLineIndent = styler.IndentAmount(skipLine, &spaceFlags, NULL); if (foldCompact) { if ((skipLineIndent & SC_FOLDLEVELNUMBERMASK) > levelAfterComments) skipLevel = levelBeforeComments; int whiteFlag = skipLineIndent & SC_FOLDLEVELWHITEFLAG; styler.SetLevel(skipLine, skipLevel | whiteFlag); } else { if ((skipLineIndent & SC_FOLDLEVELNUMBERMASK) > levelAfterComments && !(skipLineIndent & SC_FOLDLEVELWHITEFLAG) && !IsCommentLine(skipLine, styler)) skipLevel = levelBeforeComments; styler.SetLevel(skipLine, skipLevel); } } // Set fold header on non-quote line if (!quote && !(indentCurrent & SC_FOLDLEVELWHITEFLAG)) { if ((indentCurrent & SC_FOLDLEVELNUMBERMASK) < (indentNext & SC_FOLDLEVELNUMBERMASK)) lev |= SC_FOLDLEVELHEADERFLAG; } // Keep track of triple quote state of previous line prevQuote = quote; // Set fold level for this line and move to next line styler.SetLevel(lineCurrent, foldCompact ? lev : lev & ~SC_FOLDLEVELWHITEFLAG); indentCurrent = indentNext; lineCurrent = lineNext; } // NOTE: Cannot set level of last line here because indentCurrent doesn't have // header flag set; the loop above is crafted to take care of this case! //styler.SetLevel(lineCurrent, indentCurrent); } static const char *const pythonWordListDesc[] = { "Keywords", "Highlighted identifiers", 0 }; LexerModule lmPython(SCLEX_PYTHON, ColourisePyDoc, "python", FoldPyDoc, pythonWordListDesc); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexPOV.cxx000444001750001750 2316211727344243 24262 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexPOV.cxx ** Lexer for POV-Ray SDL (Persistance of Vision Raytracer, Scene Description Language). ** Written by Philippe Lhoste but this is mostly a derivative of LexCPP... **/ // Copyright 1998-2005 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. // Some points that distinguish from a simple C lexer: // Identifiers start only by a character. // No line continuation character. // Strings are limited to 256 characters. // Directives are similar to preprocessor commands, // but we match directive keywords and colorize incorrect ones. // Block comments can be nested (code stolen from my code in LexLua). #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static inline bool IsAWordChar(int ch) { return ch < 0x80 && (isalnum(ch) || ch == '_'); } static inline bool IsAWordStart(int ch) { return ch < 0x80 && isalpha(ch); } static inline bool IsANumberChar(int ch) { // Not exactly following number definition (several dots are seen as OK, etc.) // but probably enough in most cases. return (ch < 0x80) && (isdigit(ch) || toupper(ch) == 'E' || ch == '.' || ch == '-' || ch == '+'); } static void ColourisePovDoc( unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { WordList &keywords1 = *keywordlists[0]; WordList &keywords2 = *keywordlists[1]; WordList &keywords3 = *keywordlists[2]; WordList &keywords4 = *keywordlists[3]; WordList &keywords5 = *keywordlists[4]; WordList &keywords6 = *keywordlists[5]; WordList &keywords7 = *keywordlists[6]; WordList &keywords8 = *keywordlists[7]; int currentLine = styler.GetLine(startPos); // Initialize the block comment /* */ nesting level, if we are inside such a comment. int blockCommentLevel = 0; if (initStyle == SCE_POV_COMMENT) { blockCommentLevel = styler.GetLineState(currentLine - 1); } // Do not leak onto next line if (initStyle == SCE_POV_STRINGEOL || initStyle == SCE_POV_COMMENTLINE) { initStyle = SCE_POV_DEFAULT; } short stringLen = 0; StyleContext sc(startPos, length, initStyle, styler); for (; sc.More(); sc.Forward()) { if (sc.atLineEnd) { // Update the line state, so it can be seen by next line currentLine = styler.GetLine(sc.currentPos); if (sc.state == SCE_POV_COMMENT) { // Inside a block comment, we set the line state styler.SetLineState(currentLine, blockCommentLevel); } else { // Reset the line state styler.SetLineState(currentLine, 0); } } if (sc.atLineStart && (sc.state == SCE_POV_STRING)) { // Prevent SCE_POV_STRINGEOL from leaking back to previous line sc.SetState(SCE_POV_STRING); } // Determine if the current state should terminate. if (sc.state == SCE_POV_OPERATOR) { sc.SetState(SCE_POV_DEFAULT); } else if (sc.state == SCE_POV_NUMBER) { // We stop the number definition on non-numerical non-dot non-eE non-sign char if (!IsANumberChar(sc.ch)) { sc.SetState(SCE_POV_DEFAULT); } } else if (sc.state == SCE_POV_IDENTIFIER) { if (!IsAWordChar(sc.ch)) { char s[100]; sc.GetCurrent(s, sizeof(s)); if (keywords2.InList(s)) { sc.ChangeState(SCE_POV_WORD2); } else if (keywords3.InList(s)) { sc.ChangeState(SCE_POV_WORD3); } else if (keywords4.InList(s)) { sc.ChangeState(SCE_POV_WORD4); } else if (keywords5.InList(s)) { sc.ChangeState(SCE_POV_WORD5); } else if (keywords6.InList(s)) { sc.ChangeState(SCE_POV_WORD6); } else if (keywords7.InList(s)) { sc.ChangeState(SCE_POV_WORD7); } else if (keywords8.InList(s)) { sc.ChangeState(SCE_POV_WORD8); } sc.SetState(SCE_POV_DEFAULT); } } else if (sc.state == SCE_POV_DIRECTIVE) { if (!IsAWordChar(sc.ch)) { char s[100]; char *p; sc.GetCurrent(s, sizeof(s)); p = s; // Skip # and whitespace between # and directive word do { p++; } while ((*p == ' ' || *p == '\t') && *p != '\0'); if (!keywords1.InList(p)) { sc.ChangeState(SCE_POV_BADDIRECTIVE); } sc.SetState(SCE_POV_DEFAULT); } } else if (sc.state == SCE_POV_COMMENT) { if (sc.Match('/', '*')) { blockCommentLevel++; sc.Forward(); } else if (sc.Match('*', '/') && blockCommentLevel > 0) { blockCommentLevel--; sc.Forward(); if (blockCommentLevel == 0) { sc.ForwardSetState(SCE_POV_DEFAULT); } } } else if (sc.state == SCE_POV_COMMENTLINE) { if (sc.atLineEnd) { sc.ForwardSetState(SCE_POV_DEFAULT); } } else if (sc.state == SCE_POV_STRING) { if (sc.ch == '\\') { stringLen++; if (strchr("abfnrtuv0'\"", sc.chNext)) { // Compound characters are counted as one. // Note: for Unicode chars \u, we shouldn't count the next 4 digits... sc.Forward(); } } else if (sc.ch == '\"') { sc.ForwardSetState(SCE_POV_DEFAULT); } else if (sc.atLineEnd) { sc.ChangeState(SCE_POV_STRINGEOL); sc.ForwardSetState(SCE_POV_DEFAULT); } else { stringLen++; } if (stringLen > 256) { // Strings are limited to 256 chars sc.SetState(SCE_POV_STRINGEOL); } } else if (sc.state == SCE_POV_STRINGEOL) { if (sc.ch == '\\') { if (sc.chNext == '\"' || sc.chNext == '\\') { sc.Forward(); } } else if (sc.ch == '\"') { sc.ForwardSetState(SCE_C_DEFAULT); } else if (sc.atLineEnd) { sc.ForwardSetState(SCE_POV_DEFAULT); } } // Determine if a new state should be entered. if (sc.state == SCE_POV_DEFAULT) { if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) { sc.SetState(SCE_POV_NUMBER); } else if (IsAWordStart(sc.ch)) { sc.SetState(SCE_POV_IDENTIFIER); } else if (sc.Match('/', '*')) { blockCommentLevel = 1; sc.SetState(SCE_POV_COMMENT); sc.Forward(); // Eat the * so it isn't used for the end of the comment } else if (sc.Match('/', '/')) { sc.SetState(SCE_POV_COMMENTLINE); } else if (sc.ch == '\"') { sc.SetState(SCE_POV_STRING); stringLen = 0; } else if (sc.ch == '#') { sc.SetState(SCE_POV_DIRECTIVE); // Skip whitespace between # and directive word do { sc.Forward(); } while ((sc.ch == ' ' || sc.ch == '\t') && sc.More()); if (sc.atLineEnd) { sc.SetState(SCE_POV_DEFAULT); } } else if (isoperator(static_cast(sc.ch))) { sc.SetState(SCE_POV_OPERATOR); } } } sc.Complete(); } static void FoldPovDoc( unsigned int startPos, int length, int initStyle, WordList *[], Accessor &styler) { bool foldComment = styler.GetPropertyInt("fold.comment") != 0; bool foldDirective = styler.GetPropertyInt("fold.directive") != 0; bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; unsigned int endPos = startPos + length; int visibleChars = 0; int lineCurrent = styler.GetLine(startPos); int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; int levelCurrent = levelPrev; char chNext = styler[startPos]; int styleNext = styler.StyleAt(startPos); int style = initStyle; for (unsigned int i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); int stylePrev = style; style = styleNext; styleNext = styler.StyleAt(i + 1); bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); if (foldComment && (style == SCE_POV_COMMENT)) { if (stylePrev != SCE_POV_COMMENT) { levelCurrent++; } else if ((styleNext != SCE_POV_COMMENT) && !atEOL) { // Comments don't end at end of line and the next character may be unstyled. levelCurrent--; } } if (foldComment && (style == SCE_POV_COMMENTLINE)) { if ((ch == '/') && (chNext == '/')) { char chNext2 = styler.SafeGetCharAt(i + 2); if (chNext2 == '{') { levelCurrent++; } else if (chNext2 == '}') { levelCurrent--; } } } if (foldDirective && (style == SCE_POV_DIRECTIVE)) { if (ch == '#') { unsigned int j=i+1; while ((j levelPrev) && (visibleChars > 0)) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) { styler.SetLevel(lineCurrent, lev); } lineCurrent++; levelPrev = levelCurrent; visibleChars = 0; } if (!isspacechar(ch)) visibleChars++; } // Fill in the real level of the next line, keeping the current flags as they will be filled in later int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; styler.SetLevel(lineCurrent, levelPrev | flagsNext); } static const char * const povWordLists[] = { "Language directives", "Objects & CSG & Appearance", "Types & Modifiers & Items", "Predefined Identifiers", "Predefined Functions", "User defined 1", "User defined 2", "User defined 3", 0, }; LexerModule lmPOV(SCLEX_POV, ColourisePovDoc, "pov", FoldPovDoc, povWordLists); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexFortran.cxx000444001750001750 4072011727344243 25230 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexFortran.cxx ** Lexer for Fortran. ** Writen by Chuan-jian Shen, Last changed Sep. 2003 **/ // Copyright 1998-2001 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. /***************************************/ #include #include #include #include #include #include /***************************************/ #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" /***************************************/ #ifdef SCI_NAMESPACE using namespace Scintilla; #endif /***********************************************/ static inline bool IsAWordChar(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '%'); } /**********************************************/ static inline bool IsAWordStart(const int ch) { return (ch < 0x80) && (isalnum(ch)); } /***************************************/ inline bool IsABlank(unsigned int ch) { return (ch == ' ') || (ch == 0x09) || (ch == 0x0b) ; } /***************************************/ inline bool IsALineEnd(char ch) { return ((ch == '\n') || (ch == '\r')) ; } /***************************************/ unsigned int GetContinuedPos(unsigned int pos, Accessor &styler) { while (!IsALineEnd(styler.SafeGetCharAt(pos++))) continue; if (styler.SafeGetCharAt(pos) == '\n') pos++; while (IsABlank(styler.SafeGetCharAt(pos++))) continue; char chCur = styler.SafeGetCharAt(pos); if (chCur == '&') { while (IsABlank(styler.SafeGetCharAt(++pos))) continue; return pos; } else { return pos; } } /***************************************/ static void ColouriseFortranDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler, bool isFixFormat) { WordList &keywords = *keywordlists[0]; WordList &keywords2 = *keywordlists[1]; WordList &keywords3 = *keywordlists[2]; /***************************************/ int posLineStart = 0, numNonBlank = 0, prevState = 0; int endPos = startPos + length; /***************************************/ // backtrack to the nearest keyword while ((startPos > 1) && (styler.StyleAt(startPos) != SCE_F_WORD)) { startPos--; } startPos = styler.LineStart(styler.GetLine(startPos)); initStyle = styler.StyleAt(startPos - 1); StyleContext sc(startPos, endPos-startPos, initStyle, styler); /***************************************/ for (; sc.More(); sc.Forward()) { // remember the start position of the line if (sc.atLineStart) { posLineStart = sc.currentPos; numNonBlank = 0; sc.SetState(SCE_F_DEFAULT); } if (!IsASpaceOrTab(sc.ch)) numNonBlank ++; /***********************************************/ // Handle the fix format generically int toLineStart = sc.currentPos - posLineStart; if (isFixFormat && (toLineStart < 6 || toLineStart > 72)) { if ((toLineStart == 0 && (tolower(sc.ch) == 'c' || sc.ch == '*')) || sc.ch == '!') { if (sc.MatchIgnoreCase("cdec$") || sc.MatchIgnoreCase("*dec$") || sc.MatchIgnoreCase("!dec$") || sc.MatchIgnoreCase("cdir$") || sc.MatchIgnoreCase("*dir$") || sc.MatchIgnoreCase("!dir$") || sc.MatchIgnoreCase("cms$") || sc.MatchIgnoreCase("*ms$") || sc.MatchIgnoreCase("!ms$") || sc.chNext == '$') { sc.SetState(SCE_F_PREPROCESSOR); } else { sc.SetState(SCE_F_COMMENT); } while (!sc.atLineEnd && sc.More()) sc.Forward(); // Until line end } else if (toLineStart > 72) { sc.SetState(SCE_F_COMMENT); while (!sc.atLineEnd && sc.More()) sc.Forward(); // Until line end } else if (toLineStart < 5) { if (IsADigit(sc.ch)) sc.SetState(SCE_F_LABEL); else sc.SetState(SCE_F_DEFAULT); } else if (toLineStart == 5) { if (!IsASpace(sc.ch) && sc.ch != '0') { sc.SetState(SCE_F_CONTINUATION); sc.ForwardSetState(prevState); } else sc.SetState(SCE_F_DEFAULT); } continue; } /***************************************/ // Handle line continuation generically. if (!isFixFormat && sc.ch == '&') { char chTemp = ' '; int j = 1; while (IsABlank(chTemp) && j<132) { chTemp = static_cast(sc.GetRelative(j)); j++; } if (chTemp == '!') { sc.SetState(SCE_F_CONTINUATION); if (sc.chNext == '!') sc.ForwardSetState(SCE_F_COMMENT); } else if (chTemp == '\r' || chTemp == '\n') { int currentState = sc.state; sc.SetState(SCE_F_CONTINUATION); sc.ForwardSetState(SCE_F_DEFAULT); while (IsASpace(sc.ch) && sc.More()) sc.Forward(); if (sc.ch == '&') { sc.SetState(SCE_F_CONTINUATION); sc.Forward(); } sc.SetState(currentState); } } /***************************************/ // Determine if the current state should terminate. if (sc.state == SCE_F_OPERATOR) { sc.SetState(SCE_F_DEFAULT); } else if (sc.state == SCE_F_NUMBER) { if (!(IsAWordChar(sc.ch) || sc.ch=='\'' || sc.ch=='\"' || sc.ch=='.')) { sc.SetState(SCE_F_DEFAULT); } } else if (sc.state == SCE_F_IDENTIFIER) { if (!IsAWordChar(sc.ch) || (sc.ch == '%')) { char s[100]; sc.GetCurrentLowered(s, sizeof(s)); if (keywords.InList(s)) { sc.ChangeState(SCE_F_WORD); } else if (keywords2.InList(s)) { sc.ChangeState(SCE_F_WORD2); } else if (keywords3.InList(s)) { sc.ChangeState(SCE_F_WORD3); } sc.SetState(SCE_F_DEFAULT); } } else if (sc.state == SCE_F_COMMENT || sc.state == SCE_F_PREPROCESSOR) { if (sc.ch == '\r' || sc.ch == '\n') { sc.SetState(SCE_F_DEFAULT); } } else if (sc.state == SCE_F_STRING1) { prevState = sc.state; if (sc.ch == '\'') { if (sc.chNext == '\'') { sc.Forward(); } else { sc.ForwardSetState(SCE_F_DEFAULT); prevState = SCE_F_DEFAULT; } } else if (sc.atLineEnd) { sc.ChangeState(SCE_F_STRINGEOL); sc.ForwardSetState(SCE_F_DEFAULT); } } else if (sc.state == SCE_F_STRING2) { prevState = sc.state; if (sc.atLineEnd) { sc.ChangeState(SCE_F_STRINGEOL); sc.ForwardSetState(SCE_F_DEFAULT); } else if (sc.ch == '\"') { if (sc.chNext == '\"') { sc.Forward(); } else { sc.ForwardSetState(SCE_F_DEFAULT); prevState = SCE_F_DEFAULT; } } } else if (sc.state == SCE_F_OPERATOR2) { if (sc.ch == '.') { sc.ForwardSetState(SCE_F_DEFAULT); } } else if (sc.state == SCE_F_CONTINUATION) { sc.SetState(SCE_F_DEFAULT); } else if (sc.state == SCE_F_LABEL) { if (!IsADigit(sc.ch)) { sc.SetState(SCE_F_DEFAULT); } else { if (isFixFormat && sc.currentPos-posLineStart > 4) sc.SetState(SCE_F_DEFAULT); else if (numNonBlank > 5) sc.SetState(SCE_F_DEFAULT); } } /***************************************/ // Determine if a new state should be entered. if (sc.state == SCE_F_DEFAULT) { if (sc.ch == '!') { if (sc.MatchIgnoreCase("!dec$") || sc.MatchIgnoreCase("!dir$") || sc.MatchIgnoreCase("!ms$") || sc.chNext == '$') { sc.SetState(SCE_F_PREPROCESSOR); } else { sc.SetState(SCE_F_COMMENT); } } else if ((!isFixFormat) && IsADigit(sc.ch) && numNonBlank == 1) { sc.SetState(SCE_F_LABEL); } else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) { sc.SetState(SCE_F_NUMBER); } else if ((tolower(sc.ch) == 'b' || tolower(sc.ch) == 'o' || tolower(sc.ch) == 'z') && (sc.chNext == '\"' || sc.chNext == '\'')) { sc.SetState(SCE_F_NUMBER); sc.Forward(); } else if (sc.ch == '.' && isalpha(sc.chNext)) { sc.SetState(SCE_F_OPERATOR2); } else if (IsAWordStart(sc.ch)) { sc.SetState(SCE_F_IDENTIFIER); } else if (sc.ch == '\"') { sc.SetState(SCE_F_STRING2); } else if (sc.ch == '\'') { sc.SetState(SCE_F_STRING1); } else if (isoperator(static_cast(sc.ch))) { sc.SetState(SCE_F_OPERATOR); } } } sc.Complete(); } /***************************************/ // To determine the folding level depending on keywords static int classifyFoldPointFortran(const char* s, const char* prevWord, const char chNextNonBlank) { int lev = 0; if ((strcmp(prevWord, "else") == 0 && strcmp(s, "if") == 0) || strcmp(s, "elseif") == 0) return -1; if (strcmp(s, "associate") == 0 || strcmp(s, "block") == 0 || strcmp(s, "blockdata") == 0 || strcmp(s, "select") == 0 || strcmp(s, "do") == 0 || strcmp(s, "enum") ==0 || strcmp(s, "function") == 0 || strcmp(s, "interface") == 0 || strcmp(s, "module") == 0 || strcmp(s, "program") == 0 || strcmp(s, "subroutine") == 0 || strcmp(s, "then") == 0 || (strcmp(s, "type") == 0 && chNextNonBlank != '(') ){ if (strcmp(prevWord, "end") == 0) lev = 0; else lev = 1; } else if ((strcmp(s, "end") == 0 && chNextNonBlank != '=') || strcmp(s, "endassociate") == 0 || strcmp(s, "endblock") == 0 || strcmp(s, "endblockdata") == 0 || strcmp(s, "endselect") == 0 || strcmp(s, "enddo") == 0 || strcmp(s, "endenum") ==0 || strcmp(s, "endif") == 0 || strcmp(s, "endforall") == 0 || strcmp(s, "endfunction") == 0 || strcmp(s, "endinterface") == 0 || strcmp(s, "endmodule") == 0 || strcmp(s, "endprogram") == 0 || strcmp(s, "endsubroutine") == 0 || strcmp(s, "endtype") == 0 || strcmp(s, "endwhere") == 0 || (strcmp(s, "procedure") == 0 && strcmp(prevWord,"module")==0) ) { // Take care of the module procedure statement lev = -1; } else if (strcmp(prevWord, "end") == 0 && strcmp(s, "if") == 0){ // end if lev = 0; } return lev; } // Folding the code static void FoldFortranDoc(unsigned int startPos, int length, int initStyle, Accessor &styler, bool isFixFormat) { // // bool foldComment = styler.GetPropertyInt("fold.comment") != 0; // Do not know how to fold the comment at the moment. // bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; unsigned int endPos = startPos + length; int visibleChars = 0; int lineCurrent = styler.GetLine(startPos); int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; int levelCurrent = levelPrev; char chNext = styler[startPos]; char chNextNonBlank; int styleNext = styler.StyleAt(startPos); int style = initStyle; /***************************************/ int lastStart = 0; char prevWord[32] = ""; char Label[6] = ""; // Variables for do label folding. static int doLabels[100]; static int posLabel=-1; /***************************************/ for (unsigned int i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); chNextNonBlank = chNext; unsigned int j=i+1; while(IsABlank(chNextNonBlank) && j(tolower(styler[lastStart+k])); } s[k] = '\0'; // Handle the forall and where statement and structure. if (strcmp(s, "forall") == 0 || strcmp(s, "where") == 0) { if (strcmp(prevWord, "end") != 0) { j = i + 1; char chBrace = '(', chSeek = ')', ch1 = styler.SafeGetCharAt(j); // Find the position of the first ( while (ch1 != chBrace && j -1) { levelCurrent--; posLabel--; } } } if (atEOL) { int lev = levelPrev; if (visibleChars == 0 && foldCompact) lev |= SC_FOLDLEVELWHITEFLAG; if ((levelCurrent > levelPrev) && (visibleChars > 0)) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) { styler.SetLevel(lineCurrent, lev); } lineCurrent++; levelPrev = levelCurrent; visibleChars = 0; strcpy(prevWord, ""); } /***************************************/ if (!isspacechar(ch)) visibleChars++; } /***************************************/ // Fill in the real level of the next line, keeping the current flags as they will be filled in later int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; styler.SetLevel(lineCurrent, levelPrev | flagsNext); } /***************************************/ static const char * const FortranWordLists[] = { "Primary keywords and identifiers", "Intrinsic functions", "Extended and user defined functions", 0, }; /***************************************/ static void ColouriseFortranDocFreeFormat(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { ColouriseFortranDoc(startPos, length, initStyle, keywordlists, styler, false); } /***************************************/ static void ColouriseFortranDocFixFormat(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { ColouriseFortranDoc(startPos, length, initStyle, keywordlists, styler, true); } /***************************************/ static void FoldFortranDocFreeFormat(unsigned int startPos, int length, int initStyle, WordList *[], Accessor &styler) { FoldFortranDoc(startPos, length, initStyle,styler, false); } /***************************************/ static void FoldFortranDocFixFormat(unsigned int startPos, int length, int initStyle, WordList *[], Accessor &styler) { FoldFortranDoc(startPos, length, initStyle,styler, true); } /***************************************/ LexerModule lmFortran(SCLEX_FORTRAN, ColouriseFortranDocFreeFormat, "fortran", FoldFortranDocFreeFormat, FortranWordLists); LexerModule lmF77(SCLEX_F77, ColouriseFortranDocFixFormat, "f77", FoldFortranDocFixFormat, FortranWordLists); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/SplitVector.h000444001750001750 1575311727344243 25057 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file SplitVector.h ** Main data structure for holding arrays that handle insertions ** and deletions efficiently. **/ // Copyright 1998-2007 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #ifndef SPLITVECTOR_H #define SPLITVECTOR_H template class SplitVector { protected: T *body; int size; int lengthBody; int part1Length; int gapLength; /// invariant: gapLength == size - lengthBody int growSize; /// Move the gap to a particular position so that insertion and /// deletion at that point will not require much copying and /// hence be fast. void GapTo(int position) { if (position != part1Length) { if (position < part1Length) { memmove( body + position + gapLength, body + position, sizeof(T) * (part1Length - position)); } else { // position > part1Length memmove( body + part1Length, body + part1Length + gapLength, sizeof(T) * (position - part1Length)); } part1Length = position; } } /// Check that there is room in the buffer for an insertion, /// reallocating if more space needed. void RoomFor(int insertionLength) { if (gapLength <= insertionLength) { while (growSize < size / 6) growSize *= 2; ReAllocate(size + insertionLength + growSize); } } void Init() { body = NULL; growSize = 8; size = 0; lengthBody = 0; part1Length = 0; gapLength = 0; } public: /// Construct a split buffer. SplitVector() { Init(); } ~SplitVector() { delete []body; body = 0; } int GetGrowSize() const { return growSize; } void SetGrowSize(int growSize_) { growSize = growSize_; } /// Reallocate the storage for the buffer to be newSize and /// copy exisiting contents to the new buffer. /// Must not be used to decrease the size of the buffer. void ReAllocate(int newSize) { if (newSize > size) { // Move the gap to the end GapTo(lengthBody); T *newBody = new T[newSize]; if ((size != 0) && (body != 0)) { memmove(newBody, body, sizeof(T) * lengthBody); delete []body; } body = newBody; gapLength += newSize - size; size = newSize; } } /// Retrieve the character at a particular position. /// Retrieving positions outside the range of the buffer returns 0. /// The assertions here are disabled since calling code can be /// simpler if out of range access works and returns 0. T ValueAt(int position) const { if (position < part1Length) { //PLATFORM_ASSERT(position >= 0); if (position < 0) { return 0; } else { return body[position]; } } else { //PLATFORM_ASSERT(position < lengthBody); if (position >= lengthBody) { return 0; } else { return body[gapLength + position]; } } } void SetValueAt(int position, T v) { if (position < part1Length) { PLATFORM_ASSERT(position >= 0); if (position < 0) { ; } else { body[position] = v; } } else { PLATFORM_ASSERT(position < lengthBody); if (position >= lengthBody) { ; } else { body[gapLength + position] = v; } } } T &operator[](int position) const { PLATFORM_ASSERT(position >= 0 && position < lengthBody); if (position < part1Length) { return body[position]; } else { return body[gapLength + position]; } } /// Retrieve the length of the buffer. int Length() const { return lengthBody; } /// Insert a single value into the buffer. /// Inserting at positions outside the current range fails. void Insert(int position, T v) { PLATFORM_ASSERT((position >= 0) && (position <= lengthBody)); if ((position < 0) || (position > lengthBody)) { return; } RoomFor(1); GapTo(position); body[part1Length] = v; lengthBody++; part1Length++; gapLength--; } /// Insert a number of elements into the buffer setting their value. /// Inserting at positions outside the current range fails. void InsertValue(int position, int insertLength, T v) { PLATFORM_ASSERT((position >= 0) && (position <= lengthBody)); if (insertLength > 0) { if ((position < 0) || (position > lengthBody)) { return; } RoomFor(insertLength); GapTo(position); for (int i = 0; i < insertLength; i++) body[part1Length + i] = v; lengthBody += insertLength; part1Length += insertLength; gapLength -= insertLength; } } /// Ensure at least length elements allocated, /// appending zero valued elements if needed. void EnsureLength(int wantedLength) { if (Length() < wantedLength) { InsertValue(Length(), wantedLength - Length(), 0); } } /// Insert text into the buffer from an array. void InsertFromArray(int positionToInsert, const T s[], int positionFrom, int insertLength) { PLATFORM_ASSERT((positionToInsert >= 0) && (positionToInsert <= lengthBody)); if (insertLength > 0) { if ((positionToInsert < 0) || (positionToInsert > lengthBody)) { return; } RoomFor(insertLength); GapTo(positionToInsert); memmove(body + part1Length, s + positionFrom, sizeof(T) * insertLength); lengthBody += insertLength; part1Length += insertLength; gapLength -= insertLength; } } /// Delete one element from the buffer. void Delete(int position) { PLATFORM_ASSERT((position >= 0) && (position < lengthBody)); if ((position < 0) || (position >= lengthBody)) { return; } DeleteRange(position, 1); } /// Delete a range from the buffer. /// Deleting positions outside the current range fails. void DeleteRange(int position, int deleteLength) { PLATFORM_ASSERT((position >= 0) && (position + deleteLength <= lengthBody)); if ((position < 0) || ((position + deleteLength) > lengthBody)) { return; } if ((position == 0) && (deleteLength == lengthBody)) { // Full deallocation returns storage and is faster delete []body; Init(); } else if (deleteLength > 0) { GapTo(position); lengthBody -= deleteLength; gapLength += deleteLength; } } /// Delete all the buffer contents. void DeleteAll() { DeleteRange(0, lengthBody); } // Retrieve a range of elements into an array void GetRange(T *buffer, int position, int retrieveLength) const { // Split into up to 2 ranges, before and after the split then use memcpy on each. int range1Length = 0; if (position < part1Length) { int part1AfterPosition = part1Length - position; range1Length = retrieveLength; if (range1Length > part1AfterPosition) range1Length = part1AfterPosition; } memcpy(buffer, body + position, range1Length * sizeof(T)); buffer += range1Length; position = position + range1Length + gapLength; int range2Length = retrieveLength - range1Length; memcpy(buffer, body + position, range2Length * sizeof(T)); } T *BufferPointer() { RoomFor(1); GapTo(lengthBody); body[lengthBody] = 0; return body; } }; #endif Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/CharacterSet.cxx000444001750001750 235211727344243 25473 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file CharacterSet.cxx ** Simple case functions for ASCII. ** Lexer infrastructure. **/ // Copyright 1998-2010 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include "CharacterSet.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif #ifdef SCI_NAMESPACE namespace Scintilla { #endif int CompareCaseInsensitive(const char *a, const char *b) { while (*a && *b) { if (*a != *b) { char upperA = MakeUpperCase(*a); char upperB = MakeUpperCase(*b); if (upperA != upperB) return upperA - upperB; } a++; b++; } // Either *a or *b is nul return *a - *b; } int CompareNCaseInsensitive(const char *a, const char *b, size_t len) { while (*a && *b && len) { if (*a != *b) { char upperA = MakeUpperCase(*a); char upperB = MakeUpperCase(*b); if (upperA != upperB) return upperA - upperB; } a++; b++; len--; } if (len == 0) return 0; else // Either *a or *b is nul return *a - *b; } #ifdef SCI_NAMESPACE } #endif Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexAVS.cxx000444001750001750 2122611727344243 24246 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexAVS.cxx ** Lexer for AviSynth. **/ // Copyright 2012 by Bruno Barbieri // Heavily based on LexPOV by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static inline bool IsAWordChar(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '_'); } static inline bool IsAWordStart(int ch) { return isalpha(ch) || (ch != ' ' && ch != '\n' && ch != '(' && ch != '.' && ch != ','); } static inline bool IsANumberChar(int ch) { // Not exactly following number definition (several dots are seen as OK, etc.) // but probably enough in most cases. return (ch < 0x80) && (isdigit(ch) || ch == '.' || ch == '-' || ch == '+'); } static void ColouriseAvsDoc( unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { WordList &keywords = *keywordlists[0]; WordList &filters = *keywordlists[1]; WordList &plugins = *keywordlists[2]; WordList &functions = *keywordlists[3]; WordList &clipProperties = *keywordlists[4]; WordList &userDefined = *keywordlists[5]; int currentLine = styler.GetLine(startPos); // Initialize the block comment nesting level, if we are inside such a comment. int blockCommentLevel = 0; if (initStyle == SCE_AVS_COMMENTBLOCK || initStyle == SCE_AVS_COMMENTBLOCKN) { blockCommentLevel = styler.GetLineState(currentLine - 1); } // Do not leak onto next line if (initStyle == SCE_AVS_COMMENTLINE) { initStyle = SCE_AVS_DEFAULT; } StyleContext sc(startPos, length, initStyle, styler); for (; sc.More(); sc.Forward()) { if (sc.atLineEnd) { // Update the line state, so it can be seen by next line currentLine = styler.GetLine(sc.currentPos); if (sc.state == SCE_AVS_COMMENTBLOCK || sc.state == SCE_AVS_COMMENTBLOCKN) { // Inside a block comment, we set the line state styler.SetLineState(currentLine, blockCommentLevel); } else { // Reset the line state styler.SetLineState(currentLine, 0); } } // Determine if the current state should terminate. if (sc.state == SCE_AVS_OPERATOR) { sc.SetState(SCE_AVS_DEFAULT); } else if (sc.state == SCE_AVS_NUMBER) { // We stop the number definition on non-numerical non-dot non-sign char if (!IsANumberChar(sc.ch)) { sc.SetState(SCE_AVS_DEFAULT); } } else if (sc.state == SCE_AVS_IDENTIFIER) { if (!IsAWordChar(sc.ch)) { char s[100]; sc.GetCurrentLowered(s, sizeof(s)); if (keywords.InList(s)) { sc.ChangeState(SCE_AVS_KEYWORD); } else if (filters.InList(s)) { sc.ChangeState(SCE_AVS_FILTER); } else if (plugins.InList(s)) { sc.ChangeState(SCE_AVS_PLUGIN); } else if (functions.InList(s)) { sc.ChangeState(SCE_AVS_FUNCTION); } else if (clipProperties.InList(s)) { sc.ChangeState(SCE_AVS_CLIPPROP); } else if (userDefined.InList(s)) { sc.ChangeState(SCE_AVS_USERDFN); } sc.SetState(SCE_AVS_DEFAULT); } } else if (sc.state == SCE_AVS_COMMENTBLOCK) { if (sc.Match('/', '*')) { blockCommentLevel++; sc.Forward(); } else if (sc.Match('*', '/') && blockCommentLevel > 0) { blockCommentLevel--; sc.Forward(); if (blockCommentLevel == 0) { sc.ForwardSetState(SCE_AVS_DEFAULT); } } } else if (sc.state == SCE_AVS_COMMENTBLOCKN) { if (sc.Match('[', '*')) { blockCommentLevel++; sc.Forward(); } else if (sc.Match('*', ']') && blockCommentLevel > 0) { blockCommentLevel--; sc.Forward(); if (blockCommentLevel == 0) { sc.ForwardSetState(SCE_AVS_DEFAULT); } } } else if (sc.state == SCE_AVS_COMMENTLINE) { if (sc.atLineEnd) { sc.ForwardSetState(SCE_AVS_DEFAULT); } } else if (sc.state == SCE_AVS_STRING) { if (sc.ch == '\"') { sc.ForwardSetState(SCE_AVS_DEFAULT); } } else if (sc.state == SCE_AVS_TRIPLESTRING) { if (sc.Match("\"\"\"")) { sc.Forward(); sc.Forward(); sc.ForwardSetState(SCE_AVS_DEFAULT); } } // Determine if a new state should be entered. if (sc.state == SCE_AVS_DEFAULT) { if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) { sc.SetState(SCE_AVS_NUMBER); } else if (IsADigit(sc.ch) || (sc.ch == ',' && IsADigit(sc.chNext))) { sc.Forward(); sc.SetState(SCE_AVS_NUMBER); } else if (sc.Match('/', '*')) { blockCommentLevel = 1; sc.SetState(SCE_AVS_COMMENTBLOCK); sc.Forward(); // Eat the * so it isn't used for the end of the comment } else if (sc.Match('[', '*')) { blockCommentLevel = 1; sc.SetState(SCE_AVS_COMMENTBLOCKN); sc.Forward(); // Eat the * so it isn't used for the end of the comment } else if (sc.ch == '#') { sc.SetState(SCE_AVS_COMMENTLINE); } else if (sc.ch == '\"') { if (sc.Match("\"\"\"")) { sc.SetState(SCE_AVS_TRIPLESTRING); } else { sc.SetState(SCE_AVS_STRING); } } else if (isoperator(static_cast(sc.ch))) { sc.SetState(SCE_AVS_OPERATOR); } else if (IsAWordStart(sc.ch)) { sc.SetState(SCE_AVS_IDENTIFIER); } } } // End of file: complete any pending changeState if (sc.state == SCE_AVS_IDENTIFIER) { if (!IsAWordChar(sc.ch)) { char s[100]; sc.GetCurrentLowered(s, sizeof(s)); if (keywords.InList(s)) { sc.ChangeState(SCE_AVS_KEYWORD); } else if (filters.InList(s)) { sc.ChangeState(SCE_AVS_FILTER); } else if (plugins.InList(s)) { sc.ChangeState(SCE_AVS_PLUGIN); } else if (functions.InList(s)) { sc.ChangeState(SCE_AVS_FUNCTION); } else if (clipProperties.InList(s)) { sc.ChangeState(SCE_AVS_CLIPPROP); } else if (userDefined.InList(s)) { sc.ChangeState(SCE_AVS_USERDFN); } sc.SetState(SCE_AVS_DEFAULT); } } sc.Complete(); } static void FoldAvsDoc( unsigned int startPos, int length, int initStyle, WordList *[], Accessor &styler) { bool foldComment = styler.GetPropertyInt("fold.comment") != 0; bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; unsigned int endPos = startPos + length; int visibleChars = 0; int lineCurrent = styler.GetLine(startPos); int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; int levelCurrent = levelPrev; char chNext = styler[startPos]; int styleNext = styler.StyleAt(startPos); int style = initStyle; for (unsigned int i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); int stylePrev = style; style = styleNext; styleNext = styler.StyleAt(i + 1); bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); if (foldComment && style == SCE_AVS_COMMENTBLOCK) { if (stylePrev != SCE_AVS_COMMENTBLOCK) { levelCurrent++; } else if ((styleNext != SCE_AVS_COMMENTBLOCK) && !atEOL) { // Comments don't end at end of line and the next character may be unstyled. levelCurrent--; } } if (foldComment && style == SCE_AVS_COMMENTBLOCKN) { if (stylePrev != SCE_AVS_COMMENTBLOCKN) { levelCurrent++; } else if ((styleNext != SCE_AVS_COMMENTBLOCKN) && !atEOL) { // Comments don't end at end of line and the next character may be unstyled. levelCurrent--; } } if (style == SCE_AVS_OPERATOR) { if (ch == '{') { levelCurrent++; } else if (ch == '}') { levelCurrent--; } } if (atEOL) { int lev = levelPrev; if (visibleChars == 0 && foldCompact) lev |= SC_FOLDLEVELWHITEFLAG; if ((levelCurrent > levelPrev) && (visibleChars > 0)) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) { styler.SetLevel(lineCurrent, lev); } lineCurrent++; levelPrev = levelCurrent; visibleChars = 0; } if (!isspacechar(ch)) visibleChars++; } // Fill in the real level of the next line, keeping the current flags as they will be filled in later int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; styler.SetLevel(lineCurrent, levelPrev | flagsNext); } static const char * const avsWordLists[] = { "Keywords", "Filters", "Plugins", "Functions", "Clip properties", "User defined functions", 0, }; LexerModule lmAVS(SCLEX_AVS, ColouriseAvsDoc, "avs", FoldAvsDoc, avsWordLists); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexBullant.cxx000444001750001750 1506711727344243 25224 0ustar00azawawiazawawi000000000000// SciTE - Scintilla based Text Editor // LexBullant.cxx - lexer for Bullant #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static int classifyWordBullant(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler) { char s[100]; s[0] = '\0'; for (unsigned int i = 0; i < end - start + 1 && i < 30; i++) { s[i] = static_cast(tolower(styler[start + i])); s[i + 1] = '\0'; } int lev= 0; char chAttr = SCE_C_IDENTIFIER; if (isdigit(s[0]) || (s[0] == '.')){ chAttr = SCE_C_NUMBER; } else { if (keywords.InList(s)) { chAttr = SCE_C_WORD; if (strcmp(s, "end") == 0) lev = -1; else if (strcmp(s, "method") == 0 || strcmp(s, "case") == 0 || strcmp(s, "class") == 0 || strcmp(s, "debug") == 0 || strcmp(s, "test") == 0 || strcmp(s, "if") == 0 || strcmp(s, "lock") == 0 || strcmp(s, "transaction") == 0 || strcmp(s, "trap") == 0 || strcmp(s, "until") == 0 || strcmp(s, "while") == 0) lev = 1; } } styler.ColourTo(end, chAttr); return lev; } static void ColouriseBullantDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { WordList &keywords = *keywordlists[0]; styler.StartAt(startPos); bool fold = styler.GetPropertyInt("fold") != 0; int lineCurrent = styler.GetLine(startPos); int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; int levelCurrent = levelPrev; int state = initStyle; if (state == SCE_C_STRINGEOL) // Does not leak onto next line state = SCE_C_DEFAULT; char chPrev = ' '; char chNext = styler[startPos]; unsigned int lengthDoc = startPos + length; int visibleChars = 0; styler.StartSegment(startPos); int endFoundThisLine = 0; for (unsigned int i = startPos; i < lengthDoc; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); if ((ch == '\r' && chNext != '\n') || (ch == '\n')) { // Trigger on CR only (Mac style) or either on LF from CR+LF (Dos/Win) or on LF alone (Unix) // Avoid triggering two times on Dos/Win // End of line endFoundThisLine = 0; if (state == SCE_C_STRINGEOL) { styler.ColourTo(i, state); state = SCE_C_DEFAULT; } if (fold) { int lev = levelPrev; if (visibleChars == 0) lev |= SC_FOLDLEVELWHITEFLAG; if ((levelCurrent > levelPrev) && (visibleChars > 0)) lev |= SC_FOLDLEVELHEADERFLAG; styler.SetLevel(lineCurrent, lev); lineCurrent++; levelPrev = levelCurrent; } visibleChars = 0; /* int indentBlock = GetLineIndentation(lineCurrent); if (blockChange==1){ lineCurrent++; int pos=SetLineIndentation(lineCurrent, indentBlock + indentSize); } else if (blockChange==-1) { indentBlock -= indentSize; if (indentBlock < 0) indentBlock = 0; SetLineIndentation(lineCurrent, indentBlock); lineCurrent++; } blockChange=0; */ } if (!(isascii(ch) && isspace(ch))) visibleChars++; if (styler.IsLeadByte(ch)) { chNext = styler.SafeGetCharAt(i + 2); chPrev = ' '; i += 1; continue; } if (state == SCE_C_DEFAULT) { if (iswordstart(ch)) { styler.ColourTo(i-1, state); state = SCE_C_IDENTIFIER; } else if (ch == '@' && chNext == 'o') { if ((styler.SafeGetCharAt(i+2) =='f') && (styler.SafeGetCharAt(i+3) == 'f')) { styler.ColourTo(i-1, state); state = SCE_C_COMMENT; } } else if (ch == '#') { styler.ColourTo(i-1, state); state = SCE_C_COMMENTLINE; } else if (ch == '\"') { styler.ColourTo(i-1, state); state = SCE_C_STRING; } else if (ch == '\'') { styler.ColourTo(i-1, state); state = SCE_C_CHARACTER; } else if (isoperator(ch)) { styler.ColourTo(i-1, state); styler.ColourTo(i, SCE_C_OPERATOR); } } else if (state == SCE_C_IDENTIFIER) { if (!iswordchar(ch)) { int levelChange = classifyWordBullant(styler.GetStartSegment(), i - 1, keywords, styler); state = SCE_C_DEFAULT; chNext = styler.SafeGetCharAt(i + 1); if (ch == '#') { state = SCE_C_COMMENTLINE; } else if (ch == '\"') { state = SCE_C_STRING; } else if (ch == '\'') { state = SCE_C_CHARACTER; } else if (isoperator(ch)) { styler.ColourTo(i, SCE_C_OPERATOR); } if (endFoundThisLine == 0) levelCurrent+=levelChange; if (levelChange == -1) endFoundThisLine=1; } } else if (state == SCE_C_COMMENT) { if (ch == '@' && chNext == 'o') { if (styler.SafeGetCharAt(i+2) == 'n') { styler.ColourTo(i+2, state); state = SCE_C_DEFAULT; i+=2; } } } else if (state == SCE_C_COMMENTLINE) { if (ch == '\r' || ch == '\n') { endFoundThisLine = 0; styler.ColourTo(i-1, state); state = SCE_C_DEFAULT; } } else if (state == SCE_C_STRING) { if (ch == '\\') { if (chNext == '\"' || chNext == '\'' || chNext == '\\') { i++; ch = chNext; chNext = styler.SafeGetCharAt(i + 1); } } else if (ch == '\"') { styler.ColourTo(i, state); state = SCE_C_DEFAULT; } else if (chNext == '\r' || chNext == '\n') { endFoundThisLine = 0; styler.ColourTo(i-1, SCE_C_STRINGEOL); state = SCE_C_STRINGEOL; } } else if (state == SCE_C_CHARACTER) { if ((ch == '\r' || ch == '\n') && (chPrev != '\\')) { endFoundThisLine = 0; styler.ColourTo(i-1, SCE_C_STRINGEOL); state = SCE_C_STRINGEOL; } else if (ch == '\\') { if (chNext == '\"' || chNext == '\'' || chNext == '\\') { i++; ch = chNext; chNext = styler.SafeGetCharAt(i + 1); } } else if (ch == '\'') { styler.ColourTo(i, state); state = SCE_C_DEFAULT; } } chPrev = ch; } styler.ColourTo(lengthDoc - 1, state); // Fill in the real level of the next line, keeping the current flags as they will be filled in later if (fold) { int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; //styler.SetLevel(lineCurrent, levelCurrent | flagsNext); styler.SetLevel(lineCurrent, levelPrev | flagsNext); } } static const char * const bullantWordListDesc[] = { "Keywords", 0 }; LexerModule lmBullant(SCLEX_BULLANT, ColouriseBullantDoc, "bullant", 0, bullantWordListDesc); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/XPM.h000444001750001750 652011727344243 23215 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file XPM.h ** Define a class that holds data in the X Pixmap (XPM) format. **/ // Copyright 1998-2003 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #ifndef XPM_H #define XPM_H #ifdef SCI_NAMESPACE namespace Scintilla { #endif /** * Hold a pixmap in XPM format. */ class XPM { int pid; // Assigned by container int height; int width; int nColours; char *data; char codeTransparent; char *codes; ColourDesired *colours; ColourDesired ColourDesiredFromCode(int ch) const; ColourDesired ColourFromCode(int ch) const; void FillRun(Surface *surface, int code, int startX, int y, int x); char **lines; ColourDesired *colourCodeTable[256]; public: XPM(const char *textForm); XPM(const char *const *linesForm); ~XPM(); void Init(const char *textForm); void Init(const char *const *linesForm); void Clear(); /// Decompose image into runs and use FillRectangle for each run void Draw(Surface *surface, PRectangle &rc); char **InLinesForm() { return lines; } void SetId(int pid_) { pid = pid_; } int GetId() const { return pid; } int GetHeight() const { return height; } int GetWidth() const { return width; } void PixelAt(int x, int y, ColourDesired &colour, bool &transparent) const; static const char **LinesFormFromTextForm(const char *textForm); }; /** * A collection of pixmaps indexed by integer id. */ class XPMSet { XPM **set; ///< The stored XPMs. int len; ///< Current number of XPMs. int maximum; ///< Current maximum number of XPMs, increased by steps if reached. int height; ///< Memorize largest height of the set. int width; ///< Memorize largest width of the set. public: XPMSet(); ~XPMSet(); /// Remove all XPMs. void Clear(); /// Add a XPM. void Add(int ident, const char *textForm); /// Get XPM by id. XPM *Get(int ident); /// Give the largest height of the set. int GetHeight(); /// Give the largest width of the set. int GetWidth(); }; /** * An translucent image stoed as a sequence of RGBA bytes. */ class RGBAImage { // Private so RGBAImage objects can not be copied RGBAImage(const RGBAImage &); RGBAImage &operator=(const RGBAImage &); int height; int width; std::vector pixelBytes; public: RGBAImage(int width_, int height_, const unsigned char *pixels_); RGBAImage(const XPM &xpm); virtual ~RGBAImage(); int GetHeight() const { return height; } int GetWidth() const { return width; } int CountBytes() const; const unsigned char *Pixels() const; void SetPixel(int x, int y, ColourDesired colour, int alpha=0xff); }; /** * A collection of RGBAImage pixmaps indexed by integer id. */ class RGBAImageSet { typedef std::map ImageMap; ImageMap images; mutable int height; ///< Memorize largest height of the set. mutable int width; ///< Memorize largest width of the set. public: RGBAImageSet(); ~RGBAImageSet(); /// Remove all images. void Clear(); /// Add an image. void Add(int ident, RGBAImage *image); /// Get image by id. RGBAImage *Get(int ident); /// Give the largest height of the set. int GetHeight() const; /// Give the largest width of the set. int GetWidth() const; }; #ifdef SCI_NAMESPACE } #endif #endif Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/StyleContext.cxx000444001750001750 241611727344243 25571 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file StyleContext.cxx ** Lexer infrastructure. **/ // Copyright 1998-2004 by Neil Hodgson // This file is in the public domain. #include #include #include #include #include #include "ILexer.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static void getRange(unsigned int start, unsigned int end, LexAccessor &styler, char *s, unsigned int len) { unsigned int i = 0; while ((i < end - start + 1) && (i < len-1)) { s[i] = styler[start + i]; i++; } s[i] = '\0'; } void StyleContext::GetCurrent(char *s, unsigned int len) { getRange(styler.GetStartSegment(), currentPos - 1, styler, s, len); } static void getRangeLowered(unsigned int start, unsigned int end, LexAccessor &styler, char *s, unsigned int len) { unsigned int i = 0; while ((i < end - start + 1) && (i < len-1)) { s[i] = static_cast(tolower(styler[start + i])); i++; } s[i] = '\0'; } void StyleContext::GetCurrentLowered(char *s, unsigned int len) { getRangeLowered(styler.GetStartSegment(), currentPos - 1, styler, s, len); } Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexAbaqus.cxx000444001750001750 5006111727344243 25030 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexABAQUS.cxx ** Lexer for ABAQUS. Based on the lexer for APDL by Hadar Raz. ** By Sergio Lucato. ** Sort of completely rewritten by Gertjan Kloosterman **/ // The License.txt file describes the conditions under which this software may be distributed. // Code folding copyied and modified from LexBasic.cxx #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static inline bool IsAWordChar(const int ch) { return (ch < 0x80 && (isalnum(ch) || (ch == '_'))); } static inline bool IsAKeywordChar(const int ch) { return (ch < 0x80 && (isalnum(ch) || (ch == '_') || (ch == ' '))); } static inline bool IsASetChar(const int ch) { return (ch < 0x80 && (isalnum(ch) || (ch == '_') || (ch == '.') || (ch == '-'))); } static inline bool IsAnOperator(char ch) { // '.' left out as it is used to make up numbers if (ch == '*' || ch == '/' || ch == '-' || ch == '+' || ch == '(' || ch == ')' || ch == '=' || ch == '^' || ch == '[' || ch == ']' || ch == '<' || ch == '&' || ch == '>' || ch == ',' || ch == '|' || ch == '~' || ch == '$' || ch == ':' || ch == '%') return true; return false; } static void ColouriseABAQUSDoc(unsigned int startPos, int length, int initStyle, WordList*[] /* *keywordlists[] */, Accessor &styler) { enum localState { KW_LINE_KW, KW_LINE_COMMA, KW_LINE_PAR, KW_LINE_EQ, KW_LINE_VAL, \ DAT_LINE_VAL, DAT_LINE_COMMA,\ COMMENT_LINE,\ ST_ERROR, LINE_END } state ; // Do not leak onto next line state = LINE_END ; initStyle = SCE_ABAQUS_DEFAULT; StyleContext sc(startPos, length, initStyle, styler); // Things are actually quite simple // we have commentlines // keywordlines and datalines // On a data line there will only be colouring of numbers // a keyword line is constructed as // *word,[ paramname[=paramvalue]]* // if the line ends with a , the keyword line continues onto the new line for (; sc.More(); sc.Forward()) { switch ( state ) { case KW_LINE_KW : if ( sc.atLineEnd ) { // finished the line in keyword state, switch to LINE_END sc.SetState(SCE_ABAQUS_DEFAULT) ; state = LINE_END ; } else if ( IsAKeywordChar(sc.ch) ) { // nothing changes state = KW_LINE_KW ; } else if ( sc.ch == ',' ) { // Well well we say a comma, arguments *MUST* follow sc.SetState(SCE_ABAQUS_OPERATOR) ; state = KW_LINE_COMMA ; } else { // Flag an error sc.SetState(SCE_ABAQUS_PROCESSOR) ; state = ST_ERROR ; } // Done with processing break ; case KW_LINE_COMMA : // acomma on a keywordline was seen if ( IsAKeywordChar(sc.ch)) { sc.SetState(SCE_ABAQUS_ARGUMENT) ; state = KW_LINE_PAR ; } else if ( sc.atLineEnd || (sc.ch == ',') ) { // we remain in keyword mode state = KW_LINE_COMMA ; } else if ( sc.ch == ' ' ) { sc.SetState(SCE_ABAQUS_DEFAULT) ; state = KW_LINE_COMMA ; } else { // Anything else constitutes an error sc.SetState(SCE_ABAQUS_PROCESSOR) ; state = ST_ERROR ; } break ; case KW_LINE_PAR : if ( sc.atLineEnd ) { sc.SetState(SCE_ABAQUS_DEFAULT) ; state = LINE_END ; } else if ( IsAKeywordChar(sc.ch) || (sc.ch == '-') ) { // remain in this state state = KW_LINE_PAR ; } else if ( sc.ch == ',' ) { sc.SetState(SCE_ABAQUS_OPERATOR) ; state = KW_LINE_COMMA ; } else if ( sc.ch == '=' ) { sc.SetState(SCE_ABAQUS_OPERATOR) ; state = KW_LINE_EQ ; } else { // Anything else constitutes an error sc.SetState(SCE_ABAQUS_PROCESSOR) ; state = ST_ERROR ; } break ; case KW_LINE_EQ : if ( sc.ch == ' ' ) { sc.SetState(SCE_ABAQUS_DEFAULT) ; // remain in this state state = KW_LINE_EQ ; } else if ( IsADigit(sc.ch) || (sc.ch == '-') || (sc.ch == '.' && IsADigit(sc.chNext)) ) { sc.SetState(SCE_ABAQUS_NUMBER) ; state = KW_LINE_VAL ; } else if ( IsAKeywordChar(sc.ch) ) { sc.SetState(SCE_ABAQUS_DEFAULT) ; state = KW_LINE_VAL ; } else if ( (sc.ch == '\'') || (sc.ch == '\"') ) { sc.SetState(SCE_ABAQUS_STRING) ; state = KW_LINE_VAL ; } else { sc.SetState(SCE_ABAQUS_PROCESSOR) ; state = ST_ERROR ; } break ; case KW_LINE_VAL : if ( sc.atLineEnd ) { sc.SetState(SCE_ABAQUS_DEFAULT) ; state = LINE_END ; } else if ( IsASetChar(sc.ch) && (sc.state == SCE_ABAQUS_DEFAULT) ) { // nothing changes state = KW_LINE_VAL ; } else if (( (IsADigit(sc.ch) || sc.ch == '.' || (sc.ch == 'e' || sc.ch == 'E') || ((sc.ch == '+' || sc.ch == '-') && (sc.chPrev == 'e' || sc.chPrev == 'E')))) && (sc.state == SCE_ABAQUS_NUMBER)) { // remain in number mode state = KW_LINE_VAL ; } else if (sc.state == SCE_ABAQUS_STRING) { // accept everything until a closing quote if ( sc.ch == '\'' || sc.ch == '\"' ) { sc.SetState(SCE_ABAQUS_DEFAULT) ; state = KW_LINE_VAL ; } } else if ( sc.ch == ',' ) { sc.SetState(SCE_ABAQUS_OPERATOR) ; state = KW_LINE_COMMA ; } else { // anything else is an error sc.SetState(SCE_ABAQUS_PROCESSOR) ; state = ST_ERROR ; } break ; case DAT_LINE_VAL : if ( sc.atLineEnd ) { sc.SetState(SCE_ABAQUS_DEFAULT) ; state = LINE_END ; } else if ( IsASetChar(sc.ch) && (sc.state == SCE_ABAQUS_DEFAULT) ) { // nothing changes state = DAT_LINE_VAL ; } else if (( (IsADigit(sc.ch) || sc.ch == '.' || (sc.ch == 'e' || sc.ch == 'E') || ((sc.ch == '+' || sc.ch == '-') && (sc.chPrev == 'e' || sc.chPrev == 'E')))) && (sc.state == SCE_ABAQUS_NUMBER)) { // remain in number mode state = DAT_LINE_VAL ; } else if (sc.state == SCE_ABAQUS_STRING) { // accept everything until a closing quote if ( sc.ch == '\'' || sc.ch == '\"' ) { sc.SetState(SCE_ABAQUS_DEFAULT) ; state = DAT_LINE_VAL ; } } else if ( sc.ch == ',' ) { sc.SetState(SCE_ABAQUS_OPERATOR) ; state = DAT_LINE_COMMA ; } else { // anything else is an error sc.SetState(SCE_ABAQUS_PROCESSOR) ; state = ST_ERROR ; } break ; case DAT_LINE_COMMA : // a comma on a data line was seen if ( sc.atLineEnd ) { sc.SetState(SCE_ABAQUS_DEFAULT) ; state = LINE_END ; } else if ( sc.ch == ' ' ) { sc.SetState(SCE_ABAQUS_DEFAULT) ; state = DAT_LINE_COMMA ; } else if (sc.ch == ',') { sc.SetState(SCE_ABAQUS_OPERATOR) ; state = DAT_LINE_COMMA ; } else if ( IsADigit(sc.ch) || (sc.ch == '-')|| (sc.ch == '.' && IsADigit(sc.chNext)) ) { sc.SetState(SCE_ABAQUS_NUMBER) ; state = DAT_LINE_VAL ; } else if ( IsAKeywordChar(sc.ch) ) { sc.SetState(SCE_ABAQUS_DEFAULT) ; state = DAT_LINE_VAL ; } else if ( (sc.ch == '\'') || (sc.ch == '\"') ) { sc.SetState(SCE_ABAQUS_STRING) ; state = DAT_LINE_VAL ; } else { sc.SetState(SCE_ABAQUS_PROCESSOR) ; state = ST_ERROR ; } break ; case COMMENT_LINE : if ( sc.atLineEnd ) { sc.SetState(SCE_ABAQUS_DEFAULT) ; state = LINE_END ; } break ; case ST_ERROR : if ( sc.atLineEnd ) { sc.SetState(SCE_ABAQUS_DEFAULT) ; state = LINE_END ; } break ; case LINE_END : if ( sc.atLineEnd || sc.ch == ' ' ) { // nothing changes state = LINE_END ; } else if ( sc.ch == '*' ) { if ( sc.chNext == '*' ) { state = COMMENT_LINE ; sc.SetState(SCE_ABAQUS_COMMENT) ; } else { state = KW_LINE_KW ; sc.SetState(SCE_ABAQUS_STARCOMMAND) ; } } else { // it must be a data line, things are as if we are in DAT_LINE_COMMA if ( sc.ch == ',' ) { sc.SetState(SCE_ABAQUS_OPERATOR) ; state = DAT_LINE_COMMA ; } else if ( IsADigit(sc.ch) || (sc.ch == '-')|| (sc.ch == '.' && IsADigit(sc.chNext)) ) { sc.SetState(SCE_ABAQUS_NUMBER) ; state = DAT_LINE_VAL ; } else if ( IsAKeywordChar(sc.ch) ) { sc.SetState(SCE_ABAQUS_DEFAULT) ; state = DAT_LINE_VAL ; } else if ( (sc.ch == '\'') || (sc.ch == '\"') ) { sc.SetState(SCE_ABAQUS_STRING) ; state = DAT_LINE_VAL ; } else { sc.SetState(SCE_ABAQUS_PROCESSOR) ; state = ST_ERROR ; } } break ; } } sc.Complete(); } //------------------------------------------------------------------------------ // This copyied and modified from LexBasic.cxx //------------------------------------------------------------------------------ /* Bits: * 1 - whitespace * 2 - operator * 4 - identifier * 8 - decimal digit * 16 - hex digit * 32 - bin digit */ static int character_classification[128] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 2, 2, 2, 2, 2, 2, 2, 6, 2, 2, 2, 10, 6, 60, 60, 28, 28, 28, 28, 28, 28, 28, 28, 2, 2, 2, 2, 2, 2, 2, 20, 20, 20, 20, 20, 20, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 4, 2, 20, 20, 20, 20, 20, 20, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 0 }; static bool IsSpace(int c) { return c < 128 && (character_classification[c] & 1); } static bool IsIdentifier(int c) { return c < 128 && (character_classification[c] & 4); } static int LowerCase(int c) { if (c >= 'A' && c <= 'Z') return 'a' + c - 'A'; return c; } static int LineEnd(int line, Accessor &styler) { const int docLines = styler.GetLine(styler.Length() - 1); // Available last line int eol_pos ; // if the line is the last line, the eol_pos is styler.Length() // eol will contain a new line, or a virtual new line if ( docLines == line ) eol_pos = styler.Length() ; else eol_pos = styler.LineStart(line + 1) - 1; return eol_pos ; } static int LineStart(int line, Accessor &styler) { return styler.LineStart(line) ; } // LineType // // bits determines the line type // 1 : data line // 2 : only whitespace // 3 : data line with only whitespace // 4 : keyword line // 5 : block open keyword line // 6 : block close keyword line // 7 : keyword line in error // 8 : comment line static int LineType(int line, Accessor &styler) { int pos = LineStart(line, styler) ; int eol_pos = LineEnd(line, styler) ; int c ; char ch = ' '; int i = pos ; while ( i < eol_pos ) { c = styler.SafeGetCharAt(i); ch = static_cast(LowerCase(c)); // We can say something as soon as no whitespace // was encountered if ( !IsSpace(c) ) break ; i++ ; } if ( i >= eol_pos ) { // This is a whitespace line, currently // classifies as data line return 3 ; } if ( ch != '*' ) { // This is a data line return 1 ; } if ( i == eol_pos - 1 ) { // Only a single *, error but make keyword line return 4+3 ; } // This means we can have a second character // if that is also a * this means a comment // otherwise it is a keyword. c = styler.SafeGetCharAt(i+1); ch = static_cast(LowerCase(c)); if ( ch == '*' ) { return 8 ; } // At this point we know this is a keyword line // the character at position i is a * // it is not a comment line char word[256] ; int wlen = 0; word[wlen] = '*' ; wlen++ ; i++ ; while ( (i < eol_pos) && (wlen < 255) ) { c = styler.SafeGetCharAt(i); ch = static_cast(LowerCase(c)); if ( (!IsSpace(c)) && (!IsIdentifier(c)) ) break ; if ( IsIdentifier(c) ) { word[wlen] = ch ; wlen++ ; } i++ ; } word[wlen] = 0 ; // Make a comparison if ( !strcmp(word, "*step") || !strcmp(word, "*part") || !strcmp(word, "*instance") || !strcmp(word, "*assembly")) { return 4+1 ; } if ( !strcmp(word, "*endstep") || !strcmp(word, "*endpart") || !strcmp(word, "*endinstance") || !strcmp(word, "*endassembly")) { return 4+2 ; } return 4 ; } static void SafeSetLevel(int line, int level, Accessor &styler) { if ( line < 0 ) return ; int mask = ((~SC_FOLDLEVELHEADERFLAG) | (~SC_FOLDLEVELWHITEFLAG)); if ( (level & mask) < 0 ) return ; if ( styler.LevelAt(line) != level ) styler.SetLevel(line, level) ; } static void FoldABAQUSDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) { int startLine = styler.GetLine(startPos) ; int endLine = styler.GetLine(startPos+length-1) ; // bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; // We want to deal with all the cases // To know the correct indentlevel, we need to look back to the // previous command line indentation level // order of formatting keyline datalines commentlines int beginData = -1 ; int beginComment = -1 ; int prvKeyLine = startLine ; int prvKeyLineTp = 0 ; // Scan until we find the previous keyword line // this will give us the level reference that we need while ( prvKeyLine > 0 ) { prvKeyLine-- ; prvKeyLineTp = LineType(prvKeyLine, styler) ; if ( prvKeyLineTp & 4 ) break ; } // Determine the base line level of all lines following // the previous keyword // new keyword lines are placed on this level //if ( prvKeyLineTp & 4 ) { int level = styler.LevelAt(prvKeyLine) & ~SC_FOLDLEVELHEADERFLAG ; //} // uncomment line below if weird behaviour continues prvKeyLine = -1 ; // Now start scanning over the lines. for ( int line = startLine; line <= endLine; line++ ) { int lineType = LineType(line, styler) ; // Check for comment line if ( lineType == 8 ) { if ( beginComment < 0 ) { beginComment = line ; } } // Check for data line if ( (lineType == 1) || (lineType == 3) ) { if ( beginData < 0 ) { if ( beginComment >= 0 ) { beginData = beginComment ; } else { beginData = line ; } } beginComment = -1 ; } // Check for keywordline. // As soon as a keyword line is encountered, we can set the // levels of everything from the previous keyword line to this one if ( lineType & 4 ) { // this is a keyword, we can now place the previous keyword // all its data lines and the remainder // Write comments and data line if ( beginComment < 0 ) { beginComment = line ; } if ( beginData < 0 ) { beginData = beginComment ; if ( prvKeyLineTp != 5 ) SafeSetLevel(prvKeyLine, level, styler) ; else SafeSetLevel(prvKeyLine, level | SC_FOLDLEVELHEADERFLAG, styler) ; } else { SafeSetLevel(prvKeyLine, level | SC_FOLDLEVELHEADERFLAG, styler) ; } int datLevel = level + 1 ; if ( !(prvKeyLineTp & 4) ) { datLevel = level ; } for ( int ll = beginData; ll < beginComment; ll++ ) SafeSetLevel(ll, datLevel, styler) ; // The keyword we just found is going to be written at another level // if we have a type 5 and type 6 if ( prvKeyLineTp == 5 ) { level += 1 ; } if ( prvKeyLineTp == 6 ) { level -= 1 ; if ( level < 0 ) { level = 0 ; } } for ( int lll = beginComment; lll < line; lll++ ) SafeSetLevel(lll, level, styler) ; // wrap and reset beginComment = -1 ; beginData = -1 ; prvKeyLine = line ; prvKeyLineTp = lineType ; } } if ( beginComment < 0 ) { beginComment = endLine + 1 ; } else { // We need to find out whether this comment block is followed by // a data line or a keyword line const int docLines = styler.GetLine(styler.Length() - 1); for ( int line = endLine + 1; line <= docLines; line++ ) { int lineType = LineType(line, styler) ; if ( lineType != 8 ) { if ( !(lineType & 4) ) { beginComment = endLine + 1 ; } break ; } } } if ( beginData < 0 ) { beginData = beginComment ; if ( prvKeyLineTp != 5 ) SafeSetLevel(prvKeyLine, level, styler) ; else SafeSetLevel(prvKeyLine, level | SC_FOLDLEVELHEADERFLAG, styler) ; } else { SafeSetLevel(prvKeyLine, level | SC_FOLDLEVELHEADERFLAG, styler) ; } int datLevel = level + 1 ; if ( !(prvKeyLineTp & 4) ) { datLevel = level ; } for ( int ll = beginData; ll < beginComment; ll++ ) SafeSetLevel(ll, datLevel, styler) ; if ( prvKeyLineTp == 5 ) { level += 1 ; } if ( prvKeyLineTp == 6 ) { level -= 1 ; } for ( int m = beginComment; m <= endLine; m++ ) SafeSetLevel(m, level, styler) ; } static const char * const abaqusWordListDesc[] = { "processors", "commands", "slashommands", "starcommands", "arguments", "functions", 0 }; LexerModule lmAbaqus(SCLEX_ABAQUS, ColouriseABAQUSDoc, "abaqus", FoldABAQUSDoc, abaqusWordListDesc); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexTxt2tags.cxx000444001750001750 4221011727344243 25331 0ustar00azawawiazawawi000000000000/****************************************************************** * LexTxt2tags.cxx * * A simple Txt2tags lexer for scintilla. * * * Adapted by Eric Forgeot * Based on the LexMarkdown.cxx by Jon Strait - jstrait@moonloop.net * * What could be improved: * - Verbatim lines could be like for raw lines : when there is no space between the ``` and the following text, the first letter should be colored so the user would understand there must be a space for a valid tag. * - marks such as bold, italic, strikeout, underline should begin to be highlighted only when they are closed and valid. * - verbatim and raw area should be highlighted too. * * The License.txt file describes the conditions under which this * software may be distributed. * *****************************************************************/ #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static inline bool IsNewline(const int ch) { return (ch == '\n' || ch == '\r'); } // True if can follow ch down to the end with possibly trailing whitespace static bool FollowToLineEnd(const int ch, const int state, const unsigned int endPos, StyleContext &sc) { unsigned int i = 0; while (sc.GetRelative(++i) == ch) ; // Skip over whitespace while (IsASpaceOrTab(sc.GetRelative(i)) && sc.currentPos + i < endPos) ++i; if (IsNewline(sc.GetRelative(i)) || sc.currentPos + i == endPos) { sc.Forward(i); sc.ChangeState(state); sc.SetState(SCE_TXT2TAGS_LINE_BEGIN); return true; } else return false; } // Does the previous line have more than spaces and tabs? static bool HasPrevLineContent(StyleContext &sc) { int i = 0; // Go back to the previous newline while ((--i + sc.currentPos) && !IsNewline(sc.GetRelative(i))) ; while (--i + sc.currentPos) { if (IsNewline(sc.GetRelative(i))) break; if (!IsASpaceOrTab(sc.GetRelative(i))) return true; } return false; } // Separator line static bool IsValidHrule(const unsigned int endPos, StyleContext &sc) { int c, count = 1; unsigned int i = 0; while (++i) { c = sc.GetRelative(i); if (c == sc.ch) ++count; // hit a terminating character else if (!IsASpaceOrTab(c) || sc.currentPos + i == endPos) { // Are we a valid HRULE if ((IsNewline(c) || sc.currentPos + i == endPos) && count >= 20 && !HasPrevLineContent(sc)) { sc.SetState(SCE_TXT2TAGS_HRULE); sc.Forward(i); sc.SetState(SCE_TXT2TAGS_LINE_BEGIN); return true; } else { sc.SetState(SCE_TXT2TAGS_DEFAULT); return false; } } } return false; } static void ColorizeTxt2tagsDoc(unsigned int startPos, int length, int initStyle, WordList **, Accessor &styler) { unsigned int endPos = startPos + length; int precharCount = 0; // Don't advance on a new loop iteration and retry at the same position. // Useful in the corner case of having to start at the beginning file position // in the default state. bool freezeCursor = false; StyleContext sc(startPos, length, initStyle, styler); while (sc.More()) { // Skip past escaped characters if (sc.ch == '\\') { sc.Forward(); continue; } // A blockquotes resets the line semantics if (sc.state == SCE_TXT2TAGS_BLOCKQUOTE){ sc.Forward(2); sc.SetState(SCE_TXT2TAGS_LINE_BEGIN); } // An option colors the whole line if (sc.state == SCE_TXT2TAGS_OPTION){ FollowToLineEnd('%', SCE_TXT2TAGS_OPTION, endPos, sc); } if (sc.state == SCE_TXT2TAGS_POSTPROC){ FollowToLineEnd('%', SCE_TXT2TAGS_POSTPROC, endPos, sc); } if (sc.state == SCE_TXT2TAGS_PREPROC){ FollowToLineEnd('%', SCE_TXT2TAGS_PREPROC, endPos, sc); } // A comment colors the whole line if (sc.state == SCE_TXT2TAGS_COMMENT){ FollowToLineEnd('%', SCE_TXT2TAGS_COMMENT, endPos, sc); } // Conditional state-based actions if (sc.state == SCE_TXT2TAGS_CODE2) { if (IsNewline(sc.ch)) sc.SetState(SCE_TXT2TAGS_LINE_BEGIN); if (sc.Match("``") && sc.GetRelative(-2) != ' ') { sc.Forward(2); sc.SetState(SCE_TXT2TAGS_DEFAULT); } } // Table else if (sc.state == SCE_TXT2TAGS_CODE) { if (IsNewline(sc.ch)) sc.SetState(SCE_TXT2TAGS_LINE_BEGIN); if (sc.ch == '|' && sc.chPrev != ' ') sc.ForwardSetState(SCE_TXT2TAGS_DEFAULT); } // Strong else if (sc.state == SCE_TXT2TAGS_STRONG1) { if (IsNewline(sc.ch)) sc.SetState(SCE_TXT2TAGS_LINE_BEGIN); if (sc.Match("**") && sc.chPrev != ' ') { sc.Forward(2); sc.SetState(SCE_TXT2TAGS_DEFAULT); } } // Emphasis else if (sc.state == SCE_TXT2TAGS_EM1) { if (IsNewline(sc.ch)) sc.SetState(SCE_TXT2TAGS_LINE_BEGIN); if (sc.Match("//") && sc.chPrev != ' ') { sc.Forward(2); sc.ForwardSetState(SCE_TXT2TAGS_DEFAULT); } } // Underline else if (sc.state == SCE_TXT2TAGS_EM2) { if (IsNewline(sc.ch)) sc.SetState(SCE_TXT2TAGS_LINE_BEGIN); if (sc.Match("__") && sc.chPrev != ' ') { sc.Forward(2); sc.ForwardSetState(SCE_TXT2TAGS_DEFAULT); } } // codeblock else if (sc.state == SCE_TXT2TAGS_CODEBK) { if (IsNewline(sc.ch)) sc.SetState(SCE_TXT2TAGS_LINE_BEGIN); if (sc.atLineStart && sc.Match("```")) { int i = 1; while (!IsNewline(sc.GetRelative(i)) && sc.currentPos + i < endPos) i++; sc.Forward(i); sc.SetState(SCE_TXT2TAGS_DEFAULT); } } // strikeout else if (sc.state == SCE_TXT2TAGS_STRIKEOUT) { if (IsNewline(sc.ch)) sc.SetState(SCE_TXT2TAGS_LINE_BEGIN); if (sc.Match("--") && sc.chPrev != ' ') { sc.Forward(2); sc.SetState(SCE_TXT2TAGS_DEFAULT); } } // Headers else if (sc.state == SCE_TXT2TAGS_LINE_BEGIN) { if (sc.Match("======")) { sc.SetState(SCE_TXT2TAGS_HEADER6); sc.Forward(); } else if (sc.Match("=====")) { sc.SetState(SCE_TXT2TAGS_HEADER5); sc.Forward(); } else if (sc.Match("====")) { sc.SetState(SCE_TXT2TAGS_HEADER4); sc.Forward(); } else if (sc.Match("===")) { sc.SetState(SCE_TXT2TAGS_HEADER3); sc.Forward(); } //SetStateAndZoom(SCE_TXT2TAGS_HEADER3, 3, '=', sc); else if (sc.Match("==")) { sc.SetState(SCE_TXT2TAGS_HEADER2); sc.Forward(); } //SetStateAndZoom(SCE_TXT2TAGS_HEADER2, 2, '=', sc); else if (sc.Match("=")) { // Catch the special case of an unordered list if (sc.chNext == '.' && IsASpaceOrTab(sc.GetRelative(2))) { precharCount = 0; sc.SetState(SCE_TXT2TAGS_PRECHAR); } else { sc.SetState(SCE_TXT2TAGS_HEADER1); sc.Forward(); } //SetStateAndZoom(SCE_TXT2TAGS_HEADER1, 1, '=', sc); } // Numbered title else if (sc.Match("++++++")) { sc.SetState(SCE_TXT2TAGS_HEADER6); sc.Forward(); } else if (sc.Match("+++++")) { sc.SetState(SCE_TXT2TAGS_HEADER5); sc.Forward(); } else if (sc.Match("++++")) { sc.SetState(SCE_TXT2TAGS_HEADER4); sc.Forward(); } else if (sc.Match("+++")) { sc.SetState(SCE_TXT2TAGS_HEADER3); sc.Forward(); } //SetStateAndZoom(SCE_TXT2TAGS_HEADER3, 3, '+', sc); else if (sc.Match("++")) { sc.SetState(SCE_TXT2TAGS_HEADER2); sc.Forward(); } //SetStateAndZoom(SCE_TXT2TAGS_HEADER2, 2, '+', sc); else if (sc.Match("+")) { // Catch the special case of an unordered list if (sc.chNext == ' ' && IsASpaceOrTab(sc.GetRelative(1))) { // if (IsNewline(sc.ch)) { //precharCount = 0; // sc.SetState(SCE_TXT2TAGS_LINE_BEGIN); //sc.SetState(SCE_TXT2TAGS_PRECHAR); // } // else { // precharCount = 0; sc.SetState(SCE_TXT2TAGS_OLIST_ITEM); sc.Forward(2); sc.SetState(SCE_TXT2TAGS_DEFAULT); // sc.SetState(SCE_TXT2TAGS_PRECHAR); // } } else { sc.SetState(SCE_TXT2TAGS_HEADER1); sc.Forward(); } } // Codeblock else if (sc.Match("```")) { if (!HasPrevLineContent(sc)) // if (!FollowToLineEnd(sc)) sc.SetState(SCE_TXT2TAGS_CODEBK); else sc.SetState(SCE_TXT2TAGS_DEFAULT); } // Preproc else if (sc.Match("%!preproc")) { sc.SetState(SCE_TXT2TAGS_PREPROC); } // Postproc else if (sc.Match("%!postproc")) { sc.SetState(SCE_TXT2TAGS_POSTPROC); } // Option else if (sc.Match("%!")) { sc.SetState(SCE_TXT2TAGS_OPTION); } // Comment else if (sc.ch == '%') { sc.SetState(SCE_TXT2TAGS_COMMENT); } // list else if (sc.ch == '-') { precharCount = 0; sc.SetState(SCE_TXT2TAGS_PRECHAR); } // def list else if (sc.ch == ':') { precharCount = 0; sc.SetState(SCE_TXT2TAGS_OLIST_ITEM); sc.Forward(1); sc.SetState(SCE_TXT2TAGS_PRECHAR); } else if (IsNewline(sc.ch)) sc.SetState(SCE_TXT2TAGS_LINE_BEGIN); else { precharCount = 0; sc.SetState(SCE_TXT2TAGS_PRECHAR); } } // The header lasts until the newline else if (sc.state == SCE_TXT2TAGS_HEADER1 || sc.state == SCE_TXT2TAGS_HEADER2 || sc.state == SCE_TXT2TAGS_HEADER3 || sc.state == SCE_TXT2TAGS_HEADER4 || sc.state == SCE_TXT2TAGS_HEADER5 || sc.state == SCE_TXT2TAGS_HEADER6) { if (IsNewline(sc.ch)) sc.SetState(SCE_TXT2TAGS_LINE_BEGIN); } // New state only within the initial whitespace if (sc.state == SCE_TXT2TAGS_PRECHAR) { // Blockquote if (sc.Match("\"\"\"") && precharCount < 5){ sc.SetState(SCE_TXT2TAGS_BLOCKQUOTE); sc.Forward(1); } /* // Begin of code block else if (!HasPrevLineContent(sc) && (sc.chPrev == '\t' || precharCount >= 4)) sc.SetState(SCE_TXT2TAGS_CODEBK); */ // HRule - Total of 20 or more hyphens, asterisks, or underscores // on a line by themselves else if ((sc.ch == '-' ) && IsValidHrule(endPos, sc)) ; // Unordered list else if ((sc.ch == '-') && IsASpaceOrTab(sc.chNext)) { sc.SetState(SCE_TXT2TAGS_ULIST_ITEM); sc.ForwardSetState(SCE_TXT2TAGS_DEFAULT); } // Ordered list else if (IsADigit(sc.ch)) { int digitCount = 0; while (IsADigit(sc.GetRelative(++digitCount))) ; if (sc.GetRelative(digitCount) == '.' && IsASpaceOrTab(sc.GetRelative(digitCount + 1))) { sc.SetState(SCE_TXT2TAGS_OLIST_ITEM); sc.Forward(digitCount + 1); sc.SetState(SCE_TXT2TAGS_DEFAULT); } } // Alternate Ordered list else if (sc.ch == '+' && sc.chNext == ' ' && IsASpaceOrTab(sc.GetRelative(2))) { // sc.SetState(SCE_TXT2TAGS_OLIST_ITEM); // sc.Forward(2); // sc.SetState(SCE_TXT2TAGS_DEFAULT); } else if (sc.ch != ' ' || precharCount > 2) sc.SetState(SCE_TXT2TAGS_DEFAULT); else ++precharCount; } // New state anywhere in doc if (sc.state == SCE_TXT2TAGS_DEFAULT) { // if (sc.atLineStart && sc.ch == '#') { // sc.SetState(SCE_TXT2TAGS_LINE_BEGIN); // freezeCursor = true; // } // Links and Images if (sc.Match("![") || sc.ch == '[') { int i = 0, j = 0, k = 0; int len = endPos - sc.currentPos; while (i < len && (sc.GetRelative(++i) != ']' || sc.GetRelative(i - 1) == '\\')) ; if (sc.GetRelative(i) == ']') { j = i; if (sc.GetRelative(++i) == '(') { while (i < len && (sc.GetRelative(++i) != '(' || sc.GetRelative(i - 1) == '\\')) ; if (sc.GetRelative(i) == '(') k = i; } else if (sc.GetRelative(i) == '[' || sc.GetRelative(++i) == '[') { while (i < len && (sc.GetRelative(++i) != ']' || sc.GetRelative(i - 1) == '\\')) ; if (sc.GetRelative(i) == ']') k = i; } } // At least a link text if (j) { sc.SetState(SCE_TXT2TAGS_LINK); sc.Forward(j); // Also has a URL or reference portion if (k) sc.Forward(k - j); sc.ForwardSetState(SCE_TXT2TAGS_DEFAULT); } } // Code - also a special case for alternate inside spacing if (sc.Match("``") && sc.GetRelative(3) != ' ') { sc.SetState(SCE_TXT2TAGS_CODE2); sc.Forward(); } else if (sc.ch == '|' && sc.GetRelative(3) != ' ') { sc.SetState(SCE_TXT2TAGS_CODE); } // Strong else if (sc.Match("**") && sc.GetRelative(2) != ' ') { sc.SetState(SCE_TXT2TAGS_STRONG1); sc.Forward(); } // Emphasis else if (sc.Match("//") && sc.GetRelative(2) != ' ') { sc.SetState(SCE_TXT2TAGS_EM1); sc.Forward(); } else if (sc.Match("__") && sc.GetRelative(2) != ' ') { sc.SetState(SCE_TXT2TAGS_EM2); sc.Forward(); } // Strikeout else if (sc.Match("--") && sc.GetRelative(2) != ' ') { sc.SetState(SCE_TXT2TAGS_STRIKEOUT); sc.Forward(); } // Beginning of line else if (IsNewline(sc.ch)) sc.SetState(SCE_TXT2TAGS_LINE_BEGIN); } // Advance if not holding back the cursor for this iteration. if (!freezeCursor) sc.Forward(); freezeCursor = false; } sc.Complete(); } LexerModule lmTxt2tags(SCLEX_TXT2TAGS, ColorizeTxt2tagsDoc, "txt2tags"); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexCrontab.cxx000444001750001750 1641411727344243 25210 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexCrontab.cxx ** Lexer to use with extended crontab files used by a powerful ** Windows scheduler/event monitor/automation manager nnCron. ** (http://nemtsev.eserv.ru/) **/ // Copyright 1998-2001 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static void ColouriseNncrontabDoc(unsigned int startPos, int length, int, WordList *keywordLists[], Accessor &styler) { int state = SCE_NNCRONTAB_DEFAULT; char chNext = styler[startPos]; int lengthDoc = startPos + length; // create a buffer large enough to take the largest chunk... char *buffer = new char[length]; int bufferCount = 0; // used when highliting environment variables inside quoted string: bool insideString = false; // this assumes that we have 3 keyword list in conf.properties WordList §ion = *keywordLists[0]; WordList &keyword = *keywordLists[1]; WordList &modifier = *keywordLists[2]; // go through all provided text segment // using the hand-written state machine shown below styler.StartAt(startPos); styler.StartSegment(startPos); for (int i = startPos; i < lengthDoc; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); if (styler.IsLeadByte(ch)) { chNext = styler.SafeGetCharAt(i + 2); i++; continue; } switch(state) { case SCE_NNCRONTAB_DEFAULT: if( ch == '\n' || ch == '\r' || ch == '\t' || ch == ' ') { // whitespace is simply ignored here... styler.ColourTo(i,SCE_NNCRONTAB_DEFAULT); break; } else if( ch == '#' && styler.SafeGetCharAt(i+1) == '(') { // signals the start of a task... state = SCE_NNCRONTAB_TASK; styler.ColourTo(i,SCE_NNCRONTAB_TASK); } else if( ch == '\\' && (styler.SafeGetCharAt(i+1) == ' ' || styler.SafeGetCharAt(i+1) == '\t')) { // signals the start of an extended comment... state = SCE_NNCRONTAB_COMMENT; styler.ColourTo(i,SCE_NNCRONTAB_COMMENT); } else if( ch == '#' ) { // signals the start of a plain comment... state = SCE_NNCRONTAB_COMMENT; styler.ColourTo(i,SCE_NNCRONTAB_COMMENT); } else if( ch == ')' && styler.SafeGetCharAt(i+1) == '#') { // signals the end of a task... state = SCE_NNCRONTAB_TASK; styler.ColourTo(i,SCE_NNCRONTAB_TASK); } else if( ch == '"') { state = SCE_NNCRONTAB_STRING; styler.ColourTo(i,SCE_NNCRONTAB_STRING); } else if( ch == '%') { // signals environment variables state = SCE_NNCRONTAB_ENVIRONMENT; styler.ColourTo(i,SCE_NNCRONTAB_ENVIRONMENT); } else if( ch == '<' && styler.SafeGetCharAt(i+1) == '%') { // signals environment variables state = SCE_NNCRONTAB_ENVIRONMENT; styler.ColourTo(i,SCE_NNCRONTAB_ENVIRONMENT); } else if( ch == '*' ) { // signals an asterisk // no state jump necessary for this simple case... styler.ColourTo(i,SCE_NNCRONTAB_ASTERISK); } else if( (isascii(ch) && isalpha(ch)) || ch == '<' ) { // signals the start of an identifier bufferCount = 0; buffer[bufferCount++] = ch; state = SCE_NNCRONTAB_IDENTIFIER; } else if( isascii(ch) && isdigit(ch) ) { // signals the start of a number bufferCount = 0; buffer[bufferCount++] = ch; state = SCE_NNCRONTAB_NUMBER; } else { // style it the default style.. styler.ColourTo(i,SCE_NNCRONTAB_DEFAULT); } break; case SCE_NNCRONTAB_COMMENT: // if we find a newline here, // we simply go to default state // else continue to work on it... if( ch == '\n' || ch == '\r' ) { state = SCE_NNCRONTAB_DEFAULT; } else { styler.ColourTo(i,SCE_NNCRONTAB_COMMENT); } break; case SCE_NNCRONTAB_TASK: // if we find a newline here, // we simply go to default state // else continue to work on it... if( ch == '\n' || ch == '\r' ) { state = SCE_NNCRONTAB_DEFAULT; } else { styler.ColourTo(i,SCE_NNCRONTAB_TASK); } break; case SCE_NNCRONTAB_STRING: if( ch == '%' ) { state = SCE_NNCRONTAB_ENVIRONMENT; insideString = true; styler.ColourTo(i-1,SCE_NNCRONTAB_STRING); break; } // if we find the end of a string char, we simply go to default state // else we're still dealing with an string... if( (ch == '"' && styler.SafeGetCharAt(i-1)!='\\') || (ch == '\n') || (ch == '\r') ) { state = SCE_NNCRONTAB_DEFAULT; } styler.ColourTo(i,SCE_NNCRONTAB_STRING); break; case SCE_NNCRONTAB_ENVIRONMENT: // if we find the end of a string char, we simply go to default state // else we're still dealing with an string... if( ch == '%' && insideString ) { state = SCE_NNCRONTAB_STRING; insideString = false; break; } if( (ch == '%' && styler.SafeGetCharAt(i-1)!='\\') || (ch == '\n') || (ch == '\r') || (ch == '>') ) { state = SCE_NNCRONTAB_DEFAULT; styler.ColourTo(i,SCE_NNCRONTAB_ENVIRONMENT); break; } styler.ColourTo(i+1,SCE_NNCRONTAB_ENVIRONMENT); break; case SCE_NNCRONTAB_IDENTIFIER: // stay in CONF_IDENTIFIER state until we find a non-alphanumeric if( (isascii(ch) && isalnum(ch)) || (ch == '_') || (ch == '-') || (ch == '/') || (ch == '$') || (ch == '.') || (ch == '<') || (ch == '>') || (ch == '@') ) { buffer[bufferCount++] = ch; } else { state = SCE_NNCRONTAB_DEFAULT; buffer[bufferCount] = '\0'; // check if the buffer contains a keyword, // and highlight it if it is a keyword... if(section.InList(buffer)) { styler.ColourTo(i,SCE_NNCRONTAB_SECTION ); } else if(keyword.InList(buffer)) { styler.ColourTo(i-1,SCE_NNCRONTAB_KEYWORD ); } // else if(strchr(buffer,'/') || strchr(buffer,'.')) { // styler.ColourTo(i-1,SCE_NNCRONTAB_EXTENSION); // } else if(modifier.InList(buffer)) { styler.ColourTo(i-1,SCE_NNCRONTAB_MODIFIER ); } else { styler.ColourTo(i-1,SCE_NNCRONTAB_DEFAULT); } // push back the faulty character chNext = styler[i--]; } break; case SCE_NNCRONTAB_NUMBER: // stay in CONF_NUMBER state until we find a non-numeric if( isascii(ch) && isdigit(ch) /* || ch == '.' */ ) { buffer[bufferCount++] = ch; } else { state = SCE_NNCRONTAB_DEFAULT; buffer[bufferCount] = '\0'; // Colourize here... (normal number) styler.ColourTo(i-1,SCE_NNCRONTAB_NUMBER); // push back a character chNext = styler[i--]; } break; } } delete []buffer; } static const char * const cronWordListDesc[] = { "Section keywords and Forth words", "nnCrontab keywords", "Modifiers", 0 }; LexerModule lmNncrontab(SCLEX_NNCRONTAB, ColouriseNncrontabDoc, "nncrontab", 0, cronWordListDesc); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/KeyMap.h000444001750001750 203411727344243 23733 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file KeyMap.h ** Defines a mapping between keystrokes and commands. **/ // Copyright 1998-2001 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #ifndef KEYTOCOMMAND_H #define KEYTOCOMMAND_H #ifdef SCI_NAMESPACE namespace Scintilla { #endif #define SCI_NORM 0 #define SCI_SHIFT SCMOD_SHIFT #define SCI_CTRL SCMOD_CTRL #define SCI_ALT SCMOD_ALT #define SCI_META SCMOD_META #define SCI_CSHIFT (SCI_CTRL | SCI_SHIFT) #define SCI_ASHIFT (SCI_ALT | SCI_SHIFT) /** */ class KeyToCommand { public: int key; int modifiers; unsigned int msg; }; /** */ class KeyMap { KeyToCommand *kmap; int len; int alloc; static const KeyToCommand MapDefault[]; public: KeyMap(); ~KeyMap(); void Clear(); void AssignCmdKey(int key, int modifiers, unsigned int msg); unsigned int Find(int key, int modifiers); // 0 returned on failure }; #ifdef SCI_NAMESPACE } #endif #endif Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexCmake.cxx000444001750001750 3754711727344243 24652 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexCmake.cxx ** Lexer for Cmake **/ // Copyright 2007 by Cristian Adam // based on the NSIS lexer // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static bool isCmakeNumber(char ch) { return(ch >= '0' && ch <= '9'); } static bool isCmakeChar(char ch) { return(ch == '.' ) || (ch == '_' ) || isCmakeNumber(ch) || (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z'); } static bool isCmakeLetter(char ch) { return(ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z'); } static bool CmakeNextLineHasElse(unsigned int start, unsigned int end, Accessor &styler) { int nNextLine = -1; for ( unsigned int i = start; i < end; i++ ) { char cNext = styler.SafeGetCharAt( i ); if ( cNext == '\n' ) { nNextLine = i+1; break; } } if ( nNextLine == -1 ) // We never foudn the next line... return false; for ( unsigned int firstChar = nNextLine; firstChar < end; firstChar++ ) { char cNext = styler.SafeGetCharAt( firstChar ); if ( cNext == ' ' ) continue; if ( cNext == '\t' ) continue; if ( styler.Match(firstChar, "ELSE") || styler.Match(firstChar, "else")) return true; break; } return false; } static int calculateFoldCmake(unsigned int start, unsigned int end, int foldlevel, Accessor &styler, bool bElse) { // If the word is too long, it is not what we are looking for if ( end - start > 20 ) return foldlevel; int newFoldlevel = foldlevel; char s[20]; // The key word we are looking for has atmost 13 characters for (unsigned int i = 0; i < end - start + 1 && i < 19; i++) { s[i] = static_cast( styler[ start + i ] ); s[i + 1] = '\0'; } if ( CompareCaseInsensitive(s, "IF") == 0 || CompareCaseInsensitive(s, "WHILE") == 0 || CompareCaseInsensitive(s, "MACRO") == 0 || CompareCaseInsensitive(s, "FOREACH") == 0 || CompareCaseInsensitive(s, "ELSEIF") == 0 ) newFoldlevel++; else if ( CompareCaseInsensitive(s, "ENDIF") == 0 || CompareCaseInsensitive(s, "ENDWHILE") == 0 || CompareCaseInsensitive(s, "ENDMACRO") == 0 || CompareCaseInsensitive(s, "ENDFOREACH") == 0) newFoldlevel--; else if ( bElse && CompareCaseInsensitive(s, "ELSEIF") == 0 ) newFoldlevel++; else if ( bElse && CompareCaseInsensitive(s, "ELSE") == 0 ) newFoldlevel++; return newFoldlevel; } static int classifyWordCmake(unsigned int start, unsigned int end, WordList *keywordLists[], Accessor &styler ) { char word[100] = {0}; char lowercaseWord[100] = {0}; WordList &Commands = *keywordLists[0]; WordList &Parameters = *keywordLists[1]; WordList &UserDefined = *keywordLists[2]; for (unsigned int i = 0; i < end - start + 1 && i < 99; i++) { word[i] = static_cast( styler[ start + i ] ); lowercaseWord[i] = static_cast(tolower(word[i])); } // Check for special words... if ( CompareCaseInsensitive(word, "MACRO") == 0 || CompareCaseInsensitive(word, "ENDMACRO") == 0 ) return SCE_CMAKE_MACRODEF; if ( CompareCaseInsensitive(word, "IF") == 0 || CompareCaseInsensitive(word, "ENDIF") == 0 ) return SCE_CMAKE_IFDEFINEDEF; if ( CompareCaseInsensitive(word, "ELSEIF") == 0 || CompareCaseInsensitive(word, "ELSE") == 0 ) return SCE_CMAKE_IFDEFINEDEF; if ( CompareCaseInsensitive(word, "WHILE") == 0 || CompareCaseInsensitive(word, "ENDWHILE") == 0) return SCE_CMAKE_WHILEDEF; if ( CompareCaseInsensitive(word, "FOREACH") == 0 || CompareCaseInsensitive(word, "ENDFOREACH") == 0) return SCE_CMAKE_FOREACHDEF; if ( Commands.InList(lowercaseWord) ) return SCE_CMAKE_COMMANDS; if ( Parameters.InList(word) ) return SCE_CMAKE_PARAMETERS; if ( UserDefined.InList(word) ) return SCE_CMAKE_USERDEFINED; if ( strlen(word) > 3 ) { if ( word[1] == '{' && word[strlen(word)-1] == '}' ) return SCE_CMAKE_VARIABLE; } // To check for numbers if ( isCmakeNumber( word[0] ) ) { bool bHasSimpleCmakeNumber = true; for (unsigned int j = 1; j < end - start + 1 && j < 99; j++) { if ( !isCmakeNumber( word[j] ) ) { bHasSimpleCmakeNumber = false; break; } } if ( bHasSimpleCmakeNumber ) return SCE_CMAKE_NUMBER; } return SCE_CMAKE_DEFAULT; } static void ColouriseCmakeDoc(unsigned int startPos, int length, int, WordList *keywordLists[], Accessor &styler) { int state = SCE_CMAKE_DEFAULT; if ( startPos > 0 ) state = styler.StyleAt(startPos-1); // Use the style from the previous line, usually default, but could be commentbox styler.StartAt( startPos ); styler.GetLine( startPos ); unsigned int nLengthDoc = startPos + length; styler.StartSegment( startPos ); char cCurrChar; bool bVarInString = false; bool bClassicVarInString = false; unsigned int i; for ( i = startPos; i < nLengthDoc; i++ ) { cCurrChar = styler.SafeGetCharAt( i ); char cNextChar = styler.SafeGetCharAt(i+1); switch (state) { case SCE_CMAKE_DEFAULT: if ( cCurrChar == '#' ) { // we have a comment line styler.ColourTo(i-1, state ); state = SCE_CMAKE_COMMENT; break; } if ( cCurrChar == '"' ) { styler.ColourTo(i-1, state ); state = SCE_CMAKE_STRINGDQ; bVarInString = false; bClassicVarInString = false; break; } if ( cCurrChar == '\'' ) { styler.ColourTo(i-1, state ); state = SCE_CMAKE_STRINGRQ; bVarInString = false; bClassicVarInString = false; break; } if ( cCurrChar == '`' ) { styler.ColourTo(i-1, state ); state = SCE_CMAKE_STRINGLQ; bVarInString = false; bClassicVarInString = false; break; } // CMake Variable if ( cCurrChar == '$' || isCmakeChar(cCurrChar)) { styler.ColourTo(i-1,state); state = SCE_CMAKE_VARIABLE; // If it is a number, we must check and set style here first... if ( isCmakeNumber(cCurrChar) && (cNextChar == '\t' || cNextChar == ' ' || cNextChar == '\r' || cNextChar == '\n' ) ) styler.ColourTo( i, SCE_CMAKE_NUMBER); break; } break; case SCE_CMAKE_COMMENT: if ( cNextChar == '\n' || cNextChar == '\r' ) { // Special case: if ( cCurrChar == '\\' ) { styler.ColourTo(i-2,state); styler.ColourTo(i,SCE_CMAKE_DEFAULT); } else { styler.ColourTo(i,state); state = SCE_CMAKE_DEFAULT; } } break; case SCE_CMAKE_STRINGDQ: case SCE_CMAKE_STRINGLQ: case SCE_CMAKE_STRINGRQ: if ( styler.SafeGetCharAt(i-1) == '\\' && styler.SafeGetCharAt(i-2) == '$' ) break; // Ignore the next character, even if it is a quote of some sort if ( cCurrChar == '"' && state == SCE_CMAKE_STRINGDQ ) { styler.ColourTo(i,state); state = SCE_CMAKE_DEFAULT; break; } if ( cCurrChar == '`' && state == SCE_CMAKE_STRINGLQ ) { styler.ColourTo(i,state); state = SCE_CMAKE_DEFAULT; break; } if ( cCurrChar == '\'' && state == SCE_CMAKE_STRINGRQ ) { styler.ColourTo(i,state); state = SCE_CMAKE_DEFAULT; break; } if ( cNextChar == '\r' || cNextChar == '\n' ) { int nCurLine = styler.GetLine(i+1); int nBack = i; // We need to check if the previous line has a \ in it... bool bNextLine = false; while ( nBack > 0 ) { if ( styler.GetLine(nBack) != nCurLine ) break; char cTemp = styler.SafeGetCharAt(nBack, 'a'); // Letter 'a' is safe here if ( cTemp == '\\' ) { bNextLine = true; break; } if ( cTemp != '\r' && cTemp != '\n' && cTemp != '\t' && cTemp != ' ' ) break; nBack--; } if ( bNextLine ) { styler.ColourTo(i+1,state); } if ( bNextLine == false ) { styler.ColourTo(i,state); state = SCE_CMAKE_DEFAULT; } } break; case SCE_CMAKE_VARIABLE: // CMake Variable: if ( cCurrChar == '$' ) state = SCE_CMAKE_DEFAULT; else if ( cCurrChar == '\\' && (cNextChar == 'n' || cNextChar == 'r' || cNextChar == 't' ) ) state = SCE_CMAKE_DEFAULT; else if ( (isCmakeChar(cCurrChar) && !isCmakeChar( cNextChar) && cNextChar != '}') || cCurrChar == '}' ) { state = classifyWordCmake( styler.GetStartSegment(), i, keywordLists, styler ); styler.ColourTo( i, state); state = SCE_CMAKE_DEFAULT; } else if ( !isCmakeChar( cCurrChar ) && cCurrChar != '{' && cCurrChar != '}' ) { if ( classifyWordCmake( styler.GetStartSegment(), i-1, keywordLists, styler) == SCE_CMAKE_NUMBER ) styler.ColourTo( i-1, SCE_CMAKE_NUMBER ); state = SCE_CMAKE_DEFAULT; if ( cCurrChar == '"' ) { state = SCE_CMAKE_STRINGDQ; bVarInString = false; bClassicVarInString = false; } else if ( cCurrChar == '`' ) { state = SCE_CMAKE_STRINGLQ; bVarInString = false; bClassicVarInString = false; } else if ( cCurrChar == '\'' ) { state = SCE_CMAKE_STRINGRQ; bVarInString = false; bClassicVarInString = false; } else if ( cCurrChar == '#' ) { state = SCE_CMAKE_COMMENT; } } break; } if ( state == SCE_CMAKE_COMMENT) { styler.ColourTo(i,state); } else if ( state == SCE_CMAKE_STRINGDQ || state == SCE_CMAKE_STRINGLQ || state == SCE_CMAKE_STRINGRQ ) { bool bIngoreNextDollarSign = false; if ( bVarInString && cCurrChar == '$' ) { bVarInString = false; bIngoreNextDollarSign = true; } else if ( bVarInString && cCurrChar == '\\' && (cNextChar == 'n' || cNextChar == 'r' || cNextChar == 't' || cNextChar == '"' || cNextChar == '`' || cNextChar == '\'' ) ) { styler.ColourTo( i+1, SCE_CMAKE_STRINGVAR); bVarInString = false; bIngoreNextDollarSign = false; } else if ( bVarInString && !isCmakeChar(cNextChar) ) { int nWordState = classifyWordCmake( styler.GetStartSegment(), i, keywordLists, styler); if ( nWordState == SCE_CMAKE_VARIABLE ) styler.ColourTo( i, SCE_CMAKE_STRINGVAR); bVarInString = false; } // Covers "${TEST}..." else if ( bClassicVarInString && cNextChar == '}' ) { styler.ColourTo( i+1, SCE_CMAKE_STRINGVAR); bClassicVarInString = false; } // Start of var in string if ( !bIngoreNextDollarSign && cCurrChar == '$' && cNextChar == '{' ) { styler.ColourTo( i-1, state); bClassicVarInString = true; bVarInString = false; } else if ( !bIngoreNextDollarSign && cCurrChar == '$' ) { styler.ColourTo( i-1, state); bVarInString = true; bClassicVarInString = false; } } } // Colourise remaining document styler.ColourTo(nLengthDoc-1,state); } static void FoldCmakeDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) { // No folding enabled, no reason to continue... if ( styler.GetPropertyInt("fold") == 0 ) return; bool foldAtElse = styler.GetPropertyInt("fold.at.else", 0) == 1; int lineCurrent = styler.GetLine(startPos); unsigned int safeStartPos = styler.LineStart( lineCurrent ); bool bArg1 = true; int nWordStart = -1; int levelCurrent = SC_FOLDLEVELBASE; if (lineCurrent > 0) levelCurrent = styler.LevelAt(lineCurrent-1) >> 16; int levelNext = levelCurrent; for (unsigned int i = safeStartPos; i < startPos + length; i++) { char chCurr = styler.SafeGetCharAt(i); if ( bArg1 ) { if ( nWordStart == -1 && (isCmakeLetter(chCurr)) ) { nWordStart = i; } else if ( isCmakeLetter(chCurr) == false && nWordStart > -1 ) { int newLevel = calculateFoldCmake( nWordStart, i-1, levelNext, styler, foldAtElse); if ( newLevel == levelNext ) { if ( foldAtElse ) { if ( CmakeNextLineHasElse(i, startPos + length, styler) ) levelNext--; } } else levelNext = newLevel; bArg1 = false; } } if ( chCurr == '\n' ) { if ( bArg1 && foldAtElse) { if ( CmakeNextLineHasElse(i, startPos + length, styler) ) levelNext--; } // If we are on a new line... int levelUse = levelCurrent; int lev = levelUse | levelNext << 16; if (levelUse < levelNext ) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) styler.SetLevel(lineCurrent, lev); lineCurrent++; levelCurrent = levelNext; bArg1 = true; // New line, lets look at first argument again nWordStart = -1; } } int levelUse = levelCurrent; int lev = levelUse | levelNext << 16; if (levelUse < levelNext) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) styler.SetLevel(lineCurrent, lev); } static const char * const cmakeWordLists[] = { "Commands", "Parameters", "UserDefined", 0, 0,}; LexerModule lmCmake(SCLEX_CMAKE, ColouriseCmakeDoc, "cmake", FoldCmakeDoc, cmakeWordLists); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexMarkdown.cxx000444001750001750 3747611727344243 25415 0ustar00azawawiazawawi000000000000/****************************************************************** * LexMarkdown.cxx * * A simple Markdown lexer for scintilla. * * Includes highlighting for some extra features from the * Pandoc implementation; strikeout, using '#.' as a default * ordered list item marker, and delimited code blocks. * * Limitations: * * Standard indented code blocks are not highlighted at all, * as it would conflict with other indentation schemes. Use * delimited code blocks for blanket highlighting of an * entire code block. Embedded HTML is not highlighted either. * Blanket HTML highlighting has issues, because some Markdown * implementations allow Markdown markup inside of the HTML. Also, * there is a following blank line issue that can't be ignored, * explained in the next paragraph. Embedded HTML and code * blocks would be better supported with language specific * highlighting. * * The highlighting aims to accurately reflect correct syntax, * but a few restrictions are relaxed. Delimited code blocks are * highlighted, even if the line following the code block is not blank. * Requiring a blank line after a block, breaks the highlighting * in certain cases, because of the way Scintilla ends up calling * the lexer. * * Written by Jon Strait - jstrait@moonloop.net * * The License.txt file describes the conditions under which this * software may be distributed. * *****************************************************************/ #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static inline bool IsNewline(const int ch) { return (ch == '\n' || ch == '\r'); } // True if can follow ch down to the end with possibly trailing whitespace static bool FollowToLineEnd(const int ch, const int state, const unsigned int endPos, StyleContext &sc) { unsigned int i = 0; while (sc.GetRelative(++i) == ch) ; // Skip over whitespace while (IsASpaceOrTab(sc.GetRelative(i)) && sc.currentPos + i < endPos) ++i; if (IsNewline(sc.GetRelative(i)) || sc.currentPos + i == endPos) { sc.Forward(i); sc.ChangeState(state); sc.SetState(SCE_MARKDOWN_LINE_BEGIN); return true; } else return false; } // Set the state on text section from current to length characters, // then set the rest until the newline to default, except for any characters matching token static void SetStateAndZoom(const int state, const int length, const int token, StyleContext &sc) { sc.SetState(state); sc.Forward(length); sc.SetState(SCE_MARKDOWN_DEFAULT); sc.Forward(); bool started = false; while (sc.More() && !IsNewline(sc.ch)) { if (sc.ch == token && !started) { sc.SetState(state); started = true; } else if (sc.ch != token) { sc.SetState(SCE_MARKDOWN_DEFAULT); started = false; } sc.Forward(); } sc.SetState(SCE_MARKDOWN_LINE_BEGIN); } // Does the previous line have more than spaces and tabs? static bool HasPrevLineContent(StyleContext &sc) { int i = 0; // Go back to the previous newline while ((--i + (int)sc.currentPos) >= 0 && !IsNewline(sc.GetRelative(i))) ; while ((--i + (int)sc.currentPos) >= 0) { if (IsNewline(sc.GetRelative(i))) break; if (!IsASpaceOrTab(sc.GetRelative(i))) return true; } return false; } static bool AtTermStart(StyleContext &sc) { return sc.currentPos == 0 || isspacechar(sc.chPrev); } static bool IsValidHrule(const unsigned int endPos, StyleContext &sc) { int c, count = 1; unsigned int i = 0; while (++i) { c = sc.GetRelative(i); if (c == sc.ch) ++count; // hit a terminating character else if (!IsASpaceOrTab(c) || sc.currentPos + i == endPos) { // Are we a valid HRULE if ((IsNewline(c) || sc.currentPos + i == endPos) && count >= 3 && !HasPrevLineContent(sc)) { sc.SetState(SCE_MARKDOWN_HRULE); sc.Forward(i); sc.SetState(SCE_MARKDOWN_LINE_BEGIN); return true; } else { sc.SetState(SCE_MARKDOWN_DEFAULT); return false; } } } return false; } static void ColorizeMarkdownDoc(unsigned int startPos, int length, int initStyle, WordList **, Accessor &styler) { unsigned int endPos = startPos + length; int precharCount = 0; // Don't advance on a new loop iteration and retry at the same position. // Useful in the corner case of having to start at the beginning file position // in the default state. bool freezeCursor = false; StyleContext sc(startPos, length, initStyle, styler); while (sc.More()) { // Skip past escaped characters if (sc.ch == '\\') { sc.Forward(); continue; } // A blockquotes resets the line semantics if (sc.state == SCE_MARKDOWN_BLOCKQUOTE) sc.SetState(SCE_MARKDOWN_LINE_BEGIN); // Conditional state-based actions if (sc.state == SCE_MARKDOWN_CODE2) { if (sc.Match("``") && sc.GetRelative(-2) != ' ') { sc.Forward(2); sc.SetState(SCE_MARKDOWN_DEFAULT); } } else if (sc.state == SCE_MARKDOWN_CODE) { if (sc.ch == '`' && sc.chPrev != ' ') sc.ForwardSetState(SCE_MARKDOWN_DEFAULT); } /* De-activated because it gets in the way of other valid indentation * schemes, for example multiple paragraphs inside a list item. // Code block else if (sc.state == SCE_MARKDOWN_CODEBK) { bool d = true; if (IsNewline(sc.ch)) { if (sc.chNext != '\t') { for (int c = 1; c < 5; ++c) { if (sc.GetRelative(c) != ' ') d = false; } } } else if (sc.atLineStart) { if (sc.ch != '\t' ) { for (int i = 0; i < 4; ++i) { if (sc.GetRelative(i) != ' ') d = false; } } } if (!d) sc.SetState(SCE_MARKDOWN_LINE_BEGIN); } */ // Strong else if (sc.state == SCE_MARKDOWN_STRONG1) { if (sc.Match("**") && sc.chPrev != ' ') { sc.Forward(2); sc.SetState(SCE_MARKDOWN_DEFAULT); } } else if (sc.state == SCE_MARKDOWN_STRONG2) { if (sc.Match("__") && sc.chPrev != ' ') { sc.Forward(2); sc.SetState(SCE_MARKDOWN_DEFAULT); } } // Emphasis else if (sc.state == SCE_MARKDOWN_EM1) { if (sc.ch == '*' && sc.chPrev != ' ') sc.ForwardSetState(SCE_MARKDOWN_DEFAULT); } else if (sc.state == SCE_MARKDOWN_EM2) { if (sc.ch == '_' && sc.chPrev != ' ') sc.ForwardSetState(SCE_MARKDOWN_DEFAULT); } else if (sc.state == SCE_MARKDOWN_CODEBK) { if (sc.atLineStart && sc.Match("~~~")) { int i = 1; while (!IsNewline(sc.GetRelative(i)) && sc.currentPos + i < endPos) i++; sc.Forward(i); sc.SetState(SCE_MARKDOWN_DEFAULT); } } else if (sc.state == SCE_MARKDOWN_STRIKEOUT) { if (sc.Match("~~") && sc.chPrev != ' ') { sc.Forward(2); sc.SetState(SCE_MARKDOWN_DEFAULT); } } else if (sc.state == SCE_MARKDOWN_LINE_BEGIN) { // Header if (sc.Match("######")) SetStateAndZoom(SCE_MARKDOWN_HEADER6, 6, '#', sc); else if (sc.Match("#####")) SetStateAndZoom(SCE_MARKDOWN_HEADER5, 5, '#', sc); else if (sc.Match("####")) SetStateAndZoom(SCE_MARKDOWN_HEADER4, 4, '#', sc); else if (sc.Match("###")) SetStateAndZoom(SCE_MARKDOWN_HEADER3, 3, '#', sc); else if (sc.Match("##")) SetStateAndZoom(SCE_MARKDOWN_HEADER2, 2, '#', sc); else if (sc.Match("#")) { // Catch the special case of an unordered list if (sc.chNext == '.' && IsASpaceOrTab(sc.GetRelative(2))) { precharCount = 0; sc.SetState(SCE_MARKDOWN_PRECHAR); } else SetStateAndZoom(SCE_MARKDOWN_HEADER1, 1, '#', sc); } // Code block else if (sc.Match("~~~")) { if (!HasPrevLineContent(sc)) sc.SetState(SCE_MARKDOWN_CODEBK); else sc.SetState(SCE_MARKDOWN_DEFAULT); } else if (sc.ch == '=') { if (HasPrevLineContent(sc) && FollowToLineEnd('=', SCE_MARKDOWN_HEADER1, endPos, sc)) ; else sc.SetState(SCE_MARKDOWN_DEFAULT); } else if (sc.ch == '-') { if (HasPrevLineContent(sc) && FollowToLineEnd('-', SCE_MARKDOWN_HEADER2, endPos, sc)) ; else { precharCount = 0; sc.SetState(SCE_MARKDOWN_PRECHAR); } } else if (IsNewline(sc.ch)) sc.SetState(SCE_MARKDOWN_LINE_BEGIN); else { precharCount = 0; sc.SetState(SCE_MARKDOWN_PRECHAR); } } // The header lasts until the newline else if (sc.state == SCE_MARKDOWN_HEADER1 || sc.state == SCE_MARKDOWN_HEADER2 || sc.state == SCE_MARKDOWN_HEADER3 || sc.state == SCE_MARKDOWN_HEADER4 || sc.state == SCE_MARKDOWN_HEADER5 || sc.state == SCE_MARKDOWN_HEADER6) { if (IsNewline(sc.ch)) sc.SetState(SCE_MARKDOWN_LINE_BEGIN); } // New state only within the initial whitespace if (sc.state == SCE_MARKDOWN_PRECHAR) { // Blockquote if (sc.ch == '>' && precharCount < 5) sc.SetState(SCE_MARKDOWN_BLOCKQUOTE); /* // Begin of code block else if (!HasPrevLineContent(sc) && (sc.chPrev == '\t' || precharCount >= 4)) sc.SetState(SCE_MARKDOWN_CODEBK); */ // HRule - Total of three or more hyphens, asterisks, or underscores // on a line by themselves else if ((sc.ch == '-' || sc.ch == '*' || sc.ch == '_') && IsValidHrule(endPos, sc)) ; // Unordered list else if ((sc.ch == '-' || sc.ch == '*' || sc.ch == '+') && IsASpaceOrTab(sc.chNext)) { sc.SetState(SCE_MARKDOWN_ULIST_ITEM); sc.ForwardSetState(SCE_MARKDOWN_DEFAULT); } // Ordered list else if (IsADigit(sc.ch)) { int digitCount = 0; while (IsADigit(sc.GetRelative(++digitCount))) ; if (sc.GetRelative(digitCount) == '.' && IsASpaceOrTab(sc.GetRelative(digitCount + 1))) { sc.SetState(SCE_MARKDOWN_OLIST_ITEM); sc.Forward(digitCount + 1); sc.SetState(SCE_MARKDOWN_DEFAULT); } } // Alternate Ordered list else if (sc.ch == '#' && sc.chNext == '.' && IsASpaceOrTab(sc.GetRelative(2))) { sc.SetState(SCE_MARKDOWN_OLIST_ITEM); sc.Forward(2); sc.SetState(SCE_MARKDOWN_DEFAULT); } else if (sc.ch != ' ' || precharCount > 2) sc.SetState(SCE_MARKDOWN_DEFAULT); else ++precharCount; } // New state anywhere in doc if (sc.state == SCE_MARKDOWN_DEFAULT) { if (sc.atLineStart && sc.ch == '#') { sc.SetState(SCE_MARKDOWN_LINE_BEGIN); freezeCursor = true; } // Links and Images if (sc.Match("![") || sc.ch == '[') { int i = 0, j = 0, k = 0; int len = endPos - sc.currentPos; while (i < len && (sc.GetRelative(++i) != ']' || sc.GetRelative(i - 1) == '\\')) ; if (sc.GetRelative(i) == ']') { j = i; if (sc.GetRelative(++i) == '(') { while (i < len && (sc.GetRelative(++i) != ')' || sc.GetRelative(i - 1) == '\\')) ; if (sc.GetRelative(i) == ')') k = i; } else if (sc.GetRelative(i) == '[' || sc.GetRelative(++i) == '[') { while (i < len && (sc.GetRelative(++i) != ']' || sc.GetRelative(i - 1) == '\\')) ; if (sc.GetRelative(i) == ']') k = i; } } // At least a link text if (j) { sc.SetState(SCE_MARKDOWN_LINK); sc.Forward(j); // Also has a URL or reference portion if (k) sc.Forward(k - j); sc.ForwardSetState(SCE_MARKDOWN_DEFAULT); } } // Code - also a special case for alternate inside spacing if (sc.Match("``") && sc.GetRelative(3) != ' ' && AtTermStart(sc)) { sc.SetState(SCE_MARKDOWN_CODE2); sc.Forward(); } else if (sc.ch == '`' && sc.chNext != ' ' && AtTermStart(sc)) { sc.SetState(SCE_MARKDOWN_CODE); } // Strong else if (sc.Match("**") && sc.GetRelative(2) != ' ' && AtTermStart(sc)) { sc.SetState(SCE_MARKDOWN_STRONG1); sc.Forward(); } else if (sc.Match("__") && sc.GetRelative(2) != ' ' && AtTermStart(sc)) { sc.SetState(SCE_MARKDOWN_STRONG2); sc.Forward(); } // Emphasis else if (sc.ch == '*' && sc.chNext != ' ' && AtTermStart(sc)) { sc.SetState(SCE_MARKDOWN_EM1); } else if (sc.ch == '_' && sc.chNext != ' ' && AtTermStart(sc)) { sc.SetState(SCE_MARKDOWN_EM2); } // Strikeout else if (sc.Match("~~") && sc.GetRelative(2) != ' ' && AtTermStart(sc)) { sc.SetState(SCE_MARKDOWN_STRIKEOUT); sc.Forward(); } // Beginning of line else if (IsNewline(sc.ch)) { sc.SetState(SCE_MARKDOWN_LINE_BEGIN); } } // Advance if not holding back the cursor for this iteration. if (!freezeCursor) sc.Forward(); freezeCursor = false; } sc.Complete(); } LexerModule lmMarkdown(SCLEX_MARKDOWN, ColorizeMarkdownDoc, "markdown"); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LineMarker.h000444001750001750 365411727344243 24607 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LineMarker.h ** Defines the look of a line marker in the margin . **/ // Copyright 1998-2011 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #ifndef LINEMARKER_H #define LINEMARKER_H #ifdef SCI_NAMESPACE namespace Scintilla { #endif /** */ class LineMarker { public: enum typeOfFold { undefined, head, body, tail, headWithTail }; int markType; ColourDesired fore; ColourDesired back; ColourDesired backSelected; int alpha; XPM *pxpm; RGBAImage *image; LineMarker() { markType = SC_MARK_CIRCLE; fore = ColourDesired(0,0,0); back = ColourDesired(0xff,0xff,0xff); backSelected = ColourDesired(0xff,0x00,0x00); alpha = SC_ALPHA_NOALPHA; pxpm = NULL; image = NULL; } LineMarker(const LineMarker &) { // Defined to avoid pxpm being blindly copied, not as real copy constructor markType = SC_MARK_CIRCLE; fore = ColourDesired(0,0,0); back = ColourDesired(0xff,0xff,0xff); backSelected = ColourDesired(0xff,0x00,0x00); alpha = SC_ALPHA_NOALPHA; pxpm = NULL; image = NULL; } ~LineMarker() { delete pxpm; delete image; } LineMarker &operator=(const LineMarker &) { // Defined to avoid pxpm being blindly copied, not as real assignment operator markType = SC_MARK_CIRCLE; fore = ColourDesired(0,0,0); back = ColourDesired(0xff,0xff,0xff); backSelected = ColourDesired(0xff,0x00,0x00); alpha = SC_ALPHA_NOALPHA; delete pxpm; pxpm = NULL; delete image; image = NULL; return *this; } void SetXPM(const char *textForm); void SetXPM(const char *const *linesForm); void SetRGBAImage(Point sizeRGBAImage, const unsigned char *pixelsRGBAImage); void Draw(Surface *surface, PRectangle &rc, Font &fontForCharacter, typeOfFold tFold, int marginStyle); }; #ifdef SCI_NAMESPACE } #endif #endif Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexRuby.cxx000444001750001750 20013411727344242 24552 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexRuby.cxx ** Lexer for Ruby. **/ // Copyright 2001- by Clemens Wyss // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif //XXX Identical to Perl, put in common area static inline bool isEOLChar(char ch) { return (ch == '\r') || (ch == '\n'); } #define isSafeASCII(ch) ((unsigned int)(ch) <= 127) // This one's redundant, but makes for more readable code #define isHighBitChar(ch) ((unsigned int)(ch) > 127) static inline bool isSafeAlpha(char ch) { return (isSafeASCII(ch) && isalpha(ch)) || ch == '_'; } static inline bool isSafeAlnum(char ch) { return (isSafeASCII(ch) && isalnum(ch)) || ch == '_'; } static inline bool isSafeAlnumOrHigh(char ch) { return isHighBitChar(ch) || isalnum(ch) || ch == '_'; } static inline bool isSafeDigit(char ch) { return isSafeASCII(ch) && isdigit(ch); } static inline bool isSafeWordcharOrHigh(char ch) { // Error: scintilla's KeyWords.h includes '.' as a word-char // we want to separate things that can take methods from the // methods. return isHighBitChar(ch) || isalnum(ch) || ch == '_'; } static bool inline iswhitespace(char ch) { return ch == ' ' || ch == '\t'; } #define MAX_KEYWORD_LENGTH 200 #define STYLE_MASK 63 #define actual_style(style) (style & STYLE_MASK) static bool followsDot(unsigned int pos, Accessor &styler) { styler.Flush(); for (; pos >= 1; --pos) { int style = actual_style(styler.StyleAt(pos)); char ch; switch (style) { case SCE_RB_DEFAULT: ch = styler[pos]; if (ch == ' ' || ch == '\t') { //continue } else { return false; } break; case SCE_RB_OPERATOR: return styler[pos] == '.'; default: return false; } } return false; } // Forward declarations static bool keywordIsAmbiguous(const char *prevWord); static bool keywordDoStartsLoop(int pos, Accessor &styler); static bool keywordIsModifier(const char *word, int pos, Accessor &styler); static int ClassifyWordRb(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler, char *prevWord) { char s[MAX_KEYWORD_LENGTH]; unsigned int i, j; unsigned int lim = end - start + 1; // num chars to copy if (lim >= MAX_KEYWORD_LENGTH) { lim = MAX_KEYWORD_LENGTH - 1; } for (i = start, j = 0; j < lim; i++, j++) { s[j] = styler[i]; } s[j] = '\0'; int chAttr; if (0 == strcmp(prevWord, "class")) chAttr = SCE_RB_CLASSNAME; else if (0 == strcmp(prevWord, "module")) chAttr = SCE_RB_MODULE_NAME; else if (0 == strcmp(prevWord, "def")) chAttr = SCE_RB_DEFNAME; else if (keywords.InList(s) && !followsDot(start - 1, styler)) { if (keywordIsAmbiguous(s) && keywordIsModifier(s, start, styler)) { // Demoted keywords are colored as keywords, // but do not affect changes in indentation. // // Consider the word 'if': // 1. <> : normal // 2. <> : demoted // 3. <> : normal: start a new indent level // 4. <> : color as identifer, since it follows '.' chAttr = SCE_RB_WORD_DEMOTED; } else { chAttr = SCE_RB_WORD; } } else chAttr = SCE_RB_IDENTIFIER; styler.ColourTo(end, chAttr); if (chAttr == SCE_RB_WORD) { strcpy(prevWord, s); } else { prevWord[0] = 0; } return chAttr; } //XXX Identical to Perl, put in common area static bool isMatch(Accessor &styler, int lengthDoc, int pos, const char *val) { if ((pos + static_cast(strlen(val))) >= lengthDoc) { return false; } while (*val) { if (*val != styler[pos++]) { return false; } val++; } return true; } // Do Ruby better -- find the end of the line, work back, // and then check for leading white space // Precondition: the here-doc target can be indented static bool lookingAtHereDocDelim(Accessor &styler, int pos, int lengthDoc, const char *HereDocDelim) { if (!isMatch(styler, lengthDoc, pos, HereDocDelim)) { return false; } while (--pos > 0) { char ch = styler[pos]; if (isEOLChar(ch)) { return true; } else if (ch != ' ' && ch != '\t') { return false; } } return false; } //XXX Identical to Perl, put in common area static char opposite(char ch) { if (ch == '(') return ')'; if (ch == '[') return ']'; if (ch == '{') return '}'; if (ch == '<') return '>'; return ch; } // Null transitions when we see we've reached the end // and need to relex the curr char. static void redo_char(int &i, char &ch, char &chNext, char &chNext2, int &state) { i--; chNext2 = chNext; chNext = ch; state = SCE_RB_DEFAULT; } static void advance_char(int &i, char &ch, char &chNext, char &chNext2) { i++; ch = chNext; chNext = chNext2; } // precondition: startPos points to one after the EOL char static bool currLineContainsHereDelims(int& startPos, Accessor &styler) { if (startPos <= 1) return false; int pos; for (pos = startPos - 1; pos > 0; pos--) { char ch = styler.SafeGetCharAt(pos); if (isEOLChar(ch)) { // Leave the pointers where they are -- there are no // here doc delims on the current line, even if // the EOL isn't default style return false; } else { styler.Flush(); if (actual_style(styler.StyleAt(pos)) == SCE_RB_HERE_DELIM) { break; } } } if (pos == 0) { return false; } // Update the pointers so we don't have to re-analyze the string startPos = pos; return true; } // This class is used by the enter and exit methods, so it needs // to be hoisted out of the function. class QuoteCls { public: int Count; char Up; char Down; QuoteCls() { this->New(); } void New() { Count = 0; Up = '\0'; Down = '\0'; } void Open(char u) { Count++; Up = u; Down = opposite(Up); } QuoteCls(const QuoteCls& q) { // copy constructor -- use this for copying in Count = q.Count; Up = q.Up; Down = q.Down; } QuoteCls& operator=(const QuoteCls& q) { // assignment constructor if (this != &q) { Count = q.Count; Up = q.Up; Down = q.Down; } return *this; } }; static void enterInnerExpression(int *p_inner_string_types, int *p_inner_expn_brace_counts, QuoteCls *p_inner_quotes, int& inner_string_count, int& state, int& brace_counts, QuoteCls curr_quote ) { p_inner_string_types[inner_string_count] = state; state = SCE_RB_DEFAULT; p_inner_expn_brace_counts[inner_string_count] = brace_counts; brace_counts = 0; p_inner_quotes[inner_string_count] = curr_quote; ++inner_string_count; } static void exitInnerExpression(int *p_inner_string_types, int *p_inner_expn_brace_counts, QuoteCls *p_inner_quotes, int& inner_string_count, int& state, int& brace_counts, QuoteCls& curr_quote ) { --inner_string_count; state = p_inner_string_types[inner_string_count]; brace_counts = p_inner_expn_brace_counts[inner_string_count]; curr_quote = p_inner_quotes[inner_string_count]; } static bool isEmptyLine(int pos, Accessor &styler) { int spaceFlags = 0; int lineCurrent = styler.GetLine(pos); int indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, NULL); return (indentCurrent & SC_FOLDLEVELWHITEFLAG) != 0; } static bool RE_CanFollowKeyword(const char *keyword) { if (!strcmp(keyword, "and") || !strcmp(keyword, "begin") || !strcmp(keyword, "break") || !strcmp(keyword, "case") || !strcmp(keyword, "do") || !strcmp(keyword, "else") || !strcmp(keyword, "elsif") || !strcmp(keyword, "if") || !strcmp(keyword, "next") || !strcmp(keyword, "return") || !strcmp(keyword, "when") || !strcmp(keyword, "unless") || !strcmp(keyword, "until") || !strcmp(keyword, "not") || !strcmp(keyword, "or")) { return true; } return false; } // Look at chars up to but not including endPos // Don't look at styles in case we're looking forward static int skipWhitespace(int startPos, int endPos, Accessor &styler) { for (int i = startPos; i < endPos; i++) { if (!iswhitespace(styler[i])) { return i; } } return endPos; } // This routine looks for false positives like // undef foo, << // There aren't too many. // // iPrev points to the start of << static bool sureThisIsHeredoc(int iPrev, Accessor &styler, char *prevWord) { // Not so fast, since Ruby's so dynamic. Check the context // to make sure we're OK. int prevStyle; int lineStart = styler.GetLine(iPrev); int lineStartPosn = styler.LineStart(lineStart); styler.Flush(); // Find the first word after some whitespace int firstWordPosn = skipWhitespace(lineStartPosn, iPrev, styler); if (firstWordPosn >= iPrev) { // Have something like {^ <<} //XXX Look at the first previous non-comment non-white line // to establish the context. Not too likely though. return true; } else { switch (prevStyle = styler.StyleAt(firstWordPosn)) { case SCE_RB_WORD: case SCE_RB_WORD_DEMOTED: case SCE_RB_IDENTIFIER: break; default: return true; } } int firstWordEndPosn = firstWordPosn; char *dst = prevWord; for (;;) { if (firstWordEndPosn >= iPrev || styler.StyleAt(firstWordEndPosn) != prevStyle) { *dst = 0; break; } *dst++ = styler[firstWordEndPosn]; firstWordEndPosn += 1; } //XXX Write a style-aware thing to regex scintilla buffer objects if (!strcmp(prevWord, "undef") || !strcmp(prevWord, "def") || !strcmp(prevWord, "alias")) { // These keywords are what we were looking for return false; } return true; } // Routine that saves us from allocating a buffer for the here-doc target // targetEndPos points one past the end of the current target static bool haveTargetMatch(int currPos, int lengthDoc, int targetStartPos, int targetEndPos, Accessor &styler) { if (lengthDoc - currPos < targetEndPos - targetStartPos) { return false; } int i, j; for (i = targetStartPos, j = currPos; i < targetEndPos && j < lengthDoc; i++, j++) { if (styler[i] != styler[j]) { return false; } } return true; } // We need a check because the form // [identifier] <<[target] // is ambiguous. The Ruby lexer/parser resolves it by // looking to see if [identifier] names a variable or a // function. If it's the first, it's the start of a here-doc. // If it's a var, it's an operator. This lexer doesn't // maintain a symbol table, so it looks ahead to see what's // going on, in cases where we have // ^[white-space]*[identifier([.|::]identifier)*][white-space]*<<[target] // // If there's no occurrence of [target] on a line, assume we don't. // return true == yes, we have no heredocs static bool sureThisIsNotHeredoc(int lt2StartPos, Accessor &styler) { int prevStyle; // Use full document, not just part we're styling int lengthDoc = styler.Length(); int lineStart = styler.GetLine(lt2StartPos); int lineStartPosn = styler.LineStart(lineStart); styler.Flush(); const bool definitely_not_a_here_doc = true; const bool looks_like_a_here_doc = false; // Find the first word after some whitespace int firstWordPosn = skipWhitespace(lineStartPosn, lt2StartPos, styler); if (firstWordPosn >= lt2StartPos) { return definitely_not_a_here_doc; } prevStyle = styler.StyleAt(firstWordPosn); // If we have '<<' following a keyword, it's not a heredoc if (prevStyle != SCE_RB_IDENTIFIER) { return definitely_not_a_here_doc; } int newStyle = prevStyle; // Some compilers incorrectly warn about uninit newStyle for (firstWordPosn += 1; firstWordPosn <= lt2StartPos; firstWordPosn += 1) { // Inner loop looks at the name for (; firstWordPosn <= lt2StartPos; firstWordPosn += 1) { newStyle = styler.StyleAt(firstWordPosn); if (newStyle != prevStyle) { break; } } // Do we have '::' or '.'? if (firstWordPosn < lt2StartPos && newStyle == SCE_RB_OPERATOR) { char ch = styler[firstWordPosn]; if (ch == '.') { // yes } else if (ch == ':') { if (styler.StyleAt(++firstWordPosn) != SCE_RB_OPERATOR) { return definitely_not_a_here_doc; } else if (styler[firstWordPosn] != ':') { return definitely_not_a_here_doc; } } else { break; } } else { break; } } // Skip next batch of white-space firstWordPosn = skipWhitespace(firstWordPosn, lt2StartPos, styler); if (firstWordPosn != lt2StartPos) { // Have [[^ws[identifier]ws[*something_else*]ws<< return definitely_not_a_here_doc; } // OK, now 'j' will point to the current spot moving ahead int j = firstWordPosn + 1; if (styler.StyleAt(j) != SCE_RB_OPERATOR || styler[j] != '<') { // This shouldn't happen return definitely_not_a_here_doc; } int nextLineStartPosn = styler.LineStart(lineStart + 1); if (nextLineStartPosn >= lengthDoc) { return definitely_not_a_here_doc; } j = skipWhitespace(j + 1, nextLineStartPosn, styler); if (j >= lengthDoc) { return definitely_not_a_here_doc; } bool allow_indent; int target_start, target_end; // From this point on no more styling, since we're looking ahead if (styler[j] == '-') { allow_indent = true; j++; } else { allow_indent = false; } // Allow for quoted targets. char target_quote = 0; switch (styler[j]) { case '\'': case '"': case '`': target_quote = styler[j]; j += 1; } if (isSafeAlnum(styler[j])) { // Init target_end because some compilers think it won't // be initialized by the time it's used target_start = target_end = j; j++; } else { return definitely_not_a_here_doc; } for (; j < lengthDoc; j++) { if (!isSafeAlnum(styler[j])) { if (target_quote && styler[j] != target_quote) { // unquoted end return definitely_not_a_here_doc; } // And for now make sure that it's a newline // don't handle arbitrary expressions yet target_end = j; if (target_quote) { // Now we can move to the character after the string delimiter. j += 1; } j = skipWhitespace(j, lengthDoc, styler); if (j >= lengthDoc) { return definitely_not_a_here_doc; } else { char ch = styler[j]; if (ch == '#' || isEOLChar(ch)) { // This is OK, so break and continue; break; } else { return definitely_not_a_here_doc; } } } } // Just look at the start of each line int last_line = styler.GetLine(lengthDoc - 1); // But don't go too far if (last_line > lineStart + 50) { last_line = lineStart + 50; } for (int line_num = lineStart + 1; line_num <= last_line; line_num++) { if (allow_indent) { j = skipWhitespace(styler.LineStart(line_num), lengthDoc, styler); } else { j = styler.LineStart(line_num); } // target_end is one past the end if (haveTargetMatch(j, lengthDoc, target_start, target_end, styler)) { // We got it return looks_like_a_here_doc; } } return definitely_not_a_here_doc; } //todo: if we aren't looking at a stdio character, // move to the start of the first line that is not in a // multi-line construct static void synchronizeDocStart(unsigned int& startPos, int &length, int &initStyle, Accessor &styler, bool skipWhiteSpace=false) { styler.Flush(); int style = actual_style(styler.StyleAt(startPos)); switch (style) { case SCE_RB_STDIN: case SCE_RB_STDOUT: case SCE_RB_STDERR: // Don't do anything else with these. return; } int pos = startPos; // Quick way to characterize each line int lineStart; for (lineStart = styler.GetLine(pos); lineStart > 0; lineStart--) { // Now look at the style before the previous line's EOL pos = styler.LineStart(lineStart) - 1; if (pos <= 10) { lineStart = 0; break; } char ch = styler.SafeGetCharAt(pos); char chPrev = styler.SafeGetCharAt(pos - 1); if (ch == '\n' && chPrev == '\r') { pos--; } if (styler.SafeGetCharAt(pos - 1) == '\\') { // Continuation line -- keep going } else if (actual_style(styler.StyleAt(pos)) != SCE_RB_DEFAULT) { // Part of multi-line construct -- keep going } else if (currLineContainsHereDelims(pos, styler)) { // Keep going, with pos and length now pointing // at the end of the here-doc delimiter } else if (skipWhiteSpace && isEmptyLine(pos, styler)) { // Keep going } else { break; } } pos = styler.LineStart(lineStart); length += (startPos - pos); startPos = pos; initStyle = SCE_RB_DEFAULT; } static void ColouriseRbDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { // Lexer for Ruby often has to backtrack to start of current style to determine // which characters are being used as quotes, how deeply nested is the // start position and what the termination string is for here documents WordList &keywords = *keywordlists[0]; class HereDocCls { public: int State; // States // 0: '<<' encountered // 1: collect the delimiter // 1b: text between the end of the delimiter and the EOL // 2: here doc text (lines after the delimiter) char Quote; // the char after '<<' bool Quoted; // true if Quote in ('\'','"','`') int DelimiterLength; // strlen(Delimiter) char Delimiter[256]; // the Delimiter, limit of 256: from Perl bool CanBeIndented; HereDocCls() { State = 0; DelimiterLength = 0; Delimiter[0] = '\0'; CanBeIndented = false; } }; HereDocCls HereDoc; QuoteCls Quote; int numDots = 0; // For numbers -- // Don't start lexing in the middle of a num synchronizeDocStart(startPos, length, initStyle, styler, // ref args false); bool preferRE = true; int state = initStyle; int lengthDoc = startPos + length; char prevWord[MAX_KEYWORD_LENGTH + 1]; // 1 byte for zero prevWord[0] = '\0'; if (length == 0) return; char chPrev = styler.SafeGetCharAt(startPos - 1); char chNext = styler.SafeGetCharAt(startPos); bool is_real_number = true; // Differentiate between constants and ?-sequences. // Ruby uses a different mask because bad indentation is marked by oring with 32 styler.StartAt(startPos, 127); styler.StartSegment(startPos); static int q_states[] = {SCE_RB_STRING_Q, SCE_RB_STRING_QQ, SCE_RB_STRING_QR, SCE_RB_STRING_QW, SCE_RB_STRING_QW, SCE_RB_STRING_QX}; static const char* q_chars = "qQrwWx"; // In most cases a value of 2 should be ample for the code in the // Ruby library, and the code the user is likely to enter. // For example, // fu_output_message "mkdir #{options[:mode] ? ('-m %03o ' % options[:mode]) : ''}#{list.join ' '}" // if options[:verbose] // from fileutils.rb nests to a level of 2 // If the user actually hits a 6th occurrence of '#{' in a double-quoted // string (including regex'es, %Q, %, %w, and other strings // that interpolate), it will stay as a string. The problem with this // is that quotes might flip, a 7th '#{' will look like a comment, // and code-folding might be wrong. // If anyone runs into this problem, I recommend raising this // value slightly higher to replacing the fixed array with a linked // list. Keep in mind this code will be called everytime the lexer // is invoked. #define INNER_STRINGS_MAX_COUNT 5 // These vars track our instances of "...#{,,,%Q<..#{,,,}...>,,,}..." int inner_string_types[INNER_STRINGS_MAX_COUNT]; // Track # braces when we push a new #{ thing int inner_expn_brace_counts[INNER_STRINGS_MAX_COUNT]; QuoteCls inner_quotes[INNER_STRINGS_MAX_COUNT]; int inner_string_count = 0; int brace_counts = 0; // Number of #{ ... } things within an expression int i; for (i = 0; i < INNER_STRINGS_MAX_COUNT; i++) { inner_string_types[i] = 0; inner_expn_brace_counts[i] = 0; } for (i = startPos; i < lengthDoc; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); char chNext2 = styler.SafeGetCharAt(i + 2); if (styler.IsLeadByte(ch)) { chNext = chNext2; chPrev = ' '; i += 1; continue; } // skip on DOS/Windows //No, don't, because some things will get tagged on, // so we won't recognize keywords, for example #if 0 if (ch == '\r' && chNext == '\n') { continue; } #endif if (HereDoc.State == 1 && isEOLChar(ch)) { // Begin of here-doc (the line after the here-doc delimiter): HereDoc.State = 2; styler.ColourTo(i-1, state); // Don't check for a missing quote, just jump into // the here-doc state state = SCE_RB_HERE_Q; } // Regular transitions if (state == SCE_RB_DEFAULT) { if (isSafeDigit(ch)) { styler.ColourTo(i - 1, state); state = SCE_RB_NUMBER; is_real_number = true; numDots = 0; } else if (isHighBitChar(ch) || iswordstart(ch)) { styler.ColourTo(i - 1, state); state = SCE_RB_WORD; } else if (ch == '#') { styler.ColourTo(i - 1, state); state = SCE_RB_COMMENTLINE; } else if (ch == '=') { // =begin indicates the start of a comment (doc) block if ((i == 0 || isEOLChar(chPrev)) && chNext == 'b' && styler.SafeGetCharAt(i + 2) == 'e' && styler.SafeGetCharAt(i + 3) == 'g' && styler.SafeGetCharAt(i + 4) == 'i' && styler.SafeGetCharAt(i + 5) == 'n' && !isSafeWordcharOrHigh(styler.SafeGetCharAt(i + 6))) { styler.ColourTo(i - 1, state); state = SCE_RB_POD; } else { styler.ColourTo(i - 1, state); styler.ColourTo(i, SCE_RB_OPERATOR); preferRE = true; } } else if (ch == '"') { styler.ColourTo(i - 1, state); state = SCE_RB_STRING; Quote.New(); Quote.Open(ch); } else if (ch == '\'') { styler.ColourTo(i - 1, state); state = SCE_RB_CHARACTER; Quote.New(); Quote.Open(ch); } else if (ch == '`') { styler.ColourTo(i - 1, state); state = SCE_RB_BACKTICKS; Quote.New(); Quote.Open(ch); } else if (ch == '@') { // Instance or class var styler.ColourTo(i - 1, state); if (chNext == '@') { state = SCE_RB_CLASS_VAR; advance_char(i, ch, chNext, chNext2); // pass by ref } else { state = SCE_RB_INSTANCE_VAR; } } else if (ch == '$') { // Check for a builtin global styler.ColourTo(i - 1, state); // Recognize it bit by bit state = SCE_RB_GLOBAL; } else if (ch == '/' && preferRE) { // Ambigous operator styler.ColourTo(i - 1, state); state = SCE_RB_REGEX; Quote.New(); Quote.Open(ch); } else if (ch == '<' && chNext == '<' && chNext2 != '=') { // Recognise the '<<' symbol - either a here document or a binary op styler.ColourTo(i - 1, state); i++; chNext = chNext2; styler.ColourTo(i, SCE_RB_OPERATOR); if (! (strchr("\"\'`_-", chNext2) || isSafeAlpha(chNext2))) { // It's definitely not a here-doc, // based on Ruby's lexer/parser in the // heredoc_identifier routine. // Nothing else to do. } else if (preferRE) { if (sureThisIsHeredoc(i - 1, styler, prevWord)) { state = SCE_RB_HERE_DELIM; HereDoc.State = 0; } // else leave it in default state } else { if (sureThisIsNotHeredoc(i - 1, styler)) { // leave state as default // We don't have all the heuristics Perl has for indications // of a here-doc, because '<<' is overloadable and used // for so many other classes. } else { state = SCE_RB_HERE_DELIM; HereDoc.State = 0; } } preferRE = (state != SCE_RB_HERE_DELIM); } else if (ch == ':') { styler.ColourTo(i - 1, state); if (chNext == ':') { // Mark "::" as an operator, not symbol start styler.ColourTo(i + 1, SCE_RB_OPERATOR); advance_char(i, ch, chNext, chNext2); // pass by ref state = SCE_RB_DEFAULT; preferRE = false; } else if (isSafeWordcharOrHigh(chNext)) { state = SCE_RB_SYMBOL; } else if (strchr("[*!~+-*/%=<>&^|", chNext)) { // Do the operator analysis in-line, looking ahead // Based on the table in pickaxe 2nd ed., page 339 bool doColoring = true; switch (chNext) { case '[': if (chNext2 == ']' ) { char ch_tmp = styler.SafeGetCharAt(i + 3); if (ch_tmp == '=') { i += 3; ch = ch_tmp; chNext = styler.SafeGetCharAt(i + 1); } else { i += 2; ch = chNext2; chNext = ch_tmp; } } else { doColoring = false; } break; case '*': if (chNext2 == '*') { i += 2; ch = chNext2; chNext = styler.SafeGetCharAt(i + 1); } else { advance_char(i, ch, chNext, chNext2); } break; case '!': if (chNext2 == '=' || chNext2 == '~') { i += 2; ch = chNext2; chNext = styler.SafeGetCharAt(i + 1); } else { advance_char(i, ch, chNext, chNext2); } break; case '<': if (chNext2 == '<') { i += 2; ch = chNext2; chNext = styler.SafeGetCharAt(i + 1); } else if (chNext2 == '=') { char ch_tmp = styler.SafeGetCharAt(i + 3); if (ch_tmp == '>') { // <=> operator i += 3; ch = ch_tmp; chNext = styler.SafeGetCharAt(i + 1); } else { i += 2; ch = chNext2; chNext = ch_tmp; } } else { advance_char(i, ch, chNext, chNext2); } break; default: // Simple one-character operators advance_char(i, ch, chNext, chNext2); break; } if (doColoring) { styler.ColourTo(i, SCE_RB_SYMBOL); state = SCE_RB_DEFAULT; } } else if (!preferRE) { // Don't color symbol strings (yet) // Just color the ":" and color rest as string styler.ColourTo(i, SCE_RB_SYMBOL); state = SCE_RB_DEFAULT; } else { styler.ColourTo(i, SCE_RB_OPERATOR); state = SCE_RB_DEFAULT; preferRE = true; } } else if (ch == '%') { styler.ColourTo(i - 1, state); bool have_string = false; if (strchr(q_chars, chNext) && !isSafeWordcharOrHigh(chNext2)) { Quote.New(); const char *hit = strchr(q_chars, chNext); if (hit != NULL) { state = q_states[hit - q_chars]; Quote.Open(chNext2); i += 2; ch = chNext2; chNext = styler.SafeGetCharAt(i + 1); have_string = true; } } else if (preferRE && !isSafeWordcharOrHigh(chNext)) { // Ruby doesn't allow high bit chars here, // but the editor host might Quote.New(); state = SCE_RB_STRING_QQ; Quote.Open(chNext); advance_char(i, ch, chNext, chNext2); // pass by ref have_string = true; } else if (!isSafeWordcharOrHigh(chNext) && !iswhitespace(chNext) && !isEOLChar(chNext)) { // Ruby doesn't allow high bit chars here, // but the editor host might Quote.New(); state = SCE_RB_STRING_QQ; Quote.Open(chNext); advance_char(i, ch, chNext, chNext2); // pass by ref have_string = true; } if (!have_string) { styler.ColourTo(i, SCE_RB_OPERATOR); // stay in default preferRE = true; } } else if (ch == '?') { styler.ColourTo(i - 1, state); if (iswhitespace(chNext) || chNext == '\n' || chNext == '\r') { styler.ColourTo(i, SCE_RB_OPERATOR); } else { // It's the start of a character code escape sequence // Color it as a number. state = SCE_RB_NUMBER; is_real_number = false; } } else if (isoperator(ch) || ch == '.') { styler.ColourTo(i - 1, state); styler.ColourTo(i, SCE_RB_OPERATOR); // If we're ending an expression or block, // assume it ends an object, and the ambivalent // constructs are binary operators // // So if we don't have one of these chars, // we aren't ending an object exp'n, and ops // like : << / are unary operators. if (ch == '{') { ++brace_counts; preferRE = true; } else if (ch == '}' && --brace_counts < 0 && inner_string_count > 0) { styler.ColourTo(i, SCE_RB_OPERATOR); exitInnerExpression(inner_string_types, inner_expn_brace_counts, inner_quotes, inner_string_count, state, brace_counts, Quote); } else { preferRE = (strchr(")}].", ch) == NULL); } // Stay in default state } else if (isEOLChar(ch)) { // Make sure it's a true line-end, with no backslash if ((ch == '\r' || (ch == '\n' && chPrev != '\r')) && chPrev != '\\') { // Assume we've hit the end of the statement. preferRE = true; } } } else if (state == SCE_RB_WORD) { if (ch == '.' || !isSafeWordcharOrHigh(ch)) { // Words include x? in all contexts, // and = after either 'def' or a dot // Move along until a complete word is on our left // Default accessor treats '.' as word-chars, // but we don't for now. if (ch == '=' && isSafeWordcharOrHigh(chPrev) && (chNext == '(' || strchr(" \t\n\r", chNext) != NULL) && (!strcmp(prevWord, "def") || followsDot(styler.GetStartSegment(), styler))) { // = is a name only when being def'd -- Get it the next time // This means that = is always lexed as // , (op, =), } else if ((ch == '?' || ch == '!') && isSafeWordcharOrHigh(chPrev) && !isSafeWordcharOrHigh(chNext)) { // ? is a name -- Get it the next time // But ? is always lexed as // , (op, ?), // Same with ! to indicate a method that // modifies its target } else if (isEOLChar(ch) && isMatch(styler, lengthDoc, i - 7, "__END__")) { styler.ColourTo(i, SCE_RB_DATASECTION); state = SCE_RB_DATASECTION; // No need to handle this state -- we'll just move to the end preferRE = false; } else { int wordStartPos = styler.GetStartSegment(); int word_style = ClassifyWordRb(wordStartPos, i - 1, keywords, styler, prevWord); switch (word_style) { case SCE_RB_WORD: preferRE = RE_CanFollowKeyword(prevWord); break; case SCE_RB_WORD_DEMOTED: preferRE = true; break; case SCE_RB_IDENTIFIER: if (isMatch(styler, lengthDoc, wordStartPos, "print")) { preferRE = true; } else if (isEOLChar(ch)) { preferRE = true; } else { preferRE = false; } break; default: preferRE = false; } if (ch == '.') { // We might be redefining an operator-method preferRE = false; } // And if it's the first redo_char(i, ch, chNext, chNext2, state); // pass by ref } } } else if (state == SCE_RB_NUMBER) { if (!is_real_number) { if (ch != '\\') { styler.ColourTo(i, state); state = SCE_RB_DEFAULT; preferRE = false; } else if (strchr("\\ntrfvaebs", chNext)) { // Terminal escape sequence -- handle it next time // Nothing more to do this time through the loop } else if (chNext == 'C' || chNext == 'M') { if (chNext2 != '-') { // \C or \M ends the sequence -- handle it next time } else { // Move from abc?\C-x // ^ // to // ^ i += 2; ch = chNext2; chNext = styler.SafeGetCharAt(i + 1); } } else if (chNext == 'c') { // Stay here, \c is a combining sequence advance_char(i, ch, chNext, chNext2); // pass by ref } else { // ?\x, including ?\\ is final. styler.ColourTo(i + 1, state); state = SCE_RB_DEFAULT; preferRE = false; advance_char(i, ch, chNext, chNext2); } } else if (isSafeAlnumOrHigh(ch) || ch == '_') { // Keep going } else if (ch == '.' && chNext == '.') { ++numDots; styler.ColourTo(i - 1, state); redo_char(i, ch, chNext, chNext2, state); // pass by ref } else if (ch == '.' && ++numDots == 1) { // Keep going } else { styler.ColourTo(i - 1, state); redo_char(i, ch, chNext, chNext2, state); // pass by ref preferRE = false; } } else if (state == SCE_RB_COMMENTLINE) { if (isEOLChar(ch)) { styler.ColourTo(i - 1, state); state = SCE_RB_DEFAULT; // Use whatever setting we had going into the comment } } else if (state == SCE_RB_HERE_DELIM) { // See the comment for SCE_RB_HERE_DELIM in LexPerl.cxx // Slightly different: if we find an immediate '-', // the target can appear indented. if (HereDoc.State == 0) { // '<<' encountered HereDoc.State = 1; HereDoc.DelimiterLength = 0; if (ch == '-') { HereDoc.CanBeIndented = true; advance_char(i, ch, chNext, chNext2); // pass by ref } else { HereDoc.CanBeIndented = false; } if (isEOLChar(ch)) { // Bail out of doing a here doc if there's no target state = SCE_RB_DEFAULT; preferRE = false; } else { HereDoc.Quote = ch; if (ch == '\'' || ch == '"' || ch == '`') { HereDoc.Quoted = true; HereDoc.Delimiter[0] = '\0'; } else { HereDoc.Quoted = false; HereDoc.Delimiter[0] = ch; HereDoc.Delimiter[1] = '\0'; HereDoc.DelimiterLength = 1; } } } else if (HereDoc.State == 1) { // collect the delimiter if (isEOLChar(ch)) { // End the quote now, and go back for more styler.ColourTo(i - 1, state); state = SCE_RB_DEFAULT; i--; chNext = ch; preferRE = false; } else if (HereDoc.Quoted) { if (ch == HereDoc.Quote) { // closing quote => end of delimiter styler.ColourTo(i, state); state = SCE_RB_DEFAULT; preferRE = false; } else { if (ch == '\\' && !isEOLChar(chNext)) { advance_char(i, ch, chNext, chNext2); } HereDoc.Delimiter[HereDoc.DelimiterLength++] = ch; HereDoc.Delimiter[HereDoc.DelimiterLength] = '\0'; } } else { // an unquoted here-doc delimiter if (isSafeAlnumOrHigh(ch) || ch == '_') { HereDoc.Delimiter[HereDoc.DelimiterLength++] = ch; HereDoc.Delimiter[HereDoc.DelimiterLength] = '\0'; } else { styler.ColourTo(i - 1, state); redo_char(i, ch, chNext, chNext2, state); preferRE = false; } } if (HereDoc.DelimiterLength >= static_cast(sizeof(HereDoc.Delimiter)) - 1) { styler.ColourTo(i - 1, state); state = SCE_RB_ERROR; preferRE = false; } } } else if (state == SCE_RB_HERE_Q) { // Not needed: HereDoc.State == 2 // Indentable here docs: look backwards // Non-indentable: look forwards, like in Perl // // Why: so we can quickly resolve things like <<-" abc" if (!HereDoc.CanBeIndented) { if (isEOLChar(chPrev) && isMatch(styler, lengthDoc, i, HereDoc.Delimiter)) { styler.ColourTo(i - 1, state); i += HereDoc.DelimiterLength - 1; chNext = styler.SafeGetCharAt(i + 1); if (isEOLChar(chNext)) { styler.ColourTo(i, SCE_RB_HERE_DELIM); state = SCE_RB_DEFAULT; HereDoc.State = 0; preferRE = false; } // Otherwise we skipped through the here doc faster. } } else if (isEOLChar(chNext) && lookingAtHereDocDelim(styler, i - HereDoc.DelimiterLength + 1, lengthDoc, HereDoc.Delimiter)) { styler.ColourTo(i - 1 - HereDoc.DelimiterLength, state); styler.ColourTo(i, SCE_RB_HERE_DELIM); state = SCE_RB_DEFAULT; preferRE = false; HereDoc.State = 0; } } else if (state == SCE_RB_CLASS_VAR || state == SCE_RB_INSTANCE_VAR || state == SCE_RB_SYMBOL) { if (!isSafeWordcharOrHigh(ch)) { styler.ColourTo(i - 1, state); redo_char(i, ch, chNext, chNext2, state); // pass by ref preferRE = false; } } else if (state == SCE_RB_GLOBAL) { if (!isSafeWordcharOrHigh(ch)) { // handle special globals here as well if (chPrev == '$') { if (ch == '-') { // Include the next char, like $-a advance_char(i, ch, chNext, chNext2); } styler.ColourTo(i, state); state = SCE_RB_DEFAULT; } else { styler.ColourTo(i - 1, state); redo_char(i, ch, chNext, chNext2, state); // pass by ref } preferRE = false; } } else if (state == SCE_RB_POD) { // PODs end with ^=end\s, -- any whitespace can follow =end if (strchr(" \t\n\r", ch) != NULL && i > 5 && isEOLChar(styler[i - 5]) && isMatch(styler, lengthDoc, i - 4, "=end")) { styler.ColourTo(i - 1, state); state = SCE_RB_DEFAULT; preferRE = false; } } else if (state == SCE_RB_REGEX || state == SCE_RB_STRING_QR) { if (ch == '\\' && Quote.Up != '\\') { // Skip one advance_char(i, ch, chNext, chNext2); } else if (ch == Quote.Down) { Quote.Count--; if (Quote.Count == 0) { // Include the options while (isSafeAlpha(chNext)) { i++; ch = chNext; chNext = styler.SafeGetCharAt(i + 1); } styler.ColourTo(i, state); state = SCE_RB_DEFAULT; preferRE = false; } } else if (ch == Quote.Up) { // Only if close quoter != open quoter Quote.Count++; } else if (ch == '#' ) { if (chNext == '{' && inner_string_count < INNER_STRINGS_MAX_COUNT) { // process #{ ... } styler.ColourTo(i - 1, state); styler.ColourTo(i + 1, SCE_RB_OPERATOR); enterInnerExpression(inner_string_types, inner_expn_brace_counts, inner_quotes, inner_string_count, state, brace_counts, Quote); preferRE = true; // Skip one advance_char(i, ch, chNext, chNext2); } else { //todo: distinguish comments from pound chars // for now, handle as comment styler.ColourTo(i - 1, state); bool inEscape = false; while (++i < lengthDoc) { ch = styler.SafeGetCharAt(i); if (ch == '\\') { inEscape = true; } else if (isEOLChar(ch)) { // Comment inside a regex styler.ColourTo(i - 1, SCE_RB_COMMENTLINE); break; } else if (inEscape) { inEscape = false; // don't look at char } else if (ch == Quote.Down) { // Have the regular handler deal with this // to get trailing modifiers. i--; ch = styler[i]; break; } } chNext = styler.SafeGetCharAt(i + 1); } } // Quotes of all kinds... } else if (state == SCE_RB_STRING_Q || state == SCE_RB_STRING_QQ || state == SCE_RB_STRING_QX || state == SCE_RB_STRING_QW || state == SCE_RB_STRING || state == SCE_RB_CHARACTER || state == SCE_RB_BACKTICKS) { if (!Quote.Down && !isspacechar(ch)) { Quote.Open(ch); } else if (ch == '\\' && Quote.Up != '\\') { //Riddle me this: Is it safe to skip *every* escaped char? advance_char(i, ch, chNext, chNext2); } else if (ch == Quote.Down) { Quote.Count--; if (Quote.Count == 0) { styler.ColourTo(i, state); state = SCE_RB_DEFAULT; preferRE = false; } } else if (ch == Quote.Up) { Quote.Count++; } else if (ch == '#' && chNext == '{' && inner_string_count < INNER_STRINGS_MAX_COUNT && state != SCE_RB_CHARACTER && state != SCE_RB_STRING_Q) { // process #{ ... } styler.ColourTo(i - 1, state); styler.ColourTo(i + 1, SCE_RB_OPERATOR); enterInnerExpression(inner_string_types, inner_expn_brace_counts, inner_quotes, inner_string_count, state, brace_counts, Quote); preferRE = true; // Skip one advance_char(i, ch, chNext, chNext2); } } if (state == SCE_RB_ERROR) { break; } chPrev = ch; } if (state == SCE_RB_WORD) { // We've ended on a word, possibly at EOF, and need to // classify it. (void) ClassifyWordRb(styler.GetStartSegment(), lengthDoc - 1, keywords, styler, prevWord); } else { styler.ColourTo(lengthDoc - 1, state); } } // Helper functions for folding, disambiguation keywords // Assert that there are no high-bit chars static void getPrevWord(int pos, char *prevWord, Accessor &styler, int word_state) { int i; styler.Flush(); for (i = pos - 1; i > 0; i--) { if (actual_style(styler.StyleAt(i)) != word_state) { i++; break; } } if (i < pos - MAX_KEYWORD_LENGTH) // overflow i = pos - MAX_KEYWORD_LENGTH; char *dst = prevWord; for (; i <= pos; i++) { *dst++ = styler[i]; } *dst = 0; } static bool keywordIsAmbiguous(const char *prevWord) { // Order from most likely used to least likely // Lots of ways to do a loop in Ruby besides 'while/until' if (!strcmp(prevWord, "if") || !strcmp(prevWord, "do") || !strcmp(prevWord, "while") || !strcmp(prevWord, "unless") || !strcmp(prevWord, "until")) { return true; } else { return false; } } // Demote keywords in the following conditions: // if, while, unless, until modify a statement // do after a while or until, as a noise word (like then after if) static bool keywordIsModifier(const char *word, int pos, Accessor &styler) { if (word[0] == 'd' && word[1] == 'o' && !word[2]) { return keywordDoStartsLoop(pos, styler); } char ch, chPrev, chPrev2; int style = SCE_RB_DEFAULT; int lineStart = styler.GetLine(pos); int lineStartPosn = styler.LineStart(lineStart); // We want to step backwards until we don't care about the current // position. But first move lineStartPosn back behind any // continuations immediately above word. while (lineStartPosn > 0) { ch = styler[lineStartPosn-1]; if (ch == '\n' || ch == '\r') { chPrev = styler.SafeGetCharAt(lineStartPosn-2); chPrev2 = styler.SafeGetCharAt(lineStartPosn-3); lineStart = styler.GetLine(lineStartPosn-1); // If we find a continuation line, include it in our analysis. if (chPrev == '\\') { lineStartPosn = styler.LineStart(lineStart); } else if (ch == '\n' && chPrev == '\r' && chPrev2 == '\\') { lineStartPosn = styler.LineStart(lineStart); } else { break; } } else { break; } } styler.Flush(); while (--pos >= lineStartPosn) { style = actual_style(styler.StyleAt(pos)); if (style == SCE_RB_DEFAULT) { if (iswhitespace(ch = styler[pos])) { //continue } else if (ch == '\r' || ch == '\n') { // Scintilla's LineStart() and GetLine() routines aren't // platform-independent, so if we have text prepared with // a different system we can't rely on it. // Also, lineStartPosn may have been moved to more than one // line above word's line while pushing past continuations. chPrev = styler.SafeGetCharAt(pos - 1); chPrev2 = styler.SafeGetCharAt(pos - 2); if (chPrev == '\\') { pos-=1; // gloss over the "\\" //continue } else if (ch == '\n' && chPrev == '\r' && chPrev2 == '\\') { pos-=2; // gloss over the "\\\r" //continue } else { return false; } } } else { break; } } if (pos < lineStartPosn) { return false; } // First things where the action is unambiguous switch (style) { case SCE_RB_DEFAULT: case SCE_RB_COMMENTLINE: case SCE_RB_POD: case SCE_RB_CLASSNAME: case SCE_RB_DEFNAME: case SCE_RB_MODULE_NAME: return false; case SCE_RB_OPERATOR: break; case SCE_RB_WORD: // Watch out for uses of 'else if' //XXX: Make a list of other keywords where 'if' isn't a modifier // and can appear legitimately // Formulate this to avoid warnings from most compilers if (strcmp(word, "if") == 0) { char prevWord[MAX_KEYWORD_LENGTH + 1]; getPrevWord(pos, prevWord, styler, SCE_RB_WORD); return strcmp(prevWord, "else") != 0; } return true; default: return true; } // Assume that if the keyword follows an operator, // usually it's a block assignment, like // a << if x then y else z ch = styler[pos]; switch (ch) { case ')': case ']': case '}': return true; default: return false; } } #define WHILE_BACKWARDS "elihw" #define UNTIL_BACKWARDS "litnu" // Nothing fancy -- look to see if we follow a while/until somewhere // on the current line static bool keywordDoStartsLoop(int pos, Accessor &styler) { char ch; int style; int lineStart = styler.GetLine(pos); int lineStartPosn = styler.LineStart(lineStart); styler.Flush(); while (--pos >= lineStartPosn) { style = actual_style(styler.StyleAt(pos)); if (style == SCE_RB_DEFAULT) { if ((ch = styler[pos]) == '\r' || ch == '\n') { // Scintilla's LineStart() and GetLine() routines aren't // platform-independent, so if we have text prepared with // a different system we can't rely on it. return false; } } else if (style == SCE_RB_WORD) { // Check for while or until, but write the word in backwards char prevWord[MAX_KEYWORD_LENGTH + 1]; // 1 byte for zero char *dst = prevWord; int wordLen = 0; int start_word; for (start_word = pos; start_word >= lineStartPosn && actual_style(styler.StyleAt(start_word)) == SCE_RB_WORD; start_word--) { if (++wordLen < MAX_KEYWORD_LENGTH) { *dst++ = styler[start_word]; } } *dst = 0; // Did we see our keyword? if (!strcmp(prevWord, WHILE_BACKWARDS) || !strcmp(prevWord, UNTIL_BACKWARDS)) { return true; } // We can move pos to the beginning of the keyword, and then // accept another decrement, as we can never have two contiguous // keywords: // word1 word2 // ^ // <- move to start_word // ^ // <- loop decrement // ^ # pointing to end of word1 is fine pos = start_word; } } return false; } /* * Folding Ruby * * The language is quite complex to analyze without a full parse. * For example, this line shouldn't affect fold level: * * print "hello" if feeling_friendly? * * Neither should this: * * print "hello" \ * if feeling_friendly? * * * But this should: * * if feeling_friendly? #++ * print "hello" \ * print "goodbye" * end #-- * * So we cheat, by actually looking at the existing indentation * levels for each line, and just echoing it back. Like Python. * Then if we get better at it, we'll take braces into consideration, * which always affect folding levels. * How the keywords should work: * No effect: * __FILE__ __LINE__ BEGIN END alias and * defined? false in nil not or self super then * true undef * Always increment: * begin class def do for module when { * * Always decrement: * end } * * Increment if these start a statement * if unless until while -- do nothing if they're modifiers * These end a block if there's no modifier, but don't bother * break next redo retry return yield * * These temporarily de-indent, but re-indent * case else elsif ensure rescue * * This means that the folder reflects indentation rather * than setting it. The language-service updates indentation * when users type return and finishes entering de-denters. * * Later offer to fold POD, here-docs, strings, and blocks of comments */ static void FoldRbDoc(unsigned int startPos, int length, int initStyle, WordList *[], Accessor &styler) { const bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; bool foldComment = styler.GetPropertyInt("fold.comment") != 0; synchronizeDocStart(startPos, length, initStyle, styler, // ref args false); unsigned int endPos = startPos + length; int visibleChars = 0; int lineCurrent = styler.GetLine(startPos); int levelPrev = startPos == 0 ? 0 : (styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK & ~SC_FOLDLEVELBASE); int levelCurrent = levelPrev; char chNext = styler[startPos]; int styleNext = styler.StyleAt(startPos); int stylePrev = startPos <= 1 ? SCE_RB_DEFAULT : styler.StyleAt(startPos - 1); bool buffer_ends_with_eol = false; for (unsigned int i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); int style = styleNext; styleNext = styler.StyleAt(i + 1); bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); if (style == SCE_RB_COMMENTLINE) { if (foldComment && stylePrev != SCE_RB_COMMENTLINE) { if (chNext == '{') { levelCurrent++; } else if (chNext == '}' && levelCurrent > 0) { levelCurrent--; } } } else if (style == SCE_RB_OPERATOR) { if (strchr("[{(", ch)) { levelCurrent++; } else if (strchr(")}]", ch)) { // Don't decrement below 0 if (levelCurrent > 0) levelCurrent--; } } else if (style == SCE_RB_WORD && styleNext != SCE_RB_WORD) { // Look at the keyword on the left and decide what to do char prevWord[MAX_KEYWORD_LENGTH + 1]; // 1 byte for zero prevWord[0] = 0; getPrevWord(i, prevWord, styler, SCE_RB_WORD); if (!strcmp(prevWord, "end")) { // Don't decrement below 0 if (levelCurrent > 0) levelCurrent--; } else if ( !strcmp(prevWord, "if") || !strcmp(prevWord, "def") || !strcmp(prevWord, "class") || !strcmp(prevWord, "module") || !strcmp(prevWord, "begin") || !strcmp(prevWord, "case") || !strcmp(prevWord, "do") || !strcmp(prevWord, "while") || !strcmp(prevWord, "unless") || !strcmp(prevWord, "until") || !strcmp(prevWord, "for") ) { levelCurrent++; } } else if (style == SCE_RB_HERE_DELIM) { if (styler.SafeGetCharAt(i-2) == '<' && styler.SafeGetCharAt(i-1) == '<') { levelCurrent++; } else if (styleNext == SCE_RB_DEFAULT) { levelCurrent--; } } if (atEOL) { int lev = levelPrev; if (visibleChars == 0 && foldCompact) lev |= SC_FOLDLEVELWHITEFLAG; if ((levelCurrent > levelPrev) && (visibleChars > 0)) lev |= SC_FOLDLEVELHEADERFLAG; styler.SetLevel(lineCurrent, lev|SC_FOLDLEVELBASE); lineCurrent++; levelPrev = levelCurrent; visibleChars = 0; buffer_ends_with_eol = true; } else if (!isspacechar(ch)) { visibleChars++; buffer_ends_with_eol = false; } stylePrev = style; } // Fill in the real level of the next line, keeping the current flags as they will be filled in later if (!buffer_ends_with_eol) { lineCurrent++; int new_lev = levelCurrent; if (visibleChars == 0 && foldCompact) new_lev |= SC_FOLDLEVELWHITEFLAG; if ((levelCurrent > levelPrev) && (visibleChars > 0)) new_lev |= SC_FOLDLEVELHEADERFLAG; levelCurrent = new_lev; } styler.SetLevel(lineCurrent, levelCurrent|SC_FOLDLEVELBASE); } static const char * const rubyWordListDesc[] = { "Keywords", 0 }; LexerModule lmRuby(SCLEX_RUBY, ColouriseRbDoc, "ruby", FoldRbDoc, rubyWordListDesc, 6); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/UniConversion.h000444001750001750 120611727344243 25346 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file UniConversion.h ** Functions to handle UTF-8 and UTF-16 strings. **/ // Copyright 1998-2001 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. unsigned int UTF8Length(const wchar_t *uptr, unsigned int tlen); void UTF8FromUTF16(const wchar_t *uptr, unsigned int tlen, char *putf, unsigned int len); unsigned int UTF8CharLength(unsigned char ch); unsigned int UTF16Length(const char *s, unsigned int len); unsigned int UTF16FromUTF8(const char *s, unsigned int len, wchar_t *tbuf, unsigned int tlen); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexVHDL.cxx000444001750001750 4103011727344243 24345 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexVHDL.cxx ** Lexer for VHDL ** Written by Phil Reid, ** Based on: ** - The Verilog Lexer by Avi Yegudin ** - The Fortran Lexer by Chuan-jian Shen ** - The C++ lexer by Neil Hodgson **/ // Copyright 1998-2002 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static void ColouriseVHDLDoc( unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler); /***************************************/ static inline bool IsAWordChar(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_' ); } /***************************************/ static inline bool IsAWordStart(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '_'); } /***************************************/ inline bool IsABlank(unsigned int ch) { return (ch == ' ') || (ch == 0x09) || (ch == 0x0b) ; } /***************************************/ static void ColouriseVHDLDoc( unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { WordList &Keywords = *keywordlists[0]; WordList &Operators = *keywordlists[1]; WordList &Attributes = *keywordlists[2]; WordList &Functions = *keywordlists[3]; WordList &Packages = *keywordlists[4]; WordList &Types = *keywordlists[5]; WordList &User = *keywordlists[6]; StyleContext sc(startPos, length, initStyle, styler); for (; sc.More(); sc.Forward()) { // Determine if the current state should terminate. if (sc.state == SCE_VHDL_OPERATOR) { sc.SetState(SCE_VHDL_DEFAULT); } else if (sc.state == SCE_VHDL_NUMBER) { if (!IsAWordChar(sc.ch) && (sc.ch != '#')) { sc.SetState(SCE_VHDL_DEFAULT); } } else if (sc.state == SCE_VHDL_IDENTIFIER) { if (!IsAWordChar(sc.ch) || (sc.ch == '.')) { char s[100]; sc.GetCurrentLowered(s, sizeof(s)); if (Keywords.InList(s)) { sc.ChangeState(SCE_VHDL_KEYWORD); } else if (Operators.InList(s)) { sc.ChangeState(SCE_VHDL_STDOPERATOR); } else if (Attributes.InList(s)) { sc.ChangeState(SCE_VHDL_ATTRIBUTE); } else if (Functions.InList(s)) { sc.ChangeState(SCE_VHDL_STDFUNCTION); } else if (Packages.InList(s)) { sc.ChangeState(SCE_VHDL_STDPACKAGE); } else if (Types.InList(s)) { sc.ChangeState(SCE_VHDL_STDTYPE); } else if (User.InList(s)) { sc.ChangeState(SCE_VHDL_USERWORD); } sc.SetState(SCE_VHDL_DEFAULT); } } else if (sc.state == SCE_VHDL_COMMENT || sc.state == SCE_VHDL_COMMENTLINEBANG) { if (sc.atLineEnd) { sc.SetState(SCE_VHDL_DEFAULT); } } else if (sc.state == SCE_VHDL_STRING) { if (sc.ch == '\\') { if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') { sc.Forward(); } } else if (sc.ch == '\"') { sc.ForwardSetState(SCE_VHDL_DEFAULT); } else if (sc.atLineEnd) { sc.ChangeState(SCE_VHDL_STRINGEOL); sc.ForwardSetState(SCE_VHDL_DEFAULT); } } // Determine if a new state should be entered. if (sc.state == SCE_VHDL_DEFAULT) { if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) { sc.SetState(SCE_VHDL_NUMBER); } else if (IsAWordStart(sc.ch)) { sc.SetState(SCE_VHDL_IDENTIFIER); } else if (sc.Match('-', '-')) { if (sc.Match("--!")) // Nice to have a different comment style sc.SetState(SCE_VHDL_COMMENTLINEBANG); else sc.SetState(SCE_VHDL_COMMENT); } else if (sc.ch == '\"') { sc.SetState(SCE_VHDL_STRING); } else if (isoperator(static_cast(sc.ch))) { sc.SetState(SCE_VHDL_OPERATOR); } } } sc.Complete(); } //============================================================================= static bool IsCommentLine(int line, Accessor &styler) { int pos = styler.LineStart(line); int eol_pos = styler.LineStart(line + 1) - 1; for (int i = pos; i < eol_pos; i++) { char ch = styler[i]; char chNext = styler[i+1]; if ((ch == '-') && (chNext == '-')) return true; else if (ch != ' ' && ch != '\t') return false; } return false; } //============================================================================= // Folding the code static void FoldNoBoxVHDLDoc( unsigned int startPos, int length, int, Accessor &styler) { // Decided it would be smarter to have the lexer have all keywords included. Therefore I // don't check if the style for the keywords that I use to adjust the levels. char words[] = "architecture begin case component else elsif end entity generate loop package process record then " "procedure function when"; WordList keywords; keywords.Set(words); bool foldComment = styler.GetPropertyInt("fold.comment", 1) != 0; bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; bool foldAtElse = styler.GetPropertyInt("fold.at.else", 1) != 0; bool foldAtBegin = styler.GetPropertyInt("fold.at.Begin", 1) != 0; bool foldAtParenthese = styler.GetPropertyInt("fold.at.Parenthese", 1) != 0; //bool foldAtWhen = styler.GetPropertyInt("fold.at.When", 1) != 0; //< fold at when in case statements int visibleChars = 0; unsigned int endPos = startPos + length; int lineCurrent = styler.GetLine(startPos); int levelCurrent = SC_FOLDLEVELBASE; if(lineCurrent > 0) levelCurrent = styler.LevelAt(lineCurrent-1) >> 16; //int levelMinCurrent = levelCurrent; int levelMinCurrentElse = levelCurrent; //< Used for folding at 'else' int levelMinCurrentBegin = levelCurrent; //< Used for folding at 'begin' int levelNext = levelCurrent; /***************************************/ int lastStart = 0; char prevWord[32] = ""; /***************************************/ // Find prev word // The logic for going up or down a level depends on a the previous keyword // This code could be cleaned up. int end = 0; unsigned int j; for(j = startPos; j>0; j--) { char ch = styler.SafeGetCharAt(j); char chPrev = styler.SafeGetCharAt(j-1); int style = styler.StyleAt(j); int stylePrev = styler.StyleAt(j-1); if ((stylePrev != SCE_VHDL_COMMENT) && (stylePrev != SCE_VHDL_STRING)) { if(IsAWordChar(chPrev) && !IsAWordChar(ch)) { end = j-1; } } if ((style != SCE_VHDL_COMMENT) && (style != SCE_VHDL_STRING)) { if(!IsAWordChar(chPrev) && IsAWordStart(ch) && (end != 0)) { char s[32]; unsigned int k; for(k=0; (k<31 ) && (k(tolower(styler[j+k])); } s[k] = '\0'; if(keywords.InList(s)) { strcpy(prevWord, s); break; } } } } for(j=j+static_cast(strlen(prevWord)); j(tolower(styler[lastStart+k])); } s[k] = '\0'; if(keywords.InList(s)) { if ( strcmp(s, "architecture") == 0 || strcmp(s, "case") == 0 || strcmp(s, "component") == 0 || strcmp(s, "entity") == 0 || strcmp(s, "generate") == 0 || strcmp(s, "loop") == 0 || strcmp(s, "package") ==0 || strcmp(s, "process") == 0 || strcmp(s, "record") == 0 || strcmp(s, "then") == 0) { if (strcmp(prevWord, "end") != 0) { if (levelMinCurrentElse > levelNext) { levelMinCurrentElse = levelNext; } levelNext++; } } else if ( strcmp(s, "procedure") == 0 || strcmp(s, "function") == 0) { if (strcmp(prevWord, "end") != 0) // check for "end procedure" etc. { // This code checks to see if the procedure / function is a definition within a "package" // rather than the actual code in the body. int BracketLevel = 0; for(int j=i+1; j levelNext) { levelMinCurrentElse = levelNext; } levelNext++; break; } if((BracketLevel == 0) && (LocalCh == ';')) { break; } } } } else if (strcmp(s, "end") == 0) { levelNext--; } else if(strcmp(s, "elsif") == 0) { // elsif is followed by then so folding occurs correctly levelNext--; } else if (strcmp(s, "else") == 0) { if(strcmp(prevWord, "when") != 0) // ignore a <= x when y else z; { levelMinCurrentElse = levelNext - 1; // VHDL else is all on its own so just dec. the min level } } else if( ((strcmp(s, "begin") == 0) && (strcmp(prevWord, "architecture") == 0)) || ((strcmp(s, "begin") == 0) && (strcmp(prevWord, "function") == 0)) || ((strcmp(s, "begin") == 0) && (strcmp(prevWord, "procedure") == 0))) { levelMinCurrentBegin = levelNext - 1; } //Platform::DebugPrintf("Line[%04d] Prev[%20s] Cur[%20s] Level[%x]\n", lineCurrent+1, prevWord, s, levelCurrent); strcpy(prevWord, s); } } } if (atEOL) { int levelUse = levelCurrent; if (foldAtElse && (levelMinCurrentElse < levelUse)) { levelUse = levelMinCurrentElse; } if (foldAtBegin && (levelMinCurrentBegin < levelUse)) { levelUse = levelMinCurrentBegin; } int lev = levelUse | levelNext << 16; if (visibleChars == 0 && foldCompact) lev |= SC_FOLDLEVELWHITEFLAG; if (levelUse < levelNext) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) { styler.SetLevel(lineCurrent, lev); } //Platform::DebugPrintf("Line[%04d] ---------------------------------------------------- Level[%x]\n", lineCurrent+1, levelCurrent); lineCurrent++; levelCurrent = levelNext; //levelMinCurrent = levelCurrent; levelMinCurrentElse = levelCurrent; levelMinCurrentBegin = levelCurrent; visibleChars = 0; } /***************************************/ if (!isspacechar(ch)) visibleChars++; } /***************************************/ // Platform::DebugPrintf("Line[%04d] ---------------------------------------------------- Level[%x]\n", lineCurrent+1, levelCurrent); } //============================================================================= static void FoldVHDLDoc(unsigned int startPos, int length, int initStyle, WordList *[], Accessor &styler) { FoldNoBoxVHDLDoc(startPos, length, initStyle, styler); } //============================================================================= static const char * const VHDLWordLists[] = { "Keywords", "Operators", "Attributes", "Standard Functions", "Standard Packages", "Standard Types", "User Words", 0, }; LexerModule lmVHDL(SCLEX_VHDL, ColouriseVHDLDoc, "vhdl", FoldVHDLDoc, VHDLWordLists); // Keyword: // access after alias all architecture array assert attribute begin block body buffer bus case component // configuration constant disconnect downto else elsif end entity exit file for function generate generic // group guarded if impure in inertial inout is label library linkage literal loop map new next null of // on open others out package port postponed procedure process pure range record register reject report // return select severity shared signal subtype then to transport type unaffected units until use variable // wait when while with // // Operators: // abs and mod nand nor not or rem rol ror sla sll sra srl xnor xor // // Attributes: // left right low high ascending image value pos val succ pred leftof rightof base range reverse_range // length delayed stable quiet transaction event active last_event last_active last_value driving // driving_value simple_name path_name instance_name // // Std Functions: // now readline read writeline write endfile resolved to_bit to_bitvector to_stdulogic to_stdlogicvector // to_stdulogicvector to_x01 to_x01z to_UX01 rising_edge falling_edge is_x shift_left shift_right rotate_left // rotate_right resize to_integer to_unsigned to_signed std_match to_01 // // Std Packages: // std ieee work standard textio std_logic_1164 std_logic_arith std_logic_misc std_logic_signed // std_logic_textio std_logic_unsigned numeric_bit numeric_std math_complex math_real vital_primitives // vital_timing // // Std Types: // boolean bit character severity_level integer real time delay_length natural positive string bit_vector // file_open_kind file_open_status line text side width std_ulogic std_ulogic_vector std_logic // std_logic_vector X01 X01Z UX01 UX01Z unsigned signed // Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexPLM.cxx000444001750001750 1322711727344243 24247 0ustar00azawawiazawawi000000000000// Copyright (c) 1990-2007, Scientific Toolworks, Inc. // Author: Jason Haslam // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static void GetRange(unsigned int start, unsigned int end, Accessor &styler, char *s, unsigned int len) { unsigned int i = 0; while ((i < end - start + 1) && (i < len-1)) { s[i] = static_cast(tolower(styler[start + i])); i++; } s[i] = '\0'; } static void ColourisePlmDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { unsigned int endPos = startPos + length; int state = initStyle; styler.StartAt(startPos); styler.StartSegment(startPos); for (unsigned int i = startPos; i < endPos; i++) { char ch = styler.SafeGetCharAt(i); char chNext = styler.SafeGetCharAt(i + 1); if (state == SCE_PLM_DEFAULT) { if (ch == '/' && chNext == '*') { styler.ColourTo(i - 1, state); state = SCE_PLM_COMMENT; } else if (ch == '\'') { styler.ColourTo(i - 1, state); state = SCE_PLM_STRING; } else if (isdigit(ch)) { styler.ColourTo(i - 1, state); state = SCE_PLM_NUMBER; } else if (isalpha(ch)) { styler.ColourTo(i - 1, state); state = SCE_PLM_IDENTIFIER; } else if (ch == '+' || ch == '-' || ch == '*' || ch == '/' || ch == '=' || ch == '<' || ch == '>' || ch == ':') { styler.ColourTo(i - 1, state); state = SCE_PLM_OPERATOR; } else if (ch == '$') { styler.ColourTo(i - 1, state); state = SCE_PLM_CONTROL; } } else if (state == SCE_PLM_COMMENT) { if (ch == '*' && chNext == '/') { i++; styler.ColourTo(i, state); state = SCE_PLM_DEFAULT; } } else if (state == SCE_PLM_STRING) { if (ch == '\'') { if (chNext == '\'') { i++; } else { styler.ColourTo(i, state); state = SCE_PLM_DEFAULT; } } } else if (state == SCE_PLM_NUMBER) { if (!isdigit(ch) && !isalpha(ch) && ch != '$') { i--; styler.ColourTo(i, state); state = SCE_PLM_DEFAULT; } } else if (state == SCE_PLM_IDENTIFIER) { if (!isdigit(ch) && !isalpha(ch) && ch != '$') { // Get the entire identifier. char word[1024]; int segmentStart = styler.GetStartSegment(); GetRange(segmentStart, i - 1, styler, word, sizeof(word)); i--; if (keywordlists[0]->InList(word)) styler.ColourTo(i, SCE_PLM_KEYWORD); else styler.ColourTo(i, state); state = SCE_PLM_DEFAULT; } } else if (state == SCE_PLM_OPERATOR) { if (ch != '=' && ch != '>') { i--; styler.ColourTo(i, state); state = SCE_PLM_DEFAULT; } } else if (state == SCE_PLM_CONTROL) { if (ch == '\r' || ch == '\n') { styler.ColourTo(i - 1, state); state = SCE_PLM_DEFAULT; } } } styler.ColourTo(endPos - 1, state); } static void FoldPlmDoc(unsigned int startPos, int length, int initStyle, WordList *[], Accessor &styler) { bool foldComment = styler.GetPropertyInt("fold.comment") != 0; bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; unsigned int endPos = startPos + length; int visibleChars = 0; int lineCurrent = styler.GetLine(startPos); int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; int levelCurrent = levelPrev; char chNext = styler[startPos]; int styleNext = styler.StyleAt(startPos); int style = initStyle; int startKeyword = 0; for (unsigned int i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); int stylePrev = style; style = styleNext; styleNext = styler.StyleAt(i + 1); bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); if (stylePrev != SCE_PLM_KEYWORD && style == SCE_PLM_KEYWORD) startKeyword = i; if (style == SCE_PLM_KEYWORD && styleNext != SCE_PLM_KEYWORD) { char word[1024]; GetRange(startKeyword, i, styler, word, sizeof(word)); if (strcmp(word, "procedure") == 0 || strcmp(word, "do") == 0) levelCurrent++; else if (strcmp(word, "end") == 0) levelCurrent--; } if (foldComment) { if (stylePrev != SCE_PLM_COMMENT && style == SCE_PLM_COMMENT) levelCurrent++; else if (stylePrev == SCE_PLM_COMMENT && style != SCE_PLM_COMMENT) levelCurrent--; } if (atEOL) { int lev = levelPrev; if (visibleChars == 0 && foldCompact) lev |= SC_FOLDLEVELWHITEFLAG; if ((levelCurrent > levelPrev) && (visibleChars > 0)) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) { styler.SetLevel(lineCurrent, lev); } lineCurrent++; levelPrev = levelCurrent; visibleChars = 0; } if (!isspacechar(ch)) visibleChars++; } int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; styler.SetLevel(lineCurrent, levelPrev | flagsNext); } static const char *const plmWordListDesc[] = { "Keywords", 0 }; LexerModule lmPLM(SCLEX_PLM, ColourisePlmDoc, "PL/M", FoldPlmDoc, plmWordListDesc); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexLisp.cxx000444001750001750 2060111727344243 24520 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexLisp.cxx ** Lexer for Lisp. ** Written by Alexey Yutkin. **/ // Copyright 1998-2001 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif #define SCE_LISP_CHARACTER 29 #define SCE_LISP_MACRO 30 #define SCE_LISP_MACRO_DISPATCH 31 static inline bool isLispoperator(char ch) { if (isascii(ch) && isalnum(ch)) return false; if (ch == '\'' || ch == '`' || ch == '(' || ch == ')' || ch == '[' || ch == ']' || ch == '{' || ch == '}') return true; return false; } static inline bool isLispwordstart(char ch) { return isascii(ch) && ch != ';' && !isspacechar(ch) && !isLispoperator(ch) && ch != '\n' && ch != '\r' && ch != '\"'; } static void classifyWordLisp(unsigned int start, unsigned int end, WordList &keywords, WordList &keywords_kw, Accessor &styler) { assert(end >= start); char s[100]; unsigned int i; bool digit_flag = true; for (i = 0; (i < end - start + 1) && (i < 99); i++) { s[i] = styler[start + i]; s[i + 1] = '\0'; if (!isdigit(s[i]) && (s[i] != '.')) digit_flag = false; } char chAttr = SCE_LISP_IDENTIFIER; if(digit_flag) chAttr = SCE_LISP_NUMBER; else { if (keywords.InList(s)) { chAttr = SCE_LISP_KEYWORD; } else if (keywords_kw.InList(s)) { chAttr = SCE_LISP_KEYWORD_KW; } else if ((s[0] == '*' && s[i-1] == '*') || (s[0] == '+' && s[i-1] == '+')) { chAttr = SCE_LISP_SPECIAL; } } styler.ColourTo(end, chAttr); return; } static void ColouriseLispDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { WordList &keywords = *keywordlists[0]; WordList &keywords_kw = *keywordlists[1]; styler.StartAt(startPos); int state = initStyle, radix = -1; char chNext = styler[startPos]; unsigned int lengthDoc = startPos + length; styler.StartSegment(startPos); for (unsigned int i = startPos; i < lengthDoc; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); if (styler.IsLeadByte(ch)) { chNext = styler.SafeGetCharAt(i + 2); i += 1; continue; } if (state == SCE_LISP_DEFAULT) { if (ch == '#') { styler.ColourTo(i - 1, state); radix = -1; state = SCE_LISP_MACRO_DISPATCH; } else if (ch == ':' && isLispwordstart(chNext)) { styler.ColourTo(i - 1, state); state = SCE_LISP_SYMBOL; } else if (isLispwordstart(ch)) { styler.ColourTo(i - 1, state); state = SCE_LISP_IDENTIFIER; } else if (ch == ';') { styler.ColourTo(i - 1, state); state = SCE_LISP_COMMENT; } else if (isLispoperator(ch) || ch=='\'') { styler.ColourTo(i - 1, state); styler.ColourTo(i, SCE_LISP_OPERATOR); if (ch=='\'' && isLispwordstart(chNext)) { state = SCE_LISP_SYMBOL; } } else if (ch == '\"') { styler.ColourTo(i - 1, state); state = SCE_LISP_STRING; } } else if (state == SCE_LISP_IDENTIFIER || state == SCE_LISP_SYMBOL) { if (!isLispwordstart(ch)) { if (state == SCE_LISP_IDENTIFIER) { classifyWordLisp(styler.GetStartSegment(), i - 1, keywords, keywords_kw, styler); } else { styler.ColourTo(i - 1, state); } state = SCE_LISP_DEFAULT; } /*else*/ if (isLispoperator(ch) || ch=='\'') { styler.ColourTo(i - 1, state); styler.ColourTo(i, SCE_LISP_OPERATOR); if (ch=='\'' && isLispwordstart(chNext)) { state = SCE_LISP_SYMBOL; } } } else if (state == SCE_LISP_MACRO_DISPATCH) { if (!(isascii(ch) && isdigit(ch))) { if (ch != 'r' && ch != 'R' && (i - styler.GetStartSegment()) > 1) { state = SCE_LISP_DEFAULT; } else { switch (ch) { case '|': state = SCE_LISP_MULTI_COMMENT; break; case 'o': case 'O': radix = 8; state = SCE_LISP_MACRO; break; case 'x': case 'X': radix = 16; state = SCE_LISP_MACRO; break; case 'b': case 'B': radix = 2; state = SCE_LISP_MACRO; break; case '\\': state = SCE_LISP_CHARACTER; break; case ':': case '-': case '+': state = SCE_LISP_MACRO; break; case '\'': if (isLispwordstart(chNext)) { state = SCE_LISP_SPECIAL; } else { styler.ColourTo(i - 1, SCE_LISP_DEFAULT); styler.ColourTo(i, SCE_LISP_OPERATOR); state = SCE_LISP_DEFAULT; } break; default: if (isLispoperator(ch)) { styler.ColourTo(i - 1, SCE_LISP_DEFAULT); styler.ColourTo(i, SCE_LISP_OPERATOR); } state = SCE_LISP_DEFAULT; break; } } } } else if (state == SCE_LISP_MACRO) { if (isLispwordstart(ch) && (radix == -1 || IsADigit(ch, radix))) { state = SCE_LISP_SPECIAL; } else { state = SCE_LISP_DEFAULT; } } else if (state == SCE_LISP_CHARACTER) { if (isLispoperator(ch)) { styler.ColourTo(i, SCE_LISP_SPECIAL); state = SCE_LISP_DEFAULT; } else if (isLispwordstart(ch)) { styler.ColourTo(i, SCE_LISP_SPECIAL); state = SCE_LISP_SPECIAL; } else { state = SCE_LISP_DEFAULT; } } else if (state == SCE_LISP_SPECIAL) { if (!isLispwordstart(ch) || (radix != -1 && !IsADigit(ch, radix))) { styler.ColourTo(i - 1, state); state = SCE_LISP_DEFAULT; } if (isLispoperator(ch) || ch=='\'') { styler.ColourTo(i - 1, state); styler.ColourTo(i, SCE_LISP_OPERATOR); if (ch=='\'' && isLispwordstart(chNext)) { state = SCE_LISP_SYMBOL; } } } else { if (state == SCE_LISP_COMMENT) { if (atEOL) { styler.ColourTo(i - 1, state); state = SCE_LISP_DEFAULT; } } else if (state == SCE_LISP_MULTI_COMMENT) { if (ch == '|' && chNext == '#') { i++; chNext = styler.SafeGetCharAt(i + 1); styler.ColourTo(i, state); state = SCE_LISP_DEFAULT; } } else if (state == SCE_LISP_STRING) { if (ch == '\\') { if (chNext == '\"' || chNext == '\'' || chNext == '\\') { i++; chNext = styler.SafeGetCharAt(i + 1); } } else if (ch == '\"') { styler.ColourTo(i, state); state = SCE_LISP_DEFAULT; } } } } styler.ColourTo(lengthDoc - 1, state); } static void FoldLispDoc(unsigned int startPos, int length, int /* initStyle */, WordList *[], Accessor &styler) { unsigned int lengthDoc = startPos + length; int visibleChars = 0; int lineCurrent = styler.GetLine(startPos); int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; int levelCurrent = levelPrev; char chNext = styler[startPos]; int styleNext = styler.StyleAt(startPos); for (unsigned int i = startPos; i < lengthDoc; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); int style = styleNext; styleNext = styler.StyleAt(i + 1); bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); if (style == SCE_LISP_OPERATOR) { if (ch == '(' || ch == '[' || ch == '{') { levelCurrent++; } else if (ch == ')' || ch == ']' || ch == '}') { levelCurrent--; } } if (atEOL) { int lev = levelPrev; if (visibleChars == 0) lev |= SC_FOLDLEVELWHITEFLAG; if ((levelCurrent > levelPrev) && (visibleChars > 0)) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) { styler.SetLevel(lineCurrent, lev); } lineCurrent++; levelPrev = levelCurrent; visibleChars = 0; } if (!isspacechar(ch)) visibleChars++; } // Fill in the real level of the next line, keeping the current flags as they will be filled in later int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; styler.SetLevel(lineCurrent, levelPrev | flagsNext); } static const char * const lispWordListDesc[] = { "Functions and special operators", "Keywords", 0 }; LexerModule lmLISP(SCLEX_LISP, ColouriseLispDoc, "lisp", FoldLispDoc, lispWordListDesc); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/CharacterSet.h000444001750001750 710111727344243 25115 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file CharacterSet.h ** Encapsulates a set of characters. Used to test if a character is within a set. **/ // Copyright 2007 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #ifndef CHARACTERSET_H #define CHARACTERSET_H #ifdef SCI_NAMESPACE namespace Scintilla { #endif class CharacterSet { int size; bool valueAfter; bool *bset; public: enum setBase { setNone=0, setLower=1, setUpper=2, setDigits=4, setAlpha=setLower|setUpper, setAlphaNum=setAlpha|setDigits }; CharacterSet(setBase base=setNone, const char *initialSet="", int size_=0x80, bool valueAfter_=false) { size = size_; valueAfter = valueAfter_; bset = new bool[size]; for (int i=0; i < size; i++) { bset[i] = false; } AddString(initialSet); if (base & setLower) AddString("abcdefghijklmnopqrstuvwxyz"); if (base & setUpper) AddString("ABCDEFGHIJKLMNOPQRSTUVWXYZ"); if (base & setDigits) AddString("0123456789"); } ~CharacterSet() { delete []bset; bset = 0; size = 0; } void Add(int val) { assert(val >= 0); assert(val < size); bset[val] = true; } void AddString(const char *setToAdd) { for (const char *cp=setToAdd; *cp; cp++) { int val = static_cast(*cp); assert(val >= 0); assert(val < size); bset[val] = true; } } bool Contains(int val) const { assert(val >= 0); if (val < 0) return false; return (val < size) ? bset[val] : valueAfter; } }; // Functions for classifying characters inline bool IsASpace(int ch) { return (ch == ' ') || ((ch >= 0x09) && (ch <= 0x0d)); } inline bool IsASpaceOrTab(int ch) { return (ch == ' ') || (ch == '\t'); } inline bool IsADigit(int ch) { return (ch >= '0') && (ch <= '9'); } inline bool IsADigit(int ch, int base) { if (base <= 10) { return (ch >= '0') && (ch < '0' + base); } else { return ((ch >= '0') && (ch <= '9')) || ((ch >= 'A') && (ch < 'A' + base - 10)) || ((ch >= 'a') && (ch < 'a' + base - 10)); } } inline bool IsASCII(int ch) { return ch < 0x80; } inline bool IsAlphaNumeric(int ch) { return ((ch >= '0') && (ch <= '9')) || ((ch >= 'a') && (ch <= 'z')) || ((ch >= 'A') && (ch <= 'Z')); } /** * Check if a character is a space. * This is ASCII specific but is safe with chars >= 0x80. */ inline bool isspacechar(int ch) { return (ch == ' ') || ((ch >= 0x09) && (ch <= 0x0d)); } inline bool iswordchar(int ch) { return IsASCII(ch) && (IsAlphaNumeric(ch) || ch == '.' || ch == '_'); } inline bool iswordstart(int ch) { return IsASCII(ch) && (IsAlphaNumeric(ch) || ch == '_'); } inline bool isoperator(int ch) { if (IsASCII(ch) && IsAlphaNumeric(ch)) return false; if (ch == '%' || ch == '^' || ch == '&' || ch == '*' || ch == '(' || ch == ')' || ch == '-' || ch == '+' || ch == '=' || ch == '|' || ch == '{' || ch == '}' || ch == '[' || ch == ']' || ch == ':' || ch == ';' || ch == '<' || ch == '>' || ch == ',' || ch == '/' || ch == '?' || ch == '!' || ch == '.' || ch == '~') return true; return false; } // Simple case functions for ASCII. inline char MakeUpperCase(char ch) { if (ch < 'a' || ch > 'z') return ch; else return static_cast(ch - 'a' + 'A'); } int CompareCaseInsensitive(const char *a, const char *b); int CompareNCaseInsensitive(const char *a, const char *b, size_t len); #ifdef SCI_NAMESPACE } #endif #endif Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexCLW.cxx000444001750001750 5431611727344243 24250 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexClw.cxx ** Lexer for Clarion. ** 2004/12/17 Updated Lexer **/ // Copyright 2003-2004 by Ron Schofield // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif // Is an end of line character inline bool IsEOL(const int ch) { return(ch == '\n'); } // Convert character to uppercase static char CharacterUpper(char chChar) { if (chChar < 'a' || chChar > 'z') { return(chChar); } else { return(static_cast(chChar - 'a' + 'A')); } } // Convert string to uppercase static void StringUpper(char *szString) { while (*szString) { *szString = CharacterUpper(*szString); szString++; } } // Is a label start character inline bool IsALabelStart(const int iChar) { return(isalpha(iChar) || iChar == '_'); } // Is a label character inline bool IsALabelCharacter(const int iChar) { return(isalnum(iChar) || iChar == '_' || iChar == ':'); } // Is the character is a ! and the the next character is not a ! inline bool IsACommentStart(const int iChar) { return(iChar == '!'); } // Is the character a Clarion hex character (ABCDEF) inline bool IsAHexCharacter(const int iChar, bool bCaseSensitive) { // Case insensitive. if (!bCaseSensitive) { if (strchr("ABCDEFabcdef", iChar) != NULL) { return(true); } } // Case sensitive else { if (strchr("ABCDEF", iChar) != NULL) { return(true); } } return(false); } // Is the character a Clarion base character (B=Binary, O=Octal, H=Hex) inline bool IsANumericBaseCharacter(const int iChar, bool bCaseSensitive) { // Case insensitive. if (!bCaseSensitive) { // If character is a numeric base character if (strchr("BOHboh", iChar) != NULL) { return(true); } } // Case sensitive else { // If character is a numeric base character if (strchr("BOH", iChar) != NULL) { return(true); } } return(false); } // Set the correct numeric constant state inline bool SetNumericConstantState(StyleContext &scDoc) { int iPoints = 0; // Point counter char cNumericString[512]; // Numeric string buffer // Buffer the current numberic string scDoc.GetCurrent(cNumericString, sizeof(cNumericString)); // Loop through the string until end of string (NULL termination) for (int iIndex = 0; cNumericString[iIndex] != '\0'; iIndex++) { // Depending on the character switch (cNumericString[iIndex]) { // Is a . (point) case '.' : // Increment point counter iPoints++; break; default : break; } } // If points found (can be more than one for improper formatted number if (iPoints > 0) { return(true); } // Else no points found else { return(false); } } // Get the next word in uppercase from the current position (keyword lookahead) inline bool GetNextWordUpper(Accessor &styler, unsigned int uiStartPos, int iLength, char *cWord) { unsigned int iIndex = 0; // Buffer Index // Loop through the remaining string from the current position for (int iOffset = uiStartPos; iOffset < iLength; iOffset++) { // Get the character from the buffer using the offset char cCharacter = styler[iOffset]; if (IsEOL(cCharacter)) { break; } // If the character is alphabet character if (isalpha(cCharacter)) { // Add UPPERCASE character to the word buffer cWord[iIndex++] = CharacterUpper(cCharacter); } } // Add null termination cWord[iIndex] = '\0'; // If no word was found if (iIndex == 0) { // Return failure return(false); } // Else word was found else { // Return success return(true); } } // Clarion Language Colouring Procedure static void ColouriseClarionDoc(unsigned int uiStartPos, int iLength, int iInitStyle, WordList *wlKeywords[], Accessor &accStyler, bool bCaseSensitive) { int iParenthesesLevel = 0; // Parenthese Level int iColumn1Label = false; // Label starts in Column 1 WordList &wlClarionKeywords = *wlKeywords[0]; // Clarion Keywords WordList &wlCompilerDirectives = *wlKeywords[1]; // Compiler Directives WordList &wlRuntimeExpressions = *wlKeywords[2]; // Runtime Expressions WordList &wlBuiltInProcsFuncs = *wlKeywords[3]; // Builtin Procedures and Functions WordList &wlStructsDataTypes = *wlKeywords[4]; // Structures and Data Types WordList &wlAttributes = *wlKeywords[5]; // Procedure Attributes WordList &wlStandardEquates = *wlKeywords[6]; // Standard Equates WordList &wlLabelReservedWords = *wlKeywords[7]; // Clarion Reserved Keywords (Labels) WordList &wlProcLabelReservedWords = *wlKeywords[8]; // Clarion Reserved Keywords (Procedure Labels) const char wlProcReservedKeywordList[] = "PROCEDURE FUNCTION"; WordList wlProcReservedKeywords; wlProcReservedKeywords.Set(wlProcReservedKeywordList); const char wlCompilerKeywordList[] = "COMPILE OMIT"; WordList wlCompilerKeywords; wlCompilerKeywords.Set(wlCompilerKeywordList); const char wlLegacyStatementsList[] = "BOF EOF FUNCTION POINTER SHARE"; WordList wlLegacyStatements; wlLegacyStatements.Set(wlLegacyStatementsList); StyleContext scDoc(uiStartPos, iLength, iInitStyle, accStyler); // lex source code for (; scDoc.More(); scDoc.Forward()) { // // Determine if the current state should terminate. // // Label State Handling if (scDoc.state == SCE_CLW_LABEL) { // If the character is not a valid label if (!IsALabelCharacter(scDoc.ch)) { // If the character is a . (dot syntax) if (scDoc.ch == '.') { // Turn off column 1 label flag as label now cannot be reserved work iColumn1Label = false; // Uncolour the . (dot) to default state, move forward one character, // and change back to the label state. scDoc.SetState(SCE_CLW_DEFAULT); scDoc.Forward(); scDoc.SetState(SCE_CLW_LABEL); } // Else check label else { char cLabel[512]; // Label buffer // Buffer the current label string scDoc.GetCurrent(cLabel,sizeof(cLabel)); // If case insensitive, convert string to UPPERCASE to match passed keywords. if (!bCaseSensitive) { StringUpper(cLabel); } // Else if UPPERCASE label string is in the Clarion compiler keyword list if (wlCompilerKeywords.InList(cLabel) && iColumn1Label){ // change the label to error state scDoc.ChangeState(SCE_CLW_COMPILER_DIRECTIVE); } // Else if UPPERCASE label string is in the Clarion reserved keyword list else if (wlLabelReservedWords.InList(cLabel) && iColumn1Label){ // change the label to error state scDoc.ChangeState(SCE_CLW_ERROR); } // Else if UPPERCASE label string is else if (wlProcLabelReservedWords.InList(cLabel) && iColumn1Label) { char cWord[512]; // Word buffer // Get the next word from the current position if (GetNextWordUpper(accStyler,scDoc.currentPos,uiStartPos+iLength,cWord)) { // If the next word is a procedure reserved word if (wlProcReservedKeywords.InList(cWord)) { // Change the label to error state scDoc.ChangeState(SCE_CLW_ERROR); } } } // Else if label string is in the compiler directive keyword list else if (wlCompilerDirectives.InList(cLabel)) { // change the state to compiler directive state scDoc.ChangeState(SCE_CLW_COMPILER_DIRECTIVE); } // Terminate the label state and set to default state scDoc.SetState(SCE_CLW_DEFAULT); } } } // Keyword State Handling else if (scDoc.state == SCE_CLW_KEYWORD) { // If character is : (colon) if (scDoc.ch == ':') { char cEquate[512]; // Equate buffer // Move forward to include : (colon) in buffer scDoc.Forward(); // Buffer the equate string scDoc.GetCurrent(cEquate,sizeof(cEquate)); // If case insensitive, convert string to UPPERCASE to match passed keywords. if (!bCaseSensitive) { StringUpper(cEquate); } // If statement string is in the equate list if (wlStandardEquates.InList(cEquate)) { // Change to equate state scDoc.ChangeState(SCE_CLW_STANDARD_EQUATE); } } // If the character is not a valid label character else if (!IsALabelCharacter(scDoc.ch)) { char cStatement[512]; // Statement buffer // Buffer the statement string scDoc.GetCurrent(cStatement,sizeof(cStatement)); // If case insensitive, convert string to UPPERCASE to match passed keywords. if (!bCaseSensitive) { StringUpper(cStatement); } // If statement string is in the Clarion keyword list if (wlClarionKeywords.InList(cStatement)) { // Change the statement string to the Clarion keyword state scDoc.ChangeState(SCE_CLW_KEYWORD); } // Else if statement string is in the compiler directive keyword list else if (wlCompilerDirectives.InList(cStatement)) { // Change the statement string to the compiler directive state scDoc.ChangeState(SCE_CLW_COMPILER_DIRECTIVE); } // Else if statement string is in the runtime expressions keyword list else if (wlRuntimeExpressions.InList(cStatement)) { // Change the statement string to the runtime expressions state scDoc.ChangeState(SCE_CLW_RUNTIME_EXPRESSIONS); } // Else if statement string is in the builtin procedures and functions keyword list else if (wlBuiltInProcsFuncs.InList(cStatement)) { // Change the statement string to the builtin procedures and functions state scDoc.ChangeState(SCE_CLW_BUILTIN_PROCEDURES_FUNCTION); } // Else if statement string is in the tructures and data types keyword list else if (wlStructsDataTypes.InList(cStatement)) { // Change the statement string to the structures and data types state scDoc.ChangeState(SCE_CLW_STRUCTURE_DATA_TYPE); } // Else if statement string is in the procedure attribute keyword list else if (wlAttributes.InList(cStatement)) { // Change the statement string to the procedure attribute state scDoc.ChangeState(SCE_CLW_ATTRIBUTE); } // Else if statement string is in the standard equate keyword list else if (wlStandardEquates.InList(cStatement)) { // Change the statement string to the standard equate state scDoc.ChangeState(SCE_CLW_STANDARD_EQUATE); } // Else if statement string is in the deprecated or legacy keyword list else if (wlLegacyStatements.InList(cStatement)) { // Change the statement string to the standard equate state scDoc.ChangeState(SCE_CLW_DEPRECATED); } // Else the statement string doesn't match any work list else { // Change the statement string to the default state scDoc.ChangeState(SCE_CLW_DEFAULT); } // Terminate the keyword state and set to default state scDoc.SetState(SCE_CLW_DEFAULT); } } // String State Handling else if (scDoc.state == SCE_CLW_STRING) { // If the character is an ' (single quote) if (scDoc.ch == '\'') { // Set the state to default and move forward colouring // the ' (single quote) as default state // terminating the string state scDoc.SetState(SCE_CLW_DEFAULT); scDoc.Forward(); } // If the next character is an ' (single quote) if (scDoc.chNext == '\'') { // Move forward one character and set to default state // colouring the next ' (single quote) as default state // terminating the string state scDoc.ForwardSetState(SCE_CLW_DEFAULT); scDoc.Forward(); } } // Picture String State Handling else if (scDoc.state == SCE_CLW_PICTURE_STRING) { // If the character is an ( (open parenthese) if (scDoc.ch == '(') { // Increment the parenthese level iParenthesesLevel++; } // Else if the character is a ) (close parenthese) else if (scDoc.ch == ')') { // If the parenthese level is set to zero // parentheses matched if (!iParenthesesLevel) { scDoc.SetState(SCE_CLW_DEFAULT); } // Else parenthese level is greater than zero // still looking for matching parentheses else { // Decrement the parenthese level iParenthesesLevel--; } } } // Standard Equate State Handling else if (scDoc.state == SCE_CLW_STANDARD_EQUATE) { if (!isalnum(scDoc.ch)) { scDoc.SetState(SCE_CLW_DEFAULT); } } // Integer Constant State Handling else if (scDoc.state == SCE_CLW_INTEGER_CONSTANT) { // If the character is not a digit (0-9) // or character is not a hexidecimal character (A-F) // or character is not a . (point) // or character is not a numberic base character (B,O,H) if (!(isdigit(scDoc.ch) || IsAHexCharacter(scDoc.ch, bCaseSensitive) || scDoc.ch == '.' || IsANumericBaseCharacter(scDoc.ch, bCaseSensitive))) { // If the number was a real if (SetNumericConstantState(scDoc)) { // Colour the matched string to the real constant state scDoc.ChangeState(SCE_CLW_REAL_CONSTANT); } // Else the number was an integer else { // Colour the matched string to an integer constant state scDoc.ChangeState(SCE_CLW_INTEGER_CONSTANT); } // Terminate the integer constant state and set to default state scDoc.SetState(SCE_CLW_DEFAULT); } } // // Determine if a new state should be entered. // // Beginning of Line Handling if (scDoc.atLineStart) { // Reset the column 1 label flag iColumn1Label = false; // If column 1 character is a label start character if (IsALabelStart(scDoc.ch)) { // Label character is found in column 1 // so set column 1 label flag and clear last column 1 label iColumn1Label = true; // Set the state to label scDoc.SetState(SCE_CLW_LABEL); } // else if character is a space or tab else if (IsASpace(scDoc.ch)){ // Set to default state scDoc.SetState(SCE_CLW_DEFAULT); } // else if comment start (!) or is an * (asterisk) else if (IsACommentStart(scDoc.ch) || scDoc.ch == '*' ) { // then set the state to comment. scDoc.SetState(SCE_CLW_COMMENT); } // else the character is a ? (question mark) else if (scDoc.ch == '?') { // Change to the compiler directive state, move forward, // colouring the ? (question mark), change back to default state. scDoc.ChangeState(SCE_CLW_COMPILER_DIRECTIVE); scDoc.Forward(); scDoc.SetState(SCE_CLW_DEFAULT); } // else an invalid character in column 1 else { // Set to error state scDoc.SetState(SCE_CLW_ERROR); } } // End of Line Handling else if (scDoc.atLineEnd) { // Reset to the default state at the end of each line. scDoc.SetState(SCE_CLW_DEFAULT); } // Default Handling else { // If in default state if (scDoc.state == SCE_CLW_DEFAULT) { // If is a letter could be a possible statement if (isalpha(scDoc.ch)) { // Set the state to Clarion Keyword and verify later scDoc.SetState(SCE_CLW_KEYWORD); } // else is a number else if (isdigit(scDoc.ch)) { // Set the state to Integer Constant and verify later scDoc.SetState(SCE_CLW_INTEGER_CONSTANT); } // else if the start of a comment or a | (line continuation) else if (IsACommentStart(scDoc.ch) || scDoc.ch == '|') { // then set the state to comment. scDoc.SetState(SCE_CLW_COMMENT); } // else if the character is a ' (single quote) else if (scDoc.ch == '\'') { // If the character is also a ' (single quote) // Embedded Apostrophe if (scDoc.chNext == '\'') { // Move forward colouring it as default state scDoc.ForwardSetState(SCE_CLW_DEFAULT); } else { // move to the next character and then set the state to comment. scDoc.ForwardSetState(SCE_CLW_STRING); } } // else the character is an @ (ampersand) else if (scDoc.ch == '@') { // Case insensitive. if (!bCaseSensitive) { // If character is a valid picture token character if (strchr("DEKNPSTdeknpst", scDoc.chNext) != NULL) { // Set to the picture string state scDoc.SetState(SCE_CLW_PICTURE_STRING); } } // Case sensitive else { // If character is a valid picture token character if (strchr("DEKNPST", scDoc.chNext) != NULL) { // Set the picture string state scDoc.SetState(SCE_CLW_PICTURE_STRING); } } } } } } // lexing complete scDoc.Complete(); } // Clarion Language Case Sensitive Colouring Procedure static void ColouriseClarionDocSensitive(unsigned int uiStartPos, int iLength, int iInitStyle, WordList *wlKeywords[], Accessor &accStyler) { ColouriseClarionDoc(uiStartPos, iLength, iInitStyle, wlKeywords, accStyler, true); } // Clarion Language Case Insensitive Colouring Procedure static void ColouriseClarionDocInsensitive(unsigned int uiStartPos, int iLength, int iInitStyle, WordList *wlKeywords[], Accessor &accStyler) { ColouriseClarionDoc(uiStartPos, iLength, iInitStyle, wlKeywords, accStyler, false); } // Fill Buffer static void FillBuffer(unsigned int uiStart, unsigned int uiEnd, Accessor &accStyler, char *szBuffer, unsigned int uiLength) { unsigned int uiPos = 0; while ((uiPos < uiEnd - uiStart + 1) && (uiPos < uiLength-1)) { szBuffer[uiPos] = static_cast(toupper(accStyler[uiStart + uiPos])); uiPos++; } szBuffer[uiPos] = '\0'; } // Classify Clarion Fold Point static int ClassifyClarionFoldPoint(int iLevel, const char* szString) { if (!(isdigit(szString[0]) || (szString[0] == '.'))) { if (strcmp(szString, "PROCEDURE") == 0) { // iLevel = SC_FOLDLEVELBASE + 1; } else if (strcmp(szString, "MAP") == 0 || strcmp(szString,"ACCEPT") == 0 || strcmp(szString,"BEGIN") == 0 || strcmp(szString,"CASE") == 0 || strcmp(szString,"EXECUTE") == 0 || strcmp(szString,"IF") == 0 || strcmp(szString,"ITEMIZE") == 0 || strcmp(szString,"INTERFACE") == 0 || strcmp(szString,"JOIN") == 0 || strcmp(szString,"LOOP") == 0 || strcmp(szString,"MODULE") == 0 || strcmp(szString,"RECORD") == 0) { iLevel++; } else if (strcmp(szString, "APPLICATION") == 0 || strcmp(szString, "CLASS") == 0 || strcmp(szString, "DETAIL") == 0 || strcmp(szString, "FILE") == 0 || strcmp(szString, "FOOTER") == 0 || strcmp(szString, "FORM") == 0 || strcmp(szString, "GROUP") == 0 || strcmp(szString, "HEADER") == 0 || strcmp(szString, "INTERFACE") == 0 || strcmp(szString, "MENU") == 0 || strcmp(szString, "MENUBAR") == 0 || strcmp(szString, "OLE") == 0 || strcmp(szString, "OPTION") == 0 || strcmp(szString, "QUEUE") == 0 || strcmp(szString, "REPORT") == 0 || strcmp(szString, "SHEET") == 0 || strcmp(szString, "TAB") == 0 || strcmp(szString, "TOOLBAR") == 0 || strcmp(szString, "VIEW") == 0 || strcmp(szString, "WINDOW") == 0) { iLevel++; } else if (strcmp(szString, "END") == 0 || strcmp(szString, "UNTIL") == 0 || strcmp(szString, "WHILE") == 0) { iLevel--; } } return(iLevel); } // Clarion Language Folding Procedure static void FoldClarionDoc(unsigned int uiStartPos, int iLength, int iInitStyle, WordList *[], Accessor &accStyler) { unsigned int uiEndPos = uiStartPos + iLength; int iLineCurrent = accStyler.GetLine(uiStartPos); int iLevelPrev = accStyler.LevelAt(iLineCurrent) & SC_FOLDLEVELNUMBERMASK; int iLevelCurrent = iLevelPrev; char chNext = accStyler[uiStartPos]; int iStyle = iInitStyle; int iStyleNext = accStyler.StyleAt(uiStartPos); int iVisibleChars = 0; int iLastStart = 0; for (unsigned int uiPos = uiStartPos; uiPos < uiEndPos; uiPos++) { char chChar = chNext; chNext = accStyler.SafeGetCharAt(uiPos + 1); int iStylePrev = iStyle; iStyle = iStyleNext; iStyleNext = accStyler.StyleAt(uiPos + 1); bool bEOL = (chChar == '\r' && chNext != '\n') || (chChar == '\n'); if (iStylePrev == SCE_CLW_DEFAULT) { if (iStyle == SCE_CLW_KEYWORD || iStyle == SCE_CLW_STRUCTURE_DATA_TYPE) { // Store last word start point. iLastStart = uiPos; } } if (iStylePrev == SCE_CLW_KEYWORD || iStylePrev == SCE_CLW_STRUCTURE_DATA_TYPE) { if(iswordchar(chChar) && !iswordchar(chNext)) { char chBuffer[100]; FillBuffer(iLastStart, uiPos, accStyler, chBuffer, sizeof(chBuffer)); iLevelCurrent = ClassifyClarionFoldPoint(iLevelCurrent,chBuffer); // if ((iLevelCurrent == SC_FOLDLEVELBASE + 1) && iLineCurrent > 1) { // accStyler.SetLevel(iLineCurrent-1,SC_FOLDLEVELBASE); // iLevelPrev = SC_FOLDLEVELBASE; // } } } if (bEOL) { int iLevel = iLevelPrev; if ((iLevelCurrent > iLevelPrev) && (iVisibleChars > 0)) iLevel |= SC_FOLDLEVELHEADERFLAG; if (iLevel != accStyler.LevelAt(iLineCurrent)) { accStyler.SetLevel(iLineCurrent,iLevel); } iLineCurrent++; iLevelPrev = iLevelCurrent; iVisibleChars = 0; } if (!isspacechar(chChar)) iVisibleChars++; } // Fill in the real level of the next line, keeping the current flags // as they will be filled in later. int iFlagsNext = accStyler.LevelAt(iLineCurrent) & ~SC_FOLDLEVELNUMBERMASK; accStyler.SetLevel(iLineCurrent, iLevelPrev | iFlagsNext); } // Word List Descriptions static const char * const rgWordListDescriptions[] = { "Clarion Keywords", "Compiler Directives", "Built-in Procedures and Functions", "Runtime Expressions", "Structure and Data Types", "Attributes", "Standard Equates", "Reserved Words (Labels)", "Reserved Words (Procedure Labels)", 0, }; // Case Sensitive Clarion Language Lexer LexerModule lmClw(SCLEX_CLW, ColouriseClarionDocSensitive, "clarion", FoldClarionDoc, rgWordListDescriptions); // Case Insensitive Clarion Language Lexer LexerModule lmClwNoCase(SCLEX_CLWNOCASE, ColouriseClarionDocInsensitive, "clarionnocase", FoldClarionDoc, rgWordListDescriptions); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/Selection.h000444001750001750 1236511727344243 24522 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file Selection.h ** Classes maintaining the selection. **/ // Copyright 2009 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #ifndef SELECTION_H #define SELECTION_H #ifdef SCI_NAMESPACE namespace Scintilla { #endif class SelectionPosition { int position; int virtualSpace; public: explicit SelectionPosition(int position_=INVALID_POSITION, int virtualSpace_=0) : position(position_), virtualSpace(virtualSpace_) { PLATFORM_ASSERT(virtualSpace < 800000); if (virtualSpace < 0) virtualSpace = 0; } void Reset() { position = 0; virtualSpace = 0; } void MoveForInsertDelete(bool insertion, int startChange, int length); bool operator ==(const SelectionPosition &other) const { return position == other.position && virtualSpace == other.virtualSpace; } bool operator <(const SelectionPosition &other) const; bool operator >(const SelectionPosition &other) const; bool operator <=(const SelectionPosition &other) const; bool operator >=(const SelectionPosition &other) const; int Position() const { return position; } void SetPosition(int position_) { position = position_; virtualSpace = 0; } int VirtualSpace() const { return virtualSpace; } void SetVirtualSpace(int virtualSpace_) { PLATFORM_ASSERT(virtualSpace_ < 800000); if (virtualSpace_ >= 0) virtualSpace = virtualSpace_; } void Add(int increment) { position = position + increment; } bool IsValid() const { return position >= 0; } }; // Ordered range to make drawing simpler struct SelectionSegment { SelectionPosition start; SelectionPosition end; SelectionSegment() : start(), end() { } SelectionSegment(SelectionPosition a, SelectionPosition b) { if (a < b) { start = a; end = b; } else { start = b; end = a; } } bool Empty() const { return start == end; } void Extend(SelectionPosition p) { if (start > p) start = p; if (end < p) end = p; } }; struct SelectionRange { SelectionPosition caret; SelectionPosition anchor; SelectionRange() : caret(), anchor() { } SelectionRange(SelectionPosition single) : caret(single), anchor(single) { } SelectionRange(int single) : caret(single), anchor(single) { } SelectionRange(SelectionPosition caret_, SelectionPosition anchor_) : caret(caret_), anchor(anchor_) { } SelectionRange(int caret_, int anchor_) : caret(caret_), anchor(anchor_) { } bool Empty() const { return anchor == caret; } int Length() const; // int Width() const; // Like Length but takes virtual space into account bool operator ==(const SelectionRange &other) const { return caret == other.caret && anchor == other.anchor; } bool operator <(const SelectionRange &other) const { return caret < other.caret || ((caret == other.caret) && (anchor < other.anchor)); } void Reset() { anchor.Reset(); caret.Reset(); } void ClearVirtualSpace() { anchor.SetVirtualSpace(0); caret.SetVirtualSpace(0); } bool Contains(int pos) const; bool Contains(SelectionPosition sp) const; bool ContainsCharacter(int posCharacter) const; SelectionSegment Intersect(SelectionSegment check) const; SelectionPosition Start() const { return (anchor < caret) ? anchor : caret; } SelectionPosition End() const { return (anchor < caret) ? caret : anchor; } bool Trim(SelectionRange range); // If range is all virtual collapse to start of virtual space void MinimizeVirtualSpace(); }; class Selection { std::vector ranges; std::vector rangesSaved; SelectionRange rangeRectangular; size_t mainRange; bool moveExtends; bool tentativeMain; public: enum selTypes { noSel, selStream, selRectangle, selLines, selThin }; selTypes selType; Selection(); ~Selection(); bool IsRectangular() const; int MainCaret() const; int MainAnchor() const; SelectionRange &Rectangular(); SelectionSegment Limits() const; // This is for when you want to move the caret in response to a // user direction command - for rectangular selections, use the range // that covers all selected text otherwise return the main selection. SelectionSegment LimitsForRectangularElseMain() const; size_t Count() const; size_t Main() const; void SetMain(size_t r); SelectionRange &Range(size_t r); SelectionRange &RangeMain(); bool MoveExtends() const; void SetMoveExtends(bool moveExtends_); bool Empty() const; SelectionPosition Last() const; int Length() const; void MovePositions(bool insertion, int startChange, int length); void TrimSelection(SelectionRange range); void SetSelection(SelectionRange range); void AddSelection(SelectionRange range); void AddSelectionWithoutTrim(SelectionRange range); void TentativeSelection(SelectionRange range); void CommitTentative(); int CharacterInSelection(int posCharacter) const; int InSelectionForEOL(int pos) const; int VirtualSpaceFor(int pos) const; void Clear(); void RemoveDuplicates(); void RotateMain(); bool Tentative() const { return tentativeMain; } std::vector RangesCopy() const { return ranges; } }; #ifdef SCI_NAMESPACE } #endif #endif Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexProgress.cxx000444001750001750 2224411727344243 25422 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexProgress.cxx ** Lexer for Progress 4GL. ** Based on LexCPP.cxx of Neil Hodgson **/ // Copyright 2006-2007 by Yuval Papish // The License.txt file describes the conditions under which this software may be distributed. /** TODO: WebSpeed support in html lexer Support "end triggers" expression of the triggers phrase Support more than 6 comments levels **/ #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static inline bool IsAWordChar(int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '_'); } static inline bool IsAWordStart(int ch) { return (ch < 0x80) && (isalpha(ch) || ch == '_'); } enum SentenceStart { SetSentenceStart = 0xf, ResetSentenceStart = 0x10}; // true -> bit = 0 static void Colourise4glDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { WordList &keywords1 = *keywordlists[0]; // regular keywords WordList &keywords2 = *keywordlists[1]; // block opening keywords, only when SentenceStart WordList &keywords3 = *keywordlists[2]; // block opening keywords //WordList &keywords4 = *keywordlists[3]; // preprocessor keywords. Not implemented int visibleChars = 0; int mask; StyleContext sc(startPos, length, initStyle, styler); for (; sc.More(); sc.Forward()) { if (sc.atLineStart) { // Reset states to begining of colourise so no surprises // if different sets of lines lexed. visibleChars = 0; } // Handle line continuation generically. if ((sc.state & 0xf) < SCE_4GL_COMMENT1) { if (sc.ch == '~') { if (sc.chNext > ' ') { // skip special char after ~ sc.Forward(); continue; } else { // Skip whitespace between ~ and EOL while (sc.More() && (sc.chNext == ' ' || sc.chNext == '\t') ) { sc.Forward(); } if (sc.chNext == '\n' || sc.chNext == '\r') { sc.Forward(); if (sc.ch == '\r' && sc.chNext == '\n') { sc.Forward(); } sc.Forward(); continue; } } } } // Determine if a new state should be terminated. mask = sc.state & 0x10; switch (sc.state & 0xf) { case SCE_4GL_OPERATOR: sc.SetState(SCE_4GL_DEFAULT | mask); break; case SCE_4GL_NUMBER: if (!(IsADigit(sc.ch))) { sc.SetState(SCE_4GL_DEFAULT | mask); } break; case SCE_4GL_IDENTIFIER: if (!IsAWordChar(sc.ch) && sc.ch != '-') { char s[1000]; sc.GetCurrentLowered(s, sizeof(s)); if ((((sc.state & 0x10) == 0) && keywords2.InList(s)) || keywords3.InList(s)) { sc.ChangeState(SCE_4GL_BLOCK | ResetSentenceStart); } else if (keywords1.InList(s)) { if ((s[0] == 'e' && s[1] =='n' && s[2] == 'd' && !isalnum(s[3]) && s[3] != '-') || (s[0] == 'f' && s[1] =='o' && s[2] == 'r' && s[3] == 'w' && s[4] =='a' && s[5] == 'r' && s[6] == 'd'&& !isalnum(s[7]))) { sc.ChangeState(SCE_4GL_END | ResetSentenceStart); } else if ((s[0] == 'e' && s[1] =='l' && s[2] == 's' && s[3] == 'e') || (s[0] == 't' && s[1] =='h' && s[2] == 'e' && s[3] == 'n')) { sc.ChangeState(SCE_4GL_WORD & SetSentenceStart); } else { sc.ChangeState(SCE_4GL_WORD | ResetSentenceStart); } } sc.SetState(SCE_4GL_DEFAULT | (sc.state & 0x10)); } break; case SCE_4GL_PREPROCESSOR: if (sc.atLineStart) { sc.SetState(SCE_4GL_DEFAULT & SetSentenceStart); } /* code removed to allow comments inside preprocessor else if (sc.ch == '*' && sc.chNext == '/') { sc.ForwardSetState(SCE_4GL_DEFAULT | sentenceStartState); } */ break; case SCE_4GL_STRING: if (sc.ch == '\"') { sc.ForwardSetState(SCE_4GL_DEFAULT | mask); } break; case SCE_4GL_CHARACTER: if (sc.ch == '\'') { sc.ForwardSetState(SCE_4GL_DEFAULT | mask); } break; default: if ((sc.state & 0xf) >= SCE_4GL_COMMENT1) { if (sc.ch == '*' && sc.chNext == '/') { sc.Forward(); if ((sc.state & 0xf) == SCE_4GL_COMMENT1) { sc.ForwardSetState(SCE_4GL_DEFAULT | mask); } else sc.SetState((sc.state & 0x1f) - 1); } else if (sc.ch == '/' && sc.chNext == '*') { sc.Forward(); sc.SetState((sc.state & 0x1f) + 1); } } } // Determine if a new state should be entered. mask = sc.state & 0x10; if ((sc.state & 0xf) == SCE_4GL_DEFAULT) { if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) { sc.SetState(SCE_4GL_NUMBER | ResetSentenceStart); } else if (IsAWordStart(sc.ch) || (sc.ch == '@')) { sc.SetState(SCE_4GL_IDENTIFIER | mask); } else if (sc.ch == '/' && sc.chNext == '*') { sc.SetState(SCE_4GL_COMMENT1 | mask); sc.Forward(); } else if (sc.ch == '\"') { sc.SetState(SCE_4GL_STRING | ResetSentenceStart); } else if (sc.ch == '\'') { sc.SetState(SCE_4GL_CHARACTER | ResetSentenceStart); } else if (sc.ch == '&' && visibleChars == 0 && ((sc.state & 0x10) == 0)) { sc.SetState(SCE_4GL_PREPROCESSOR | ResetSentenceStart); // Skip whitespace between & and preprocessor word do { sc.Forward(); } while ((sc.ch == ' ' || sc.ch == '\t') && sc.More()); // Handle syntactical line termination } else if ((sc.ch == '.' || sc.ch == ':' || sc.ch == '}') && (sc.chNext == ' ' || sc.chNext == '\t' || sc.chNext == '\n' || sc.chNext == '\r')) { sc.SetState(sc.state & SetSentenceStart); } else if (isoperator(static_cast(sc.ch))) { /* This code allows highlight of handles. Alas, it would cause the phrase "last-event:function" to be recognized as a BlockBegin */ if (sc.ch == ':') sc.SetState(SCE_4GL_OPERATOR & SetSentenceStart); /* else */ sc.SetState(SCE_4GL_OPERATOR | ResetSentenceStart); } } if (!IsASpace(sc.ch)) { visibleChars++; } } sc.Complete(); } static bool IsStreamCommentStyle(int style) { return (style & 0xf) >= SCE_4GL_COMMENT1 ; } // Store both the current line's fold level and the next lines in the // level store to make it easy to pick up with each increment // and to make it possible to fiddle the current level for "} else {". static void FoldNoBox4glDoc(unsigned int startPos, int length, int initStyle, Accessor &styler) { bool foldComment = styler.GetPropertyInt("fold.comment") != 0; bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; bool foldAtElse = styler.GetPropertyInt("fold.at.else", 0) != 0; unsigned int endPos = startPos + length; int visibleChars = 0; int lineCurrent = styler.GetLine(startPos); int levelCurrent = SC_FOLDLEVELBASE; if (lineCurrent > 0) levelCurrent = styler.LevelAt(lineCurrent-1) >> 16; int levelMinCurrent = levelCurrent; int levelNext = levelCurrent; char chNext = static_cast(tolower(styler[startPos])); int styleNext = styler.StyleAt(startPos); int style = initStyle; for (unsigned int i = startPos; i < endPos; i++) { char ch = chNext; chNext = static_cast(tolower(styler.SafeGetCharAt(i + 1))); int stylePrev = style; style = styleNext; styleNext = styler.StyleAt(i + 1); bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); if (foldComment && IsStreamCommentStyle(style)) { if (!IsStreamCommentStyle(stylePrev)) { levelNext++; } else if (!IsStreamCommentStyle(styleNext)) { // && !atEOL) { // Comments don't end at end of line and the next character may be unstyled. levelNext--; } } else if ((style & 0xf) == SCE_4GL_BLOCK && !isalnum(chNext)) { levelNext++; } else if ((style & 0xf) == SCE_4GL_END && (ch == 'e' || ch == 'f')) { levelNext--; } if (atEOL) { int levelUse = levelCurrent; if (foldAtElse) { levelUse = levelMinCurrent; } int lev = levelUse | levelNext << 16; if (visibleChars == 0 && foldCompact) lev |= SC_FOLDLEVELWHITEFLAG; if (levelUse < levelNext) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) { styler.SetLevel(lineCurrent, lev); } lineCurrent++; levelCurrent = levelNext; levelMinCurrent = levelCurrent; visibleChars = 0; } if (!isspacechar(ch)) visibleChars++; } } static void Fold4glDoc(unsigned int startPos, int length, int initStyle, WordList *[], Accessor &styler) { FoldNoBox4glDoc(startPos, length, initStyle, styler); } static const char * const FglWordLists[] = { "Primary keywords and identifiers", "Secondary keywords and identifiers", "Documentation comment keywords", "Unused", "Global classes and typedefs", 0, }; LexerModule lmProgress(SCLEX_PROGRESS, Colourise4glDoc, "progress", Fold4glDoc, FglWordLists); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexMSSQL.cxx000444001750001750 2737411727344243 24526 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexMSSQL.cxx ** Lexer for MSSQL. **/ // By Filip Yaghob // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif #define KW_MSSQL_STATEMENTS 0 #define KW_MSSQL_DATA_TYPES 1 #define KW_MSSQL_SYSTEM_TABLES 2 #define KW_MSSQL_GLOBAL_VARIABLES 3 #define KW_MSSQL_FUNCTIONS 4 #define KW_MSSQL_STORED_PROCEDURES 5 #define KW_MSSQL_OPERATORS 6 static bool isMSSQLOperator(char ch) { if (isascii(ch) && isalnum(ch)) return false; // '.' left out as it is used to make up numbers if (ch == '%' || ch == '^' || ch == '&' || ch == '*' || ch == '-' || ch == '+' || ch == '=' || ch == '|' || ch == '<' || ch == '>' || ch == '/' || ch == '!' || ch == '~' || ch == '(' || ch == ')' || ch == ',') return true; return false; } static char classifyWordSQL(unsigned int start, unsigned int end, WordList *keywordlists[], Accessor &styler, unsigned int actualState, unsigned int prevState) { char s[256]; bool wordIsNumber = isdigit(styler[start]) || (styler[start] == '.'); WordList &kwStatements = *keywordlists[KW_MSSQL_STATEMENTS]; WordList &kwDataTypes = *keywordlists[KW_MSSQL_DATA_TYPES]; WordList &kwSystemTables = *keywordlists[KW_MSSQL_SYSTEM_TABLES]; WordList &kwGlobalVariables = *keywordlists[KW_MSSQL_GLOBAL_VARIABLES]; WordList &kwFunctions = *keywordlists[KW_MSSQL_FUNCTIONS]; WordList &kwStoredProcedures = *keywordlists[KW_MSSQL_STORED_PROCEDURES]; WordList &kwOperators = *keywordlists[KW_MSSQL_OPERATORS]; for (unsigned int i = 0; i < end - start + 1 && i < 128; i++) { s[i] = static_cast(tolower(styler[start + i])); s[i + 1] = '\0'; } char chAttr = SCE_MSSQL_IDENTIFIER; if (actualState == SCE_MSSQL_GLOBAL_VARIABLE) { if (kwGlobalVariables.InList(&s[2])) chAttr = SCE_MSSQL_GLOBAL_VARIABLE; } else if (wordIsNumber) { chAttr = SCE_MSSQL_NUMBER; } else if (prevState == SCE_MSSQL_DEFAULT_PREF_DATATYPE) { // Look first in datatypes if (kwDataTypes.InList(s)) chAttr = SCE_MSSQL_DATATYPE; else if (kwOperators.InList(s)) chAttr = SCE_MSSQL_OPERATOR; else if (kwStatements.InList(s)) chAttr = SCE_MSSQL_STATEMENT; else if (kwSystemTables.InList(s)) chAttr = SCE_MSSQL_SYSTABLE; else if (kwFunctions.InList(s)) chAttr = SCE_MSSQL_FUNCTION; else if (kwStoredProcedures.InList(s)) chAttr = SCE_MSSQL_STORED_PROCEDURE; } else { if (kwOperators.InList(s)) chAttr = SCE_MSSQL_OPERATOR; else if (kwStatements.InList(s)) chAttr = SCE_MSSQL_STATEMENT; else if (kwSystemTables.InList(s)) chAttr = SCE_MSSQL_SYSTABLE; else if (kwFunctions.InList(s)) chAttr = SCE_MSSQL_FUNCTION; else if (kwStoredProcedures.InList(s)) chAttr = SCE_MSSQL_STORED_PROCEDURE; else if (kwDataTypes.InList(s)) chAttr = SCE_MSSQL_DATATYPE; } styler.ColourTo(end, chAttr); return chAttr; } static void ColouriseMSSQLDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { styler.StartAt(startPos); bool fold = styler.GetPropertyInt("fold") != 0; int lineCurrent = styler.GetLine(startPos); int spaceFlags = 0; int state = initStyle; int prevState = initStyle; char chPrev = ' '; char chNext = styler[startPos]; styler.StartSegment(startPos); unsigned int lengthDoc = startPos + length; for (unsigned int i = startPos; i < lengthDoc; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); if ((ch == '\r' && chNext != '\n') || (ch == '\n')) { int indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags); int lev = indentCurrent; if (!(indentCurrent & SC_FOLDLEVELWHITEFLAG)) { // Only non whitespace lines can be headers int indentNext = styler.IndentAmount(lineCurrent + 1, &spaceFlags); if (indentCurrent < (indentNext & ~SC_FOLDLEVELWHITEFLAG)) { lev |= SC_FOLDLEVELHEADERFLAG; } } if (fold) { styler.SetLevel(lineCurrent, lev); } } if (styler.IsLeadByte(ch)) { chNext = styler.SafeGetCharAt(i + 2); chPrev = ' '; i += 1; continue; } // When the last char isn't part of the state (have to deal with it too)... if ( (state == SCE_MSSQL_IDENTIFIER) || (state == SCE_MSSQL_STORED_PROCEDURE) || (state == SCE_MSSQL_DATATYPE) || //~ (state == SCE_MSSQL_COLUMN_NAME) || (state == SCE_MSSQL_FUNCTION) || //~ (state == SCE_MSSQL_GLOBAL_VARIABLE) || (state == SCE_MSSQL_VARIABLE)) { if (!iswordchar(ch)) { int stateTmp; if ((state == SCE_MSSQL_VARIABLE) || (state == SCE_MSSQL_COLUMN_NAME)) { styler.ColourTo(i - 1, state); stateTmp = state; } else stateTmp = classifyWordSQL(styler.GetStartSegment(), i - 1, keywordlists, styler, state, prevState); prevState = state; if (stateTmp == SCE_MSSQL_IDENTIFIER || stateTmp == SCE_MSSQL_VARIABLE) state = SCE_MSSQL_DEFAULT_PREF_DATATYPE; else state = SCE_MSSQL_DEFAULT; } } else if (state == SCE_MSSQL_LINE_COMMENT) { if (ch == '\r' || ch == '\n') { styler.ColourTo(i - 1, state); prevState = state; state = SCE_MSSQL_DEFAULT; } } else if (state == SCE_MSSQL_GLOBAL_VARIABLE) { if ((ch != '@') && !iswordchar(ch)) { classifyWordSQL(styler.GetStartSegment(), i - 1, keywordlists, styler, state, prevState); prevState = state; state = SCE_MSSQL_DEFAULT; } } // If is the default or one of the above succeeded if (state == SCE_MSSQL_DEFAULT || state == SCE_MSSQL_DEFAULT_PREF_DATATYPE) { if (iswordstart(ch)) { styler.ColourTo(i - 1, SCE_MSSQL_DEFAULT); prevState = state; state = SCE_MSSQL_IDENTIFIER; } else if (ch == '/' && chNext == '*') { styler.ColourTo(i - 1, SCE_MSSQL_DEFAULT); prevState = state; state = SCE_MSSQL_COMMENT; } else if (ch == '-' && chNext == '-') { styler.ColourTo(i - 1, SCE_MSSQL_DEFAULT); prevState = state; state = SCE_MSSQL_LINE_COMMENT; } else if (ch == '\'') { styler.ColourTo(i - 1, SCE_MSSQL_DEFAULT); prevState = state; state = SCE_MSSQL_STRING; } else if (ch == '"') { styler.ColourTo(i - 1, SCE_MSSQL_DEFAULT); prevState = state; state = SCE_MSSQL_COLUMN_NAME; } else if (ch == '[') { styler.ColourTo(i - 1, SCE_MSSQL_DEFAULT); prevState = state; state = SCE_MSSQL_COLUMN_NAME_2; } else if (isMSSQLOperator(ch)) { styler.ColourTo(i - 1, SCE_MSSQL_DEFAULT); styler.ColourTo(i, SCE_MSSQL_OPERATOR); //~ style = SCE_MSSQL_DEFAULT; prevState = state; state = SCE_MSSQL_DEFAULT; } else if (ch == '@') { styler.ColourTo(i - 1, SCE_MSSQL_DEFAULT); prevState = state; if (chNext == '@') { state = SCE_MSSQL_GLOBAL_VARIABLE; // i += 2; } else state = SCE_MSSQL_VARIABLE; } // When the last char is part of the state... } else if (state == SCE_MSSQL_COMMENT) { if (ch == '/' && chPrev == '*') { if (((i > (styler.GetStartSegment() + 2)) || ((initStyle == SCE_MSSQL_COMMENT) && (styler.GetStartSegment() == startPos)))) { styler.ColourTo(i, state); //~ state = SCE_MSSQL_COMMENT; prevState = state; state = SCE_MSSQL_DEFAULT; } } } else if (state == SCE_MSSQL_STRING) { if (ch == '\'') { if ( chNext == '\'' ) { i++; ch = chNext; chNext = styler.SafeGetCharAt(i + 1); } else { styler.ColourTo(i, state); prevState = state; state = SCE_MSSQL_DEFAULT; //i++; } //ch = chNext; //chNext = styler.SafeGetCharAt(i + 1); } } else if (state == SCE_MSSQL_COLUMN_NAME) { if (ch == '"') { if (chNext == '"') { i++; ch = chNext; chNext = styler.SafeGetCharAt(i + 1); } else { styler.ColourTo(i, state); prevState = state; state = SCE_MSSQL_DEFAULT_PREF_DATATYPE; //i++; } } } else if (state == SCE_MSSQL_COLUMN_NAME_2) { if (ch == ']') { styler.ColourTo(i, state); prevState = state; state = SCE_MSSQL_DEFAULT_PREF_DATATYPE; //i++; } } chPrev = ch; } styler.ColourTo(lengthDoc - 1, state); } static void FoldMSSQLDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) { bool foldComment = styler.GetPropertyInt("fold.comment") != 0; bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; unsigned int endPos = startPos + length; int visibleChars = 0; int lineCurrent = styler.GetLine(startPos); int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; int levelCurrent = levelPrev; char chNext = styler[startPos]; bool inComment = (styler.StyleAt(startPos-1) == SCE_MSSQL_COMMENT); char s[10]; for (unsigned int i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); int style = styler.StyleAt(i); bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); // Comment folding if (foldComment) { if (!inComment && (style == SCE_MSSQL_COMMENT)) levelCurrent++; else if (inComment && (style != SCE_MSSQL_COMMENT)) levelCurrent--; inComment = (style == SCE_MSSQL_COMMENT); } if (style == SCE_MSSQL_STATEMENT) { // Folding between begin or case and end if (ch == 'b' || ch == 'B' || ch == 'c' || ch == 'C' || ch == 'e' || ch == 'E') { for (unsigned int j = 0; j < 5; j++) { if (!iswordchar(styler[i + j])) { break; } s[j] = static_cast(tolower(styler[i + j])); s[j + 1] = '\0'; } if ((strcmp(s, "begin") == 0) || (strcmp(s, "case") == 0)) { levelCurrent++; } if (strcmp(s, "end") == 0) { levelCurrent--; } } } if (atEOL) { int lev = levelPrev; if (visibleChars == 0 && foldCompact) lev |= SC_FOLDLEVELWHITEFLAG; if ((levelCurrent > levelPrev) && (visibleChars > 0)) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) { styler.SetLevel(lineCurrent, lev); } lineCurrent++; levelPrev = levelCurrent; visibleChars = 0; } if (!isspacechar(ch)) visibleChars++; } // Fill in the real level of the next line, keeping the current flags as they will be filled in later int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; styler.SetLevel(lineCurrent, levelPrev | flagsNext); } static const char * const sqlWordListDesc[] = { "Statements", "Data Types", "System tables", "Global variables", "Functions", "System Stored Procedures", "Operators", 0, }; LexerModule lmMSSQL(SCLEX_MSSQL, ColouriseMSSQLDoc, "mssql", FoldMSSQLDoc, sqlWordListDesc); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexTADS3.cxx000444001750001750 11272211727344243 24455 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexTADS3.cxx ** Lexer for TADS3. **/ // Copyright 1998-2006 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. /* * TADS3 is a language designed by Michael J. Roberts for the writing of text * based games. TADS comes from Text Adventure Development System. It has good * support for the processing and outputting of formatted text and much of a * TADS program listing consists of strings. * * TADS has two types of strings, those enclosed in single quotes (') and those * enclosed in double quotes ("). These strings have different symantics and * can be given different highlighting if desired. * * There can be embedded within both types of strings html tags * ( ), library directives ( <.directive> ), and message * parameters ( {The doctor's/his} ). * * Double quoted strings can also contain interpolated expressions * ( << rug.moved ? ' and a hole in the floor. ' : nil >> ). These expressions * may themselves contain single or double quoted strings, although the double * quoted strings may not contain interpolated expressions. * * These embedded constructs influence the output and formatting and are an * important part of a program and require highlighting. * * LINKS * http://www.tads.org/ */ #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static const int T3_SINGLE_QUOTE = 1; static const int T3_INT_EXPRESSION = 2; static const int T3_INT_EXPRESSION_IN_TAG = 4; static const int T3_HTML_SQUOTE = 8; static inline bool IsEOL(const int ch, const int chNext) { return (ch == '\r' && chNext != '\n') || (ch == '\n'); } /* * Test the current character to see if it's the START of an EOL sequence; * if so, skip ahead to the last character of the sequence and return true, * and if not just return false. There are a few places where we want to * check to see if a newline sequence occurs at a particular point, but * where a caller expects a subroutine to stop only upon reaching the END * of a newline sequence (in particular, CR-LF on Windows). That's why * IsEOL() above only returns true on CR if the CR isn't followed by an LF * - it doesn't want to admit that there's a newline until reaching the END * of the sequence. We meet both needs by saying that there's a newline * when we see the CR in a CR-LF, but skipping the CR before returning so * that the caller's caller will see that we've stopped at the LF. */ static inline bool IsEOLSkip(StyleContext &sc) { /* test for CR-LF */ if (sc.ch == '\r' && sc.chNext == '\n') { /* got CR-LF - skip the CR and indicate that we're at a newline */ sc.Forward(); return true; } /* * in other cases, we have at most a 1-character newline, so do the * normal IsEOL test */ return IsEOL(sc.ch, sc.chNext); } static inline bool IsATADS3Operator(const int ch) { return ch == '=' || ch == '{' || ch == '}' || ch == '(' || ch == ')' || ch == '[' || ch == ']' || ch == ',' || ch == ':' || ch == ';' || ch == '+' || ch == '-' || ch == '*' || ch == '/' || ch == '%' || ch == '?' || ch == '!' || ch == '<' || ch == '>' || ch == '|' || ch == '@' || ch == '&' || ch == '~'; } static inline bool IsAWordChar(const int ch) { return isalnum(ch) || ch == '_'; } static inline bool IsAWordStart(const int ch) { return isalpha(ch) || ch == '_'; } static inline bool IsAHexDigit(const int ch) { int lch = tolower(ch); return isdigit(lch) || lch == 'a' || lch == 'b' || lch == 'c' || lch == 'd' || lch == 'e' || lch == 'f'; } static inline bool IsAnHTMLChar(int ch) { return isalnum(ch) || ch == '-' || ch == '_' || ch == '.'; } static inline bool IsADirectiveChar(int ch) { return isalnum(ch) || isspace(ch) || ch == '-' || ch == '/'; } static inline bool IsANumberStart(StyleContext &sc) { return isdigit(sc.ch) || (!isdigit(sc.chPrev) && sc.ch == '.' && isdigit(sc.chNext)); } inline static void ColouriseTADS3Operator(StyleContext &sc) { int initState = sc.state; int c = sc.ch; sc.SetState(c == '{' || c == '}' ? SCE_T3_BRACE : SCE_T3_OPERATOR); sc.ForwardSetState(initState); } static void ColouriseTADSHTMLString(StyleContext &sc, int &lineState) { int endState = sc.state; int chQuote = sc.ch; int chString = (lineState & T3_SINGLE_QUOTE) ? '\'' : '"'; if (endState == SCE_T3_HTML_STRING) { if (lineState&T3_SINGLE_QUOTE) { endState = SCE_T3_S_STRING; chString = '\''; } else if (lineState&T3_INT_EXPRESSION) { endState = SCE_T3_X_STRING; chString = '"'; } else { endState = SCE_T3_HTML_DEFAULT; chString = '"'; } chQuote = (lineState & T3_HTML_SQUOTE) ? '\'' : '"'; } else { sc.SetState(SCE_T3_HTML_STRING); sc.Forward(); } if (chQuote == '"') lineState &= ~T3_HTML_SQUOTE; else lineState |= T3_HTML_SQUOTE; while (sc.More()) { if (IsEOL(sc.ch, sc.chNext)) { return; } if (sc.ch == chQuote) { sc.ForwardSetState(endState); return; } if (sc.Match('\\', static_cast(chQuote))) { sc.Forward(2); sc.SetState(endState); return; } if (sc.ch == chString) { sc.SetState(SCE_T3_DEFAULT); return; } if (sc.Match('<', '<')) { lineState |= T3_INT_EXPRESSION | T3_INT_EXPRESSION_IN_TAG; sc.SetState(SCE_T3_X_DEFAULT); sc.Forward(2); return; } if (sc.Match('\\', static_cast(chQuote)) || sc.Match('\\', static_cast(chString)) || sc.Match('\\', '\\')) { sc.Forward(2); } else { sc.Forward(); } } } static void ColouriseTADS3HTMLTagStart(StyleContext &sc) { sc.SetState(SCE_T3_HTML_TAG); sc.Forward(); if (sc.ch == '/') { sc.Forward(); } while (IsAnHTMLChar(sc.ch)) { sc.Forward(); } } static void ColouriseTADS3HTMLTag(StyleContext &sc, int &lineState) { int endState = sc.state; int chQuote = '"'; int chString = '\''; switch (endState) { case SCE_T3_S_STRING: ColouriseTADS3HTMLTagStart(sc); sc.SetState(SCE_T3_HTML_DEFAULT); chQuote = '\''; chString = '"'; break; case SCE_T3_D_STRING: case SCE_T3_X_STRING: ColouriseTADS3HTMLTagStart(sc); sc.SetState(SCE_T3_HTML_DEFAULT); break; case SCE_T3_HTML_DEFAULT: if (lineState&T3_SINGLE_QUOTE) { endState = SCE_T3_S_STRING; chQuote = '\''; chString = '"'; } else if (lineState&T3_INT_EXPRESSION) { endState = SCE_T3_X_STRING; } else { endState = SCE_T3_D_STRING; } break; } while (sc.More()) { if (IsEOL(sc.ch, sc.chNext)) { return; } if (sc.Match('/', '>')) { sc.SetState(SCE_T3_HTML_TAG); sc.Forward(2); sc.SetState(endState); return; } if (sc.ch == '>') { sc.SetState(SCE_T3_HTML_TAG); sc.ForwardSetState(endState); return; } if (sc.ch == chQuote) { sc.SetState(endState); return; } if (sc.Match('\\', static_cast(chQuote))) { sc.Forward(); ColouriseTADSHTMLString(sc, lineState); if (sc.state == SCE_T3_X_DEFAULT) break; } else if (sc.ch == chString) { ColouriseTADSHTMLString(sc, lineState); } else if (sc.ch == '=') { ColouriseTADS3Operator(sc); } else { sc.Forward(); } } } static void ColouriseTADS3Keyword(StyleContext &sc, WordList *keywordlists[], unsigned int endPos) { char s[250]; WordList &keywords = *keywordlists[0]; WordList &userwords1 = *keywordlists[1]; WordList &userwords2 = *keywordlists[2]; WordList &userwords3 = *keywordlists[3]; int initState = sc.state; sc.SetState(SCE_T3_IDENTIFIER); while (sc.More() && (IsAWordChar(sc.ch))) { sc.Forward(); } sc.GetCurrent(s, sizeof(s)); if ( strcmp(s, "is") == 0 || strcmp(s, "not") == 0) { // have to find if "in" is next int n = 1; while (n + sc.currentPos < endPos && IsASpaceOrTab(sc.GetRelative(n))) n++; if (sc.GetRelative(n) == 'i' && sc.GetRelative(n+1) == 'n') { sc.Forward(n+2); sc.ChangeState(SCE_T3_KEYWORD); } } else if (keywords.InList(s)) { sc.ChangeState(SCE_T3_KEYWORD); } else if (userwords3.InList(s)) { sc.ChangeState(SCE_T3_USER3); } else if (userwords2.InList(s)) { sc.ChangeState(SCE_T3_USER2); } else if (userwords1.InList(s)) { sc.ChangeState(SCE_T3_USER1); } sc.SetState(initState); } static void ColouriseTADS3MsgParam(StyleContext &sc, int &lineState) { int endState = sc.state; int chQuote = '"'; switch (endState) { case SCE_T3_S_STRING: sc.SetState(SCE_T3_MSG_PARAM); sc.Forward(); chQuote = '\''; break; case SCE_T3_D_STRING: case SCE_T3_X_STRING: sc.SetState(SCE_T3_MSG_PARAM); sc.Forward(); break; case SCE_T3_MSG_PARAM: if (lineState&T3_SINGLE_QUOTE) { endState = SCE_T3_S_STRING; chQuote = '\''; } else if (lineState&T3_INT_EXPRESSION) { endState = SCE_T3_X_STRING; } else { endState = SCE_T3_D_STRING; } break; } while (sc.More() && sc.ch != '}' && sc.ch != chQuote) { if (IsEOL(sc.ch, sc.chNext)) { return; } if (sc.ch == '\\') { sc.Forward(); } sc.Forward(); } if (sc.ch == chQuote) { sc.SetState(endState); } else { sc.ForwardSetState(endState); } } static void ColouriseTADS3LibDirective(StyleContext &sc, int &lineState) { int initState = sc.state; int chQuote = '"'; switch (initState) { case SCE_T3_S_STRING: sc.SetState(SCE_T3_LIB_DIRECTIVE); sc.Forward(2); chQuote = '\''; break; case SCE_T3_D_STRING: sc.SetState(SCE_T3_LIB_DIRECTIVE); sc.Forward(2); break; case SCE_T3_LIB_DIRECTIVE: if (lineState&T3_SINGLE_QUOTE) { initState = SCE_T3_S_STRING; chQuote = '\''; } else { initState = SCE_T3_D_STRING; } break; } while (sc.More() && IsADirectiveChar(sc.ch)) { if (IsEOL(sc.ch, sc.chNext)) { return; } sc.Forward(); }; if (sc.ch == '>' || !sc.More()) { sc.ForwardSetState(initState); } else if (sc.ch == chQuote) { sc.SetState(initState); } else { sc.ChangeState(initState); sc.Forward(); } } static void ColouriseTADS3String(StyleContext &sc, int &lineState) { int chQuote = sc.ch; int endState = sc.state; switch (sc.state) { case SCE_T3_DEFAULT: case SCE_T3_X_DEFAULT: if (chQuote == '"') { if (sc.state == SCE_T3_DEFAULT) { sc.SetState(SCE_T3_D_STRING); } else { sc.SetState(SCE_T3_X_STRING); } lineState &= ~T3_SINGLE_QUOTE; } else { sc.SetState(SCE_T3_S_STRING); lineState |= T3_SINGLE_QUOTE; } sc.Forward(); break; case SCE_T3_S_STRING: chQuote = '\''; endState = lineState&T3_INT_EXPRESSION ? SCE_T3_X_DEFAULT : SCE_T3_DEFAULT; break; case SCE_T3_D_STRING: chQuote = '"'; endState = SCE_T3_DEFAULT; break; case SCE_T3_X_STRING: chQuote = '"'; endState = SCE_T3_X_DEFAULT; break; } while (sc.More()) { if (IsEOL(sc.ch, sc.chNext)) { return; } if (sc.ch == chQuote) { sc.ForwardSetState(endState); return; } if (sc.state == SCE_T3_D_STRING && sc.Match('<', '<')) { lineState |= T3_INT_EXPRESSION; sc.SetState(SCE_T3_X_DEFAULT); sc.Forward(2); return; } if (sc.Match('\\', static_cast(chQuote)) || sc.Match('\\', '\\')) { sc.Forward(2); } else if (sc.ch == '{') { ColouriseTADS3MsgParam(sc, lineState); } else if (sc.Match('<', '.')) { ColouriseTADS3LibDirective(sc, lineState); } else if (sc.ch == '<') { ColouriseTADS3HTMLTag(sc, lineState); if (sc.state == SCE_T3_X_DEFAULT) return; } else { sc.Forward(); } } } static void ColouriseTADS3Comment(StyleContext &sc, int endState) { sc.SetState(SCE_T3_BLOCK_COMMENT); while (sc.More()) { if (IsEOL(sc.ch, sc.chNext)) { return; } if (sc.Match('*', '/')) { sc.Forward(2); sc.SetState(endState); return; } sc.Forward(); } } static void ColouriseToEndOfLine(StyleContext &sc, int initState, int endState) { sc.SetState(initState); while (sc.More()) { if (sc.ch == '\\') { sc.Forward(); if (IsEOLSkip(sc)) { return; } } if (IsEOL(sc.ch, sc.chNext)) { sc.SetState(endState); return; } sc.Forward(); } } static void ColouriseTADS3Number(StyleContext &sc) { int endState = sc.state; bool inHexNumber = false; bool seenE = false; bool seenDot = sc.ch == '.'; sc.SetState(SCE_T3_NUMBER); if (sc.More()) { sc.Forward(); } if (sc.chPrev == '0' && tolower(sc.ch) == 'x') { inHexNumber = true; sc.Forward(); } while (sc.More()) { if (inHexNumber) { if (!IsAHexDigit(sc.ch)) { break; } } else if (!isdigit(sc.ch)) { if (!seenE && tolower(sc.ch) == 'e') { seenE = true; seenDot = true; if (sc.chNext == '+' || sc.chNext == '-') { sc.Forward(); } } else if (!seenDot && sc.ch == '.') { seenDot = true; } else { break; } } sc.Forward(); } sc.SetState(endState); } static void ColouriseTADS3Doc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { int visibleChars = 0; int bracketLevel = 0; int lineState = 0; unsigned int endPos = startPos + length; int lineCurrent = styler.GetLine(startPos); if (lineCurrent > 0) { lineState = styler.GetLineState(lineCurrent-1); } StyleContext sc(startPos, length, initStyle, styler); while (sc.More()) { if (IsEOL(sc.ch, sc.chNext)) { styler.SetLineState(lineCurrent, lineState); lineCurrent++; visibleChars = 0; sc.Forward(); if (sc.ch == '\n') { sc.Forward(); } } switch(sc.state) { case SCE_T3_PREPROCESSOR: case SCE_T3_LINE_COMMENT: ColouriseToEndOfLine(sc, sc.state, lineState&T3_INT_EXPRESSION ? SCE_T3_X_DEFAULT : SCE_T3_DEFAULT); break; case SCE_T3_S_STRING: case SCE_T3_D_STRING: case SCE_T3_X_STRING: ColouriseTADS3String(sc, lineState); visibleChars++; break; case SCE_T3_MSG_PARAM: ColouriseTADS3MsgParam(sc, lineState); break; case SCE_T3_LIB_DIRECTIVE: ColouriseTADS3LibDirective(sc, lineState); break; case SCE_T3_HTML_DEFAULT: ColouriseTADS3HTMLTag(sc, lineState); break; case SCE_T3_HTML_STRING: ColouriseTADSHTMLString(sc, lineState); break; case SCE_T3_BLOCK_COMMENT: ColouriseTADS3Comment(sc, lineState&T3_INT_EXPRESSION ? SCE_T3_X_DEFAULT : SCE_T3_DEFAULT); break; case SCE_T3_DEFAULT: case SCE_T3_X_DEFAULT: if (IsASpaceOrTab(sc.ch)) { sc.Forward(); } else if (sc.ch == '#' && visibleChars == 0) { ColouriseToEndOfLine(sc, SCE_T3_PREPROCESSOR, sc.state); } else if (sc.Match('/', '*')) { ColouriseTADS3Comment(sc, sc.state); visibleChars++; } else if (sc.Match('/', '/')) { ColouriseToEndOfLine(sc, SCE_T3_LINE_COMMENT, sc.state); } else if (sc.ch == '"') { bracketLevel = 0; ColouriseTADS3String(sc, lineState); visibleChars++; } else if (sc.ch == '\'') { ColouriseTADS3String(sc, lineState); visibleChars++; } else if (sc.state == SCE_T3_X_DEFAULT && bracketLevel == 0 && sc.Match('>', '>')) { sc.Forward(2); sc.SetState(SCE_T3_D_STRING); if (lineState & T3_INT_EXPRESSION_IN_TAG) sc.SetState(SCE_T3_HTML_STRING); lineState &= ~(T3_SINGLE_QUOTE|T3_INT_EXPRESSION |T3_INT_EXPRESSION_IN_TAG); } else if (IsATADS3Operator(sc.ch)) { if (sc.state == SCE_T3_X_DEFAULT) { if (sc.ch == '(') { bracketLevel++; } else if (sc.ch == ')' && bracketLevel > 0) { bracketLevel--; } } ColouriseTADS3Operator(sc); visibleChars++; } else if (IsANumberStart(sc)) { ColouriseTADS3Number(sc); visibleChars++; } else if (IsAWordStart(sc.ch)) { ColouriseTADS3Keyword(sc, keywordlists, endPos); visibleChars++; } else if (sc.Match("...")) { sc.SetState(SCE_T3_IDENTIFIER); sc.Forward(3); sc.SetState(SCE_T3_DEFAULT); } else { sc.Forward(); visibleChars++; } break; default: sc.SetState(SCE_T3_DEFAULT); sc.Forward(); } } sc.Complete(); } /* TADS3 has two styles of top level block (TLB). Eg // default style silverKey : Key 'small silver key' 'small silver key' "A small key glints in the sunlight. " ; and silverKey : Key { 'small silver key' 'small silver key' "A small key glints in the sunlight. " } Some constructs mandate one or the other, but usually the author has may choose either. T3_SEENSTART is used to indicate that a braceless TLB has been (potentially) seen and is also used to match the closing ';' of the default style. T3_EXPECTINGIDENTIFIER and T3_EXPECTINGPUNCTUATION are used to keep track of what characters may be seen without incrementing the block level. The general pattern is identifier identifier, acceptable punctuation characters are ':', ',', '(' and ')'. No attempt is made to ensure that punctuation characters are syntactically correct, eg parentheses match. A ')' always signifies the start of a block. We just need to check if it is followed by a '{', in which case we let the brace handling code handle the folding level. expectingIdentifier == false && expectingIdentifier == false Before the start of a TLB. expectingIdentifier == true && expectingIdentifier == true Currently in an identifier. Will accept identifier or punctuation. expectingIdentifier == true && expectingIdentifier == false Just seen a punctuation character & now waiting for an identifier to start. expectingIdentifier == false && expectingIdentifier == truee We were in an identifier and have seen space. Now waiting to see a punctuation character Space, comments & preprocessor directives are always acceptable and are equivalent. */ static const int T3_SEENSTART = 1 << 12; static const int T3_EXPECTINGIDENTIFIER = 1 << 13; static const int T3_EXPECTINGPUNCTUATION = 1 << 14; static inline bool IsStringTransition(int s1, int s2) { return s1 != s2 && (s1 == SCE_T3_S_STRING || s1 == SCE_T3_X_STRING || (s1 == SCE_T3_D_STRING && s2 != SCE_T3_X_DEFAULT)) && s2 != SCE_T3_LIB_DIRECTIVE && s2 != SCE_T3_MSG_PARAM && s2 != SCE_T3_HTML_TAG && s2 != SCE_T3_HTML_STRING; } static inline bool IsATADS3Punctuation(const int ch) { return ch == ':' || ch == ',' || ch == '(' || ch == ')'; } static inline bool IsAnIdentifier(const int style) { return style == SCE_T3_IDENTIFIER || style == SCE_T3_USER1 || style == SCE_T3_USER2 || style == SCE_T3_USER3; } static inline bool IsAnOperator(const int style) { return style == SCE_T3_OPERATOR || style == SCE_T3_BRACE; } static inline bool IsSpaceEquivalent(const int ch, const int style) { return isspace(ch) || style == SCE_T3_BLOCK_COMMENT || style == SCE_T3_LINE_COMMENT || style == SCE_T3_PREPROCESSOR; } static char peekAhead(unsigned int startPos, unsigned int endPos, Accessor &styler) { for (unsigned int i = startPos; i < endPos; i++) { int style = styler.StyleAt(i); char ch = styler[i]; if (!IsSpaceEquivalent(ch, style)) { if (IsAnIdentifier(style)) { return 'a'; } if (IsATADS3Punctuation(ch)) { return ':'; } if (ch == '{') { return '{'; } return '*'; } } return ' '; } static void FoldTADS3Doc(unsigned int startPos, int length, int initStyle, WordList *[], Accessor &styler) { unsigned int endPos = startPos + length; int lineCurrent = styler.GetLine(startPos); int levelCurrent = SC_FOLDLEVELBASE; if (lineCurrent > 0) levelCurrent = styler.LevelAt(lineCurrent-1) >> 16; int seenStart = levelCurrent & T3_SEENSTART; int expectingIdentifier = levelCurrent & T3_EXPECTINGIDENTIFIER; int expectingPunctuation = levelCurrent & T3_EXPECTINGPUNCTUATION; levelCurrent &= SC_FOLDLEVELNUMBERMASK; int levelMinCurrent = levelCurrent; int levelNext = levelCurrent; char chNext = styler[startPos]; int styleNext = styler.StyleAt(startPos); int style = initStyle; char ch = chNext; int stylePrev = style; bool redo = false; for (unsigned int i = startPos; i < endPos; i++) { if (redo) { redo = false; i--; } else { ch = chNext; chNext = styler.SafeGetCharAt(i + 1); stylePrev = style; style = styleNext; styleNext = styler.StyleAt(i + 1); } bool atEOL = IsEOL(ch, chNext); if (levelNext == SC_FOLDLEVELBASE) { if (IsSpaceEquivalent(ch, style)) { if (expectingPunctuation) { expectingIdentifier = 0; } if (style == SCE_T3_BLOCK_COMMENT) { levelNext++; } } else if (ch == '{') { levelNext++; seenStart = 0; } else if (ch == '\'' || ch == '"' || ch == '[') { levelNext++; if (seenStart) { redo = true; } } else if (ch == ';') { seenStart = 0; expectingIdentifier = 0; expectingPunctuation = 0; } else if (expectingIdentifier && expectingPunctuation) { if (IsATADS3Punctuation(ch)) { if (ch == ')' && peekAhead(i+1, endPos, styler) != '{') { levelNext++; } else { expectingPunctuation = 0; } } else if (!IsAnIdentifier(style)) { levelNext++; } } else if (expectingIdentifier && !expectingPunctuation) { if (!IsAnIdentifier(style)) { levelNext++; } else { expectingPunctuation = T3_EXPECTINGPUNCTUATION; } } else if (!expectingIdentifier && expectingPunctuation) { if (!IsATADS3Punctuation(ch)) { levelNext++; } else { if (ch == ')' && peekAhead(i+1, endPos, styler) != '{') { levelNext++; } else { expectingIdentifier = T3_EXPECTINGIDENTIFIER; expectingPunctuation = 0; } } } else if (!expectingIdentifier && !expectingPunctuation) { if (IsAnIdentifier(style)) { seenStart = T3_SEENSTART; expectingIdentifier = T3_EXPECTINGIDENTIFIER; expectingPunctuation = T3_EXPECTINGPUNCTUATION; } } if (levelNext != SC_FOLDLEVELBASE && style != SCE_T3_BLOCK_COMMENT) { expectingIdentifier = 0; expectingPunctuation = 0; } } else if (levelNext == SC_FOLDLEVELBASE+1 && seenStart && ch == ';' && IsAnOperator(style)) { levelNext--; seenStart = 0; } else if (style == SCE_T3_BLOCK_COMMENT) { if (stylePrev != SCE_T3_BLOCK_COMMENT) { levelNext++; } else if (styleNext != SCE_T3_BLOCK_COMMENT && !atEOL) { // Comments don't end at end of line and the next character may be unstyled. levelNext--; } } else if (ch == '\'' || ch == '"') { if (IsStringTransition(style, stylePrev)) { if (levelMinCurrent > levelNext) { levelMinCurrent = levelNext; } levelNext++; } else if (IsStringTransition(style, styleNext)) { levelNext--; } } else if (IsAnOperator(style)) { if (ch == '{' || ch == '[') { // Measure the minimum before a '{' to allow // folding on "} else {" if (levelMinCurrent > levelNext) { levelMinCurrent = levelNext; } levelNext++; } else if (ch == '}' || ch == ']') { levelNext--; } } if (atEOL) { if (seenStart && levelNext == SC_FOLDLEVELBASE) { switch (peekAhead(i+1, endPos, styler)) { case ' ': case '{': break; case '*': levelNext++; break; case 'a': if (expectingPunctuation) { levelNext++; } break; case ':': if (expectingIdentifier) { levelNext++; } break; } if (levelNext != SC_FOLDLEVELBASE) { expectingIdentifier = 0; expectingPunctuation = 0; } } int lev = levelMinCurrent | (levelNext | expectingIdentifier | expectingPunctuation | seenStart) << 16; if (levelMinCurrent < levelNext) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) { styler.SetLevel(lineCurrent, lev); } lineCurrent++; levelCurrent = levelNext; levelMinCurrent = levelCurrent; } } } static const char * const tads3WordList[] = { "TADS3 Keywords", "User defined 1", "User defined 2", "User defined 3", 0 }; LexerModule lmTADS3(SCLEX_TADS3, ColouriseTADS3Doc, "tads3", FoldTADS3Doc, tads3WordList); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/RESearch.cxx000444001750001750 6762211727344243 24612 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file RESearch.cxx ** Regular expression search library. **/ /* * regex - Regular expression pattern matching and replacement * * By: Ozan S. Yigit (oz) * Dept. of Computer Science * York University * * Original code available from http://www.cs.yorku.ca/~oz/ * Translation to C++ by Neil Hodgson neilh@scintilla.org * Removed all use of register. * Converted to modern function prototypes. * Put all global/static variables into an object so this code can be * used from multiple threads, etc. * Some extensions by Philippe Lhoste PhiLho(a)GMX.net * '?' extensions by Michael Mullin masmullin@gmail.com * * These routines are the PUBLIC DOMAIN equivalents of regex * routines as found in 4.nBSD UN*X, with minor extensions. * * These routines are derived from various implementations found * in software tools books, and Conroy's grep. They are NOT derived * from licensed/restricted software. * For more interesting/academic/complicated implementations, * see Henry Spencer's regexp routines, or GNU Emacs pattern * matching module. * * Modification history removed. * * Interfaces: * RESearch::Compile: compile a regular expression into a NFA. * * const char *RESearch::Compile(const char *pattern, int length, * bool caseSensitive, bool posix) * * Returns a short error string if they fail. * * RESearch::Execute: execute the NFA to match a pattern. * * int RESearch::Execute(characterIndexer &ci, int lp, int endp) * * RESearch::Substitute: substitute the matched portions in a new string. * * int RESearch::Substitute(CharacterIndexer &ci, char *src, char *dst) * * re_fail: failure routine for RESearch::Execute. (no longer used) * * void re_fail(char *msg, char op) * * Regular Expressions: * * [1] char matches itself, unless it is a special * character (metachar): . \ [ ] * + ? ^ $ * and ( ) if posix option. * * [2] . matches any character. * * [3] \ matches the character following it, except: * - \a, \b, \f, \n, \r, \t, \v match the corresponding C * escape char, respectively BEL, BS, FF, LF, CR, TAB and VT; * Note that \r and \n are never matched because Scintilla * regex searches are made line per line * (stripped of end-of-line chars). * - if not in posix mode, when followed by a * left or right round bracket (see [8]); * - when followed by a digit 1 to 9 (see [9]); * - when followed by a left or right angle bracket * (see [10]); * - when followed by d, D, s, S, w or W (see [11]); * - when followed by x and two hexa digits (see [12]. * Backslash is used as an escape character for all * other meta-characters, and itself. * * [4] [set] matches one of the characters in the set. * If the first character in the set is "^", * it matches the characters NOT in the set, i.e. * complements the set. A shorthand S-E (start dash end) * is used to specify a set of characters S up to * E, inclusive. S and E must be characters, otherwise * the dash is taken literally (eg. in expression [\d-a]). * The special characters "]" and "-" have no special * meaning if they appear as the first chars in the set. * To include both, put - first: [-]A-Z] * (or just backslash them). * examples: match: * * [-]|] matches these 3 chars, * * []-|] matches from ] to | chars * * [a-z] any lowercase alpha * * [^-]] any char except - and ] * * [^A-Z] any char except uppercase * alpha * * [a-zA-Z] any alpha * * [5] * any regular expression form [1] to [4] * (except [8], [9] and [10] forms of [3]), * followed by closure char (*) * matches zero or more matches of that form. * * [6] + same as [5], except it matches one or more. * * [5-6] Both [5] and [6] are greedy (they match as much as possible). * Unless they are followed by the 'lazy' quantifier (?) * In which case both [5] and [6] try to match as little as possible * * [7] ? same as [5] except it matches zero or one. * * [8] a regular expression in the form [1] to [13], enclosed * as \(form\) (or (form) with posix flag) matches what * form matches. The enclosure creates a set of tags, * used for [9] and for pattern substitution. * The tagged forms are numbered starting from 1. * * [9] a \ followed by a digit 1 to 9 matches whatever a * previously tagged regular expression ([8]) matched. * * [10] \< a regular expression starting with a \< construct * \> and/or ending with a \> construct, restricts the * pattern matching to the beginning of a word, and/or * the end of a word. A word is defined to be a character * string beginning and/or ending with the characters * A-Z a-z 0-9 and _. Scintilla extends this definition * by user setting. The word must also be preceded and/or * followed by any character outside those mentioned. * * [11] \l a backslash followed by d, D, s, S, w or W, * becomes a character class (both inside and * outside sets []). * d: decimal digits * D: any char except decimal digits * s: whitespace (space, \t \n \r \f \v) * S: any char except whitespace (see above) * w: alphanumeric & underscore (changed by user setting) * W: any char except alphanumeric & underscore (see above) * * [12] \xHH a backslash followed by x and two hexa digits, * becomes the character whose Ascii code is equal * to these digits. If not followed by two digits, * it is 'x' char itself. * * [13] a composite regular expression xy where x and y * are in the form [1] to [12] matches the longest * match of x followed by a match for y. * * [14] ^ a regular expression starting with a ^ character * $ and/or ending with a $ character, restricts the * pattern matching to the beginning of the line, * or the end of line. [anchors] Elsewhere in the * pattern, ^ and $ are treated as ordinary characters. * * * Acknowledgements: * * HCR's Hugh Redelmeier has been most helpful in various * stages of development. He convinced me to include BOW * and EOW constructs, originally invented by Rob Pike at * the University of Toronto. * * References: * Software tools Kernighan & Plauger * Software tools in Pascal Kernighan & Plauger * Grep [rsx-11 C dist] David Conroy * ed - text editor Un*x Programmer's Manual * Advanced editing on Un*x B. W. Kernighan * RegExp routines Henry Spencer * * Notes: * * This implementation uses a bit-set representation for character * classes for speed and compactness. Each character is represented * by one bit in a 256-bit block. Thus, CCL always takes a * constant 32 bytes in the internal nfa, and RESearch::Execute does a single * bit comparison to locate the character in the set. * * Examples: * * pattern: foo*.* * compile: CHR f CHR o CLO CHR o END CLO ANY END END * matches: fo foo fooo foobar fobar foxx ... * * pattern: fo[ob]a[rz] * compile: CHR f CHR o CCL bitset CHR a CCL bitset END * matches: fobar fooar fobaz fooaz * * pattern: foo\\+ * compile: CHR f CHR o CHR o CHR \ CLO CHR \ END END * matches: foo\ foo\\ foo\\\ ... * * pattern: \(foo\)[1-3]\1 (same as foo[1-3]foo) * compile: BOT 1 CHR f CHR o CHR o EOT 1 CCL bitset REF 1 END * matches: foo1foo foo2foo foo3foo * * pattern: \(fo.*\)-\1 * compile: BOT 1 CHR f CHR o CLO ANY END EOT 1 CHR - REF 1 END * matches: foo-foo fo-fo fob-fob foobar-foobar ... */ #include #include "CharClassify.h" #include "RESearch.h" // Shut up annoying Visual C++ warnings: #ifdef _MSC_VER #pragma warning(disable: 4514) #endif #ifdef SCI_NAMESPACE using namespace Scintilla; #endif #define OKP 1 #define NOP 0 #define CHR 1 #define ANY 2 #define CCL 3 #define BOL 4 #define EOL 5 #define BOT 6 #define EOT 7 #define BOW 8 #define EOW 9 #define REF 10 #define CLO 11 #define CLQ 12 /* 0 to 1 closure */ #define LCLO 13 /* lazy closure */ #define END 0 /* * The following defines are not meant to be changeable. * They are for readability only. */ #define BLKIND 0370 #define BITIND 07 const char bitarr[] = { 1, 2, 4, 8, 16, 32, 64, '\200' }; #define badpat(x) (*nfa = END, x) /* * Character classification table for word boundary operators BOW * and EOW is passed in by the creator of this object (Scintilla * Document). The Document default state is that word chars are: * 0-9, a-z, A-Z and _ */ RESearch::RESearch(CharClassify *charClassTable) { failure = 0; charClass = charClassTable; Init(); } RESearch::~RESearch() { Clear(); } void RESearch::Init() { sta = NOP; /* status of lastpat */ bol = 0; for (int i = 0; i < MAXTAG; i++) pat[i] = 0; for (int j = 0; j < BITBLK; j++) bittab[j] = 0; } void RESearch::Clear() { for (int i = 0; i < MAXTAG; i++) { delete []pat[i]; pat[i] = 0; bopat[i] = NOTFOUND; eopat[i] = NOTFOUND; } } bool RESearch::GrabMatches(CharacterIndexer &ci) { bool success = true; for (unsigned int i = 0; i < MAXTAG; i++) { if ((bopat[i] != NOTFOUND) && (eopat[i] != NOTFOUND)) { unsigned int len = eopat[i] - bopat[i]; pat[i] = new char[len + 1]; if (pat[i]) { for (unsigned int j = 0; j < len; j++) pat[i][j] = ci.CharAt(bopat[i] + j); pat[i][len] = '\0'; } else { success = false; } } } return success; } void RESearch::ChSet(unsigned char c) { bittab[((c) & BLKIND) >> 3] |= bitarr[(c) & BITIND]; } void RESearch::ChSetWithCase(unsigned char c, bool caseSensitive) { if (caseSensitive) { ChSet(c); } else { if ((c >= 'a') && (c <= 'z')) { ChSet(c); ChSet(static_cast(c - 'a' + 'A')); } else if ((c >= 'A') && (c <= 'Z')) { ChSet(c); ChSet(static_cast(c - 'A' + 'a')); } else { ChSet(c); } } } unsigned char escapeValue(unsigned char ch) { switch (ch) { case 'a': return '\a'; case 'b': return '\b'; case 'f': return '\f'; case 'n': return '\n'; case 'r': return '\r'; case 't': return '\t'; case 'v': return '\v'; } return 0; } static int GetHexaChar(unsigned char hd1, unsigned char hd2) { int hexValue = 0; if (hd1 >= '0' && hd1 <= '9') { hexValue += 16 * (hd1 - '0'); } else if (hd1 >= 'A' && hd1 <= 'F') { hexValue += 16 * (hd1 - 'A' + 10); } else if (hd1 >= 'a' && hd1 <= 'f') { hexValue += 16 * (hd1 - 'a' + 10); } else return -1; if (hd2 >= '0' && hd2 <= '9') { hexValue += hd2 - '0'; } else if (hd2 >= 'A' && hd2 <= 'F') { hexValue += hd2 - 'A' + 10; } else if (hd2 >= 'a' && hd2 <= 'f') { hexValue += hd2 - 'a' + 10; } else return -1; return hexValue; } /** * Called when the parser finds a backslash not followed * by a valid expression (like \( in non-Posix mode). * @param pattern: pointer on the char after the backslash. * @param incr: (out) number of chars to skip after expression evaluation. * @return the char if it resolves to a simple char, * or -1 for a char class. In this case, bittab is changed. */ int RESearch::GetBackslashExpression( const char *pattern, int &incr) { // Since error reporting is primitive and messages are not used anyway, // I choose to interpret unexpected syntax in a logical way instead // of reporting errors. Otherwise, we can stick on, eg., PCRE behavior. incr = 0; // Most of the time, will skip the char "naturally". int c; int result = -1; unsigned char bsc = *pattern; if (!bsc) { // Avoid overrun result = '\\'; // \ at end of pattern, take it literally return result; } switch (bsc) { case 'a': case 'b': case 'n': case 'f': case 'r': case 't': case 'v': result = escapeValue(bsc); break; case 'x': { unsigned char hd1 = *(pattern + 1); unsigned char hd2 = *(pattern + 2); int hexValue = GetHexaChar(hd1, hd2); if (hexValue >= 0) { result = hexValue; incr = 2; // Must skip the digits } else { result = 'x'; // \x without 2 digits: see it as 'x' } } break; case 'd': for (c = '0'; c <= '9'; c++) { ChSet(static_cast(c)); } break; case 'D': for (c = 0; c < MAXCHR; c++) { if (c < '0' || c > '9') { ChSet(static_cast(c)); } } break; case 's': ChSet(' '); ChSet('\t'); ChSet('\n'); ChSet('\r'); ChSet('\f'); ChSet('\v'); break; case 'S': for (c = 0; c < MAXCHR; c++) { if (c != ' ' && !(c >= 0x09 && c <= 0x0D)) { ChSet(static_cast(c)); } } break; case 'w': for (c = 0; c < MAXCHR; c++) { if (iswordc(static_cast(c))) { ChSet(static_cast(c)); } } break; case 'W': for (c = 0; c < MAXCHR; c++) { if (!iswordc(static_cast(c))) { ChSet(static_cast(c)); } } break; default: result = bsc; } return result; } const char *RESearch::Compile(const char *pattern, int length, bool caseSensitive, bool posix) { char *mp=nfa; /* nfa pointer */ char *lp; /* saved pointer */ char *sp=nfa; /* another one */ char *mpMax = mp + MAXNFA - BITBLK - 10; int tagi = 0; /* tag stack index */ int tagc = 1; /* actual tag count */ int n; char mask; /* xor mask -CCL/NCL */ int c1, c2, prevChar; if (!pattern || !length) { if (sta) return 0; else return badpat("No previous regular expression"); } sta = NOP; const char *p=pattern; /* pattern pointer */ for (int i=0; i mpMax) return badpat("Pattern too long"); lp = mp; switch (*p) { case '.': /* match any char */ *mp++ = ANY; break; case '^': /* match beginning */ if (p == pattern) *mp++ = BOL; else { *mp++ = CHR; *mp++ = *p; } break; case '$': /* match endofline */ if (!*(p+1)) *mp++ = EOL; else { *mp++ = CHR; *mp++ = *p; } break; case '[': /* match char class */ *mp++ = CCL; prevChar = 0; i++; if (*++p == '^') { mask = '\377'; i++; p++; } else mask = 0; if (*p == '-') { /* real dash */ i++; prevChar = *p; ChSet(*p++); } if (*p == ']') { /* real brace */ i++; prevChar = *p; ChSet(*p++); } while (*p && *p != ']') { if (*p == '-') { if (prevChar < 0) { // Previous def. was a char class like \d, take dash literally prevChar = *p; ChSet(*p); } else if (*(p+1)) { if (*(p+1) != ']') { c1 = prevChar + 1; i++; c2 = static_cast(*++p); if (c2 == '\\') { if (!*(p+1)) // End of RE return badpat("Missing ]"); else { i++; p++; int incr; c2 = GetBackslashExpression(p, incr); i += incr; p += incr; if (c2 >= 0) { // Convention: \c (c is any char) is case sensitive, whatever the option ChSet(static_cast(c2)); prevChar = c2; } else { // bittab is already changed prevChar = -1; } } } if (prevChar < 0) { // Char after dash is char class like \d, take dash literally prevChar = '-'; ChSet('-'); } else { // Put all chars between c1 and c2 included in the char set while (c1 <= c2) { ChSetWithCase(static_cast(c1++), caseSensitive); } } } else { // Dash before the ], take it literally prevChar = *p; ChSet(*p); } } else { return badpat("Missing ]"); } } else if (*p == '\\' && *(p+1)) { i++; p++; int incr; int c = GetBackslashExpression(p, incr); i += incr; p += incr; if (c >= 0) { // Convention: \c (c is any char) is case sensitive, whatever the option ChSet(static_cast(c)); prevChar = c; } else { // bittab is already changed prevChar = -1; } } else { prevChar = static_cast(*p); ChSetWithCase(*p, caseSensitive); } i++; p++; } if (!*p) return badpat("Missing ]"); for (n = 0; n < BITBLK; bittab[n++] = 0) *mp++ = static_cast(mask ^ bittab[n]); break; case '*': /* match 0 or more... */ case '+': /* match 1 or more... */ case '?': if (p == pattern) return badpat("Empty closure"); lp = sp; /* previous opcode */ if (*lp == CLO || *lp == LCLO) /* equivalence... */ break; switch (*lp) { case BOL: case BOT: case EOT: case BOW: case EOW: case REF: return badpat("Illegal closure"); default: break; } if (*p == '+') for (sp = mp; lp < sp; lp++) *mp++ = *lp; *mp++ = END; *mp++ = END; sp = mp; while (--mp > lp) *mp = mp[-1]; if (*p == '?') *mp = CLQ; else if (*(p+1) == '?') *mp = LCLO; else *mp = CLO; mp = sp; break; case '\\': /* tags, backrefs... */ i++; switch (*++p) { case '<': *mp++ = BOW; break; case '>': if (*sp == BOW) return badpat("Null pattern inside \\<\\>"); *mp++ = EOW; break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': n = *p-'0'; if (tagi > 0 && tagstk[tagi] == n) return badpat("Cyclical reference"); if (tagc > n) { *mp++ = static_cast(REF); *mp++ = static_cast(n); } else return badpat("Undetermined reference"); break; default: if (!posix && *p == '(') { if (tagc < MAXTAG) { tagstk[++tagi] = tagc; *mp++ = BOT; *mp++ = static_cast(tagc++); } else return badpat("Too many \\(\\) pairs"); } else if (!posix && *p == ')') { if (*sp == BOT) return badpat("Null pattern inside \\(\\)"); if (tagi > 0) { *mp++ = static_cast(EOT); *mp++ = static_cast(tagstk[tagi--]); } else return badpat("Unmatched \\)"); } else { int incr; int c = GetBackslashExpression(p, incr); i += incr; p += incr; if (c >= 0) { *mp++ = CHR; *mp++ = static_cast(c); } else { *mp++ = CCL; mask = 0; for (n = 0; n < BITBLK; bittab[n++] = 0) *mp++ = static_cast(mask ^ bittab[n]); } } } break; default : /* an ordinary char */ if (posix && *p == '(') { if (tagc < MAXTAG) { tagstk[++tagi] = tagc; *mp++ = BOT; *mp++ = static_cast(tagc++); } else return badpat("Too many () pairs"); } else if (posix && *p == ')') { if (*sp == BOT) return badpat("Null pattern inside ()"); if (tagi > 0) { *mp++ = static_cast(EOT); *mp++ = static_cast(tagstk[tagi--]); } else return badpat("Unmatched )"); } else { unsigned char c = *p; if (!c) // End of RE c = '\\'; // We take it as raw backslash if (caseSensitive || !iswordc(c)) { *mp++ = CHR; *mp++ = c; } else { *mp++ = CCL; mask = 0; ChSetWithCase(c, false); for (n = 0; n < BITBLK; bittab[n++] = 0) *mp++ = static_cast(mask ^ bittab[n]); } } break; } sp = lp; } if (tagi > 0) return badpat((posix ? "Unmatched (" : "Unmatched \\(")); *mp = END; sta = OKP; return 0; } /* * RESearch::Execute: * execute nfa to find a match. * * special cases: (nfa[0]) * BOL * Match only once, starting from the * beginning. * CHR * First locate the character without * calling PMatch, and if found, call * PMatch for the remaining string. * END * RESearch::Compile failed, poor luser did not * check for it. Fail fast. * * If a match is found, bopat[0] and eopat[0] are set * to the beginning and the end of the matched fragment, * respectively. * */ int RESearch::Execute(CharacterIndexer &ci, int lp, int endp) { unsigned char c; int ep = NOTFOUND; char *ap = nfa; bol = lp; failure = 0; Clear(); switch (*ap) { case BOL: /* anchored: match from BOL only */ ep = PMatch(ci, lp, endp, ap); break; case EOL: /* just searching for end of line normal path doesn't work */ if (*(ap+1) == END) { lp = endp; ep = lp; break; } else { return 0; } case CHR: /* ordinary char: locate it fast */ c = *(ap+1); while ((lp < endp) && (ci.CharAt(lp) != c)) lp++; if (lp >= endp) /* if EOS, fail, else fall thru. */ return 0; default: /* regular matching all the way. */ while (lp < endp) { ep = PMatch(ci, lp, endp, ap); if (ep != NOTFOUND) break; lp++; } break; case END: /* munged automaton. fail always */ return 0; } if (ep == NOTFOUND) return 0; bopat[0] = lp; eopat[0] = ep; return 1; } /* * PMatch: internal routine for the hard part * * This code is partly snarfed from an early grep written by * David Conroy. The backref and tag stuff, and various other * innovations are by oz. * * special case optimizations: (nfa[n], nfa[n+1]) * CLO ANY * We KNOW .* will match everything upto the * end of line. Thus, directly go to the end of * line, without recursive PMatch calls. As in * the other closure cases, the remaining pattern * must be matched by moving backwards on the * string recursively, to find a match for xy * (x is ".*" and y is the remaining pattern) * where the match satisfies the LONGEST match for * x followed by a match for y. * CLO CHR * We can again scan the string forward for the * single char and at the point of failure, we * execute the remaining nfa recursively, same as * above. * * At the end of a successful match, bopat[n] and eopat[n] * are set to the beginning and end of subpatterns matched * by tagged expressions (n = 1 to 9). */ extern void re_fail(char *,char); #define isinset(x,y) ((x)[((y)&BLKIND)>>3] & bitarr[(y)&BITIND]) /* * skip values for CLO XXX to skip past the closure */ #define ANYSKIP 2 /* [CLO] ANY END */ #define CHRSKIP 3 /* [CLO] CHR chr END */ #define CCLSKIP 34 /* [CLO] CCL 32 bytes END */ int RESearch::PMatch(CharacterIndexer &ci, int lp, int endp, char *ap) { int op, c, n; int e; /* extra pointer for CLO */ int bp; /* beginning of subpat... */ int ep; /* ending of subpat... */ int are; /* to save the line ptr. */ int llp; /* lazy lp for LCLO */ while ((op = *ap++) != END) switch (op) { case CHR: if (ci.CharAt(lp++) != *ap++) return NOTFOUND; break; case ANY: if (lp++ >= endp) return NOTFOUND; break; case CCL: if (lp >= endp) return NOTFOUND; c = ci.CharAt(lp++); if (!isinset(ap,c)) return NOTFOUND; ap += BITBLK; break; case BOL: if (lp != bol) return NOTFOUND; break; case EOL: if (lp < endp) return NOTFOUND; break; case BOT: bopat[static_cast(*ap++)] = lp; break; case EOT: eopat[static_cast(*ap++)] = lp; break; case BOW: if ((lp!=bol && iswordc(ci.CharAt(lp-1))) || !iswordc(ci.CharAt(lp))) return NOTFOUND; break; case EOW: if (lp==bol || !iswordc(ci.CharAt(lp-1)) || iswordc(ci.CharAt(lp))) return NOTFOUND; break; case REF: n = *ap++; bp = bopat[n]; ep = eopat[n]; while (bp < ep) if (ci.CharAt(bp++) != ci.CharAt(lp++)) return NOTFOUND; break; case LCLO: case CLQ: case CLO: are = lp; switch (*ap) { case ANY: if (op == CLO || op == LCLO) while (lp < endp) lp++; else if (lp < endp) lp++; n = ANYSKIP; break; case CHR: c = *(ap+1); if (op == CLO || op == LCLO) while ((lp < endp) && (c == ci.CharAt(lp))) lp++; else if ((lp < endp) && (c == ci.CharAt(lp))) lp++; n = CHRSKIP; break; case CCL: while ((lp < endp) && isinset(ap+1,ci.CharAt(lp))) lp++; n = CCLSKIP; break; default: failure = true; //re_fail("closure: bad nfa.", *ap); return NOTFOUND; } ap += n; llp = lp; e = NOTFOUND; while (llp >= are) { int q; if ((q = PMatch(ci, llp, endp, ap)) != NOTFOUND) { e = q; lp = llp; if (op != LCLO) return e; } if (*ap == END) return e; --llp; } if (*ap == EOT) PMatch(ci, lp, endp, ap); return e; default: //re_fail("RESearch::Execute: bad nfa.", static_cast(op)); return NOTFOUND; } return lp; } /* * RESearch::Substitute: * substitute the matched portions of the src in dst. * * & substitute the entire matched pattern. * * \digit substitute a subpattern, with the given tag number. * Tags are numbered from 1 to 9. If the particular * tagged subpattern does not exist, null is substituted. */ int RESearch::Substitute(CharacterIndexer &ci, char *src, char *dst) { unsigned char c; int pin; int bp; int ep; if (!*src || !bopat[0]) return 0; while ((c = *src++) != 0) { switch (c) { case '&': pin = 0; break; case '\\': c = *src++; if (c >= '0' && c <= '9') { pin = c - '0'; break; } default: *dst++ = c; continue; } if ((bp = bopat[pin]) != 0 && (ep = eopat[pin]) != 0) { while (ci.CharAt(bp) && bp < ep) *dst++ = ci.CharAt(bp++); if (bp < ep) return 0; } } *dst = '\0'; return 1; } Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/KeyMap.cxx000444001750001750 1347411727344243 24340 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file KeyMap.cxx ** Defines a mapping between keystrokes and commands. **/ // Copyright 1998-2003 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include "Platform.h" #include "Scintilla.h" #include "KeyMap.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif KeyMap::KeyMap() : kmap(0), len(0), alloc(0) { for (int i = 0; MapDefault[i].key; i++) { AssignCmdKey(MapDefault[i].key, MapDefault[i].modifiers, MapDefault[i].msg); } } KeyMap::~KeyMap() { Clear(); } void KeyMap::Clear() { delete []kmap; kmap = 0; len = 0; alloc = 0; } void KeyMap::AssignCmdKey(int key, int modifiers, unsigned int msg) { if ((len+1) >= alloc) { KeyToCommand *ktcNew = new KeyToCommand[alloc + 5]; if (!ktcNew) return; for (int k = 0; k < len; k++) ktcNew[k] = kmap[k]; alloc += 5; delete []kmap; kmap = ktcNew; } for (int keyIndex = 0; keyIndex < len; keyIndex++) { if ((key == kmap[keyIndex].key) && (modifiers == kmap[keyIndex].modifiers)) { kmap[keyIndex].msg = msg; return; } } kmap[len].key = key; kmap[len].modifiers = modifiers; kmap[len].msg = msg; len++; } unsigned int KeyMap::Find(int key, int modifiers) { for (int i = 0; i < len; i++) { if ((key == kmap[i].key) && (modifiers == kmap[i].modifiers)) { return kmap[i].msg; } } return 0; } #if PLAT_GTK_MACOSX #define OS_X_KEYS 1 #else #define OS_X_KEYS 0 #endif // Define a modifier that is exactly Ctrl key on all platforms // Most uses of Ctrl map to Cmd on OS X but some can't so use SCI_[S]CTRL_META #if OS_X_KEYS #define SCI_CTRL_META SCI_META #define SCI_SCTRL_META (SCI_META | SCI_SHIFT) #else #define SCI_CTRL_META SCI_CTRL #define SCI_SCTRL_META (SCI_CTRL | SCI_SHIFT) #endif const KeyToCommand KeyMap::MapDefault[] = { #if OS_X_KEYS {SCK_DOWN, SCI_CTRL, SCI_DOCUMENTEND}, {SCK_DOWN, SCI_CSHIFT, SCI_DOCUMENTENDEXTEND}, {SCK_UP, SCI_CTRL, SCI_DOCUMENTSTART}, {SCK_UP, SCI_CSHIFT, SCI_DOCUMENTSTARTEXTEND}, {SCK_LEFT, SCI_CTRL, SCI_VCHOME}, {SCK_LEFT, SCI_CSHIFT, SCI_VCHOMEEXTEND}, {SCK_RIGHT, SCI_CTRL, SCI_LINEEND}, {SCK_RIGHT, SCI_CSHIFT, SCI_LINEENDEXTEND}, #endif {SCK_DOWN, SCI_NORM, SCI_LINEDOWN}, {SCK_DOWN, SCI_SHIFT, SCI_LINEDOWNEXTEND}, {SCK_DOWN, SCI_CTRL_META, SCI_LINESCROLLDOWN}, {SCK_DOWN, SCI_ASHIFT, SCI_LINEDOWNRECTEXTEND}, {SCK_UP, SCI_NORM, SCI_LINEUP}, {SCK_UP, SCI_SHIFT, SCI_LINEUPEXTEND}, {SCK_UP, SCI_CTRL_META, SCI_LINESCROLLUP}, {SCK_UP, SCI_ASHIFT, SCI_LINEUPRECTEXTEND}, {'[', SCI_CTRL, SCI_PARAUP}, {'[', SCI_CSHIFT, SCI_PARAUPEXTEND}, {']', SCI_CTRL, SCI_PARADOWN}, {']', SCI_CSHIFT, SCI_PARADOWNEXTEND}, {SCK_LEFT, SCI_NORM, SCI_CHARLEFT}, {SCK_LEFT, SCI_SHIFT, SCI_CHARLEFTEXTEND}, {SCK_LEFT, SCI_CTRL_META, SCI_WORDLEFT}, {SCK_LEFT, SCI_SCTRL_META, SCI_WORDLEFTEXTEND}, {SCK_LEFT, SCI_ASHIFT, SCI_CHARLEFTRECTEXTEND}, {SCK_RIGHT, SCI_NORM, SCI_CHARRIGHT}, {SCK_RIGHT, SCI_SHIFT, SCI_CHARRIGHTEXTEND}, {SCK_RIGHT, SCI_CTRL_META, SCI_WORDRIGHT}, {SCK_RIGHT, SCI_SCTRL_META, SCI_WORDRIGHTEXTEND}, {SCK_RIGHT, SCI_ASHIFT, SCI_CHARRIGHTRECTEXTEND}, {'/', SCI_CTRL, SCI_WORDPARTLEFT}, {'/', SCI_CSHIFT, SCI_WORDPARTLEFTEXTEND}, {'\\', SCI_CTRL, SCI_WORDPARTRIGHT}, {'\\', SCI_CSHIFT, SCI_WORDPARTRIGHTEXTEND}, {SCK_HOME, SCI_NORM, SCI_VCHOME}, {SCK_HOME, SCI_SHIFT, SCI_VCHOMEEXTEND}, {SCK_HOME, SCI_CTRL, SCI_DOCUMENTSTART}, {SCK_HOME, SCI_CSHIFT, SCI_DOCUMENTSTARTEXTEND}, {SCK_HOME, SCI_ALT, SCI_HOMEDISPLAY}, {SCK_HOME, SCI_ASHIFT, SCI_VCHOMERECTEXTEND}, {SCK_END, SCI_NORM, SCI_LINEEND}, {SCK_END, SCI_SHIFT, SCI_LINEENDEXTEND}, {SCK_END, SCI_CTRL, SCI_DOCUMENTEND}, {SCK_END, SCI_CSHIFT, SCI_DOCUMENTENDEXTEND}, {SCK_END, SCI_ALT, SCI_LINEENDDISPLAY}, {SCK_END, SCI_ASHIFT, SCI_LINEENDRECTEXTEND}, {SCK_PRIOR, SCI_NORM, SCI_PAGEUP}, {SCK_PRIOR, SCI_SHIFT, SCI_PAGEUPEXTEND}, {SCK_PRIOR, SCI_ASHIFT, SCI_PAGEUPRECTEXTEND}, {SCK_NEXT, SCI_NORM, SCI_PAGEDOWN}, {SCK_NEXT, SCI_SHIFT, SCI_PAGEDOWNEXTEND}, {SCK_NEXT, SCI_ASHIFT, SCI_PAGEDOWNRECTEXTEND}, {SCK_DELETE, SCI_NORM, SCI_CLEAR}, {SCK_DELETE, SCI_SHIFT, SCI_CUT}, {SCK_DELETE, SCI_CTRL, SCI_DELWORDRIGHT}, {SCK_DELETE, SCI_CSHIFT, SCI_DELLINERIGHT}, {SCK_INSERT, SCI_NORM, SCI_EDITTOGGLEOVERTYPE}, {SCK_INSERT, SCI_SHIFT, SCI_PASTE}, {SCK_INSERT, SCI_CTRL, SCI_COPY}, {SCK_ESCAPE, SCI_NORM, SCI_CANCEL}, {SCK_BACK, SCI_NORM, SCI_DELETEBACK}, {SCK_BACK, SCI_SHIFT, SCI_DELETEBACK}, {SCK_BACK, SCI_CTRL, SCI_DELWORDLEFT}, {SCK_BACK, SCI_ALT, SCI_UNDO}, {SCK_BACK, SCI_CSHIFT, SCI_DELLINELEFT}, {'Z', SCI_CTRL, SCI_UNDO}, #if OS_X_KEYS {'Z', SCI_CSHIFT, SCI_REDO}, #else {'Y', SCI_CTRL, SCI_REDO}, #endif {'X', SCI_CTRL, SCI_CUT}, {'C', SCI_CTRL, SCI_COPY}, {'V', SCI_CTRL, SCI_PASTE}, {'A', SCI_CTRL, SCI_SELECTALL}, {SCK_TAB, SCI_NORM, SCI_TAB}, {SCK_TAB, SCI_SHIFT, SCI_BACKTAB}, {SCK_RETURN, SCI_NORM, SCI_NEWLINE}, {SCK_RETURN, SCI_SHIFT, SCI_NEWLINE}, {SCK_ADD, SCI_CTRL, SCI_ZOOMIN}, {SCK_SUBTRACT, SCI_CTRL, SCI_ZOOMOUT}, {SCK_DIVIDE, SCI_CTRL, SCI_SETZOOM}, {'L', SCI_CTRL, SCI_LINECUT}, {'L', SCI_CSHIFT, SCI_LINEDELETE}, {'T', SCI_CSHIFT, SCI_LINECOPY}, {'T', SCI_CTRL, SCI_LINETRANSPOSE}, {'D', SCI_CTRL, SCI_SELECTIONDUPLICATE}, {'U', SCI_CTRL, SCI_LOWERCASE}, {'U', SCI_CSHIFT, SCI_UPPERCASE}, {0,0,0}, }; Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexYAML.cxx000444001750001750 2553211727344243 24363 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexYAML.cxx ** Lexer for YAML. **/ // Copyright 2003- by Sean O'Dell // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static const char * const yamlWordListDesc[] = { "Keywords", 0 }; static inline bool AtEOL(Accessor &styler, unsigned int i) { return (styler[i] == '\n') || ((styler[i] == '\r') && (styler.SafeGetCharAt(i + 1) != '\n')); } static unsigned int SpaceCount(char* lineBuffer) { if (lineBuffer == NULL) return 0; char* headBuffer = lineBuffer; while (*headBuffer == ' ') headBuffer++; return headBuffer - lineBuffer; } #define YAML_STATE_BITSIZE 16 #define YAML_STATE_MASK (0xFFFF0000) #define YAML_STATE_DOCUMENT (1 << YAML_STATE_BITSIZE) #define YAML_STATE_VALUE (2 << YAML_STATE_BITSIZE) #define YAML_STATE_COMMENT (3 << YAML_STATE_BITSIZE) #define YAML_STATE_TEXT_PARENT (4 << YAML_STATE_BITSIZE) #define YAML_STATE_TEXT (5 << YAML_STATE_BITSIZE) static void ColouriseYAMLLine( char *lineBuffer, unsigned int currentLine, unsigned int lengthLine, unsigned int startLine, unsigned int endPos, WordList &keywords, Accessor &styler) { unsigned int i = 0; bool bInQuotes = false; unsigned int indentAmount = SpaceCount(lineBuffer); if (currentLine > 0) { int parentLineState = styler.GetLineState(currentLine - 1); if ((parentLineState&YAML_STATE_MASK) == YAML_STATE_TEXT || (parentLineState&YAML_STATE_MASK) == YAML_STATE_TEXT_PARENT) { unsigned int parentIndentAmount = parentLineState&(~YAML_STATE_MASK); if (indentAmount > parentIndentAmount) { styler.SetLineState(currentLine, YAML_STATE_TEXT | parentIndentAmount); styler.ColourTo(endPos, SCE_YAML_TEXT); return; } } } styler.SetLineState(currentLine, 0); if (strncmp(lineBuffer, "---", 3) == 0) { // Document marker styler.SetLineState(currentLine, YAML_STATE_DOCUMENT); styler.ColourTo(endPos, SCE_YAML_DOCUMENT); return; } // Skip initial spaces while ((i < lengthLine) && lineBuffer[i] == ' ') { // YAML always uses space, never TABS or anything else i++; } if (lineBuffer[i] == '\t') { // if we skipped all spaces, and we are NOT inside a text block, this is wrong styler.ColourTo(endPos, SCE_YAML_ERROR); return; } if (lineBuffer[i] == '#') { // Comment styler.SetLineState(currentLine, YAML_STATE_COMMENT); styler.ColourTo(endPos, SCE_YAML_COMMENT); return; } while (i < lengthLine) { if (lineBuffer[i] == '\'' || lineBuffer[i] == '\"') { bInQuotes = !bInQuotes; } else if (lineBuffer[i] == ':' && !bInQuotes) { styler.ColourTo(startLine + i - 1, SCE_YAML_IDENTIFIER); styler.ColourTo(startLine + i, SCE_YAML_OPERATOR); // Non-folding scalar i++; while ((i < lengthLine) && isspacechar(lineBuffer[i])) i++; unsigned int endValue = lengthLine - 1; while ((endValue >= i) && isspacechar(lineBuffer[endValue])) endValue--; lineBuffer[endValue + 1] = '\0'; if (lineBuffer[i] == '|' || lineBuffer[i] == '>') { i++; if (lineBuffer[i] == '+' || lineBuffer[i] == '-') i++; while ((i < lengthLine) && isspacechar(lineBuffer[i])) i++; if (lineBuffer[i] == '\0') { styler.SetLineState(currentLine, YAML_STATE_TEXT_PARENT | indentAmount); styler.ColourTo(endPos, SCE_YAML_DEFAULT); return; } else if (lineBuffer[i] == '#') { styler.SetLineState(currentLine, YAML_STATE_TEXT_PARENT | indentAmount); styler.ColourTo(startLine + i - 1, SCE_YAML_DEFAULT); styler.ColourTo(endPos, SCE_YAML_COMMENT); return; } else { styler.ColourTo(endPos, SCE_YAML_ERROR); return; } } else if (lineBuffer[i] == '#') { styler.ColourTo(startLine + i - 1, SCE_YAML_DEFAULT); styler.ColourTo(endPos, SCE_YAML_COMMENT); return; } styler.SetLineState(currentLine, YAML_STATE_VALUE); if (lineBuffer[i] == '&' || lineBuffer[i] == '*') { styler.ColourTo(endPos, SCE_YAML_REFERENCE); return; } if (keywords.InList(&lineBuffer[i])) { // Convertible value (true/false, etc.) styler.ColourTo(endPos, SCE_YAML_KEYWORD); return; } else { unsigned int i2 = i; while ((i < lengthLine) && lineBuffer[i]) { if (!(isascii(lineBuffer[i]) && isdigit(lineBuffer[i])) && lineBuffer[i] != '-' && lineBuffer[i] != '.' && lineBuffer[i] != ',') { styler.ColourTo(endPos, SCE_YAML_DEFAULT); return; } i++; } if (i > i2) { styler.ColourTo(endPos, SCE_YAML_NUMBER); return; } } break; // shouldn't get here, but just in case, the rest of the line is coloured the default } i++; } styler.ColourTo(endPos, SCE_YAML_DEFAULT); } static void ColouriseYAMLDoc(unsigned int startPos, int length, int, WordList *keywordLists[], Accessor &styler) { char lineBuffer[1024]; styler.StartAt(startPos); styler.StartSegment(startPos); unsigned int linePos = 0; unsigned int startLine = startPos; unsigned int endPos = startPos + length; unsigned int maxPos = styler.Length(); unsigned int lineCurrent = styler.GetLine(startPos); for (unsigned int i = startPos; i < maxPos && i < endPos; i++) { lineBuffer[linePos++] = styler[i]; if (AtEOL(styler, i) || (linePos >= sizeof(lineBuffer) - 1)) { // End of line (or of line buffer) met, colourise it lineBuffer[linePos] = '\0'; ColouriseYAMLLine(lineBuffer, lineCurrent, linePos, startLine, i, *keywordLists[0], styler); linePos = 0; startLine = i + 1; lineCurrent++; } } if (linePos > 0) { // Last line does not have ending characters ColouriseYAMLLine(lineBuffer, lineCurrent, linePos, startLine, startPos + length - 1, *keywordLists[0], styler); } } static bool IsCommentLine(int line, Accessor &styler) { int pos = styler.LineStart(line); if (styler[pos] == '#') return true; return false; } static void FoldYAMLDoc(unsigned int startPos, int length, int /*initStyle - unused*/, WordList *[], Accessor &styler) { const int maxPos = startPos + length; const int maxLines = styler.GetLine(maxPos - 1); // Requested last line const int docLines = styler.GetLine(styler.Length() - 1); // Available last line const bool foldComment = styler.GetPropertyInt("fold.comment.yaml") != 0; // Backtrack to previous non-blank line so we can determine indent level // for any white space lines // and so we can fix any preceding fold level (which is why we go back // at least one line in all cases) int spaceFlags = 0; int lineCurrent = styler.GetLine(startPos); int indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, NULL); while (lineCurrent > 0) { lineCurrent--; indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, NULL); if (!(indentCurrent & SC_FOLDLEVELWHITEFLAG) && (!IsCommentLine(lineCurrent, styler))) break; } int indentCurrentLevel = indentCurrent & SC_FOLDLEVELNUMBERMASK; // Set up initial loop state int prevComment = 0; if (lineCurrent >= 1) prevComment = foldComment && IsCommentLine(lineCurrent - 1, styler); // Process all characters to end of requested range // or comment that hangs over the end of the range. Cap processing in all cases // to end of document (in case of unclosed comment at end). while ((lineCurrent <= docLines) && ((lineCurrent <= maxLines) || prevComment)) { // Gather info int lev = indentCurrent; int lineNext = lineCurrent + 1; int indentNext = indentCurrent; if (lineNext <= docLines) { // Information about next line is only available if not at end of document indentNext = styler.IndentAmount(lineNext, &spaceFlags, NULL); } const int comment = foldComment && IsCommentLine(lineCurrent, styler); const int comment_start = (comment && !prevComment && (lineNext <= docLines) && IsCommentLine(lineNext, styler) && (lev > SC_FOLDLEVELBASE)); const int comment_continue = (comment && prevComment); if (!comment) indentCurrentLevel = indentCurrent & SC_FOLDLEVELNUMBERMASK; if (indentNext & SC_FOLDLEVELWHITEFLAG) indentNext = SC_FOLDLEVELWHITEFLAG | indentCurrentLevel; if (comment_start) { // Place fold point at start of a block of comments lev |= SC_FOLDLEVELHEADERFLAG; } else if (comment_continue) { // Add level to rest of lines in the block lev = lev + 1; } // Skip past any blank lines for next indent level info; we skip also // comments (all comments, not just those starting in column 0) // which effectively folds them into surrounding code rather // than screwing up folding. while ((lineNext < docLines) && ((indentNext & SC_FOLDLEVELWHITEFLAG) || (lineNext <= docLines && IsCommentLine(lineNext, styler)))) { lineNext++; indentNext = styler.IndentAmount(lineNext, &spaceFlags, NULL); } const int levelAfterComments = indentNext & SC_FOLDLEVELNUMBERMASK; const int levelBeforeComments = Maximum(indentCurrentLevel,levelAfterComments); // Now set all the indent levels on the lines we skipped // Do this from end to start. Once we encounter one line // which is indented more than the line after the end of // the comment-block, use the level of the block before int skipLine = lineNext; int skipLevel = levelAfterComments; while (--skipLine > lineCurrent) { int skipLineIndent = styler.IndentAmount(skipLine, &spaceFlags, NULL); if ((skipLineIndent & SC_FOLDLEVELNUMBERMASK) > levelAfterComments) skipLevel = levelBeforeComments; int whiteFlag = skipLineIndent & SC_FOLDLEVELWHITEFLAG; styler.SetLevel(skipLine, skipLevel | whiteFlag); } // Set fold header on non-comment line if (!comment && !(indentCurrent & SC_FOLDLEVELWHITEFLAG) ) { if ((indentCurrent & SC_FOLDLEVELNUMBERMASK) < (indentNext & SC_FOLDLEVELNUMBERMASK)) lev |= SC_FOLDLEVELHEADERFLAG; } // Keep track of block comment state of previous line prevComment = comment_start || comment_continue; // Set fold level for this line and move to next line styler.SetLevel(lineCurrent, lev); indentCurrent = indentNext; lineCurrent = lineNext; } // NOTE: Cannot set level of last line here because indentCurrent doesn't have // header flag set; the loop above is crafted to take care of this case! //styler.SetLevel(lineCurrent, indentCurrent); } LexerModule lmYAML(SCLEX_YAML, ColouriseYAMLDoc, "yaml", FoldYAMLDoc, yamlWordListDesc); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/UniConversion.cxx000444001750001750 733611727344243 25733 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file UniConversion.cxx ** Functions to handle UTF-8 and UTF-16 strings. **/ // Copyright 1998-2001 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include "UniConversion.h" enum { SURROGATE_LEAD_FIRST = 0xD800 }; enum { SURROGATE_TRAIL_FIRST = 0xDC00 }; enum { SURROGATE_TRAIL_LAST = 0xDFFF }; unsigned int UTF8Length(const wchar_t *uptr, unsigned int tlen) { unsigned int len = 0; for (unsigned int i = 0; i < tlen && uptr[i];) { unsigned int uch = uptr[i]; if (uch < 0x80) { len++; } else if (uch < 0x800) { len += 2; } else if ((uch >= SURROGATE_LEAD_FIRST) && (uch <= SURROGATE_TRAIL_LAST)) { len += 4; i++; } else { len += 3; } i++; } return len; } void UTF8FromUTF16(const wchar_t *uptr, unsigned int tlen, char *putf, unsigned int len) { int k = 0; for (unsigned int i = 0; i < tlen && uptr[i];) { unsigned int uch = uptr[i]; if (uch < 0x80) { putf[k++] = static_cast(uch); } else if (uch < 0x800) { putf[k++] = static_cast(0xC0 | (uch >> 6)); putf[k++] = static_cast(0x80 | (uch & 0x3f)); } else if ((uch >= SURROGATE_LEAD_FIRST) && (uch <= SURROGATE_TRAIL_LAST)) { // Half a surrogate pair i++; unsigned int xch = 0x10000 + ((uch & 0x3ff) << 10) + (uptr[i] & 0x3ff); putf[k++] = static_cast(0xF0 | (xch >> 18)); putf[k++] = static_cast(0x80 | ((xch >> 12) & 0x3f)); putf[k++] = static_cast(0x80 | ((xch >> 6) & 0x3f)); putf[k++] = static_cast(0x80 | (xch & 0x3f)); } else { putf[k++] = static_cast(0xE0 | (uch >> 12)); putf[k++] = static_cast(0x80 | ((uch >> 6) & 0x3f)); putf[k++] = static_cast(0x80 | (uch & 0x3f)); } i++; } putf[len] = '\0'; } unsigned int UTF8CharLength(unsigned char ch) { if (ch < 0x80) { return 1; } else if (ch < 0x80 + 0x40 + 0x20) { return 2; } else if (ch < 0x80 + 0x40 + 0x20 + 0x10) { return 3; } else { return 4; } } unsigned int UTF16Length(const char *s, unsigned int len) { unsigned int ulen = 0; unsigned int charLen; for (unsigned int i=0; i(s[i]); if (ch < 0x80) { charLen = 1; } else if (ch < 0x80 + 0x40 + 0x20) { charLen = 2; } else if (ch < 0x80 + 0x40 + 0x20 + 0x10) { charLen = 3; } else { charLen = 4; ulen++; } i += charLen; ulen++; } return ulen; } unsigned int UTF16FromUTF8(const char *s, unsigned int len, wchar_t *tbuf, unsigned int tlen) { unsigned int ui=0; const unsigned char *us = reinterpret_cast(s); unsigned int i=0; while ((i((ch & 0x1F) << 6); ch = us[i++]; tbuf[ui] = static_cast(tbuf[ui] + (ch & 0x7F)); } else if (ch < 0x80 + 0x40 + 0x20 + 0x10) { tbuf[ui] = static_cast((ch & 0xF) << 12); ch = us[i++]; tbuf[ui] = static_cast(tbuf[ui] + ((ch & 0x7F) << 6)); ch = us[i++]; tbuf[ui] = static_cast(tbuf[ui] + (ch & 0x7F)); } else { // Outside the BMP so need two surrogates int val = (ch & 0x7) << 18; ch = us[i++]; val += (ch & 0x3F) << 12; ch = us[i++]; val += (ch & 0x3F) << 6; ch = us[i++]; val += (ch & 0x3F); tbuf[ui] = static_cast(((val - 0x10000) >> 10) + SURROGATE_LEAD_FIRST); ui++; tbuf[ui] = static_cast((val & 0x3ff) + SURROGATE_TRAIL_FIRST); } ui++; } return ui; } Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexerBase.h000444001750001750 241411727344243 24421 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexerBase.h ** A simple lexer with no state. **/ // Copyright 1998-2010 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #ifndef LEXERBASE_H #define LEXERBASE_H #ifdef SCI_NAMESPACE namespace Scintilla { #endif // A simple lexer with no state class LexerBase : public ILexer { protected: PropSetSimple props; enum {numWordLists=KEYWORDSET_MAX+1}; WordList *keyWordLists[numWordLists+1]; public: LexerBase(); virtual ~LexerBase(); void SCI_METHOD Release(); int SCI_METHOD Version() const; const char * SCI_METHOD PropertyNames(); int SCI_METHOD PropertyType(const char *name); const char * SCI_METHOD DescribeProperty(const char *name); int SCI_METHOD PropertySet(const char *key, const char *val); const char * SCI_METHOD DescribeWordListSets(); int SCI_METHOD WordListSet(int n, const char *wl); void SCI_METHOD Lex(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess) = 0; void SCI_METHOD Fold(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess) = 0; void * SCI_METHOD PrivateCall(int operation, void *pointer); }; #ifdef SCI_NAMESPACE } #endif #endif Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexCaml.cxx000444001750001750 3466011727344243 24477 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexCaml.cxx ** Lexer for Objective Caml. **/ // Copyright 2005-2009 by Robert Roessler // The License.txt file describes the conditions under which this software may be distributed. /* Release History 20050204 Initial release. 20050205 Quick compiler standards/"cleanliness" adjustment. 20050206 Added cast for IsLeadByte(). 20050209 Changes to "external" build support. 20050306 Fix for 1st-char-in-doc "corner" case. 20050502 Fix for [harmless] one-past-the-end coloring. 20050515 Refined numeric token recognition logic. 20051125 Added 2nd "optional" keywords class. 20051129 Support "magic" (read-only) comments for RCaml. 20051204 Swtich to using StyleContext infrastructure. 20090629 Add full Standard ML '97 support. */ #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "PropSetSimple.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" // Since the Microsoft __iscsym[f] funcs are not ANSI... inline int iscaml(int c) {return isalnum(c) || c == '_';} inline int iscamlf(int c) {return isalpha(c) || c == '_';} static const int baseT[24] = { 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* A - L */ 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0,16 /* M - X */ }; #ifdef SCI_NAMESPACE using namespace Scintilla; #endif #ifdef BUILD_AS_EXTERNAL_LEXER /* (actually seems to work!) */ #include #include "WindowAccessor.h" #include "ExternalLexer.h" #undef EXT_LEXER_DECL #define EXT_LEXER_DECL __declspec( dllexport ) __stdcall #if PLAT_WIN #include #endif static void ColouriseCamlDoc( unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler); static void FoldCamlDoc( unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler); static void InternalLexOrFold(int lexOrFold, unsigned int startPos, int length, int initStyle, char *words[], WindowID window, char *props); static const char* LexerName = "caml"; #ifdef TRACE void Platform::DebugPrintf(const char *format, ...) { char buffer[2000]; va_list pArguments; va_start(pArguments, format); vsprintf(buffer,format,pArguments); va_end(pArguments); Platform::DebugDisplay(buffer); } #else void Platform::DebugPrintf(const char *, ...) { } #endif bool Platform::IsDBCSLeadByte(int codePage, char ch) { return ::IsDBCSLeadByteEx(codePage, ch) != 0; } long Platform::SendScintilla(WindowID w, unsigned int msg, unsigned long wParam, long lParam) { return ::SendMessage(reinterpret_cast(w), msg, wParam, lParam); } long Platform::SendScintillaPointer(WindowID w, unsigned int msg, unsigned long wParam, void *lParam) { return ::SendMessage(reinterpret_cast(w), msg, wParam, reinterpret_cast(lParam)); } void EXT_LEXER_DECL Fold(unsigned int lexer, unsigned int startPos, int length, int initStyle, char *words[], WindowID window, char *props) { // below useless evaluation(s) to supress "not used" warnings lexer; // build expected data structures and do the Fold InternalLexOrFold(1, startPos, length, initStyle, words, window, props); } int EXT_LEXER_DECL GetLexerCount() { return 1; // just us [Objective] Caml lexers here! } void EXT_LEXER_DECL GetLexerName(unsigned int Index, char *name, int buflength) { // below useless evaluation(s) to supress "not used" warnings Index; // return as much of our lexer name as will fit (what's up with Index?) if (buflength > 0) { buflength--; int n = strlen(LexerName); if (n > buflength) n = buflength; memcpy(name, LexerName, n), name[n] = '\0'; } } void EXT_LEXER_DECL Lex(unsigned int lexer, unsigned int startPos, int length, int initStyle, char *words[], WindowID window, char *props) { // below useless evaluation(s) to supress "not used" warnings lexer; // build expected data structures and do the Lex InternalLexOrFold(0, startPos, length, initStyle, words, window, props); } static void InternalLexOrFold(int foldOrLex, unsigned int startPos, int length, int initStyle, char *words[], WindowID window, char *props) { // create and initialize a WindowAccessor (including contained PropSet) PropSetSimple ps; ps.SetMultiple(props); WindowAccessor wa(window, ps); // create and initialize WordList(s) int nWL = 0; for (; words[nWL]; nWL++) ; // count # of WordList PTRs needed WordList** wl = new WordList* [nWL + 1];// alloc WordList PTRs int i = 0; for (; i < nWL; i++) { wl[i] = new WordList(); // (works or THROWS bad_alloc EXCEPTION) wl[i]->Set(words[i]); } wl[i] = 0; // call our "internal" folder/lexer (... then do Flush!) if (foldOrLex) FoldCamlDoc(startPos, length, initStyle, wl, wa); else ColouriseCamlDoc(startPos, length, initStyle, wl, wa); wa.Flush(); // clean up before leaving for (i = nWL - 1; i >= 0; i--) delete wl[i]; delete [] wl; } static #endif /* BUILD_AS_EXTERNAL_LEXER */ void ColouriseCamlDoc( unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { // initialize styler StyleContext sc(startPos, length, initStyle, styler); int chBase = 0, chToken = 0, chLit = 0; WordList& keywords = *keywordlists[0]; WordList& keywords2 = *keywordlists[1]; WordList& keywords3 = *keywordlists[2]; const bool isSML = keywords.InList("andalso"); const int useMagic = styler.GetPropertyInt("lexer.caml.magic", 0); // set up [initial] state info (terminating states that shouldn't "bleed") const int state_ = sc.state & 0x0f; if (state_ <= SCE_CAML_CHAR || (isSML && state_ == SCE_CAML_STRING)) sc.state = SCE_CAML_DEFAULT; int nesting = (state_ >= SCE_CAML_COMMENT)? (state_ - SCE_CAML_COMMENT): 0; // foreach char in range... while (sc.More()) { // set up [per-char] state info int state2 = -1; // (ASSUME no state change) int chColor = sc.currentPos - 1;// (ASSUME standard coloring range) bool advance = true; // (ASSUME scanner "eats" 1 char) // step state machine switch (sc.state & 0x0f) { case SCE_CAML_DEFAULT: chToken = sc.currentPos; // save [possible] token start (JIC) // it's wide open; what do we have? if (iscamlf(sc.ch)) state2 = SCE_CAML_IDENTIFIER; else if (!isSML && sc.Match('`') && iscamlf(sc.chNext)) state2 = SCE_CAML_TAGNAME; else if (!isSML && sc.Match('#') && isdigit(sc.chNext)) state2 = SCE_CAML_LINENUM; else if (isdigit(sc.ch)) { // it's a number, assume base 10 state2 = SCE_CAML_NUMBER, chBase = 10; if (sc.Match('0')) { // there MAY be a base specified... const char* baseC = "bBoOxX"; if (isSML) { if (sc.chNext == 'w') sc.Forward(); // (consume SML "word" indicator) baseC = "x"; } // ... change to specified base AS REQUIRED if (strchr(baseC, sc.chNext)) chBase = baseT[tolower(sc.chNext) - 'a'], sc.Forward(); } } else if (!isSML && sc.Match('\'')) // (Caml char literal?) state2 = SCE_CAML_CHAR, chLit = 0; else if (isSML && sc.Match('#', '"')) // (SML char literal?) state2 = SCE_CAML_CHAR, sc.Forward(); else if (sc.Match('"')) state2 = SCE_CAML_STRING; else if (sc.Match('(', '*')) state2 = SCE_CAML_COMMENT, sc.Forward(), sc.ch = ' '; // (*)... else if (strchr("!?~" /* Caml "prefix-symbol" */ "=<>@^|&+-*/$%" /* Caml "infix-symbol" */ "()[]{};,:.#", sc.ch) // Caml "bracket" or ;,:.# // SML "extra" ident chars || (isSML && (sc.Match('\\') || sc.Match('`')))) state2 = SCE_CAML_OPERATOR; break; case SCE_CAML_IDENTIFIER: // [try to] interpret as [additional] identifier char if (!(iscaml(sc.ch) || sc.Match('\''))) { const int n = sc.currentPos - chToken; if (n < 24) { // length is believable as keyword, [re-]construct token char t[24]; for (int i = -n; i < 0; i++) t[n + i] = static_cast(sc.GetRelative(i)); t[n] = '\0'; // special-case "_" token as KEYWORD if ((n == 1 && sc.chPrev == '_') || keywords.InList(t)) sc.ChangeState(SCE_CAML_KEYWORD); else if (keywords2.InList(t)) sc.ChangeState(SCE_CAML_KEYWORD2); else if (keywords3.InList(t)) sc.ChangeState(SCE_CAML_KEYWORD3); } state2 = SCE_CAML_DEFAULT, advance = false; } break; case SCE_CAML_TAGNAME: // [try to] interpret as [additional] tagname char if (!(iscaml(sc.ch) || sc.Match('\''))) state2 = SCE_CAML_DEFAULT, advance = false; break; /*case SCE_CAML_KEYWORD: case SCE_CAML_KEYWORD2: case SCE_CAML_KEYWORD3: // [try to] interpret as [additional] keyword char if (!iscaml(ch)) state2 = SCE_CAML_DEFAULT, advance = false; break;*/ case SCE_CAML_LINENUM: // [try to] interpret as [additional] linenum directive char if (!isdigit(sc.ch)) state2 = SCE_CAML_DEFAULT, advance = false; break; case SCE_CAML_OPERATOR: { // [try to] interpret as [additional] operator char const char* o = 0; if (iscaml(sc.ch) || isspace(sc.ch) // ident or whitespace || (o = strchr(")]};,\'\"#", sc.ch),o) // "termination" chars || (!isSML && sc.Match('`')) // Caml extra term char || (!strchr("!$%&*+-./:<=>?@^|~", sc.ch)// "operator" chars // SML extra ident chars && !(isSML && (sc.Match('\\') || sc.Match('`'))))) { // check for INCLUSIVE termination if (o && strchr(")]};,", sc.ch)) { if ((sc.Match(')') && sc.chPrev == '(') || (sc.Match(']') && sc.chPrev == '[')) // special-case "()" and "[]" tokens as KEYWORDS sc.ChangeState(SCE_CAML_KEYWORD); chColor++; } else advance = false; state2 = SCE_CAML_DEFAULT; } break; } case SCE_CAML_NUMBER: // [try to] interpret as [additional] numeric literal char if ((!isSML && sc.Match('_')) || IsADigit(sc.ch, chBase)) break; // how about an integer suffix? if (!isSML && (sc.Match('l') || sc.Match('L') || sc.Match('n')) && (sc.chPrev == '_' || IsADigit(sc.chPrev, chBase))) break; // or a floating-point literal? if (chBase == 10) { // with a decimal point? if (sc.Match('.') && ((!isSML && sc.chPrev == '_') || IsADigit(sc.chPrev, chBase))) break; // with an exponent? (I) if ((sc.Match('e') || sc.Match('E')) && ((!isSML && (sc.chPrev == '.' || sc.chPrev == '_')) || IsADigit(sc.chPrev, chBase))) break; // with an exponent? (II) if (((!isSML && (sc.Match('+') || sc.Match('-'))) || (isSML && sc.Match('~'))) && (sc.chPrev == 'e' || sc.chPrev == 'E')) break; } // it looks like we have run out of number state2 = SCE_CAML_DEFAULT, advance = false; break; case SCE_CAML_CHAR: if (!isSML) { // [try to] interpret as [additional] char literal char if (sc.Match('\\')) { chLit = 1; // (definitely IS a char literal) if (sc.chPrev == '\\') sc.ch = ' '; // (...\\') // should we be terminating - one way or another? } else if ((sc.Match('\'') && sc.chPrev != '\\') || sc.atLineEnd) { state2 = SCE_CAML_DEFAULT; if (sc.Match('\'')) chColor++; else sc.ChangeState(SCE_CAML_IDENTIFIER); // ... maybe a char literal, maybe not } else if (chLit < 1 && sc.currentPos - chToken >= 2) sc.ChangeState(SCE_CAML_IDENTIFIER), advance = false; break; }/* else // fall through for SML char literal (handle like string) */ case SCE_CAML_STRING: // [try to] interpret as [additional] [SML char/] string literal char if (isSML && sc.Match('\\') && sc.chPrev != '\\' && isspace(sc.chNext)) state2 = SCE_CAML_WHITE; else if (sc.Match('\\') && sc.chPrev == '\\') sc.ch = ' '; // (...\\") // should we be terminating - one way or another? else if ((sc.Match('"') && sc.chPrev != '\\') || (isSML && sc.atLineEnd)) { state2 = SCE_CAML_DEFAULT; if (sc.Match('"')) chColor++; } break; case SCE_CAML_WHITE: // [try to] interpret as [additional] SML embedded whitespace char if (sc.Match('\\')) { // style this puppy NOW... state2 = SCE_CAML_STRING, sc.ch = ' ' /* (...\") */, chColor++, styler.ColourTo(chColor, SCE_CAML_WHITE), styler.Flush(); // ... then backtrack to determine original SML literal type int p = chColor - 2; for (; p >= 0 && styler.StyleAt(p) == SCE_CAML_WHITE; p--) ; if (p >= 0) state2 = static_cast(styler.StyleAt(p)); // take care of state change NOW sc.ChangeState(state2), state2 = -1; } break; case SCE_CAML_COMMENT: case SCE_CAML_COMMENT1: case SCE_CAML_COMMENT2: case SCE_CAML_COMMENT3: // we're IN a comment - does this start a NESTED comment? if (sc.Match('(', '*')) state2 = sc.state + 1, chToken = sc.currentPos, sc.Forward(), sc.ch = ' ' /* (*)... */, nesting++; // [try to] interpret as [additional] comment char else if (sc.Match(')') && sc.chPrev == '*') { if (nesting) state2 = (sc.state & 0x0f) - 1, chToken = 0, nesting--; else state2 = SCE_CAML_DEFAULT; chColor++; // enable "magic" (read-only) comment AS REQUIRED } else if (useMagic && sc.currentPos - chToken == 4 && sc.Match('c') && sc.chPrev == 'r' && sc.GetRelative(-2) == '@') sc.state |= 0x10; // (switch to read-only comment style) break; } // handle state change and char coloring AS REQUIRED if (state2 >= 0) styler.ColourTo(chColor, sc.state), sc.ChangeState(state2); // move to next char UNLESS re-scanning current char if (advance) sc.Forward(); } // do any required terminal char coloring (JIC) sc.Complete(); } #ifdef BUILD_AS_EXTERNAL_LEXER static #endif /* BUILD_AS_EXTERNAL_LEXER */ void FoldCamlDoc( unsigned int, int, int, WordList *[], Accessor &) { } static const char * const camlWordListDesc[] = { "Keywords", // primary Objective Caml keywords "Keywords2", // "optional" keywords (typically from Pervasives) "Keywords3", // "optional" keywords (typically typenames) 0 }; #ifndef BUILD_AS_EXTERNAL_LEXER LexerModule lmCaml(SCLEX_CAML, ColouriseCamlDoc, "caml", FoldCamlDoc, camlWordListDesc); #endif /* BUILD_AS_EXTERNAL_LEXER */ Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexPowerShell.cxx000444001750001750 1431311727344243 25700 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexPowerShell.cxx ** Lexer for PowerShell scripts. **/ // Copyright 2008 by Tim Gerundt // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif // Extended to accept accented characters static inline bool IsAWordChar(int ch) { return ch >= 0x80 || isalnum(ch) || ch == '-' || ch == '_'; } static void ColourisePowerShellDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { WordList &keywords = *keywordlists[0]; WordList &keywords2 = *keywordlists[1]; WordList &keywords3 = *keywordlists[2]; WordList &keywords4 = *keywordlists[3]; WordList &keywords5 = *keywordlists[4]; styler.StartAt(startPos); StyleContext sc(startPos, length, initStyle, styler); for (; sc.More(); sc.Forward()) { if (sc.state == SCE_POWERSHELL_COMMENT) { if (sc.atLineEnd) { sc.SetState(SCE_POWERSHELL_DEFAULT); } } else if (sc.state == SCE_POWERSHELL_COMMENTSTREAM) { if (sc.ch == '>' && sc.chPrev == '#') { sc.ForwardSetState(SCE_POWERSHELL_DEFAULT); } } else if (sc.state == SCE_POWERSHELL_STRING) { // This is a doubles quotes string if (sc.ch == '\"') { sc.ForwardSetState(SCE_POWERSHELL_DEFAULT); } } else if (sc.state == SCE_POWERSHELL_CHARACTER) { // This is a single quote string if (sc.ch == '\'') { sc.ForwardSetState(SCE_POWERSHELL_DEFAULT); } } else if (sc.state == SCE_POWERSHELL_NUMBER) { if (!IsADigit(sc.ch)) { sc.SetState(SCE_POWERSHELL_DEFAULT); } } else if (sc.state == SCE_POWERSHELL_VARIABLE) { if (!IsAWordChar(sc.ch)) { sc.SetState(SCE_POWERSHELL_DEFAULT); } } else if (sc.state == SCE_POWERSHELL_OPERATOR) { if (!isoperator(static_cast(sc.ch))) { sc.SetState(SCE_POWERSHELL_DEFAULT); } } else if (sc.state == SCE_POWERSHELL_IDENTIFIER) { if (!IsAWordChar(sc.ch)) { char s[100]; sc.GetCurrentLowered(s, sizeof(s)); if (keywords.InList(s)) { sc.ChangeState(SCE_POWERSHELL_KEYWORD); } else if (keywords2.InList(s)) { sc.ChangeState(SCE_POWERSHELL_CMDLET); } else if (keywords3.InList(s)) { sc.ChangeState(SCE_POWERSHELL_ALIAS); } else if (keywords4.InList(s)) { sc.ChangeState(SCE_POWERSHELL_FUNCTION); } else if (keywords5.InList(s)) { sc.ChangeState(SCE_POWERSHELL_USER1); } sc.SetState(SCE_POWERSHELL_DEFAULT); } } // Determine if a new state should be entered. if (sc.state == SCE_POWERSHELL_DEFAULT) { if (sc.ch == '#') { sc.SetState(SCE_POWERSHELL_COMMENT); } else if (sc.ch == '<' && sc.chNext == '#') { sc.SetState(SCE_POWERSHELL_COMMENTSTREAM); } else if (sc.ch == '\"') { sc.SetState(SCE_POWERSHELL_STRING); } else if (sc.ch == '\'') { sc.SetState(SCE_POWERSHELL_CHARACTER); } else if (sc.ch == '$') { sc.SetState(SCE_POWERSHELL_VARIABLE); } else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) { sc.SetState(SCE_POWERSHELL_NUMBER); } else if (isoperator(static_cast(sc.ch))) { sc.SetState(SCE_POWERSHELL_OPERATOR); } else if (IsAWordChar(sc.ch)) { sc.SetState(SCE_POWERSHELL_IDENTIFIER); } } } sc.Complete(); } // Store both the current line's fold level and the next lines in the // level store to make it easy to pick up with each increment // and to make it possible to fiddle the current level for "} else {". static void FoldPowerShellDoc(unsigned int startPos, int length, int initStyle, WordList *[], Accessor &styler) { bool foldComment = styler.GetPropertyInt("fold.comment") != 0; bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; bool foldAtElse = styler.GetPropertyInt("fold.at.else", 0) != 0; unsigned int endPos = startPos + length; int visibleChars = 0; int lineCurrent = styler.GetLine(startPos); int levelCurrent = SC_FOLDLEVELBASE; if (lineCurrent > 0) levelCurrent = styler.LevelAt(lineCurrent-1) >> 16; int levelMinCurrent = levelCurrent; int levelNext = levelCurrent; char chNext = styler[startPos]; int styleNext = styler.StyleAt(startPos); int style = initStyle; for (unsigned int i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); int stylePrev = style; style = styleNext; styleNext = styler.StyleAt(i + 1); bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); if (style == SCE_POWERSHELL_OPERATOR) { if (ch == '{') { // Measure the minimum before a '{' to allow // folding on "} else {" if (levelMinCurrent > levelNext) { levelMinCurrent = levelNext; } levelNext++; } else if (ch == '}') { levelNext--; } } else if (foldComment && style == SCE_POWERSHELL_COMMENTSTREAM) { if (stylePrev != SCE_POWERSHELL_COMMENTSTREAM) { levelNext++; } else if (styleNext != SCE_POWERSHELL_COMMENTSTREAM) { levelNext--; } } if (!IsASpace(ch)) visibleChars++; if (atEOL || (i == endPos-1)) { int levelUse = levelCurrent; if (foldAtElse) { levelUse = levelMinCurrent; } int lev = levelUse | levelNext << 16; if (visibleChars == 0 && foldCompact) lev |= SC_FOLDLEVELWHITEFLAG; if (levelUse < levelNext) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) { styler.SetLevel(lineCurrent, lev); } lineCurrent++; levelCurrent = levelNext; levelMinCurrent = levelCurrent; visibleChars = 0; } } } static const char * const powershellWordLists[] = { "Commands", "Cmdlets", "Aliases", "Functions", "User1", 0 }; LexerModule lmPowerShell(SCLEX_POWERSHELL, ColourisePowerShellDoc, "powershell", FoldPowerShellDoc, powershellWordLists); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/Editor.h000444001750001750 4734611727344243 24032 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file Editor.h ** Defines the main editor class. **/ // Copyright 1998-2011 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #ifndef EDITOR_H #define EDITOR_H #ifdef SCI_NAMESPACE namespace Scintilla { #endif /** */ class Caret { public: bool active; bool on; int period; Caret(); }; /** */ class Timer { public: bool ticking; int ticksToWait; enum {tickSize = 100}; TickerID tickerID; Timer(); }; /** */ class Idler { public: bool state; IdlerID idlerID; Idler(); }; /** * When platform has a way to generate an event before painting, * accumulate needed styling range in StyleNeeded to avoid unnecessary work. */ class StyleNeeded { public: bool active; Position upTo; StyleNeeded() : active(false), upTo(0) {} void Reset() { active = false; upTo = 0; } void NeedUpTo(Position pos) { if (upTo < pos) upTo = pos; } }; /** * Hold a piece of text selected for copying or dragging. * The text is expected to hold a terminating '\0' and this is counted in len. */ class SelectionText { public: char *s; int len; bool rectangular; bool lineCopy; int codePage; int characterSet; SelectionText() : s(0), len(0), rectangular(false), lineCopy(false), codePage(0), characterSet(0) {} ~SelectionText() { Free(); } void Free() { Set(0, 0, 0, 0, false, false); } void Set(char *s_, int len_, int codePage_, int characterSet_, bool rectangular_, bool lineCopy_) { delete []s; s = s_; if (s) len = len_; else len = 0; codePage = codePage_; characterSet = characterSet_; rectangular = rectangular_; lineCopy = lineCopy_; } void Copy(const char *s_, int len_, int codePage_, int characterSet_, bool rectangular_, bool lineCopy_) { delete []s; s = 0; s = new char[len_]; len = len_; for (int i = 0; i < len_; i++) { s[i] = s_[i]; } codePage = codePage_; characterSet = characterSet_; rectangular = rectangular_; lineCopy = lineCopy_; } void Copy(const SelectionText &other) { Copy(other.s, other.len, other.codePage, other.characterSet, other.rectangular, other.lineCopy); } }; /** */ class Editor : public DocWatcher { // Private so Editor objects can not be copied Editor(const Editor &); Editor &operator=(const Editor &); protected: // ScintillaBase subclass needs access to much of Editor /** On GTK+, Scintilla is a container widget holding two scroll bars * whereas on Windows there is just one window with both scroll bars turned on. */ Window wMain; ///< The Scintilla parent window /** Style resources may be expensive to allocate so are cached between uses. * When a style attribute is changed, this cache is flushed. */ bool stylesValid; ViewStyle vs; int technology; Point sizeRGBAImage; int printMagnification; int printColourMode; int printWrapState; int cursorMode; int controlCharSymbol; // Highlight current folding block HighlightDelimiter highlightDelimiter; bool hasFocus; bool hideSelection; bool inOverstrike; bool mouseDownCaptures; /** In bufferedDraw mode, graphics operations are drawn to a pixmap and then copied to * the screen. This avoids flashing but is about 30% slower. */ bool bufferedDraw; /** In twoPhaseDraw mode, drawing is performed in two phases, first the background * and then the foreground. This avoids chopping off characters that overlap the next run. */ bool twoPhaseDraw; int xOffset; ///< Horizontal scrolled amount in pixels int xCaretMargin; ///< Ensure this many pixels visible on both sides of caret bool horizontalScrollBarVisible; int scrollWidth; bool trackLineWidth; int lineWidthMaxSeen; bool verticalScrollBarVisible; bool endAtLastLine; int caretSticky; int marginOptions; bool multipleSelection; bool additionalSelectionTyping; int multiPasteMode; bool additionalCaretsBlink; bool additionalCaretsVisible; int virtualSpaceOptions; Surface *pixmapLine; Surface *pixmapSelMargin; Surface *pixmapSelPattern; Surface *pixmapIndentGuide; Surface *pixmapIndentGuideHighlight; LineLayoutCache llc; PositionCache posCache; KeyMap kmap; Caret caret; Timer timer; Timer autoScrollTimer; enum { autoScrollDelay = 200 }; Idler idler; Point lastClick; unsigned int lastClickTime; int dwellDelay; int ticksToDwell; bool dwelling; enum { selChar, selWord, selSubLine, selWholeLine } selectionType; Point ptMouseLast; enum { ddNone, ddInitial, ddDragging } inDragDrop; bool dropWentOutside; SelectionPosition posDrag; SelectionPosition posDrop; int hotSpotClickPos; int lastXChosen; int lineAnchorPos; int originalAnchorPos; int wordSelectAnchorStartPos; int wordSelectAnchorEndPos; int wordSelectInitialCaretPos; int targetStart; int targetEnd; int searchFlags; int topLine; int posTopLine; int lengthForEncode; int needUpdateUI; Position braces[2]; int bracesMatchStyle; int highlightGuideColumn; int theEdge; enum { notPainting, painting, paintAbandoned } paintState; PRectangle rcPaint; bool paintingAllText; bool willRedrawAll; StyleNeeded styleNeeded; int modEventMask; SelectionText drag; Selection sel; bool primarySelection; int caretXPolicy; int caretXSlop; ///< Ensure this many pixels visible on both sides of caret int caretYPolicy; int caretYSlop; ///< Ensure this many lines visible on both sides of caret int visiblePolicy; int visibleSlop; int searchAnchor; bool recordingMacro; int foldFlags; ContractionState cs; // Hotspot support int hsStart; int hsEnd; // Wrapping support enum { eWrapNone, eWrapWord, eWrapChar } wrapState; enum { wrapLineLarge = 0x7ffffff }; int wrapWidth; int wrapStart; int wrapEnd; int wrapVisualFlags; int wrapVisualFlagsLocation; int wrapVisualStartIndent; XYPOSITION wrapAddIndent; // This will be added to initial indent of line int wrapIndentMode; // SC_WRAPINDENT_FIXED, _SAME, _INDENT bool convertPastes; Document *pdoc; Editor(); virtual ~Editor(); virtual void Initialise() = 0; virtual void Finalise(); void InvalidateStyleData(); void InvalidateStyleRedraw(); void RefreshStyleData(); void DropGraphics(bool freeObjects); void AllocateGraphics(); virtual PRectangle GetClientRectangle(); PRectangle GetTextRectangle(); int LinesOnScreen(); int LinesToScroll(); int MaxScrollPos(); SelectionPosition ClampPositionIntoDocument(SelectionPosition sp) const; Point LocationFromPosition(SelectionPosition pos); Point LocationFromPosition(int pos); int XFromPosition(int pos); int XFromPosition(SelectionPosition sp); SelectionPosition SPositionFromLocation(Point pt, bool canReturnInvalid=false, bool charPosition=false, bool virtualSpace=true); int PositionFromLocation(Point pt, bool canReturnInvalid=false, bool charPosition=false); SelectionPosition SPositionFromLineX(int lineDoc, int x); int PositionFromLineX(int line, int x); int LineFromLocation(Point pt); void SetTopLine(int topLineNew); bool AbandonPaint(); void RedrawRect(PRectangle rc); void Redraw(); void RedrawSelMargin(int line=-1, bool allAfter=false); PRectangle RectangleFromRange(int start, int end); void InvalidateRange(int start, int end); bool UserVirtualSpace() const { return ((virtualSpaceOptions & SCVS_USERACCESSIBLE) != 0); } int CurrentPosition(); bool SelectionEmpty(); SelectionPosition SelectionStart(); SelectionPosition SelectionEnd(); void SetRectangularRange(); void ThinRectangularRange(); void InvalidateSelection(SelectionRange newMain, bool invalidateWholeSelection=false); void SetSelection(SelectionPosition currentPos_, SelectionPosition anchor_); void SetSelection(int currentPos_, int anchor_); void SetSelection(SelectionPosition currentPos_); void SetSelection(int currentPos_); void SetEmptySelection(SelectionPosition currentPos_); void SetEmptySelection(int currentPos_); bool RangeContainsProtected(int start, int end) const; bool SelectionContainsProtected(); int MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd=true) const; SelectionPosition MovePositionOutsideChar(SelectionPosition pos, int moveDir, bool checkLineEnd=true) const; int MovePositionTo(SelectionPosition newPos, Selection::selTypes sel=Selection::noSel, bool ensureVisible=true); int MovePositionTo(int newPos, Selection::selTypes sel=Selection::noSel, bool ensureVisible=true); SelectionPosition MovePositionSoVisible(SelectionPosition pos, int moveDir); SelectionPosition MovePositionSoVisible(int pos, int moveDir); Point PointMainCaret(); void SetLastXChosen(); void ScrollTo(int line, bool moveThumb=true); virtual void ScrollText(int linesToMove); void HorizontalScrollTo(int xPos); void VerticalCentreCaret(); void MoveSelectedLines(int lineDelta); void MoveSelectedLinesUp(); void MoveSelectedLinesDown(); void MoveCaretInsideView(bool ensureVisible=true); int DisplayFromPosition(int pos); struct XYScrollPosition { int xOffset; int topLine; XYScrollPosition(int xOffset_, int topLine_) : xOffset(xOffset_), topLine(topLine_) {} }; XYScrollPosition XYScrollToMakeVisible(const bool useMargin, const bool vert, const bool horiz); void SetXYScroll(XYScrollPosition newXY); void EnsureCaretVisible(bool useMargin=true, bool vert=true, bool horiz=true); void ShowCaretAtCurrentPosition(); void DropCaret(); void InvalidateCaret(); virtual void UpdateSystemCaret(); void NeedWrapping(int docLineStart = 0, int docLineEnd = wrapLineLarge); bool WrapOneLine(Surface *surface, int lineToWrap); bool WrapLines(bool fullWrap, int priorityWrapLineStart); void LinesJoin(); void LinesSplit(int pixelWidth); int SubstituteMarkerIfEmpty(int markerCheck, int markerDefault); void PaintSelMargin(Surface *surface, PRectangle &rc); LineLayout *RetrieveLineLayout(int lineNumber); void LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayout *ll, int width=LineLayout::wrapWidthInfinite); ColourDesired SelectionBackground(ViewStyle &vsDraw, bool main); ColourDesired TextBackground(ViewStyle &vsDraw, bool overrideBackground, ColourDesired background, int inSelection, bool inHotspot, int styleMain, int i, LineLayout *ll); void DrawIndentGuide(Surface *surface, int lineVisible, int lineHeight, int start, PRectangle rcSegment, bool highlight); void DrawWrapMarker(Surface *surface, PRectangle rcPlace, bool isEndMarker, ColourDesired wrapColour); void DrawEOL(Surface *surface, ViewStyle &vsDraw, PRectangle rcLine, LineLayout *ll, int line, int lineEnd, int xStart, int subLine, XYACCUMULATOR subLineStart, bool overrideBackground, ColourDesired background, bool drawWrapMark, ColourDesired wrapColour); void DrawIndicator(int indicNum, int startPos, int endPos, Surface *surface, ViewStyle &vsDraw, int xStart, PRectangle rcLine, LineLayout *ll, int subLine); void DrawIndicators(Surface *surface, ViewStyle &vsDraw, int line, int xStart, PRectangle rcLine, LineLayout *ll, int subLine, int lineEnd, bool under); void DrawAnnotation(Surface *surface, ViewStyle &vsDraw, int line, int xStart, PRectangle rcLine, LineLayout *ll, int subLine); void DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVisible, int xStart, PRectangle rcLine, LineLayout *ll, int subLine); void DrawBlockCaret(Surface *surface, ViewStyle &vsDraw, LineLayout *ll, int subLine, int xStart, int offset, int posCaret, PRectangle rcCaret, ColourDesired caretColour); void DrawCarets(Surface *surface, ViewStyle &vsDraw, int line, int xStart, PRectangle rcLine, LineLayout *ll, int subLine); void RefreshPixMaps(Surface *surfaceWindow); void Paint(Surface *surfaceWindow, PRectangle rcArea); long FormatRange(bool draw, Sci_RangeToFormat *pfr); int TextWidth(int style, const char *text); virtual void SetVerticalScrollPos() = 0; virtual void SetHorizontalScrollPos() = 0; virtual bool ModifyScrollBars(int nMax, int nPage) = 0; virtual void ReconfigureScrollBars(); void SetScrollBars(); void ChangeSize(); void FilterSelections(); int InsertSpace(int position, unsigned int spaces); void AddChar(char ch); virtual void AddCharUTF(char *s, unsigned int len, bool treatAsDBCS=false); void InsertPaste(SelectionPosition selStart, const char *text, int len); void ClearSelection(bool retainMultipleSelections=false); void ClearAll(); void ClearDocumentStyle(); void Cut(); void PasteRectangular(SelectionPosition pos, const char *ptr, int len); virtual void Copy() = 0; virtual void CopyAllowLine(); virtual bool CanPaste(); virtual void Paste() = 0; void Clear(); void SelectAll(); void Undo(); void Redo(); void DelChar(); void DelCharBack(bool allowLineStartDeletion); virtual void ClaimSelection() = 0; virtual void NotifyChange() = 0; virtual void NotifyFocus(bool focus); virtual void SetCtrlID(int identifier); virtual int GetCtrlID() { return ctrlID; } virtual void NotifyParent(SCNotification scn) = 0; virtual void NotifyStyleToNeeded(int endStyleNeeded); void NotifyChar(int ch); void NotifySavePoint(bool isSavePoint); void NotifyModifyAttempt(); virtual void NotifyDoubleClick(Point pt, bool shift, bool ctrl, bool alt); void NotifyHotSpotClicked(int position, bool shift, bool ctrl, bool alt); void NotifyHotSpotDoubleClicked(int position, bool shift, bool ctrl, bool alt); void NotifyHotSpotReleaseClick(int position, bool shift, bool ctrl, bool alt); void NotifyUpdateUI(); void NotifyPainted(); void NotifyIndicatorClick(bool click, int position, bool shift, bool ctrl, bool alt); bool NotifyMarginClick(Point pt, bool shift, bool ctrl, bool alt); void NotifyNeedShown(int pos, int len); void NotifyDwelling(Point pt, bool state); void NotifyZoom(); void NotifyModifyAttempt(Document *document, void *userData); void NotifySavePoint(Document *document, void *userData, bool atSavePoint); void CheckModificationForWrap(DocModification mh); void NotifyModified(Document *document, DocModification mh, void *userData); void NotifyDeleted(Document *document, void *userData); void NotifyStyleNeeded(Document *doc, void *userData, int endPos); void NotifyLexerChanged(Document *doc, void *userData); void NotifyErrorOccurred(Document *doc, void *userData, int status); void NotifyMacroRecord(unsigned int iMessage, uptr_t wParam, sptr_t lParam); void ContainerNeedsUpdate(int flags); void PageMove(int direction, Selection::selTypes sel=Selection::noSel, bool stuttered = false); enum { cmSame, cmUpper, cmLower } caseMap; virtual std::string CaseMapString(const std::string &s, int caseMapping); void ChangeCaseOfSelection(int caseMapping); void LineTranspose(); void Duplicate(bool forLine); virtual void CancelModes(); void NewLine(); void CursorUpOrDown(int direction, Selection::selTypes sel=Selection::noSel); void ParaUpOrDown(int direction, Selection::selTypes sel=Selection::noSel); int StartEndDisplayLine(int pos, bool start); virtual int KeyCommand(unsigned int iMessage); virtual int KeyDefault(int /* key */, int /*modifiers*/); int KeyDownWithModifiers(int key, int modifiers, bool *consumed); int KeyDown(int key, bool shift, bool ctrl, bool alt, bool *consumed=0); int GetWhitespaceVisible(); void SetWhitespaceVisible(int view); void Indent(bool forwards); virtual CaseFolder *CaseFolderForEncoding(); long FindText(uptr_t wParam, sptr_t lParam); void SearchAnchor(); long SearchText(unsigned int iMessage, uptr_t wParam, sptr_t lParam); long SearchInTarget(const char *text, int length); void GoToLine(int lineNo); virtual void CopyToClipboard(const SelectionText &selectedText) = 0; char *CopyRange(int start, int end); void CopySelectionRange(SelectionText *ss, bool allowLineCopy=false); void CopyRangeToClipboard(int start, int end); void CopyText(int length, const char *text); void SetDragPosition(SelectionPosition newPos); virtual void DisplayCursor(Window::Cursor c); virtual bool DragThreshold(Point ptStart, Point ptNow); virtual void StartDrag(); void DropAt(SelectionPosition position, const char *value, bool moving, bool rectangular); /** PositionInSelection returns true if position in selection. */ bool PositionInSelection(int pos); bool PointInSelection(Point pt); bool PointInSelMargin(Point pt); Window::Cursor GetMarginCursor(Point pt); void LineSelection(int lineCurrentPos_, int lineAnchorPos_, bool wholeLine); void WordSelection(int pos); void DwellEnd(bool mouseMoved); void MouseLeave(); virtual void ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt); void ButtonMove(Point pt); void ButtonUp(Point pt, unsigned int curTime, bool ctrl); void Tick(); bool Idle(); virtual void SetTicking(bool on) = 0; virtual bool SetIdle(bool) { return false; } virtual void SetMouseCapture(bool on) = 0; virtual bool HaveMouseCapture() = 0; void SetFocusState(bool focusState); int PositionAfterArea(PRectangle rcArea); void StyleToPositionInView(Position pos); void IdleStyling(); virtual void QueueStyling(int upTo); virtual bool PaintContains(PRectangle rc); bool PaintContainsMargin(); void CheckForChangeOutsidePaint(Range r); void SetBraceHighlight(Position pos0, Position pos1, int matchStyle); void SetAnnotationHeights(int start, int end); void SetDocPointer(Document *document); void SetAnnotationVisible(int visible); void Expand(int &line, bool doExpand); void ToggleContraction(int line); int ContractedFoldNext(int lineStart); void EnsureLineVisible(int lineDoc, bool enforcePolicy); int GetTag(char *tagValue, int tagNumber); int ReplaceTarget(bool replacePatterns, const char *text, int length=-1); bool PositionIsHotspot(int position); bool PointIsHotspot(Point pt); void SetHotSpotRange(Point *pt); void GetHotSpotRange(int &hsStart, int &hsEnd); int CodePage() const; virtual bool ValidCodePage(int /* codePage */) const { return true; } int WrapCount(int line); void AddStyledText(char *buffer, int appendLength); virtual sptr_t DefWndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) = 0; void StyleSetMessage(unsigned int iMessage, uptr_t wParam, sptr_t lParam); sptr_t StyleGetMessage(unsigned int iMessage, uptr_t wParam, sptr_t lParam); static const char *StringFromEOLMode(int eolMode); static sptr_t StringResult(sptr_t lParam, const char *val); public: // Public so the COM thunks can access it. bool IsUnicodeMode() const; // Public so scintilla_send_message can use it. virtual sptr_t WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam); // Public so scintilla_set_id can use it. int ctrlID; // Public so COM methods for drag and drop can set it. int errorStatus; friend class AutoSurface; friend class SelectionLineIterator; }; /** * A smart pointer class to ensure Surfaces are set up and deleted correctly. */ class AutoSurface { private: Surface *surf; public: AutoSurface(Editor *ed) : surf(0) { if (ed->wMain.GetID()) { surf = Surface::Allocate(ed->technology); if (surf) { surf->Init(ed->wMain.GetID()); surf->SetUnicodeMode(SC_CP_UTF8 == ed->CodePage()); surf->SetDBCSMode(ed->CodePage()); } } } AutoSurface(SurfaceID sid, Editor *ed) : surf(0) { if (ed->wMain.GetID()) { surf = Surface::Allocate(ed->technology); if (surf) { surf->Init(sid, ed->wMain.GetID()); surf->SetUnicodeMode(SC_CP_UTF8 == ed->CodePage()); surf->SetDBCSMode(ed->CodePage()); } } } ~AutoSurface() { delete surf; } Surface *operator->() const { return surf; } operator Surface *() const { return surf; } }; #ifdef SCI_NAMESPACE } #endif #endif Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexTCMD.cxx000444001750001750 4164511727344243 24353 0ustar00azawawiazawawi000000000000// Scintilla\ source code edit control /** @file LexTCMD.cxx ** Lexer for Take Command / TCC batch scripts (.bat, .btm, .cmd). **/ // Written by Rex Conn (rconn [at] jpsoft [dot] com) // based on the CMD lexer // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static bool IsAlphabetic(int ch) { return isascii(ch) && isalpha(ch); } static inline bool AtEOL(Accessor &styler, unsigned int i) { return (styler[i] == '\n') || ((styler[i] == '\r') && (styler.SafeGetCharAt(i + 1) != '\n')); } // Tests for BATCH Operators static bool IsBOperator(char ch) { return (ch == '=') || (ch == '+') || (ch == '>') || (ch == '<') || (ch == '|') || (ch == '&') || (ch == '!') || (ch == '?') || (ch == '*') || (ch == '(') || (ch == ')'); } // Tests for BATCH Separators static bool IsBSeparator(char ch) { return (ch == '\\') || (ch == '.') || (ch == ';') || (ch == ' ') || (ch == '\t') || (ch == '[') || (ch == ']') || (ch == '\"') || (ch == '\'') || (ch == '/'); } // Tests for Environment Variable symbol static inline bool IsEnvironmentVar(char ch) { return isalpha(ch) || isdigit(ch) || (ch == '_') || (ch == '$'); } // Find length of CMD FOR variable with modifier (%~...) or return 0 static unsigned int GetBatchVarLen( char *wordBuffer ) { int nLength = 0; if ( wordBuffer[0] == '%' ) { if ( wordBuffer[1] == '~' ) nLength = 2; else if (( wordBuffer[1] == '%' ) && ( wordBuffer[2] == '~' )) nLength++; else return 0; for ( ; ( wordBuffer[nLength] ); nLength++ ) { switch ( toupper(wordBuffer[nLength]) ) { case 'A': // file attributes case 'D': // drive letter only case 'F': // fully qualified path name case 'N': // filename only case 'P': // path only case 'S': // short name case 'T': // date / time of file case 'X': // file extension only case 'Z': // file size break; default: return nLength; } } } return nLength; } static void ColouriseTCMDLine( char *lineBuffer, unsigned int lengthLine, unsigned int startLine, unsigned int endPos, WordList *keywordlists[], Accessor &styler) { unsigned int offset = 0; // Line Buffer Offset char wordBuffer[260]; // Word Buffer - large to catch long paths unsigned int wbl; // Word Buffer Length unsigned int wbo; // Word Buffer Offset - also Special Keyword Buffer Length WordList &keywords = *keywordlists[0]; // Internal Commands // WordList &keywords2 = *keywordlists[1]; // Aliases (optional) bool isDelayedExpansion = 1; // !var! bool continueProcessing = true; // Used to toggle Regular Keyword Checking // Special Keywords are those that allow certain characters without whitespace after the command // Examples are: cd. cd\ echo: echo. path= bool inString = false; // Used for processing while "" // Special Keyword Buffer used to determine if the first n characters is a Keyword char sKeywordBuffer[260]; // Special Keyword Buffer bool sKeywordFound; // Exit Special Keyword for-loop if found // Skip leading whitespace while ((offset < lengthLine) && (isspacechar(lineBuffer[offset]))) { offset++; } // Colorize Default Text styler.ColourTo(startLine + offset - 1, SCE_TCMD_DEFAULT); if ( offset >= lengthLine ) return; // Check for Fake Label (Comment) or Real Label - return if found if (lineBuffer[offset] == ':') { if (lineBuffer[offset + 1] == ':') { // Colorize Fake Label (Comment) - :: is the same as REM styler.ColourTo(endPos, SCE_TCMD_COMMENT); } else { // Colorize Real Label styler.ColourTo(endPos, SCE_TCMD_LABEL); } return; // Check for Comment - return if found } else if (( CompareNCaseInsensitive(lineBuffer+offset, "rem", 3) == 0 ) && (( lineBuffer[offset+3] == 0 ) || ( isspace(lineBuffer[offset+3] )))) { styler.ColourTo(endPos, SCE_TCMD_COMMENT); return; // Check for Drive Change (Drive Change is internal command) - return if found } else if ((IsAlphabetic(lineBuffer[offset])) && (lineBuffer[offset + 1] == ':') && ((isspacechar(lineBuffer[offset + 2])) || (((lineBuffer[offset + 2] == '\\')) && (isspacechar(lineBuffer[offset + 3]))))) { // Colorize Regular Keyword styler.ColourTo(endPos, SCE_TCMD_WORD); return; } // Check for Hide Command (@ECHO OFF/ON) if (lineBuffer[offset] == '@') { styler.ColourTo(startLine + offset, SCE_TCMD_HIDE); offset++; } // Skip whitespace while ((offset < lengthLine) && (isspacechar(lineBuffer[offset]))) { offset++; } // Read remainder of line word-at-a-time or remainder-of-word-at-a-time while (offset < lengthLine) { if (offset > startLine) { // Colorize Default Text styler.ColourTo(startLine + offset - 1, SCE_TCMD_DEFAULT); } // Copy word from Line Buffer into Word Buffer wbl = 0; for (; offset < lengthLine && ( wbl < 260 ) && !isspacechar(lineBuffer[offset]); wbl++, offset++) { wordBuffer[wbl] = static_cast(tolower(lineBuffer[offset])); } wordBuffer[wbl] = '\0'; wbo = 0; // Check for Separator if (IsBSeparator(wordBuffer[0])) { // Reset Offset to re-process remainder of word offset -= (wbl - 1); // Colorize Default Text styler.ColourTo(startLine + offset - 1, SCE_BAT_DEFAULT); if (wordBuffer[0] == '"') inString = !inString; // Check for Regular expression } else if (( wordBuffer[0] == ':' ) && ( wordBuffer[1] == ':' ) && (continueProcessing)) { // Colorize Regular exoressuin styler.ColourTo(startLine + offset - 1, SCE_TCMD_DEFAULT); // No need to Reset Offset // Check for Labels in text (... :label) } else if (wordBuffer[0] == ':' && isspacechar(lineBuffer[offset - wbl - 1])) { // Colorize Default Text styler.ColourTo(startLine + offset - 1 - wbl, SCE_TCMD_DEFAULT); // Colorize Label styler.ColourTo(startLine + offset - 1, SCE_TCMD_CLABEL); // No need to Reset Offset // Check for delayed expansion Variable (!x...!) } else if (isDelayedExpansion && wordBuffer[0] == '!') { // Colorize Default Text styler.ColourTo(startLine + offset - 1 - wbl, SCE_TCMD_DEFAULT); wbo++; // Search to end of word for second ! while ((wbo < wbl) && (wordBuffer[wbo] != '!') && (!IsBOperator(wordBuffer[wbo])) && (!IsBSeparator(wordBuffer[wbo]))) { wbo++; } if (wordBuffer[wbo] == '!') { wbo++; // Colorize Environment Variable styler.ColourTo(startLine + offset - 1 - (wbl - wbo), SCE_TCMD_EXPANSION); } else { wbo = 1; // Colorize Symbol styler.ColourTo(startLine + offset - 1 - (wbl - 1), SCE_TCMD_DEFAULT); } // Reset Offset to re-process remainder of word offset -= (wbl - wbo); // Check for Regular Keyword in list } else if ((keywords.InList(wordBuffer)) && (!inString) && (continueProcessing)) { // ECHO, PATH, and PROMPT require no further Regular Keyword Checking if ((CompareCaseInsensitive(wordBuffer, "echo") == 0) || (CompareCaseInsensitive(sKeywordBuffer, "echos") == 0) || (CompareCaseInsensitive(sKeywordBuffer, "echoerr") == 0) || (CompareCaseInsensitive(sKeywordBuffer, "echoserr") == 0) || (CompareCaseInsensitive(wordBuffer, "path") == 0) || (CompareCaseInsensitive(wordBuffer, "prompt") == 0)) { continueProcessing = false; } // Colorize Regular keyword styler.ColourTo(startLine + offset - 1, SCE_TCMD_WORD); // No need to Reset Offset } else if ((wordBuffer[0] != '%') && (wordBuffer[0] != '!') && (!IsBOperator(wordBuffer[0])) && (!inString) && (continueProcessing)) { // a few commands accept "illegal" syntax -- cd\, echo., etc. sscanf( wordBuffer, "%[^.<>|&=\\/]", sKeywordBuffer ); sKeywordFound = false; if ((CompareCaseInsensitive(sKeywordBuffer, "echo") == 0) || (CompareCaseInsensitive(sKeywordBuffer, "echos") == 0) || (CompareCaseInsensitive(sKeywordBuffer, "echoerr") == 0) || (CompareCaseInsensitive(sKeywordBuffer, "echoserr") == 0) || (CompareCaseInsensitive(sKeywordBuffer, "cd") == 0) || (CompareCaseInsensitive(sKeywordBuffer, "path") == 0) || (CompareCaseInsensitive(sKeywordBuffer, "prompt") == 0)) { // no further Regular Keyword Checking continueProcessing = false; sKeywordFound = true; wbo = (unsigned int)strlen( sKeywordBuffer ); // Colorize Special Keyword as Regular Keyword styler.ColourTo(startLine + offset - 1 - (wbl - wbo), SCE_TCMD_WORD); // Reset Offset to re-process remainder of word offset -= (wbl - wbo); } // Check for Default Text if (!sKeywordFound) { wbo = 0; // Read up to %, Operator or Separator while ((wbo < wbl) && (wordBuffer[wbo] != '%') && (!isDelayedExpansion || wordBuffer[wbo] != '!') && (!IsBOperator(wordBuffer[wbo])) && (!IsBSeparator(wordBuffer[wbo]))) { wbo++; } // Colorize Default Text styler.ColourTo(startLine + offset - 1 - (wbl - wbo), SCE_TCMD_DEFAULT); // Reset Offset to re-process remainder of word offset -= (wbl - wbo); } // Check for Argument (%n), Environment Variable (%x...%) or Local Variable (%%a) } else if (wordBuffer[0] == '%') { unsigned int varlen; unsigned int n = 1; // Colorize Default Text styler.ColourTo(startLine + offset - 1 - wbl, SCE_TCMD_DEFAULT); wbo++; // check for %[nn] syntax if ( wordBuffer[1] == '[' ) { n++; while ((n < wbl) && (wordBuffer[n] != ']')) { n++; } if ( wordBuffer[n] == ']' ) n++; goto ColorizeArg; } // Search to end of word for second % or to the first terminator (can be a long path) while ((wbo < wbl) && (wordBuffer[wbo] != '%') && (!IsBOperator(wordBuffer[wbo])) && (!IsBSeparator(wordBuffer[wbo]))) { wbo++; } // Check for Argument (%n) or (%*) if (((isdigit(wordBuffer[1])) || (wordBuffer[1] == '*')) && (wordBuffer[wbo] != '%')) { while (( wordBuffer[n] ) && ( strchr( "%0123456789*#$", wordBuffer[n] ) != NULL )) n++; ColorizeArg: // Colorize Argument styler.ColourTo(startLine + offset - 1 - (wbl - n), SCE_TCMD_IDENTIFIER); // Reset Offset to re-process remainder of word offset -= (wbl - n); // Check for Variable with modifiers (%~...) } else if ((varlen = GetBatchVarLen(wordBuffer)) != 0) { // Colorize Variable styler.ColourTo(startLine + offset - 1 - (wbl - varlen), SCE_TCMD_IDENTIFIER); // Reset Offset to re-process remainder of word offset -= (wbl - varlen); // Check for Environment Variable (%x...%) } else if (( wordBuffer[1] ) && ( wordBuffer[1] != '%')) { if ( wordBuffer[wbo] == '%' ) wbo++; // Colorize Environment Variable styler.ColourTo(startLine + offset - 1 - (wbl - wbo), SCE_TCMD_ENVIRONMENT); // Reset Offset to re-process remainder of word offset -= (wbl - wbo); // Check for Local Variable (%%a) } else if ( (wbl > 2) && (wordBuffer[1] == '%') && (wordBuffer[2] != '%') && (!IsBOperator(wordBuffer[2])) && (!IsBSeparator(wordBuffer[2]))) { n = 2; while (( wordBuffer[n] ) && (!IsBOperator(wordBuffer[n])) && (!IsBSeparator(wordBuffer[n]))) n++; // Colorize Local Variable styler.ColourTo(startLine + offset - 1 - (wbl - n), SCE_TCMD_IDENTIFIER); // Reset Offset to re-process remainder of word offset -= (wbl - n); // Check for %% } else if ((wbl > 1) && (wordBuffer[1] == '%')) { // Colorize Symbols styler.ColourTo(startLine + offset - 1 - (wbl - 2), SCE_TCMD_DEFAULT); // Reset Offset to re-process remainder of word offset -= (wbl - 2); } else { // Colorize Symbol styler.ColourTo(startLine + offset - 1 - (wbl - 1), SCE_TCMD_DEFAULT); // Reset Offset to re-process remainder of word offset -= (wbl - 1); } // Check for Operator } else if (IsBOperator(wordBuffer[0])) { // Colorize Default Text styler.ColourTo(startLine + offset - 1 - wbl, SCE_TCMD_DEFAULT); // Check for Pipe, compound, or conditional Operator if ((wordBuffer[0] == '|') || (wordBuffer[0] == '&')) { // Colorize Pipe Operator styler.ColourTo(startLine + offset - 1 - (wbl - 1), SCE_TCMD_OPERATOR); // Reset Offset to re-process remainder of word offset -= (wbl - 1); continueProcessing = true; // Check for Other Operator } else { // Check for > Operator if ((wordBuffer[0] == '>') || (wordBuffer[0] == '<')) { // Turn Keyword and External Command / Program checking back on continueProcessing = true; } // Colorize Other Operator if (!inString || !(wordBuffer[0] == '(' || wordBuffer[0] == ')')) styler.ColourTo(startLine + offset - 1 - (wbl - 1), SCE_TCMD_OPERATOR); // Reset Offset to re-process remainder of word offset -= (wbl - 1); } // Check for Default Text } else { // Read up to %, Operator or Separator while ((wbo < wbl) && (wordBuffer[wbo] != '%') && (!isDelayedExpansion || wordBuffer[wbo] != '!') && (!IsBOperator(wordBuffer[wbo])) && (!IsBSeparator(wordBuffer[wbo]))) { wbo++; } // Colorize Default Text styler.ColourTo(startLine + offset - 1 - (wbl - wbo), SCE_TCMD_DEFAULT); // Reset Offset to re-process remainder of word offset -= (wbl - wbo); } // Skip whitespace - nothing happens if Offset was Reset while ((offset < lengthLine) && (isspacechar(lineBuffer[offset]))) { offset++; } } // Colorize Default Text for remainder of line - currently not lexed styler.ColourTo(endPos, SCE_TCMD_DEFAULT); } static void ColouriseTCMDDoc( unsigned int startPos, int length, int /*initStyle*/, WordList *keywordlists[], Accessor &styler ) { char lineBuffer[16384]; styler.StartAt(startPos); styler.StartSegment(startPos); unsigned int linePos = 0; unsigned int startLine = startPos; for (unsigned int i = startPos; i < startPos + length; i++) { lineBuffer[linePos++] = styler[i]; if (AtEOL(styler, i) || (linePos >= sizeof(lineBuffer) - 1)) { // End of line (or of line buffer) met, colourise it lineBuffer[linePos] = '\0'; ColouriseTCMDLine(lineBuffer, linePos, startLine, i, keywordlists, styler); linePos = 0; startLine = i + 1; } } if (linePos > 0) { // Last line does not have ending characters lineBuffer[linePos] = '\0'; ColouriseTCMDLine(lineBuffer, linePos, startLine, startPos + length - 1, keywordlists, styler); } } // Convert string to upper case static void StrUpr(char *s) { while (*s) { *s = MakeUpperCase(*s); s++; } } // Folding support (for DO, IFF, SWITCH, TEXT, and command groups) static void FoldTCMDDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) { int line = styler.GetLine(startPos); int level = styler.LevelAt(line); int levelIndent = 0; unsigned int endPos = startPos + length; char s[16]; char chPrev = styler.SafeGetCharAt(startPos - 1); // Scan for ( and ) for (unsigned int i = startPos; i < endPos; i++) { int c = styler.SafeGetCharAt(i, '\n'); int style = styler.StyleAt(i); bool bLineStart = ((chPrev == '\r') || (chPrev == '\n')) || i == 0; if (style == SCE_TCMD_OPERATOR) { // CheckFoldPoint if (c == '(') { levelIndent += 1; } else if (c == ')') { levelIndent -= 1; } } if (( bLineStart ) && ( style == SCE_TCMD_WORD )) { for (unsigned int j = 0; j < 10; j++) { if (!iswordchar(styler[i + j])) { break; } s[j] = styler[i + j]; s[j + 1] = '\0'; } StrUpr( s ); if ((strcmp(s, "DO") == 0) || (strcmp(s, "IFF") == 0) || (strcmp(s, "SWITCH") == 0) || (strcmp(s, "TEXT") == 0)) { levelIndent++; } else if ((strcmp(s, "ENDDO") == 0) || (strcmp(s, "ENDIFF") == 0) || (strcmp(s, "ENDSWITCH") == 0) || (strcmp(s, "ENDTEXT") == 0)) { levelIndent--; } } if (c == '\n') { // line end if (levelIndent > 0) { level |= SC_FOLDLEVELHEADERFLAG; } if (level != styler.LevelAt(line)) styler.SetLevel(line, level); level += levelIndent; if ((level & SC_FOLDLEVELNUMBERMASK) < SC_FOLDLEVELBASE) level = SC_FOLDLEVELBASE; line++; // reset state levelIndent = 0; level &= ~SC_FOLDLEVELHEADERFLAG; level &= ~SC_FOLDLEVELWHITEFLAG; } chPrev = c; } } static const char *const tcmdWordListDesc[] = { "Internal Commands", "Aliases", 0 }; LexerModule lmTCMD(SCLEX_TCMD, ColouriseTCMDDoc, "tcmd", FoldTCMDDoc, tcmdWordListDesc); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/ScintillaBase.h000444001750001750 511511727344243 25265 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file ScintillaBase.h ** Defines an enhanced subclass of Editor with calltips, autocomplete and context menu. **/ // Copyright 1998-2002 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #ifndef SCINTILLABASE_H #define SCINTILLABASE_H #ifdef SCI_NAMESPACE namespace Scintilla { #endif #ifdef SCI_LEXER class LexState; #endif /** */ class ScintillaBase : public Editor { // Private so ScintillaBase objects can not be copied ScintillaBase(const ScintillaBase &); ScintillaBase &operator=(const ScintillaBase &); protected: /** Enumeration of commands and child windows. */ enum { idCallTip=1, idAutoComplete=2, idcmdUndo=10, idcmdRedo=11, idcmdCut=12, idcmdCopy=13, idcmdPaste=14, idcmdDelete=15, idcmdSelectAll=16 }; bool displayPopupMenu; Menu popup; AutoComplete ac; CallTip ct; int listType; ///< 0 is an autocomplete list int maxListWidth; /// Maximum width of list, in average character widths #ifdef SCI_LEXER LexState *DocumentLexState(); void SetLexer(uptr_t wParam); void SetLexerLanguage(const char *languageName); void Colourise(int start, int end); #endif ScintillaBase(); virtual ~ScintillaBase(); virtual void Initialise() = 0; virtual void Finalise() = 0; virtual void AddCharUTF(char *s, unsigned int len, bool treatAsDBCS=false); void Command(int cmdId); virtual void CancelModes(); virtual int KeyCommand(unsigned int iMessage); void AutoCompleteStart(int lenEntered, const char *list); void AutoCompleteCancel(); void AutoCompleteMove(int delta); int AutoCompleteGetCurrent(); int AutoCompleteGetCurrentText(char *buffer); void AutoCompleteCharacterAdded(char ch); void AutoCompleteCharacterDeleted(); void AutoCompleteCompleted(); void AutoCompleteMoveToCurrentWord(); static void AutoCompleteDoubleClick(void *p); void CallTipClick(); void CallTipShow(Point pt, const char *defn); virtual void CreateCallTipWindow(PRectangle rc) = 0; virtual void AddToPopUp(const char *label, int cmd=0, bool enabled=true) = 0; void ContextMenu(Point pt); virtual void ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt); void NotifyStyleToNeeded(int endStyleNeeded); void NotifyLexerChanged(Document *doc, void *userData); public: // Public so scintilla_send_message can use it virtual sptr_t WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam); }; #ifdef SCI_NAMESPACE } #endif #endif Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexHTML.cxx000444001750001750 21355311727344243 24407 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexHTML.cxx ** Lexer for HTML. **/ // Copyright 1998-2005 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif #define SCE_HA_JS (SCE_HJA_START - SCE_HJ_START) #define SCE_HA_VBS (SCE_HBA_START - SCE_HB_START) #define SCE_HA_PYTHON (SCE_HPA_START - SCE_HP_START) enum script_type { eScriptNone = 0, eScriptJS, eScriptVBS, eScriptPython, eScriptPHP, eScriptXML, eScriptSGML, eScriptSGMLblock, eScriptComment }; enum script_mode { eHtml = 0, eNonHtmlScript, eNonHtmlPreProc, eNonHtmlScriptPreProc }; static inline bool IsAWordChar(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_'); } static inline bool IsAWordStart(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '_'); } inline bool IsOperator(int ch) { if (isascii(ch) && isalnum(ch)) return false; // '.' left out as it is used to make up numbers if (ch == '%' || ch == '^' || ch == '&' || ch == '*' || ch == '(' || ch == ')' || ch == '-' || ch == '+' || ch == '=' || ch == '|' || ch == '{' || ch == '}' || ch == '[' || ch == ']' || ch == ':' || ch == ';' || ch == '<' || ch == '>' || ch == ',' || ch == '/' || ch == '?' || ch == '!' || ch == '.' || ch == '~') return true; return false; } static void GetTextSegment(Accessor &styler, unsigned int start, unsigned int end, char *s, size_t len) { unsigned int i = 0; for (; (i < end - start + 1) && (i < len-1); i++) { s[i] = static_cast(MakeLowerCase(styler[start + i])); } s[i] = '\0'; } static const char *GetNextWord(Accessor &styler, unsigned int start, char *s, size_t sLen) { unsigned int i = 0; for (; i < sLen-1; i++) { char ch = static_cast(styler.SafeGetCharAt(start + i)); if ((i == 0) && !IsAWordStart(ch)) break; if ((i > 0) && !IsAWordChar(ch)) break; s[i] = ch; } s[i] = '\0'; return s; } static script_type segIsScriptingIndicator(Accessor &styler, unsigned int start, unsigned int end, script_type prevValue) { char s[100]; GetTextSegment(styler, start, end, s, sizeof(s)); //Platform::DebugPrintf("Scripting indicator [%s]\n", s); if (strstr(s, "src")) // External script return eScriptNone; if (strstr(s, "vbs")) return eScriptVBS; if (strstr(s, "pyth")) return eScriptPython; if (strstr(s, "javas")) return eScriptJS; if (strstr(s, "jscr")) return eScriptJS; if (strstr(s, "php")) return eScriptPHP; if (strstr(s, "xml")) { const char *xml = strstr(s, "xml"); for (const char *t=s; t= SCE_HP_START) && (state <= SCE_HP_IDENTIFIER)) { return eScriptPython; } else if ((state >= SCE_HB_START) && (state <= SCE_HB_STRINGEOL)) { return eScriptVBS; } else if ((state >= SCE_HJ_START) && (state <= SCE_HJ_REGEX)) { return eScriptJS; } else if ((state >= SCE_HPHP_DEFAULT) && (state <= SCE_HPHP_COMMENTLINE)) { return eScriptPHP; } else if ((state >= SCE_H_SGML_DEFAULT) && (state < SCE_H_SGML_BLOCK_DEFAULT)) { return eScriptSGML; } else if (state == SCE_H_SGML_BLOCK_DEFAULT) { return eScriptSGMLblock; } else { return eScriptNone; } } static int statePrintForState(int state, script_mode inScriptType) { int StateToPrint = state; if (state >= SCE_HJ_START) { if ((state >= SCE_HP_START) && (state <= SCE_HP_IDENTIFIER)) { StateToPrint = state + ((inScriptType == eNonHtmlScript) ? 0 : SCE_HA_PYTHON); } else if ((state >= SCE_HB_START) && (state <= SCE_HB_STRINGEOL)) { StateToPrint = state + ((inScriptType == eNonHtmlScript) ? 0 : SCE_HA_VBS); } else if ((state >= SCE_HJ_START) && (state <= SCE_HJ_REGEX)) { StateToPrint = state + ((inScriptType == eNonHtmlScript) ? 0 : SCE_HA_JS); } } return StateToPrint; } static int stateForPrintState(int StateToPrint) { int state; if ((StateToPrint >= SCE_HPA_START) && (StateToPrint <= SCE_HPA_IDENTIFIER)) { state = StateToPrint - SCE_HA_PYTHON; } else if ((StateToPrint >= SCE_HBA_START) && (StateToPrint <= SCE_HBA_STRINGEOL)) { state = StateToPrint - SCE_HA_VBS; } else if ((StateToPrint >= SCE_HJA_START) && (StateToPrint <= SCE_HJA_REGEX)) { state = StateToPrint - SCE_HA_JS; } else { state = StateToPrint; } return state; } static inline bool IsNumber(unsigned int start, Accessor &styler) { return IsADigit(styler[start]) || (styler[start] == '.') || (styler[start] == '-') || (styler[start] == '#'); } static inline bool isStringState(int state) { bool bResult; switch (state) { case SCE_HJ_DOUBLESTRING: case SCE_HJ_SINGLESTRING: case SCE_HJA_DOUBLESTRING: case SCE_HJA_SINGLESTRING: case SCE_HB_STRING: case SCE_HBA_STRING: case SCE_HP_STRING: case SCE_HP_CHARACTER: case SCE_HP_TRIPLE: case SCE_HP_TRIPLEDOUBLE: case SCE_HPA_STRING: case SCE_HPA_CHARACTER: case SCE_HPA_TRIPLE: case SCE_HPA_TRIPLEDOUBLE: case SCE_HPHP_HSTRING: case SCE_HPHP_SIMPLESTRING: case SCE_HPHP_HSTRING_VARIABLE: case SCE_HPHP_COMPLEX_VARIABLE: bResult = true; break; default : bResult = false; break; } return bResult; } static inline bool stateAllowsTermination(int state) { bool allowTermination = !isStringState(state); if (allowTermination) { switch (state) { case SCE_HB_COMMENTLINE: case SCE_HPHP_COMMENT: case SCE_HP_COMMENTLINE: case SCE_HPA_COMMENTLINE: allowTermination = false; } } return allowTermination; } // not really well done, since it's only comments that should lex the %> and <% static inline bool isCommentASPState(int state) { bool bResult; switch (state) { case SCE_HJ_COMMENT: case SCE_HJ_COMMENTLINE: case SCE_HJ_COMMENTDOC: case SCE_HB_COMMENTLINE: case SCE_HP_COMMENTLINE: case SCE_HPHP_COMMENT: case SCE_HPHP_COMMENTLINE: bResult = true; break; default : bResult = false; break; } return bResult; } static void classifyAttribHTML(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler) { bool wordIsNumber = IsNumber(start, styler); char chAttr = SCE_H_ATTRIBUTEUNKNOWN; if (wordIsNumber) { chAttr = SCE_H_NUMBER; } else { char s[100]; GetTextSegment(styler, start, end, s, sizeof(s)); if (keywords.InList(s)) chAttr = SCE_H_ATTRIBUTE; } if ((chAttr == SCE_H_ATTRIBUTEUNKNOWN) && !keywords) // No keywords -> all are known chAttr = SCE_H_ATTRIBUTE; styler.ColourTo(end, chAttr); } static int classifyTagHTML(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler, bool &tagDontFold, bool caseSensitive, bool isXml, bool allowScripts) { char withSpace[30 + 2] = " "; const char *s = withSpace + 1; // Copy after the '<' unsigned int i = 1; for (unsigned int cPos = start; cPos <= end && i < 30; cPos++) { char ch = styler[cPos]; if ((ch != '<') && (ch != '/')) { withSpace[i++] = caseSensitive ? ch : static_cast(MakeLowerCase(ch)); } } //The following is only a quick hack, to see if this whole thing would work //we first need the tagname with a trailing space... withSpace[i] = ' '; withSpace[i+1] = '\0'; // if the current language is XML, I can fold any tag // if the current language is HTML, I don't want to fold certain tags (input, meta, etc.) //...to find it in the list of no-container-tags tagDontFold = (!isXml) && (NULL != strstr(" area base basefont br col command embed frame hr img input isindex keygen link meta param source track wbr ", withSpace)); //now we can remove the trailing space withSpace[i] = '\0'; // No keywords -> all are known char chAttr = SCE_H_TAGUNKNOWN; if (s[0] == '!') { chAttr = SCE_H_SGML_DEFAULT; } else if (!keywords || keywords.InList(s)) { chAttr = SCE_H_TAG; } styler.ColourTo(end, chAttr); if (chAttr == SCE_H_TAG) { if (allowScripts && 0 == strcmp(s, "script")) { // check to see if this is a self-closing tag by sniffing ahead bool isSelfClose = false; for (unsigned int cPos = end; cPos <= end + 100; cPos++) { char ch = styler.SafeGetCharAt(cPos, '\0'); if (ch == '\0' || ch == '>') break; else if (ch == '/' && styler.SafeGetCharAt(cPos + 1, '\0') == '>') { isSelfClose = true; break; } } // do not enter a script state if the tag self-closed if (!isSelfClose) chAttr = SCE_H_SCRIPT; } else if (!isXml && 0 == strcmp(s, "comment")) { chAttr = SCE_H_COMMENT; } } return chAttr; } static void classifyWordHTJS(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler, script_mode inScriptType) { char s[30 + 1]; unsigned int i = 0; for (; i < end - start + 1 && i < 30; i++) { s[i] = styler[start + i]; } s[i] = '\0'; char chAttr = SCE_HJ_WORD; bool wordIsNumber = IsADigit(s[0]) || ((s[0] == '.') && IsADigit(s[1])); if (wordIsNumber) { chAttr = SCE_HJ_NUMBER; } else if (keywords.InList(s)) { chAttr = SCE_HJ_KEYWORD; } styler.ColourTo(end, statePrintForState(chAttr, inScriptType)); } static int classifyWordHTVB(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler, script_mode inScriptType) { char chAttr = SCE_HB_IDENTIFIER; bool wordIsNumber = IsADigit(styler[start]) || (styler[start] == '.'); if (wordIsNumber) chAttr = SCE_HB_NUMBER; else { char s[100]; GetTextSegment(styler, start, end, s, sizeof(s)); if (keywords.InList(s)) { chAttr = SCE_HB_WORD; if (strcmp(s, "rem") == 0) chAttr = SCE_HB_COMMENTLINE; } } styler.ColourTo(end, statePrintForState(chAttr, inScriptType)); if (chAttr == SCE_HB_COMMENTLINE) return SCE_HB_COMMENTLINE; else return SCE_HB_DEFAULT; } static void classifyWordHTPy(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler, char *prevWord, script_mode inScriptType, bool isMako) { bool wordIsNumber = IsADigit(styler[start]); char s[30 + 1]; unsigned int i = 0; for (; i < end - start + 1 && i < 30; i++) { s[i] = styler[start + i]; } s[i] = '\0'; char chAttr = SCE_HP_IDENTIFIER; if (0 == strcmp(prevWord, "class")) chAttr = SCE_HP_CLASSNAME; else if (0 == strcmp(prevWord, "def")) chAttr = SCE_HP_DEFNAME; else if (wordIsNumber) chAttr = SCE_HP_NUMBER; else if (keywords.InList(s)) chAttr = SCE_HP_WORD; else if (isMako && 0 == strcmp(s, "block")) chAttr = SCE_HP_WORD; styler.ColourTo(end, statePrintForState(chAttr, inScriptType)); strcpy(prevWord, s); } // Update the word colour to default or keyword // Called when in a PHP word static void classifyWordHTPHP(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler) { char chAttr = SCE_HPHP_DEFAULT; bool wordIsNumber = IsADigit(styler[start]) || (styler[start] == '.' && start+1 <= end && IsADigit(styler[start+1])); if (wordIsNumber) chAttr = SCE_HPHP_NUMBER; else { char s[100]; GetTextSegment(styler, start, end, s, sizeof(s)); if (keywords.InList(s)) chAttr = SCE_HPHP_WORD; } styler.ColourTo(end, chAttr); } static bool isWordHSGML(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler) { char s[30 + 1]; unsigned int i = 0; for (; i < end - start + 1 && i < 30; i++) { s[i] = styler[start + i]; } s[i] = '\0'; return keywords.InList(s); } static bool isWordCdata(unsigned int start, unsigned int end, Accessor &styler) { char s[30 + 1]; unsigned int i = 0; for (; i < end - start + 1 && i < 30; i++) { s[i] = styler[start + i]; } s[i] = '\0'; return (0 == strcmp(s, "[CDATA[")); } // Return the first state to reach when entering a scripting language static int StateForScript(script_type scriptLanguage) { int Result; switch (scriptLanguage) { case eScriptVBS: Result = SCE_HB_START; break; case eScriptPython: Result = SCE_HP_START; break; case eScriptPHP: Result = SCE_HPHP_DEFAULT; break; case eScriptXML: Result = SCE_H_TAGUNKNOWN; break; case eScriptSGML: Result = SCE_H_SGML_DEFAULT; break; case eScriptComment: Result = SCE_H_COMMENT; break; default : Result = SCE_HJ_START; break; } return Result; } static inline bool ishtmlwordchar(int ch) { return !isascii(ch) || (isalnum(ch) || ch == '.' || ch == '-' || ch == '_' || ch == ':' || ch == '!' || ch == '#'); } static inline bool issgmlwordchar(int ch) { return !isascii(ch) || (isalnum(ch) || ch == '.' || ch == '_' || ch == ':' || ch == '!' || ch == '#' || ch == '['); } static inline bool IsPhpWordStart(int ch) { return (isascii(ch) && (isalpha(ch) || (ch == '_'))) || (ch >= 0x7f); } static inline bool IsPhpWordChar(int ch) { return IsADigit(ch) || IsPhpWordStart(ch); } static bool InTagState(int state) { return state == SCE_H_TAG || state == SCE_H_TAGUNKNOWN || state == SCE_H_SCRIPT || state == SCE_H_ATTRIBUTE || state == SCE_H_ATTRIBUTEUNKNOWN || state == SCE_H_NUMBER || state == SCE_H_OTHER || state == SCE_H_DOUBLESTRING || state == SCE_H_SINGLESTRING; } static bool IsCommentState(const int state) { return state == SCE_H_COMMENT || state == SCE_H_SGML_COMMENT; } static bool IsScriptCommentState(const int state) { return state == SCE_HJ_COMMENT || state == SCE_HJ_COMMENTLINE || state == SCE_HJA_COMMENT || state == SCE_HJA_COMMENTLINE || state == SCE_HB_COMMENTLINE || state == SCE_HBA_COMMENTLINE; } static bool isLineEnd(int ch) { return ch == '\r' || ch == '\n'; } static bool isOKBeforeRE(int ch) { return (ch == '(') || (ch == '=') || (ch == ','); } static bool isMakoBlockEnd(const int ch, const int chNext, const char *blockType) { if (strlen(blockType) == 0) { return ((ch == '%') && (chNext == '>')); } else if ((0 == strcmp(blockType, "inherit")) || (0 == strcmp(blockType, "namespace")) || (0 == strcmp(blockType, "include")) || (0 == strcmp(blockType, "page"))) { return ((ch == '/') && (chNext == '>')); } else if (0 == strcmp(blockType, "%")) { if (ch == '/' && isLineEnd(chNext)) return 1; else return isLineEnd(ch); } else if (0 == strcmp(blockType, "{")) { return ch == '}'; } else { return (ch == '>'); } } static bool isDjangoBlockEnd(const int ch, const int chNext, const char *blockType) { if (strlen(blockType) == 0) { return 0; } else if (0 == strcmp(blockType, "%")) { return ((ch == '%') && (chNext == '}')); } else if (0 == strcmp(blockType, "{")) { return ((ch == '}') && (chNext == '}')); } else { return 0; } } static bool isPHPStringState(int state) { return (state == SCE_HPHP_HSTRING) || (state == SCE_HPHP_SIMPLESTRING) || (state == SCE_HPHP_HSTRING_VARIABLE) || (state == SCE_HPHP_COMPLEX_VARIABLE); } static int FindPhpStringDelimiter(char *phpStringDelimiter, const int phpStringDelimiterSize, int i, const int lengthDoc, Accessor &styler, bool &isSimpleString) { int j; const int beginning = i - 1; bool isValidSimpleString = false; while (i < lengthDoc && (styler[i] == ' ' || styler[i] == '\t')) i++; char ch = styler.SafeGetCharAt(i); const char chNext = styler.SafeGetCharAt(i + 1); if (!IsPhpWordStart(ch)) { if (ch == '\'' && IsPhpWordStart(chNext)) { i++; ch = chNext; isSimpleString = true; } else { phpStringDelimiter[0] = '\0'; return beginning; } } phpStringDelimiter[0] = ch; i++; for (j = i; j < lengthDoc && !isLineEnd(styler[j]); j++) { if (!IsPhpWordChar(styler[j])) { if (isSimpleString && (styler[j] == '\'') && isLineEnd(styler.SafeGetCharAt(j + 1))) { isValidSimpleString = true; j++; break; } else { phpStringDelimiter[0] = '\0'; return beginning; } } if (j - i < phpStringDelimiterSize - 2) phpStringDelimiter[j-i+1] = styler[j]; else i++; } if (isSimpleString && !isValidSimpleString) { phpStringDelimiter[0] = '\0'; return beginning; } phpStringDelimiter[j-i+1 - (isSimpleString ? 1 : 0)] = '\0'; return j - 1; } static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler, bool isXml) { WordList &keywords = *keywordlists[0]; WordList &keywords2 = *keywordlists[1]; WordList &keywords3 = *keywordlists[2]; WordList &keywords4 = *keywordlists[3]; WordList &keywords5 = *keywordlists[4]; WordList &keywords6 = *keywordlists[5]; // SGML (DTD) keywords // Lexer for HTML requires more lexical states (8 bits worth) than most lexers styler.StartAt(startPos, static_cast(STYLE_MAX)); char prevWord[200]; prevWord[0] = '\0'; char phpStringDelimiter[200]; // PHP is not limited in length, we are phpStringDelimiter[0] = '\0'; int StateToPrint = initStyle; int state = stateForPrintState(StateToPrint); char makoBlockType[200]; makoBlockType[0] = '\0'; int makoComment = 0; char djangoBlockType[2]; djangoBlockType[0] = '\0'; // If inside a tag, it may be a script tag, so reread from the start to ensure any language tags are seen if (InTagState(state)) { while ((startPos > 0) && (InTagState(styler.StyleAt(startPos - 1)))) { startPos--; length++; } state = SCE_H_DEFAULT; } // String can be heredoc, must find a delimiter first. Reread from beginning of line containing the string, to get the correct lineState if (isPHPStringState(state)) { while (startPos > 0 && (isPHPStringState(state) || !isLineEnd(styler[startPos - 1]))) { startPos--; length++; state = styler.StyleAt(startPos); } if (startPos == 0) state = SCE_H_DEFAULT; } styler.StartAt(startPos, static_cast(STYLE_MAX)); int lineCurrent = styler.GetLine(startPos); int lineState; if (lineCurrent > 0) { lineState = styler.GetLineState(lineCurrent-1); } else { // Default client and ASP scripting language is JavaScript lineState = eScriptJS << 8; // property asp.default.language // Script in ASP code is initially assumed to be in JavaScript. // To change this to VBScript set asp.default.language to 2. Python is 3. lineState |= styler.GetPropertyInt("asp.default.language", eScriptJS) << 4; } script_mode inScriptType = script_mode((lineState >> 0) & 0x03); // 2 bits of scripting mode bool tagOpened = (lineState >> 2) & 0x01; // 1 bit to know if we are in an opened tag bool tagClosing = (lineState >> 3) & 0x01; // 1 bit to know if we are in a closing tag bool tagDontFold = false; //some HTML tags should not be folded script_type aspScript = script_type((lineState >> 4) & 0x0F); // 4 bits of script name script_type clientScript = script_type((lineState >> 8) & 0x0F); // 4 bits of script name int beforePreProc = (lineState >> 12) & 0xFF; // 8 bits of state script_type scriptLanguage = ScriptOfState(state); // If eNonHtmlScript coincides with SCE_H_COMMENT, assume eScriptComment if (inScriptType == eNonHtmlScript && state == SCE_H_COMMENT) { scriptLanguage = eScriptComment; } script_type beforeLanguage = ScriptOfState(beforePreProc); // property fold.html // Folding is turned on or off for HTML and XML files with this option. // The fold option must also be on for folding to occur. const bool foldHTML = styler.GetPropertyInt("fold.html", 0) != 0; const bool fold = foldHTML && styler.GetPropertyInt("fold", 0); // property fold.html.preprocessor // Folding is turned on or off for scripts embedded in HTML files with this option. // The default is on. const bool foldHTMLPreprocessor = foldHTML && styler.GetPropertyInt("fold.html.preprocessor", 1); const bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; // property fold.hypertext.comment // Allow folding for comments in scripts embedded in HTML. // The default is off. const bool foldComment = fold && styler.GetPropertyInt("fold.hypertext.comment", 0) != 0; // property fold.hypertext.heredoc // Allow folding for heredocs in scripts embedded in HTML. // The default is off. const bool foldHeredoc = fold && styler.GetPropertyInt("fold.hypertext.heredoc", 0) != 0; // property html.tags.case.sensitive // For XML and HTML, setting this property to 1 will make tags match in a case // sensitive way which is the expected behaviour for XML and XHTML. const bool caseSensitive = styler.GetPropertyInt("html.tags.case.sensitive", 0) != 0; // property lexer.xml.allow.scripts // Set to 0 to disable scripts in XML. const bool allowScripts = styler.GetPropertyInt("lexer.xml.allow.scripts", 1) != 0; // property lexer.html.mako // Set to 1 to enable the mako template language. const bool isMako = styler.GetPropertyInt("lexer.html.mako", 0) != 0; // property lexer.html.django // Set to 1 to enable the django template language. const bool isDjango = styler.GetPropertyInt("lexer.html.django", 0) != 0; const CharacterSet setHTMLWord(CharacterSet::setAlphaNum, ".-_:!#", 0x80, true); const CharacterSet setTagContinue(CharacterSet::setAlphaNum, ".-_:!#[", 0x80, true); const CharacterSet setAttributeContinue(CharacterSet::setAlphaNum, ".-_:!#/", 0x80, true); int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; int levelCurrent = levelPrev; int visibleChars = 0; int lineStartVisibleChars = 0; int chPrev = ' '; int ch = ' '; int chPrevNonWhite = ' '; // look back to set chPrevNonWhite properly for better regex colouring if (scriptLanguage == eScriptJS && startPos > 0) { int back = startPos; int style = 0; while (--back) { style = styler.StyleAt(back); if (style < SCE_HJ_DEFAULT || style > SCE_HJ_COMMENTDOC) // includes SCE_HJ_COMMENT & SCE_HJ_COMMENTLINE break; } if (style == SCE_HJ_SYMBOLS) { chPrevNonWhite = static_cast(styler.SafeGetCharAt(back)); } } styler.StartSegment(startPos); const int lengthDoc = startPos + length; for (int i = startPos; i < lengthDoc; i++) { const int chPrev2 = chPrev; chPrev = ch; if (!IsASpace(ch) && state != SCE_HJ_COMMENT && state != SCE_HJ_COMMENTLINE && state != SCE_HJ_COMMENTDOC) chPrevNonWhite = ch; ch = static_cast(styler[i]); int chNext = static_cast(styler.SafeGetCharAt(i + 1)); const int chNext2 = static_cast(styler.SafeGetCharAt(i + 2)); // Handle DBCS codepages if (styler.IsLeadByte(static_cast(ch))) { chPrev = ' '; i += 1; continue; } if ((!IsASpace(ch) || !foldCompact) && fold) visibleChars++; if (!IsASpace(ch)) lineStartVisibleChars++; // decide what is the current state to print (depending of the script tag) StateToPrint = statePrintForState(state, inScriptType); // handle script folding if (fold) { switch (scriptLanguage) { case eScriptJS: case eScriptPHP: //not currently supported case eScriptVBS: if ((state != SCE_HPHP_COMMENT) && (state != SCE_HPHP_COMMENTLINE) && (state != SCE_HJ_COMMENT) && (state != SCE_HJ_COMMENTLINE) && (state != SCE_HJ_COMMENTDOC) && (!isStringState(state))) { //Platform::DebugPrintf("state=%d, StateToPrint=%d, initStyle=%d\n", state, StateToPrint, initStyle); //if ((state == SCE_HPHP_OPERATOR) || (state == SCE_HPHP_DEFAULT) || (state == SCE_HJ_SYMBOLS) || (state == SCE_HJ_START) || (state == SCE_HJ_DEFAULT)) { if (ch == '#') { int j = i + 1; while ((j < lengthDoc) && IsASpaceOrTab(styler.SafeGetCharAt(j))) { j++; } if (styler.Match(j, "region") || styler.Match(j, "if")) { levelCurrent++; } else if (styler.Match(j, "end")) { levelCurrent--; } } else if ((ch == '{') || (ch == '}') || (foldComment && (ch == '/') && (chNext == '*'))) { levelCurrent += (((ch == '{') || (ch == '/')) ? 1 : -1); } } else if (((state == SCE_HPHP_COMMENT) || (state == SCE_HJ_COMMENT)) && foldComment && (ch == '*') && (chNext == '/')) { levelCurrent--; } break; case eScriptPython: if (state != SCE_HP_COMMENTLINE && !isMako) { if ((ch == ':') && ((chNext == '\n') || (chNext == '\r' && chNext2 == '\n'))) { levelCurrent++; } else if ((ch == '\n') && !((chNext == '\r') && (chNext2 == '\n')) && (chNext != '\n')) { // check if the number of tabs is lower than the level int Findlevel = (levelCurrent & ~SC_FOLDLEVELBASE) * 8; for (int j = 0; Findlevel > 0; j++) { char chTmp = styler.SafeGetCharAt(i + j + 1); if (chTmp == '\t') { Findlevel -= 8; } else if (chTmp == ' ') { Findlevel--; } else { break; } } if (Findlevel > 0) { levelCurrent -= Findlevel / 8; if (Findlevel % 8) levelCurrent--; } } } break; default: break; } } if ((ch == '\r' && chNext != '\n') || (ch == '\n')) { // Trigger on CR only (Mac style) or either on LF from CR+LF (Dos/Win) or on LF alone (Unix) // Avoid triggering two times on Dos/Win // New line -> record any line state onto /next/ line if (fold) { int lev = levelPrev; if (visibleChars == 0) lev |= SC_FOLDLEVELWHITEFLAG; if ((levelCurrent > levelPrev) && (visibleChars > 0)) lev |= SC_FOLDLEVELHEADERFLAG; styler.SetLevel(lineCurrent, lev); visibleChars = 0; levelPrev = levelCurrent; } styler.SetLineState(lineCurrent, ((inScriptType & 0x03) << 0) | ((tagOpened & 0x01) << 2) | ((tagClosing & 0x01) << 3) | ((aspScript & 0x0F) << 4) | ((clientScript & 0x0F) << 8) | ((beforePreProc & 0xFF) << 12)); lineCurrent++; lineStartVisibleChars = 0; } // handle start of Mako comment line if (isMako && ch == '#' && chNext == '#') { makoComment = 1; } // handle end of Mako comment line else if (isMako && makoComment && (ch == '\r' || ch == '\n')) { makoComment = 0; styler.ColourTo(i, SCE_HP_COMMENTLINE); state = SCE_HP_DEFAULT; } // Allow falling through to mako handling code if newline is going to end a block if (((ch == '\r' && chNext != '\n') || (ch == '\n')) && (!isMako || (0 != strcmp(makoBlockType, "%")))) { } // generic end of script processing else if ((inScriptType == eNonHtmlScript) && (ch == '<') && (chNext == '/')) { // Check if it's the end of the script tag (or any other HTML tag) switch (state) { // in these cases, you can embed HTML tags (to confirm !!!!!!!!!!!!!!!!!!!!!!) case SCE_H_DOUBLESTRING: case SCE_H_SINGLESTRING: case SCE_HJ_COMMENT: case SCE_HJ_COMMENTDOC: //case SCE_HJ_COMMENTLINE: // removed as this is a common thing done to hide // the end of script marker from some JS interpreters. case SCE_HB_COMMENTLINE: case SCE_HBA_COMMENTLINE: case SCE_HJ_DOUBLESTRING: case SCE_HJ_SINGLESTRING: case SCE_HJ_REGEX: case SCE_HB_STRING: case SCE_HBA_STRING: case SCE_HP_STRING: case SCE_HP_TRIPLE: case SCE_HP_TRIPLEDOUBLE: case SCE_HPHP_HSTRING: case SCE_HPHP_SIMPLESTRING: case SCE_HPHP_COMMENT: case SCE_HPHP_COMMENTLINE: break; default : // check if the closing tag is a script tag if (const char *tag = state == SCE_HJ_COMMENTLINE || isXml ? "script" : state == SCE_H_COMMENT ? "comment" : 0) { int j = i + 2; int chr; do { chr = static_cast(*tag++); } while (chr != 0 && chr == MakeLowerCase(styler.SafeGetCharAt(j++))); if (chr != 0) break; } // closing tag of the script (it's a closing HTML tag anyway) styler.ColourTo(i - 1, StateToPrint); state = SCE_H_TAGUNKNOWN; inScriptType = eHtml; scriptLanguage = eScriptNone; clientScript = eScriptJS; i += 2; visibleChars += 2; tagClosing = true; continue; } } ///////////////////////////////////// // handle the start of PHP pre-processor = Non-HTML else if ((state != SCE_H_ASPAT) && !isPHPStringState(state) && (state != SCE_HPHP_COMMENT) && (state != SCE_HPHP_COMMENTLINE) && (ch == '<') && (chNext == '?') && !IsScriptCommentState(state)) { beforeLanguage = scriptLanguage; scriptLanguage = segIsScriptingIndicator(styler, i + 2, i + 6, isXml ? eScriptXML : eScriptPHP); if (scriptLanguage != eScriptPHP && isStringState(state)) continue; styler.ColourTo(i - 1, StateToPrint); beforePreProc = state; i++; visibleChars++; i += PrintScriptingIndicatorOffset(styler, styler.GetStartSegment() + 2, i + 6); if (scriptLanguage == eScriptXML) styler.ColourTo(i, SCE_H_XMLSTART); else styler.ColourTo(i, SCE_H_QUESTION); state = StateForScript(scriptLanguage); if (inScriptType == eNonHtmlScript) inScriptType = eNonHtmlScriptPreProc; else inScriptType = eNonHtmlPreProc; // Fold whole script, but not if the XML first tag (all XML-like tags in this case) if (foldHTMLPreprocessor && (scriptLanguage != eScriptXML)) { levelCurrent++; } // should be better ch = static_cast(styler.SafeGetCharAt(i)); continue; } // handle the start Mako template Python code else if (isMako && scriptLanguage == eScriptNone && ((ch == '<' && chNext == '%') || (lineStartVisibleChars == 1 && ch == '%') || (lineStartVisibleChars == 1 && ch == '/' && chNext == '%') || (ch == '$' && chNext == '{') || (ch == '<' && chNext == '/' && chNext2 == '%'))) { if (ch == '%' || ch == '/') strcpy(makoBlockType, "%"); else if (ch == '$') strcpy(makoBlockType, "{"); else if (chNext == '/') GetNextWord(styler, i+3, makoBlockType, sizeof(makoBlockType)); else GetNextWord(styler, i+2, makoBlockType, sizeof(makoBlockType)); styler.ColourTo(i - 1, StateToPrint); beforePreProc = state; if (inScriptType == eNonHtmlScript) inScriptType = eNonHtmlScriptPreProc; else inScriptType = eNonHtmlPreProc; if (chNext == '/') { i += 2; visibleChars += 2; } else if (ch != '%') { i++; visibleChars++; } state = SCE_HP_START; scriptLanguage = eScriptPython; styler.ColourTo(i, SCE_H_ASP); if (ch != '%' && ch != '$' && ch != '/') { i += static_cast(strlen(makoBlockType)); visibleChars += static_cast(strlen(makoBlockType)); if (keywords4.InList(makoBlockType)) styler.ColourTo(i, SCE_HP_WORD); else styler.ColourTo(i, SCE_H_TAGUNKNOWN); } ch = static_cast(styler.SafeGetCharAt(i)); continue; } // handle the start/end of Django comment else if (isDjango && state != SCE_H_COMMENT && (ch == '{' && chNext == '#')) { styler.ColourTo(i - 1, StateToPrint); beforePreProc = state; beforeLanguage = scriptLanguage; if (inScriptType == eNonHtmlScript) inScriptType = eNonHtmlScriptPreProc; else inScriptType = eNonHtmlPreProc; i += 1; visibleChars += 1; scriptLanguage = eScriptComment; state = SCE_H_COMMENT; styler.ColourTo(i, SCE_H_ASP); ch = static_cast(styler.SafeGetCharAt(i)); continue; } else if (isDjango && state == SCE_H_COMMENT && (ch == '#' && chNext == '}')) { styler.ColourTo(i - 1, StateToPrint); i += 1; visibleChars += 1; styler.ColourTo(i, SCE_H_ASP); state = beforePreProc; if (inScriptType == eNonHtmlScriptPreProc) inScriptType = eNonHtmlScript; else inScriptType = eHtml; scriptLanguage = beforeLanguage; continue; } // handle the start Django template code else if (isDjango && scriptLanguage != eScriptPython && (ch == '{' && (chNext == '%' || chNext == '{'))) { if (chNext == '%') strcpy(djangoBlockType, "%"); else strcpy(djangoBlockType, "{"); styler.ColourTo(i - 1, StateToPrint); beforePreProc = state; if (inScriptType == eNonHtmlScript) inScriptType = eNonHtmlScriptPreProc; else inScriptType = eNonHtmlPreProc; i += 1; visibleChars += 1; state = SCE_HP_START; beforeLanguage = scriptLanguage; scriptLanguage = eScriptPython; styler.ColourTo(i, SCE_H_ASP); ch = static_cast(styler.SafeGetCharAt(i)); continue; } // handle the start of ASP pre-processor = Non-HTML else if (!isMako && !isDjango && !isCommentASPState(state) && (ch == '<') && (chNext == '%') && !isPHPStringState(state)) { styler.ColourTo(i - 1, StateToPrint); beforePreProc = state; if (inScriptType == eNonHtmlScript) inScriptType = eNonHtmlScriptPreProc; else inScriptType = eNonHtmlPreProc; if (chNext2 == '@') { i += 2; // place as if it was the second next char treated visibleChars += 2; state = SCE_H_ASPAT; } else if ((chNext2 == '-') && (styler.SafeGetCharAt(i + 3) == '-')) { styler.ColourTo(i + 3, SCE_H_ASP); state = SCE_H_XCCOMMENT; scriptLanguage = eScriptVBS; continue; } else { if (chNext2 == '=') { i += 2; // place as if it was the second next char treated visibleChars += 2; } else { i++; // place as if it was the next char treated visibleChars++; } state = StateForScript(aspScript); } scriptLanguage = eScriptVBS; styler.ColourTo(i, SCE_H_ASP); // fold whole script if (foldHTMLPreprocessor) levelCurrent++; // should be better ch = static_cast(styler.SafeGetCharAt(i)); continue; } ///////////////////////////////////// // handle the start of SGML language (DTD) else if (((scriptLanguage == eScriptNone) || (scriptLanguage == eScriptXML)) && (chPrev == '<') && (ch == '!') && (StateToPrint != SCE_H_CDATA) && (!IsCommentState(StateToPrint)) && (!IsScriptCommentState(StateToPrint))) { beforePreProc = state; styler.ColourTo(i - 2, StateToPrint); if ((chNext == '-') && (chNext2 == '-')) { state = SCE_H_COMMENT; // wait for a pending command styler.ColourTo(i + 2, SCE_H_COMMENT); i += 2; // follow styling after the -- } else if (isWordCdata(i + 1, i + 7, styler)) { state = SCE_H_CDATA; } else { styler.ColourTo(i, SCE_H_SGML_DEFAULT); // ') { i++; visibleChars++; } else if (0 == strcmp(makoBlockType, "%") && ch == '/') { i++; visibleChars++; } if (0 != strcmp(makoBlockType, "%") || ch == '/') { styler.ColourTo(i, SCE_H_ASP); } state = beforePreProc; if (inScriptType == eNonHtmlScriptPreProc) inScriptType = eNonHtmlScript; else inScriptType = eHtml; scriptLanguage = eScriptNone; continue; } // handle the end of Django template code else if (isDjango && ((inScriptType == eNonHtmlPreProc) || (inScriptType == eNonHtmlScriptPreProc)) && (scriptLanguage != eScriptNone) && stateAllowsTermination(state) && isDjangoBlockEnd(ch, chNext, djangoBlockType)) { if (state == SCE_H_ASPAT) { aspScript = segIsScriptingIndicator(styler, styler.GetStartSegment(), i - 1, aspScript); } if (state == SCE_HP_WORD) { classifyWordHTPy(styler.GetStartSegment(), i - 1, keywords4, styler, prevWord, inScriptType, isMako); } else { styler.ColourTo(i - 1, StateToPrint); } i += 1; visibleChars += 1; styler.ColourTo(i, SCE_H_ASP); state = beforePreProc; if (inScriptType == eNonHtmlScriptPreProc) inScriptType = eNonHtmlScript; else inScriptType = eHtml; scriptLanguage = beforeLanguage; continue; } // handle the end of a pre-processor = Non-HTML else if ((!isMako && !isDjango && ((inScriptType == eNonHtmlPreProc) || (inScriptType == eNonHtmlScriptPreProc)) && (((scriptLanguage != eScriptNone) && stateAllowsTermination(state))) && (((ch == '%') || (ch == '?')) && (chNext == '>'))) || ((scriptLanguage == eScriptSGML) && (ch == '>') && (state != SCE_H_SGML_COMMENT))) { if (state == SCE_H_ASPAT) { aspScript = segIsScriptingIndicator(styler, styler.GetStartSegment(), i - 1, aspScript); } // Bounce out of any ASP mode switch (state) { case SCE_HJ_WORD: classifyWordHTJS(styler.GetStartSegment(), i - 1, keywords2, styler, inScriptType); break; case SCE_HB_WORD: classifyWordHTVB(styler.GetStartSegment(), i - 1, keywords3, styler, inScriptType); break; case SCE_HP_WORD: classifyWordHTPy(styler.GetStartSegment(), i - 1, keywords4, styler, prevWord, inScriptType, isMako); break; case SCE_HPHP_WORD: classifyWordHTPHP(styler.GetStartSegment(), i - 1, keywords5, styler); break; case SCE_H_XCCOMMENT: styler.ColourTo(i - 1, state); break; default : styler.ColourTo(i - 1, StateToPrint); break; } if (scriptLanguage != eScriptSGML) { i++; visibleChars++; } if (ch == '%') styler.ColourTo(i, SCE_H_ASP); else if (scriptLanguage == eScriptXML) styler.ColourTo(i, SCE_H_XMLEND); else if (scriptLanguage == eScriptSGML) styler.ColourTo(i, SCE_H_SGML_DEFAULT); else styler.ColourTo(i, SCE_H_QUESTION); state = beforePreProc; if (inScriptType == eNonHtmlScriptPreProc) inScriptType = eNonHtmlScript; else inScriptType = eHtml; // Unfold all scripting languages, except for XML tag if (foldHTMLPreprocessor && (scriptLanguage != eScriptXML)) { levelCurrent--; } scriptLanguage = beforeLanguage; continue; } ///////////////////////////////////// switch (state) { case SCE_H_DEFAULT: if (ch == '<') { // in HTML, fold on tag open and unfold on tag close tagOpened = true; tagClosing = (chNext == '/'); styler.ColourTo(i - 1, StateToPrint); if (chNext != '!') state = SCE_H_TAGUNKNOWN; } else if (ch == '&') { styler.ColourTo(i - 1, SCE_H_DEFAULT); state = SCE_H_ENTITY; } break; case SCE_H_SGML_DEFAULT: case SCE_H_SGML_BLOCK_DEFAULT: // if (scriptLanguage == eScriptSGMLblock) // StateToPrint = SCE_H_SGML_BLOCK_DEFAULT; if (ch == '\"') { styler.ColourTo(i - 1, StateToPrint); state = SCE_H_SGML_DOUBLESTRING; } else if (ch == '\'') { styler.ColourTo(i - 1, StateToPrint); state = SCE_H_SGML_SIMPLESTRING; } else if ((ch == '-') && (chPrev == '-')) { if (static_cast(styler.GetStartSegment()) <= (i - 2)) { styler.ColourTo(i - 2, StateToPrint); } state = SCE_H_SGML_COMMENT; } else if (isascii(ch) && isalpha(ch) && (chPrev == '%')) { styler.ColourTo(i - 2, StateToPrint); state = SCE_H_SGML_ENTITY; } else if (ch == '#') { styler.ColourTo(i - 1, StateToPrint); state = SCE_H_SGML_SPECIAL; } else if (ch == '[') { styler.ColourTo(i - 1, StateToPrint); scriptLanguage = eScriptSGMLblock; state = SCE_H_SGML_BLOCK_DEFAULT; } else if (ch == ']') { if (scriptLanguage == eScriptSGMLblock) { styler.ColourTo(i, StateToPrint); scriptLanguage = eScriptSGML; } else { styler.ColourTo(i - 1, StateToPrint); styler.ColourTo(i, SCE_H_SGML_ERROR); } state = SCE_H_SGML_DEFAULT; } else if (scriptLanguage == eScriptSGMLblock) { if ((ch == '!') && (chPrev == '<')) { styler.ColourTo(i - 2, StateToPrint); styler.ColourTo(i, SCE_H_SGML_DEFAULT); state = SCE_H_SGML_COMMAND; } else if (ch == '>') { styler.ColourTo(i - 1, StateToPrint); styler.ColourTo(i, SCE_H_SGML_DEFAULT); } } break; case SCE_H_SGML_COMMAND: if ((ch == '-') && (chPrev == '-')) { styler.ColourTo(i - 2, StateToPrint); state = SCE_H_SGML_COMMENT; } else if (!issgmlwordchar(ch)) { if (isWordHSGML(styler.GetStartSegment(), i - 1, keywords6, styler)) { styler.ColourTo(i - 1, StateToPrint); state = SCE_H_SGML_1ST_PARAM; } else { state = SCE_H_SGML_ERROR; } } break; case SCE_H_SGML_1ST_PARAM: // wait for the beginning of the word if ((ch == '-') && (chPrev == '-')) { if (scriptLanguage == eScriptSGMLblock) { styler.ColourTo(i - 2, SCE_H_SGML_BLOCK_DEFAULT); } else { styler.ColourTo(i - 2, SCE_H_SGML_DEFAULT); } state = SCE_H_SGML_1ST_PARAM_COMMENT; } else if (issgmlwordchar(ch)) { if (scriptLanguage == eScriptSGMLblock) { styler.ColourTo(i - 1, SCE_H_SGML_BLOCK_DEFAULT); } else { styler.ColourTo(i - 1, SCE_H_SGML_DEFAULT); } // find the length of the word int size = 1; while (setHTMLWord.Contains(static_cast(styler.SafeGetCharAt(i + size)))) size++; styler.ColourTo(i + size - 1, StateToPrint); i += size - 1; visibleChars += size - 1; ch = static_cast(styler.SafeGetCharAt(i)); if (scriptLanguage == eScriptSGMLblock) { state = SCE_H_SGML_BLOCK_DEFAULT; } else { state = SCE_H_SGML_DEFAULT; } continue; } break; case SCE_H_SGML_ERROR: if ((ch == '-') && (chPrev == '-')) { styler.ColourTo(i - 2, StateToPrint); state = SCE_H_SGML_COMMENT; } case SCE_H_SGML_DOUBLESTRING: if (ch == '\"') { styler.ColourTo(i, StateToPrint); state = SCE_H_SGML_DEFAULT; } break; case SCE_H_SGML_SIMPLESTRING: if (ch == '\'') { styler.ColourTo(i, StateToPrint); state = SCE_H_SGML_DEFAULT; } break; case SCE_H_SGML_COMMENT: if ((ch == '-') && (chPrev == '-')) { styler.ColourTo(i, StateToPrint); state = SCE_H_SGML_DEFAULT; } break; case SCE_H_CDATA: if ((chPrev2 == ']') && (chPrev == ']') && (ch == '>')) { styler.ColourTo(i, StateToPrint); state = SCE_H_DEFAULT; levelCurrent--; } break; case SCE_H_COMMENT: if ((scriptLanguage != eScriptComment) && (chPrev2 == '-') && (chPrev == '-') && (ch == '>')) { styler.ColourTo(i, StateToPrint); state = SCE_H_DEFAULT; levelCurrent--; } break; case SCE_H_SGML_1ST_PARAM_COMMENT: if ((ch == '-') && (chPrev == '-')) { styler.ColourTo(i, SCE_H_SGML_COMMENT); state = SCE_H_SGML_1ST_PARAM; } break; case SCE_H_SGML_SPECIAL: if (!(isascii(ch) && isupper(ch))) { styler.ColourTo(i - 1, StateToPrint); if (isalnum(ch)) { state = SCE_H_SGML_ERROR; } else { state = SCE_H_SGML_DEFAULT; } } break; case SCE_H_SGML_ENTITY: if (ch == ';') { styler.ColourTo(i, StateToPrint); state = SCE_H_SGML_DEFAULT; } else if (!(isascii(ch) && isalnum(ch)) && ch != '-' && ch != '.') { styler.ColourTo(i, SCE_H_SGML_ERROR); state = SCE_H_SGML_DEFAULT; } break; case SCE_H_ENTITY: if (ch == ';') { styler.ColourTo(i, StateToPrint); state = SCE_H_DEFAULT; } if (ch != '#' && !(isascii(ch) && isalnum(ch)) // Should check that '#' follows '&', but it is unlikely anyway... && ch != '.' && ch != '-' && ch != '_' && ch != ':') { // valid in XML if (!isascii(ch)) // Possibly start of a multibyte character so don't allow this byte to be in entity style styler.ColourTo(i-1, SCE_H_TAGUNKNOWN); else styler.ColourTo(i, SCE_H_TAGUNKNOWN); state = SCE_H_DEFAULT; } break; case SCE_H_TAGUNKNOWN: if (!setTagContinue.Contains(ch) && !((ch == '/') && (chPrev == '<'))) { int eClass = classifyTagHTML(styler.GetStartSegment(), i - 1, keywords, styler, tagDontFold, caseSensitive, isXml, allowScripts); if (eClass == SCE_H_SCRIPT || eClass == SCE_H_COMMENT) { if (!tagClosing) { inScriptType = eNonHtmlScript; scriptLanguage = eClass == SCE_H_SCRIPT ? clientScript : eScriptComment; } else { scriptLanguage = eScriptNone; } eClass = SCE_H_TAG; } if (ch == '>') { styler.ColourTo(i, eClass); if (inScriptType == eNonHtmlScript) { state = StateForScript(scriptLanguage); } else { state = SCE_H_DEFAULT; } tagOpened = false; if (!tagDontFold) { if (tagClosing) { levelCurrent--; } else { levelCurrent++; } } tagClosing = false; } else if (ch == '/' && chNext == '>') { if (eClass == SCE_H_TAGUNKNOWN) { styler.ColourTo(i + 1, SCE_H_TAGUNKNOWN); } else { styler.ColourTo(i - 1, StateToPrint); styler.ColourTo(i + 1, SCE_H_TAGEND); } i++; ch = chNext; state = SCE_H_DEFAULT; tagOpened = false; } else { if (eClass != SCE_H_TAGUNKNOWN) { if (eClass == SCE_H_SGML_DEFAULT) { state = SCE_H_SGML_DEFAULT; } else { state = SCE_H_OTHER; } } } } break; case SCE_H_ATTRIBUTE: if (!setAttributeContinue.Contains(ch)) { if (inScriptType == eNonHtmlScript) { int scriptLanguagePrev = scriptLanguage; clientScript = segIsScriptingIndicator(styler, styler.GetStartSegment(), i - 1, scriptLanguage); scriptLanguage = clientScript; if ((scriptLanguagePrev != scriptLanguage) && (scriptLanguage == eScriptNone)) inScriptType = eHtml; } classifyAttribHTML(styler.GetStartSegment(), i - 1, keywords, styler); if (ch == '>') { styler.ColourTo(i, SCE_H_TAG); if (inScriptType == eNonHtmlScript) { state = StateForScript(scriptLanguage); } else { state = SCE_H_DEFAULT; } tagOpened = false; if (!tagDontFold) { if (tagClosing) { levelCurrent--; } else { levelCurrent++; } } tagClosing = false; } else if (ch == '=') { styler.ColourTo(i, SCE_H_OTHER); state = SCE_H_VALUE; } else { state = SCE_H_OTHER; } } break; case SCE_H_OTHER: if (ch == '>') { styler.ColourTo(i - 1, StateToPrint); styler.ColourTo(i, SCE_H_TAG); if (inScriptType == eNonHtmlScript) { state = StateForScript(scriptLanguage); } else { state = SCE_H_DEFAULT; } tagOpened = false; if (!tagDontFold) { if (tagClosing) { levelCurrent--; } else { levelCurrent++; } } tagClosing = false; } else if (ch == '\"') { styler.ColourTo(i - 1, StateToPrint); state = SCE_H_DOUBLESTRING; } else if (ch == '\'') { styler.ColourTo(i - 1, StateToPrint); state = SCE_H_SINGLESTRING; } else if (ch == '=') { styler.ColourTo(i, StateToPrint); state = SCE_H_VALUE; } else if (ch == '/' && chNext == '>') { styler.ColourTo(i - 1, StateToPrint); styler.ColourTo(i + 1, SCE_H_TAGEND); i++; ch = chNext; state = SCE_H_DEFAULT; tagOpened = false; } else if (ch == '?' && chNext == '>') { styler.ColourTo(i - 1, StateToPrint); styler.ColourTo(i + 1, SCE_H_XMLEND); i++; ch = chNext; state = SCE_H_DEFAULT; } else if (setHTMLWord.Contains(ch)) { styler.ColourTo(i - 1, StateToPrint); state = SCE_H_ATTRIBUTE; } break; case SCE_H_DOUBLESTRING: if (ch == '\"') { if (inScriptType == eNonHtmlScript) { scriptLanguage = segIsScriptingIndicator(styler, styler.GetStartSegment(), i, scriptLanguage); } styler.ColourTo(i, SCE_H_DOUBLESTRING); state = SCE_H_OTHER; } break; case SCE_H_SINGLESTRING: if (ch == '\'') { if (inScriptType == eNonHtmlScript) { scriptLanguage = segIsScriptingIndicator(styler, styler.GetStartSegment(), i, scriptLanguage); } styler.ColourTo(i, SCE_H_SINGLESTRING); state = SCE_H_OTHER; } break; case SCE_H_VALUE: if (!setHTMLWord.Contains(ch)) { if (ch == '\"' && chPrev == '=') { // Should really test for being first character state = SCE_H_DOUBLESTRING; } else if (ch == '\'' && chPrev == '=') { state = SCE_H_SINGLESTRING; } else { if (IsNumber(styler.GetStartSegment(), styler)) { styler.ColourTo(i - 1, SCE_H_NUMBER); } else { styler.ColourTo(i - 1, StateToPrint); } if (ch == '>') { styler.ColourTo(i, SCE_H_TAG); if (inScriptType == eNonHtmlScript) { state = StateForScript(scriptLanguage); } else { state = SCE_H_DEFAULT; } tagOpened = false; if (!tagDontFold) { if (tagClosing) { levelCurrent--; } else { levelCurrent++; } } tagClosing = false; } else { state = SCE_H_OTHER; } } } break; case SCE_HJ_DEFAULT: case SCE_HJ_START: case SCE_HJ_SYMBOLS: if (IsAWordStart(ch)) { styler.ColourTo(i - 1, StateToPrint); state = SCE_HJ_WORD; } else if (ch == '/' && chNext == '*') { styler.ColourTo(i - 1, StateToPrint); if (chNext2 == '*') state = SCE_HJ_COMMENTDOC; else state = SCE_HJ_COMMENT; } else if (ch == '/' && chNext == '/') { styler.ColourTo(i - 1, StateToPrint); state = SCE_HJ_COMMENTLINE; } else if (ch == '/' && isOKBeforeRE(chPrevNonWhite)) { styler.ColourTo(i - 1, StateToPrint); state = SCE_HJ_REGEX; } else if (ch == '\"') { styler.ColourTo(i - 1, StateToPrint); state = SCE_HJ_DOUBLESTRING; } else if (ch == '\'') { styler.ColourTo(i - 1, StateToPrint); state = SCE_HJ_SINGLESTRING; } else if ((ch == '<') && (chNext == '!') && (chNext2 == '-') && styler.SafeGetCharAt(i + 3) == '-') { styler.ColourTo(i - 1, StateToPrint); state = SCE_HJ_COMMENTLINE; } else if ((ch == '-') && (chNext == '-') && (chNext2 == '>')) { styler.ColourTo(i - 1, StateToPrint); state = SCE_HJ_COMMENTLINE; i += 2; } else if (IsOperator(ch)) { styler.ColourTo(i - 1, StateToPrint); styler.ColourTo(i, statePrintForState(SCE_HJ_SYMBOLS, inScriptType)); state = SCE_HJ_DEFAULT; } else if ((ch == ' ') || (ch == '\t')) { if (state == SCE_HJ_START) { styler.ColourTo(i - 1, StateToPrint); state = SCE_HJ_DEFAULT; } } break; case SCE_HJ_WORD: if (!IsAWordChar(ch)) { classifyWordHTJS(styler.GetStartSegment(), i - 1, keywords2, styler, inScriptType); //styler.ColourTo(i - 1, eHTJSKeyword); state = SCE_HJ_DEFAULT; if (ch == '/' && chNext == '*') { if (chNext2 == '*') state = SCE_HJ_COMMENTDOC; else state = SCE_HJ_COMMENT; } else if (ch == '/' && chNext == '/') { state = SCE_HJ_COMMENTLINE; } else if (ch == '\"') { state = SCE_HJ_DOUBLESTRING; } else if (ch == '\'') { state = SCE_HJ_SINGLESTRING; } else if ((ch == '-') && (chNext == '-') && (chNext2 == '>')) { styler.ColourTo(i - 1, StateToPrint); state = SCE_HJ_COMMENTLINE; i += 2; } else if (IsOperator(ch)) { styler.ColourTo(i, statePrintForState(SCE_HJ_SYMBOLS, inScriptType)); state = SCE_HJ_DEFAULT; } } break; case SCE_HJ_COMMENT: case SCE_HJ_COMMENTDOC: if (ch == '/' && chPrev == '*') { styler.ColourTo(i, StateToPrint); state = SCE_HJ_DEFAULT; ch = ' '; } break; case SCE_HJ_COMMENTLINE: if (ch == '\r' || ch == '\n') { styler.ColourTo(i - 1, statePrintForState(SCE_HJ_COMMENTLINE, inScriptType)); state = SCE_HJ_DEFAULT; ch = ' '; } break; case SCE_HJ_DOUBLESTRING: if (ch == '\\') { if (chNext == '\"' || chNext == '\'' || chNext == '\\') { i++; } } else if (ch == '\"') { styler.ColourTo(i, statePrintForState(SCE_HJ_DOUBLESTRING, inScriptType)); state = SCE_HJ_DEFAULT; } else if ((inScriptType == eNonHtmlScript) && (ch == '-') && (chNext == '-') && (chNext2 == '>')) { styler.ColourTo(i - 1, StateToPrint); state = SCE_HJ_COMMENTLINE; i += 2; } else if (isLineEnd(ch)) { styler.ColourTo(i - 1, StateToPrint); state = SCE_HJ_STRINGEOL; } break; case SCE_HJ_SINGLESTRING: if (ch == '\\') { if (chNext == '\"' || chNext == '\'' || chNext == '\\') { i++; } } else if (ch == '\'') { styler.ColourTo(i, statePrintForState(SCE_HJ_SINGLESTRING, inScriptType)); state = SCE_HJ_DEFAULT; } else if ((inScriptType == eNonHtmlScript) && (ch == '-') && (chNext == '-') && (chNext2 == '>')) { styler.ColourTo(i - 1, StateToPrint); state = SCE_HJ_COMMENTLINE; i += 2; } else if (isLineEnd(ch)) { styler.ColourTo(i - 1, StateToPrint); if (chPrev != '\\' && (chPrev2 != '\\' || chPrev != '\r' || ch != '\n')) { state = SCE_HJ_STRINGEOL; } } break; case SCE_HJ_STRINGEOL: if (!isLineEnd(ch)) { styler.ColourTo(i - 1, StateToPrint); state = SCE_HJ_DEFAULT; } else if (!isLineEnd(chNext)) { styler.ColourTo(i, StateToPrint); state = SCE_HJ_DEFAULT; } break; case SCE_HJ_REGEX: if (ch == '\r' || ch == '\n' || ch == '/') { if (ch == '/') { while (isascii(chNext) && islower(chNext)) { // gobble regex flags i++; ch = chNext; chNext = static_cast(styler.SafeGetCharAt(i + 1)); } } styler.ColourTo(i, StateToPrint); state = SCE_HJ_DEFAULT; } else if (ch == '\\') { // Gobble up the quoted character if (chNext == '\\' || chNext == '/') { i++; ch = chNext; chNext = static_cast(styler.SafeGetCharAt(i + 1)); } } break; case SCE_HB_DEFAULT: case SCE_HB_START: if (IsAWordStart(ch)) { styler.ColourTo(i - 1, StateToPrint); state = SCE_HB_WORD; } else if (ch == '\'') { styler.ColourTo(i - 1, StateToPrint); state = SCE_HB_COMMENTLINE; } else if (ch == '\"') { styler.ColourTo(i - 1, StateToPrint); state = SCE_HB_STRING; } else if ((ch == '<') && (chNext == '!') && (chNext2 == '-') && styler.SafeGetCharAt(i + 3) == '-') { styler.ColourTo(i - 1, StateToPrint); state = SCE_HB_COMMENTLINE; } else if (IsOperator(ch)) { styler.ColourTo(i - 1, StateToPrint); styler.ColourTo(i, statePrintForState(SCE_HB_DEFAULT, inScriptType)); state = SCE_HB_DEFAULT; } else if ((ch == ' ') || (ch == '\t')) { if (state == SCE_HB_START) { styler.ColourTo(i - 1, StateToPrint); state = SCE_HB_DEFAULT; } } break; case SCE_HB_WORD: if (!IsAWordChar(ch)) { state = classifyWordHTVB(styler.GetStartSegment(), i - 1, keywords3, styler, inScriptType); if (state == SCE_HB_DEFAULT) { if (ch == '\"') { state = SCE_HB_STRING; } else if (ch == '\'') { state = SCE_HB_COMMENTLINE; } else if (IsOperator(ch)) { styler.ColourTo(i, statePrintForState(SCE_HB_DEFAULT, inScriptType)); state = SCE_HB_DEFAULT; } } } break; case SCE_HB_STRING: if (ch == '\"') { styler.ColourTo(i, StateToPrint); state = SCE_HB_DEFAULT; } else if (ch == '\r' || ch == '\n') { styler.ColourTo(i - 1, StateToPrint); state = SCE_HB_STRINGEOL; } break; case SCE_HB_COMMENTLINE: if (ch == '\r' || ch == '\n') { styler.ColourTo(i - 1, StateToPrint); state = SCE_HB_DEFAULT; } break; case SCE_HB_STRINGEOL: if (!isLineEnd(ch)) { styler.ColourTo(i - 1, StateToPrint); state = SCE_HB_DEFAULT; } else if (!isLineEnd(chNext)) { styler.ColourTo(i, StateToPrint); state = SCE_HB_DEFAULT; } break; case SCE_HP_DEFAULT: case SCE_HP_START: if (IsAWordStart(ch)) { styler.ColourTo(i - 1, StateToPrint); state = SCE_HP_WORD; } else if ((ch == '<') && (chNext == '!') && (chNext2 == '-') && styler.SafeGetCharAt(i + 3) == '-') { styler.ColourTo(i - 1, StateToPrint); state = SCE_HP_COMMENTLINE; } else if (ch == '#') { styler.ColourTo(i - 1, StateToPrint); state = SCE_HP_COMMENTLINE; } else if (ch == '\"') { styler.ColourTo(i - 1, StateToPrint); if (chNext == '\"' && chNext2 == '\"') { i += 2; state = SCE_HP_TRIPLEDOUBLE; ch = ' '; chPrev = ' '; chNext = static_cast(styler.SafeGetCharAt(i + 1)); } else { // state = statePrintForState(SCE_HP_STRING,inScriptType); state = SCE_HP_STRING; } } else if (ch == '\'') { styler.ColourTo(i - 1, StateToPrint); if (chNext == '\'' && chNext2 == '\'') { i += 2; state = SCE_HP_TRIPLE; ch = ' '; chPrev = ' '; chNext = static_cast(styler.SafeGetCharAt(i + 1)); } else { state = SCE_HP_CHARACTER; } } else if (IsOperator(ch)) { styler.ColourTo(i - 1, StateToPrint); styler.ColourTo(i, statePrintForState(SCE_HP_OPERATOR, inScriptType)); } else if ((ch == ' ') || (ch == '\t')) { if (state == SCE_HP_START) { styler.ColourTo(i - 1, StateToPrint); state = SCE_HP_DEFAULT; } } break; case SCE_HP_WORD: if (!IsAWordChar(ch)) { classifyWordHTPy(styler.GetStartSegment(), i - 1, keywords4, styler, prevWord, inScriptType, isMako); state = SCE_HP_DEFAULT; if (ch == '#') { state = SCE_HP_COMMENTLINE; } else if (ch == '\"') { if (chNext == '\"' && chNext2 == '\"') { i += 2; state = SCE_HP_TRIPLEDOUBLE; ch = ' '; chPrev = ' '; chNext = static_cast(styler.SafeGetCharAt(i + 1)); } else { state = SCE_HP_STRING; } } else if (ch == '\'') { if (chNext == '\'' && chNext2 == '\'') { i += 2; state = SCE_HP_TRIPLE; ch = ' '; chPrev = ' '; chNext = static_cast(styler.SafeGetCharAt(i + 1)); } else { state = SCE_HP_CHARACTER; } } else if (IsOperator(ch)) { styler.ColourTo(i, statePrintForState(SCE_HP_OPERATOR, inScriptType)); } } break; case SCE_HP_COMMENTLINE: if (ch == '\r' || ch == '\n') { styler.ColourTo(i - 1, StateToPrint); state = SCE_HP_DEFAULT; } break; case SCE_HP_STRING: if (ch == '\\') { if (chNext == '\"' || chNext == '\'' || chNext == '\\') { i++; ch = chNext; chNext = static_cast(styler.SafeGetCharAt(i + 1)); } } else if (ch == '\"') { styler.ColourTo(i, StateToPrint); state = SCE_HP_DEFAULT; } break; case SCE_HP_CHARACTER: if (ch == '\\') { if (chNext == '\"' || chNext == '\'' || chNext == '\\') { i++; ch = chNext; chNext = static_cast(styler.SafeGetCharAt(i + 1)); } } else if (ch == '\'') { styler.ColourTo(i, StateToPrint); state = SCE_HP_DEFAULT; } break; case SCE_HP_TRIPLE: if (ch == '\'' && chPrev == '\'' && chPrev2 == '\'') { styler.ColourTo(i, StateToPrint); state = SCE_HP_DEFAULT; } break; case SCE_HP_TRIPLEDOUBLE: if (ch == '\"' && chPrev == '\"' && chPrev2 == '\"') { styler.ColourTo(i, StateToPrint); state = SCE_HP_DEFAULT; } break; ///////////// start - PHP state handling case SCE_HPHP_WORD: if (!IsAWordChar(ch)) { classifyWordHTPHP(styler.GetStartSegment(), i - 1, keywords5, styler); if (ch == '/' && chNext == '*') { i++; state = SCE_HPHP_COMMENT; } else if (ch == '/' && chNext == '/') { i++; state = SCE_HPHP_COMMENTLINE; } else if (ch == '#') { state = SCE_HPHP_COMMENTLINE; } else if (ch == '\"') { state = SCE_HPHP_HSTRING; strcpy(phpStringDelimiter, "\""); } else if (styler.Match(i, "<<<")) { bool isSimpleString = false; i = FindPhpStringDelimiter(phpStringDelimiter, sizeof(phpStringDelimiter), i + 3, lengthDoc, styler, isSimpleString); if (strlen(phpStringDelimiter)) { state = (isSimpleString ? SCE_HPHP_SIMPLESTRING : SCE_HPHP_HSTRING); if (foldHeredoc) levelCurrent++; } } else if (ch == '\'') { state = SCE_HPHP_SIMPLESTRING; strcpy(phpStringDelimiter, "\'"); } else if (ch == '$' && IsPhpWordStart(chNext)) { state = SCE_HPHP_VARIABLE; } else if (IsOperator(ch)) { state = SCE_HPHP_OPERATOR; } else { state = SCE_HPHP_DEFAULT; } } break; case SCE_HPHP_NUMBER: // recognize bases 8,10 or 16 integers OR floating-point numbers if (!IsADigit(ch) && strchr(".xXabcdefABCDEF", ch) == NULL && ((ch != '-' && ch != '+') || (chPrev != 'e' && chPrev != 'E'))) { styler.ColourTo(i - 1, SCE_HPHP_NUMBER); if (IsOperator(ch)) state = SCE_HPHP_OPERATOR; else state = SCE_HPHP_DEFAULT; } break; case SCE_HPHP_VARIABLE: if (!IsPhpWordChar(chNext)) { styler.ColourTo(i, SCE_HPHP_VARIABLE); state = SCE_HPHP_DEFAULT; } break; case SCE_HPHP_COMMENT: if (ch == '/' && chPrev == '*') { styler.ColourTo(i, StateToPrint); state = SCE_HPHP_DEFAULT; } break; case SCE_HPHP_COMMENTLINE: if (ch == '\r' || ch == '\n') { styler.ColourTo(i - 1, StateToPrint); state = SCE_HPHP_DEFAULT; } break; case SCE_HPHP_HSTRING: if (ch == '\\' && (phpStringDelimiter[0] == '\"' || chNext == '$' || chNext == '{')) { // skip the next char i++; } else if (((ch == '{' && chNext == '$') || (ch == '$' && chNext == '{')) && IsPhpWordStart(chNext2)) { styler.ColourTo(i - 1, StateToPrint); state = SCE_HPHP_COMPLEX_VARIABLE; } else if (ch == '$' && IsPhpWordStart(chNext)) { styler.ColourTo(i - 1, StateToPrint); state = SCE_HPHP_HSTRING_VARIABLE; } else if (styler.Match(i, phpStringDelimiter)) { if (phpStringDelimiter[0] == '\"') { styler.ColourTo(i, StateToPrint); state = SCE_HPHP_DEFAULT; } else if (isLineEnd(chPrev)) { const int psdLength = static_cast(strlen(phpStringDelimiter)); const char chAfterPsd = styler.SafeGetCharAt(i + psdLength); const char chAfterPsd2 = styler.SafeGetCharAt(i + psdLength + 1); if (isLineEnd(chAfterPsd) || (chAfterPsd == ';' && isLineEnd(chAfterPsd2))) { i += (((i + psdLength) < lengthDoc) ? psdLength : lengthDoc) - 1; styler.ColourTo(i, StateToPrint); state = SCE_HPHP_DEFAULT; if (foldHeredoc) levelCurrent--; } } } break; case SCE_HPHP_SIMPLESTRING: if (phpStringDelimiter[0] == '\'') { if (ch == '\\') { // skip the next char i++; } else if (ch == '\'') { styler.ColourTo(i, StateToPrint); state = SCE_HPHP_DEFAULT; } } else if (isLineEnd(chPrev) && styler.Match(i, phpStringDelimiter)) { const int psdLength = static_cast(strlen(phpStringDelimiter)); const char chAfterPsd = styler.SafeGetCharAt(i + psdLength); const char chAfterPsd2 = styler.SafeGetCharAt(i + psdLength + 1); if (isLineEnd(chAfterPsd) || (chAfterPsd == ';' && isLineEnd(chAfterPsd2))) { i += (((i + psdLength) < lengthDoc) ? psdLength : lengthDoc) - 1; styler.ColourTo(i, StateToPrint); state = SCE_HPHP_DEFAULT; if (foldHeredoc) levelCurrent--; } } break; case SCE_HPHP_HSTRING_VARIABLE: if (!IsPhpWordChar(chNext)) { styler.ColourTo(i, StateToPrint); state = SCE_HPHP_HSTRING; } break; case SCE_HPHP_COMPLEX_VARIABLE: if (ch == '}') { styler.ColourTo(i, StateToPrint); state = SCE_HPHP_HSTRING; } break; case SCE_HPHP_OPERATOR: case SCE_HPHP_DEFAULT: styler.ColourTo(i - 1, StateToPrint); if (IsADigit(ch) || (ch == '.' && IsADigit(chNext))) { state = SCE_HPHP_NUMBER; } else if (IsAWordStart(ch)) { state = SCE_HPHP_WORD; } else if (ch == '/' && chNext == '*') { i++; state = SCE_HPHP_COMMENT; } else if (ch == '/' && chNext == '/') { i++; state = SCE_HPHP_COMMENTLINE; } else if (ch == '#') { state = SCE_HPHP_COMMENTLINE; } else if (ch == '\"') { state = SCE_HPHP_HSTRING; strcpy(phpStringDelimiter, "\""); } else if (styler.Match(i, "<<<")) { bool isSimpleString = false; i = FindPhpStringDelimiter(phpStringDelimiter, sizeof(phpStringDelimiter), i + 3, lengthDoc, styler, isSimpleString); if (strlen(phpStringDelimiter)) { state = (isSimpleString ? SCE_HPHP_SIMPLESTRING : SCE_HPHP_HSTRING); if (foldHeredoc) levelCurrent++; } } else if (ch == '\'') { state = SCE_HPHP_SIMPLESTRING; strcpy(phpStringDelimiter, "\'"); } else if (ch == '$' && IsPhpWordStart(chNext)) { state = SCE_HPHP_VARIABLE; } else if (IsOperator(ch)) { state = SCE_HPHP_OPERATOR; } else if ((state == SCE_HPHP_OPERATOR) && (IsASpace(ch))) { state = SCE_HPHP_DEFAULT; } break; ///////////// end - PHP state handling } // Some of the above terminated their lexeme but since the same character starts // the same class again, only reenter if non empty segment. bool nonEmptySegment = i >= static_cast(styler.GetStartSegment()); if (state == SCE_HB_DEFAULT) { // One of the above succeeded if ((ch == '\"') && (nonEmptySegment)) { state = SCE_HB_STRING; } else if (ch == '\'') { state = SCE_HB_COMMENTLINE; } else if (IsAWordStart(ch)) { state = SCE_HB_WORD; } else if (IsOperator(ch)) { styler.ColourTo(i, SCE_HB_DEFAULT); } } else if (state == SCE_HBA_DEFAULT) { // One of the above succeeded if ((ch == '\"') && (nonEmptySegment)) { state = SCE_HBA_STRING; } else if (ch == '\'') { state = SCE_HBA_COMMENTLINE; } else if (IsAWordStart(ch)) { state = SCE_HBA_WORD; } else if (IsOperator(ch)) { styler.ColourTo(i, SCE_HBA_DEFAULT); } } else if (state == SCE_HJ_DEFAULT) { // One of the above succeeded if (ch == '/' && chNext == '*') { if (styler.SafeGetCharAt(i + 2) == '*') state = SCE_HJ_COMMENTDOC; else state = SCE_HJ_COMMENT; } else if (ch == '/' && chNext == '/') { state = SCE_HJ_COMMENTLINE; } else if ((ch == '\"') && (nonEmptySegment)) { state = SCE_HJ_DOUBLESTRING; } else if ((ch == '\'') && (nonEmptySegment)) { state = SCE_HJ_SINGLESTRING; } else if (IsAWordStart(ch)) { state = SCE_HJ_WORD; } else if (IsOperator(ch)) { styler.ColourTo(i, statePrintForState(SCE_HJ_SYMBOLS, inScriptType)); } } } switch (state) { case SCE_HJ_WORD: classifyWordHTJS(styler.GetStartSegment(), lengthDoc - 1, keywords2, styler, inScriptType); break; case SCE_HB_WORD: classifyWordHTVB(styler.GetStartSegment(), lengthDoc - 1, keywords3, styler, inScriptType); break; case SCE_HP_WORD: classifyWordHTPy(styler.GetStartSegment(), lengthDoc - 1, keywords4, styler, prevWord, inScriptType, isMako); break; case SCE_HPHP_WORD: classifyWordHTPHP(styler.GetStartSegment(), lengthDoc - 1, keywords5, styler); break; default: StateToPrint = statePrintForState(state, inScriptType); styler.ColourTo(lengthDoc - 1, StateToPrint); break; } // Fill in the real level of the next line, keeping the current flags as they will be filled in later if (fold) { int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; styler.SetLevel(lineCurrent, levelPrev | flagsNext); } } static void ColouriseXMLDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { // Passing in true because we're lexing XML ColouriseHyperTextDoc(startPos, length, initStyle, keywordlists, styler, true); } static void ColouriseHTMLDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { // Passing in false because we're notlexing XML ColouriseHyperTextDoc(startPos, length, initStyle, keywordlists, styler, false); } static void ColourisePHPScriptDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { if (startPos == 0) initStyle = SCE_HPHP_DEFAULT; ColouriseHTMLDoc(startPos, length, initStyle, keywordlists, styler); } static const char * const htmlWordListDesc[] = { "HTML elements and attributes", "JavaScript keywords", "VBScript keywords", "Python keywords", "PHP keywords", "SGML and DTD keywords", 0, }; static const char * const phpscriptWordListDesc[] = { "", //Unused "", //Unused "", //Unused "", //Unused "PHP keywords", "", //Unused 0, }; LexerModule lmHTML(SCLEX_HTML, ColouriseHTMLDoc, "hypertext", 0, htmlWordListDesc, 8); LexerModule lmXML(SCLEX_XML, ColouriseXMLDoc, "xml", 0, htmlWordListDesc, 8); LexerModule lmPHPSCRIPT(SCLEX_PHPSCRIPT, ColourisePHPScriptDoc, "phpscript", 0, phpscriptWordListDesc, 8); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/ExternalLexer.cxx000444001750001750 1037411727344243 25730 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file ExternalLexer.cxx ** Support external lexers in DLLs. **/ // Copyright 2001 Simon Steele , portions copyright Neil Hodgson. // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "Platform.h" #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "LexerModule.h" #include "Catalogue.h" #include "ExternalLexer.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif LexerManager *LexerManager::theInstance = NULL; //------------------------------------------ // // ExternalLexerModule // //------------------------------------------ void ExternalLexerModule::SetExternal(GetLexerFactoryFunction fFactory, int index) { fneFactory = fFactory; fnFactory = fFactory(index); } //------------------------------------------ // // LexerLibrary // //------------------------------------------ LexerLibrary::LexerLibrary(const char *ModuleName) { // Initialise some members... first = NULL; last = NULL; // Load the DLL lib = DynamicLibrary::Load(ModuleName); if (lib->IsValid()) { m_sModuleName = ModuleName; //Cannot use reinterpret_cast because: ANSI C++ forbids casting between pointers to functions and objects GetLexerCountFn GetLexerCount = (GetLexerCountFn)(sptr_t)lib->FindFunction("GetLexerCount"); if (GetLexerCount) { ExternalLexerModule *lex; LexerMinder *lm; // Find functions in the DLL GetLexerNameFn GetLexerName = (GetLexerNameFn)(sptr_t)lib->FindFunction("GetLexerName"); GetLexerFactoryFunction fnFactory = (GetLexerFactoryFunction)(sptr_t)lib->FindFunction("GetLexerFactory"); // Assign a buffer for the lexer name. char lexname[100]; strcpy(lexname, ""); int nl = GetLexerCount(); for (int i = 0; i < nl; i++) { GetLexerName(i, lexname, 100); lex = new ExternalLexerModule(SCLEX_AUTOMATIC, NULL, lexname, NULL); Catalogue::AddLexerModule(lex); // Create a LexerMinder so we don't leak the ExternalLexerModule... lm = new LexerMinder; lm->self = lex; lm->next = NULL; if (first != NULL) { last->next = lm; last = lm; } else { first = lm; last = lm; } // The external lexer needs to know how to call into its DLL to // do its lexing and folding, we tell it here. lex->SetExternal(fnFactory, i); } } } next = NULL; } LexerLibrary::~LexerLibrary() { Release(); delete lib; } void LexerLibrary::Release() { LexerMinder *lm; LexerMinder *lmNext; lm = first; while (NULL != lm) { lmNext = lm->next; delete lm->self; delete lm; lm = lmNext; } first = NULL; last = NULL; } //------------------------------------------ // // LexerManager // //------------------------------------------ /// Return the single LexerManager instance... LexerManager *LexerManager::GetInstance() { if (!theInstance) theInstance = new LexerManager; return theInstance; } /// Delete any LexerManager instance... void LexerManager::DeleteInstance() { delete theInstance; theInstance = NULL; } /// protected constructor - this is a singleton... LexerManager::LexerManager() { first = NULL; last = NULL; } LexerManager::~LexerManager() { Clear(); } void LexerManager::Load(const char *path) { LoadLexerLibrary(path); } void LexerManager::LoadLexerLibrary(const char *module) { for (LexerLibrary *ll = first; ll; ll= ll->next) { if (strcmp(ll->m_sModuleName.c_str(), module) == 0) return; } LexerLibrary *lib = new LexerLibrary(module); if (NULL != first) { last->next = lib; last = lib; } else { first = lib; last = lib; } } void LexerManager::Clear() { if (NULL != first) { LexerLibrary *cur = first; LexerLibrary *next; while (cur) { next = cur->next; delete cur; cur = next; } first = NULL; last = NULL; } } //------------------------------------------ // // LexerManager // //------------------------------------------ LMMinder::~LMMinder() { LexerManager::DeleteInstance(); } LMMinder minder; Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexEScript.cxx000444001750001750 2040311727344243 25162 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexESCRIPT.cxx ** Lexer for ESCRIPT **/ // Copyright 2003 by Patrizio Bekerle (patrizio@bekerle.com) #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static inline bool IsAWordChar(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_'); } static inline bool IsAWordStart(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '_'); } static void ColouriseESCRIPTDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { WordList &keywords = *keywordlists[0]; WordList &keywords2 = *keywordlists[1]; WordList &keywords3 = *keywordlists[2]; // Do not leak onto next line /*if (initStyle == SCE_ESCRIPT_STRINGEOL) initStyle = SCE_ESCRIPT_DEFAULT;*/ StyleContext sc(startPos, length, initStyle, styler); bool caseSensitive = styler.GetPropertyInt("escript.case.sensitive", 0) != 0; for (; sc.More(); sc.Forward()) { /*if (sc.atLineStart && (sc.state == SCE_ESCRIPT_STRING)) { // Prevent SCE_ESCRIPT_STRINGEOL from leaking back to previous line sc.SetState(SCE_ESCRIPT_STRING); }*/ // Handle line continuation generically. if (sc.ch == '\\') { if (sc.chNext == '\n' || sc.chNext == '\r') { sc.Forward(); if (sc.ch == '\r' && sc.chNext == '\n') { sc.Forward(); } continue; } } // Determine if the current state should terminate. if (sc.state == SCE_ESCRIPT_OPERATOR || sc.state == SCE_ESCRIPT_BRACE) { sc.SetState(SCE_ESCRIPT_DEFAULT); } else if (sc.state == SCE_ESCRIPT_NUMBER) { if (!IsADigit(sc.ch) || sc.ch != '.') { sc.SetState(SCE_ESCRIPT_DEFAULT); } } else if (sc.state == SCE_ESCRIPT_IDENTIFIER) { if (!IsAWordChar(sc.ch) || (sc.ch == '.')) { char s[100]; if (caseSensitive) { sc.GetCurrent(s, sizeof(s)); } else { sc.GetCurrentLowered(s, sizeof(s)); } // sc.GetCurrentLowered(s, sizeof(s)); if (keywords.InList(s)) { sc.ChangeState(SCE_ESCRIPT_WORD); } else if (keywords2.InList(s)) { sc.ChangeState(SCE_ESCRIPT_WORD2); } else if (keywords3.InList(s)) { sc.ChangeState(SCE_ESCRIPT_WORD3); // sc.state = SCE_ESCRIPT_IDENTIFIER; } sc.SetState(SCE_ESCRIPT_DEFAULT); } } else if (sc.state == SCE_ESCRIPT_COMMENT) { if (sc.Match('*', '/')) { sc.Forward(); sc.ForwardSetState(SCE_ESCRIPT_DEFAULT); } } else if (sc.state == SCE_ESCRIPT_COMMENTDOC) { if (sc.Match('*', '/')) { sc.Forward(); sc.ForwardSetState(SCE_ESCRIPT_DEFAULT); } } else if (sc.state == SCE_ESCRIPT_COMMENTLINE) { if (sc.atLineEnd) { sc.SetState(SCE_ESCRIPT_DEFAULT); } } else if (sc.state == SCE_ESCRIPT_STRING) { if (sc.ch == '\\') { if (sc.chNext == '\"' || sc.chNext == '\\') { sc.Forward(); } } else if (sc.ch == '\"') { sc.ForwardSetState(SCE_ESCRIPT_DEFAULT); } } // Determine if a new state should be entered. if (sc.state == SCE_ESCRIPT_DEFAULT) { if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) { sc.SetState(SCE_ESCRIPT_NUMBER); } else if (IsAWordStart(sc.ch) || (sc.ch == '#')) { sc.SetState(SCE_ESCRIPT_IDENTIFIER); } else if (sc.Match('/', '*')) { sc.SetState(SCE_ESCRIPT_COMMENT); sc.Forward(); // Eat the * so it isn't used for the end of the comment } else if (sc.Match('/', '/')) { sc.SetState(SCE_ESCRIPT_COMMENTLINE); } else if (sc.ch == '\"') { sc.SetState(SCE_ESCRIPT_STRING); //} else if (isoperator(static_cast(sc.ch))) { } else if (sc.ch == '+' || sc.ch == '-' || sc.ch == '*' || sc.ch == '/' || sc.ch == '=' || sc.ch == '<' || sc.ch == '>' || sc.ch == '&' || sc.ch == '|' || sc.ch == '!' || sc.ch == '?' || sc.ch == ':') { sc.SetState(SCE_ESCRIPT_OPERATOR); } else if (sc.ch == '{' || sc.ch == '}') { sc.SetState(SCE_ESCRIPT_BRACE); } } } sc.Complete(); } static int classifyFoldPointESCRIPT(const char* s, const char* prevWord) { int lev = 0; if (strcmp(prevWord, "end") == 0) return lev; if ((strcmp(prevWord, "else") == 0 && strcmp(s, "if") == 0) || strcmp(s, "elseif") == 0) return -1; if (strcmp(s, "for") == 0 || strcmp(s, "foreach") == 0 || strcmp(s, "program") == 0 || strcmp(s, "function") == 0 || strcmp(s, "while") == 0 || strcmp(s, "case") == 0 || strcmp(s, "if") == 0 ) { lev = 1; } else if ( strcmp(s, "endfor") == 0 || strcmp(s, "endforeach") == 0 || strcmp(s, "endprogram") == 0 || strcmp(s, "endfunction") == 0 || strcmp(s, "endwhile") == 0 || strcmp(s, "endcase") == 0 || strcmp(s, "endif") == 0 ) { lev = -1; } return lev; } static bool IsStreamCommentStyle(int style) { return style == SCE_ESCRIPT_COMMENT || style == SCE_ESCRIPT_COMMENTDOC || style == SCE_ESCRIPT_COMMENTLINE; } static void FoldESCRIPTDoc(unsigned int startPos, int length, int initStyle, WordList *[], Accessor &styler) { //~ bool foldComment = styler.GetPropertyInt("fold.comment") != 0; // Do not know how to fold the comment at the moment. bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; bool foldComment = true; unsigned int endPos = startPos + length; int visibleChars = 0; int lineCurrent = styler.GetLine(startPos); int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; int levelCurrent = levelPrev; char chNext = styler[startPos]; int styleNext = styler.StyleAt(startPos); int style = initStyle; int lastStart = 0; char prevWord[32] = ""; for (unsigned int i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); int stylePrev = style; style = styleNext; styleNext = styler.StyleAt(i + 1); bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); if (foldComment && IsStreamCommentStyle(style)) { if (!IsStreamCommentStyle(stylePrev)) { levelCurrent++; } else if (!IsStreamCommentStyle(styleNext) && !atEOL) { // Comments don't end at end of line and the next character may be unstyled. levelCurrent--; } } if (foldComment && (style == SCE_ESCRIPT_COMMENTLINE)) { if ((ch == '/') && (chNext == '/')) { char chNext2 = styler.SafeGetCharAt(i + 2); if (chNext2 == '{') { levelCurrent++; } else if (chNext2 == '}') { levelCurrent--; } } } if (stylePrev == SCE_ESCRIPT_DEFAULT && style == SCE_ESCRIPT_WORD3) { // Store last word start point. lastStart = i; } if (style == SCE_ESCRIPT_WORD3) { if(iswordchar(ch) && !iswordchar(chNext)) { char s[32]; unsigned int j; for(j = 0; ( j < 31 ) && ( j < i-lastStart+1 ); j++) { s[j] = static_cast(tolower(styler[lastStart + j])); } s[j] = '\0'; levelCurrent += classifyFoldPointESCRIPT(s, prevWord); strcpy(prevWord, s); } } if (atEOL) { int lev = levelPrev; if (visibleChars == 0 && foldCompact) lev |= SC_FOLDLEVELWHITEFLAG; if ((levelCurrent > levelPrev) && (visibleChars > 0)) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) { styler.SetLevel(lineCurrent, lev); } lineCurrent++; levelPrev = levelCurrent; visibleChars = 0; strcpy(prevWord, ""); } if (!isspacechar(ch)) visibleChars++; } // Fill in the real level of the next line, keeping the current flags as they will be filled in later int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; styler.SetLevel(lineCurrent, levelPrev | flagsNext); } static const char * const ESCRIPTWordLists[] = { "Primary keywords and identifiers", "Intrinsic functions", "Extended and user defined functions", 0, }; LexerModule lmESCRIPT(SCLEX_ESCRIPT, ColouriseESCRIPTDoc, "escript", FoldESCRIPTDoc, ESCRIPTWordLists); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexSML.cxx000444001750001750 1354511727344243 24255 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexSML.cxx ** Lexer for SML. **/ // Copyright 2009 by James Moffatt and Yuzhou Xin // Modified from LexCaml.cxx by Robert Roessler Copyright 2005 // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" inline int issml(int c) {return isalnum(c) || c == '_';} inline int issmlf(int c) {return isalpha(c) || c == '_';} inline int issmld(int c) {return isdigit(c) || c == '_';} #ifdef SCI_NAMESPACE using namespace Scintilla; #endif void ColouriseSMLDoc( unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { StyleContext sc(startPos, length, initStyle, styler); int nesting = 0; if (sc.state < SCE_SML_STRING) sc.state = SCE_SML_DEFAULT; if (sc.state >= SCE_SML_COMMENT) nesting = (sc.state & 0x0f) - SCE_SML_COMMENT; int chBase = 0, chToken = 0, chLit = 0; WordList& keywords = *keywordlists[0]; WordList& keywords2 = *keywordlists[1]; WordList& keywords3 = *keywordlists[2]; const int useMagic = styler.GetPropertyInt("lexer.caml.magic", 0); while (sc.More()) { int state2 = -1; int chColor = sc.currentPos - 1; bool advance = true; switch (sc.state & 0x0f) { case SCE_SML_DEFAULT: chToken = sc.currentPos; if (issmlf(sc.ch)) state2 = SCE_SML_IDENTIFIER; else if (sc.Match('`') && issmlf(sc.chNext)) state2 = SCE_SML_TAGNAME; else if (sc.Match('#')&&isdigit(sc.chNext)) state2 = SCE_SML_LINENUM; else if (sc.Match('#','\"')){ state2 = SCE_SML_CHAR,chLit = 0; sc.Forward(); } else if (isdigit(sc.ch)) { state2 = SCE_SML_NUMBER, chBase = 10; if (sc.Match('0') && strchr("xX", sc.chNext)) chBase = 16, sc.Forward();} else if (sc.Match('\"')&&sc.chPrev!='#') state2 = SCE_SML_STRING; else if (sc.Match('(', '*')){ state2 = SCE_SML_COMMENT, sc.ch = ' ', sc.Forward();} else if (strchr("!~" "=<>@^+-*/" "()[];,:.#", sc.ch)) state2 = SCE_SML_OPERATOR; break; case SCE_SML_IDENTIFIER: if (!(issml(sc.ch) || sc.Match('\''))) { const int n = sc.currentPos - chToken; if (n < 24) { char t[24]; for (int i = -n; i < 0; i++) t[n + i] = static_cast(sc.GetRelative(i)); t[n] = '\0'; if ((n == 1 && sc.chPrev == '_') || keywords.InList(t)) sc.ChangeState(SCE_SML_KEYWORD); else if (keywords2.InList(t)) sc.ChangeState(SCE_SML_KEYWORD2); else if (keywords3.InList(t)) sc.ChangeState(SCE_SML_KEYWORD3); } state2 = SCE_SML_DEFAULT, advance = false; } break; case SCE_SML_TAGNAME: if (!(issml(sc.ch) || sc.Match('\''))) state2 = SCE_SML_DEFAULT, advance = false; break; case SCE_SML_LINENUM: if (!isdigit(sc.ch)) state2 = SCE_SML_DEFAULT, advance = false; break; case SCE_SML_OPERATOR: { const char* o = 0; if (issml(sc.ch) || isspace(sc.ch) || (o = strchr(")]};,\'\"`#", sc.ch),o) || !strchr("!$%&*+-./:<=>?@^|~", sc.ch)) { if (o && strchr(")]};,", sc.ch)) { if ((sc.Match(')') && sc.chPrev == '(') || (sc.Match(']') && sc.chPrev == '[')) sc.ChangeState(SCE_SML_KEYWORD); chColor++; } else advance = false; state2 = SCE_SML_DEFAULT; } break; } case SCE_SML_NUMBER: if (issmld(sc.ch) || IsADigit(sc.ch, chBase)) break; if ((sc.Match('l') || sc.Match('L') || sc.Match('n')) && (issmld(sc.chPrev) || IsADigit(sc.chPrev, chBase))) break; if (chBase == 10) { if (sc.Match('.') && issmld(sc.chPrev)) break; if ((sc.Match('e') || sc.Match('E')) && (issmld(sc.chPrev) || sc.chPrev == '.')) break; if ((sc.Match('+') || sc.Match('-')) && (sc.chPrev == 'e' || sc.chPrev == 'E')) break; } state2 = SCE_SML_DEFAULT, advance = false; break; case SCE_SML_CHAR: if (sc.Match('\\')) { chLit = 1; if (sc.chPrev == '\\') sc.ch = ' '; } else if ((sc.Match('\"') && sc.chPrev != '\\') || sc.atLineEnd) { state2 = SCE_SML_DEFAULT; chLit = 1; if (sc.Match('\"')) chColor++; else sc.ChangeState(SCE_SML_IDENTIFIER); } else if (chLit < 1 && sc.currentPos - chToken >= 3) sc.ChangeState(SCE_SML_IDENTIFIER), advance = false; break; case SCE_SML_STRING: if (sc.Match('\\') && sc.chPrev == '\\') sc.ch = ' '; else if (sc.Match('\"') && sc.chPrev != '\\') state2 = SCE_SML_DEFAULT, chColor++; break; case SCE_SML_COMMENT: case SCE_SML_COMMENT1: case SCE_SML_COMMENT2: case SCE_SML_COMMENT3: if (sc.Match('(', '*')) state2 = sc.state + 1, chToken = sc.currentPos, sc.ch = ' ', sc.Forward(), nesting++; else if (sc.Match(')') && sc.chPrev == '*') { if (nesting) state2 = (sc.state & 0x0f) - 1, chToken = 0, nesting--; else state2 = SCE_SML_DEFAULT; chColor++; } else if (useMagic && sc.currentPos - chToken == 4 && sc.Match('c') && sc.chPrev == 'r' && sc.GetRelative(-2) == '@') sc.state |= 0x10; break; } if (state2 >= 0) styler.ColourTo(chColor, sc.state), sc.ChangeState(state2); if (advance) sc.Forward(); } sc.Complete(); } void FoldSMLDoc( unsigned int, int, int, WordList *[], Accessor &) { } static const char * const SMLWordListDesc[] = { "Keywords", "Keywords2", "Keywords3", 0 }; LexerModule lmSML(SCLEX_SML, ColouriseSMLDoc, "SML", FoldSMLDoc, SMLWordListDesc); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexTeX.cxx000444001750001750 3413111727344243 24314 0ustar00azawawiazawawi000000000000// Scintilla source code edit control // File: LexTeX.cxx - general context conformant tex coloring scheme // Author: Hans Hagen - PRAGMA ADE - Hasselt NL - www.pragma-ade.com // Version: September 28, 2003 // Copyright: 1998-2003 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. // This lexer is derived from the one written for the texwork environment (1999++) which in // turn is inspired on texedit (1991++) which finds its roots in wdt (1986). // If you run into strange boundary cases, just tell me and I'll look into it. // TeX Folding code added by instanton (soft_share@126.com) with borrowed code from VisualTeX source by Alex Romanenko. // Version: June 22, 2007 #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif // val SCE_TEX_DEFAULT = 0 // val SCE_TEX_SPECIAL = 1 // val SCE_TEX_GROUP = 2 // val SCE_TEX_SYMBOL = 3 // val SCE_TEX_COMMAND = 4 // val SCE_TEX_TEXT = 5 // Definitions in SciTEGlobal.properties: // // TeX Highlighting // // # Default // style.tex.0=fore:#7F7F00 // # Special // style.tex.1=fore:#007F7F // # Group // style.tex.2=fore:#880000 // # Symbol // style.tex.3=fore:#7F7F00 // # Command // style.tex.4=fore:#008800 // # Text // style.tex.5=fore:#000000 // lexer.tex.interface.default=0 // lexer.tex.comment.process=0 // todo: lexer.tex.auto.if // Auxiliary functions: static inline bool endOfLine(Accessor &styler, unsigned int i) { return (styler[i] == '\n') || ((styler[i] == '\r') && (styler.SafeGetCharAt(i + 1) != '\n')) ; } static inline bool isTeXzero(int ch) { return (ch == '%') ; } static inline bool isTeXone(int ch) { return (ch == '[') || (ch == ']') || (ch == '=') || (ch == '#') || (ch == '(') || (ch == ')') || (ch == '<') || (ch == '>') || (ch == '"') ; } static inline bool isTeXtwo(int ch) { return (ch == '{') || (ch == '}') || (ch == '$') ; } static inline bool isTeXthree(int ch) { return (ch == '~') || (ch == '^') || (ch == '_') || (ch == '&') || (ch == '-') || (ch == '+') || (ch == '\"') || (ch == '`') || (ch == '/') || (ch == '|') || (ch == '%') ; } static inline bool isTeXfour(int ch) { return (ch == '\\') ; } static inline bool isTeXfive(int ch) { return ((ch >= 'a') && (ch <= 'z')) || ((ch >= 'A') && (ch <= 'Z')) || (ch == '@') || (ch == '!') || (ch == '?') ; } static inline bool isTeXsix(int ch) { return (ch == ' ') ; } static inline bool isTeXseven(int ch) { return (ch == '^') ; } // Interface determination static int CheckTeXInterface( unsigned int startPos, int length, Accessor &styler, int defaultInterface) { char lineBuffer[1024] ; unsigned int linePos = 0 ; // some day we can make something lexer.tex.mapping=(all,0)(nl,1)(en,2)... if (styler.SafeGetCharAt(0) == '%') { for (unsigned int i = 0; i < startPos + length; i++) { lineBuffer[linePos++] = styler.SafeGetCharAt(i) ; if (endOfLine(styler, i) || (linePos >= sizeof(lineBuffer) - 1)) { lineBuffer[linePos] = '\0'; if (strstr(lineBuffer, "interface=all")) { return 0 ; } else if (strstr(lineBuffer, "interface=tex")) { return 1 ; } else if (strstr(lineBuffer, "interface=nl")) { return 2 ; } else if (strstr(lineBuffer, "interface=en")) { return 3 ; } else if (strstr(lineBuffer, "interface=de")) { return 4 ; } else if (strstr(lineBuffer, "interface=cz")) { return 5 ; } else if (strstr(lineBuffer, "interface=it")) { return 6 ; } else if (strstr(lineBuffer, "interface=ro")) { return 7 ; } else if (strstr(lineBuffer, "interface=latex")) { // we will move latex cum suis up to 91+ when more keyword lists are supported return 8 ; } else if (styler.SafeGetCharAt(1) == 'D' && strstr(lineBuffer, "%D \\module")) { // better would be to limit the search to just one line return 3 ; } else { return defaultInterface ; } } } } return defaultInterface ; } static void ColouriseTeXDoc( unsigned int startPos, int length, int, WordList *keywordlists[], Accessor &styler) { styler.StartAt(startPos) ; styler.StartSegment(startPos) ; bool processComment = styler.GetPropertyInt("lexer.tex.comment.process", 0) == 1 ; bool useKeywords = styler.GetPropertyInt("lexer.tex.use.keywords", 1) == 1 ; bool autoIf = styler.GetPropertyInt("lexer.tex.auto.if", 1) == 1 ; int defaultInterface = styler.GetPropertyInt("lexer.tex.interface.default", 1) ; char key[100] ; int k ; bool newifDone = false ; bool inComment = false ; int currentInterface = CheckTeXInterface(startPos,length,styler,defaultInterface) ; if (currentInterface == 0) { useKeywords = false ; currentInterface = 1 ; } WordList &keywords = *keywordlists[currentInterface-1] ; StyleContext sc(startPos, length, SCE_TEX_TEXT, styler); bool going = sc.More() ; // needed because of a fuzzy end of file state for (; going; sc.Forward()) { if (! sc.More()) { going = false ; } // we need to go one behind the end of text if (inComment) { if (sc.atLineEnd) { sc.SetState(SCE_TEX_TEXT) ; newifDone = false ; inComment = false ; } } else { if (! isTeXfive(sc.ch)) { if (sc.state == SCE_TEX_COMMAND) { if (sc.LengthCurrent() == 1) { // \ if (isTeXseven(sc.ch) && isTeXseven(sc.chNext)) { sc.Forward(2) ; // \^^ and \^^ } sc.ForwardSetState(SCE_TEX_TEXT) ; } else { sc.GetCurrent(key, sizeof(key)-1) ; k = static_cast(strlen(key)) ; memmove(key,key+1,k) ; // shift left over escape token key[k] = '\0' ; k-- ; if (! keywords || ! useKeywords) { sc.SetState(SCE_TEX_COMMAND) ; newifDone = false ; } else if (k == 1) { //\ sc.SetState(SCE_TEX_COMMAND) ; newifDone = false ; } else if (keywords.InList(key)) { sc.SetState(SCE_TEX_COMMAND) ; newifDone = autoIf && (strcmp(key,"newif") == 0) ; } else if (autoIf && ! newifDone && (key[0] == 'i') && (key[1] == 'f') && keywords.InList("if")) { sc.SetState(SCE_TEX_COMMAND) ; } else { sc.ChangeState(SCE_TEX_TEXT) ; sc.SetState(SCE_TEX_TEXT) ; newifDone = false ; } } } if (isTeXzero(sc.ch)) { sc.SetState(SCE_TEX_SYMBOL); if (!endOfLine(styler,sc.currentPos + 1)) sc.ForwardSetState(SCE_TEX_DEFAULT) ; inComment = ! processComment ; newifDone = false ; } else if (isTeXseven(sc.ch) && isTeXseven(sc.chNext)) { sc.SetState(SCE_TEX_TEXT) ; sc.ForwardSetState(SCE_TEX_TEXT) ; } else if (isTeXone(sc.ch)) { sc.SetState(SCE_TEX_SPECIAL) ; newifDone = false ; } else if (isTeXtwo(sc.ch)) { sc.SetState(SCE_TEX_GROUP) ; newifDone = false ; } else if (isTeXthree(sc.ch)) { sc.SetState(SCE_TEX_SYMBOL) ; newifDone = false ; } else if (isTeXfour(sc.ch)) { sc.SetState(SCE_TEX_COMMAND) ; } else if (isTeXsix(sc.ch)) { sc.SetState(SCE_TEX_TEXT) ; } else if (sc.atLineEnd) { sc.SetState(SCE_TEX_TEXT) ; newifDone = false ; inComment = false ; } else { sc.SetState(SCE_TEX_TEXT) ; } } else if (sc.state != SCE_TEX_COMMAND) { sc.SetState(SCE_TEX_TEXT) ; } } } sc.ChangeState(SCE_TEX_TEXT) ; sc.Complete(); } static inline bool isNumber(int ch) { return (ch == '0') || (ch == '1') || (ch == '2') || (ch == '3') || (ch == '4') || (ch == '5') || (ch == '6') || (ch == '7') || (ch == '8') || (ch == '9'); } static inline bool isWordChar(int ch) { return ((ch >= 'a') && (ch <= 'z')) || ((ch >= 'A') && (ch <= 'Z')); } static int ParseTeXCommand(unsigned int pos, Accessor &styler, char *command) { int length=0; char ch=styler.SafeGetCharAt(pos+1); if(ch==',' || ch==':' || ch==';' || ch=='%'){ command[0]=ch; command[1]=0; return 1; } // find end while(isWordChar(ch) && !isNumber(ch) && ch!='_' && ch!='.' && length<100){ command[length]=ch; length++; ch=styler.SafeGetCharAt(pos+length+1); } command[length]='\0'; if(!length) return 0; return length+1; } static int classifyFoldPointTeXPaired(const char* s) { int lev=0; if (!(isdigit(s[0]) || (s[0] == '.'))){ if (strcmp(s, "begin")==0||strcmp(s,"FoldStart")==0|| strcmp(s,"abstract")==0||strcmp(s,"unprotect")==0|| strcmp(s,"title")==0||strncmp(s,"start",5)==0||strncmp(s,"Start",5)==0|| strcmp(s,"documentclass")==0||strncmp(s,"if",2)==0 ) lev=1; if (strcmp(s, "end")==0||strcmp(s,"FoldStop")==0|| strcmp(s,"maketitle")==0||strcmp(s,"protect")==0|| strncmp(s,"stop",4)==0||strncmp(s,"Stop",4)==0|| strcmp(s,"fi")==0 ) lev=-1; } return lev; } static int classifyFoldPointTeXUnpaired(const char* s) { int lev=0; if (!(isdigit(s[0]) || (s[0] == '.'))){ if (strcmp(s,"part")==0|| strcmp(s,"chapter")==0|| strcmp(s,"section")==0|| strcmp(s,"subsection")==0|| strcmp(s,"subsubsection")==0|| strcmp(s,"CJKfamily")==0|| strcmp(s,"appendix")==0|| strcmp(s,"Topic")==0||strcmp(s,"topic")==0|| strcmp(s,"subject")==0||strcmp(s,"subsubject")==0|| strcmp(s,"def")==0||strcmp(s,"gdef")==0||strcmp(s,"edef")==0|| strcmp(s,"xdef")==0||strcmp(s,"framed")==0|| strcmp(s,"frame")==0|| strcmp(s,"foilhead")==0||strcmp(s,"overlays")==0||strcmp(s,"slide")==0 ){ lev=1; } } return lev; } static bool IsTeXCommentLine(int line, Accessor &styler) { int pos = styler.LineStart(line); int eol_pos = styler.LineStart(line + 1) - 1; int startpos = pos; while (startpos SC_FOLDLEVELBASE && ((ch == '\r' || ch=='\n') && (chNext == '\\'))) { ParseTeXCommand(i+1, styler, buffer); levelCurrent -= classifyFoldPointTeXUnpaired(buffer); } char chNext2; char chNext3; char chNext4; char chNext5; chNext2=styler.SafeGetCharAt(i+2); chNext3=styler.SafeGetCharAt(i+3); chNext4=styler.SafeGetCharAt(i+4); chNext5=styler.SafeGetCharAt(i+5); bool atEOfold = (ch == '%') && (chNext == '%') && (chNext2=='}') && (chNext3=='}')&& (chNext4=='-')&& (chNext5=='-'); bool atBOfold = (ch == '%') && (chNext == '%') && (chNext2=='-') && (chNext3=='-')&& (chNext4=='{')&& (chNext5=='{'); if(atBOfold){ levelCurrent+=1; } if(atEOfold){ levelCurrent-=1; } if(ch=='\\' && chNext=='['){ levelCurrent+=1; } if(ch=='\\' && chNext==']'){ levelCurrent-=1; } bool foldComment = styler.GetPropertyInt("fold.comment") != 0; if (foldComment && atEOL && IsTeXCommentLine(lineCurrent, styler)) { if (lineCurrent==0 && IsTeXCommentLine(lineCurrent + 1, styler) ) levelCurrent++; else if (lineCurrent!=0 && !IsTeXCommentLine(lineCurrent - 1, styler) && IsTeXCommentLine(lineCurrent + 1, styler) ) levelCurrent++; else if (lineCurrent!=0 && IsTeXCommentLine(lineCurrent - 1, styler) && !IsTeXCommentLine(lineCurrent+1, styler)) levelCurrent--; } //--------------------------------------------------------------------------------------------- if (atEOL) { int lev = levelPrev; if (visibleChars == 0 && foldCompact) lev |= SC_FOLDLEVELWHITEFLAG; if ((levelCurrent > levelPrev) && (visibleChars > 0)) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) { styler.SetLevel(lineCurrent, lev); } lineCurrent++; levelPrev = levelCurrent; visibleChars = 0; } if (!isspacechar(ch)) visibleChars++; } // Fill in the real level of the next line, keeping the current flags as they will be filled in later int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; styler.SetLevel(lineCurrent, levelPrev | flagsNext); } static const char * const texWordListDesc[] = { "TeX, eTeX, pdfTeX, Omega", "ConTeXt Dutch", "ConTeXt English", "ConTeXt German", "ConTeXt Czech", "ConTeXt Italian", "ConTeXt Romanian", 0, } ; LexerModule lmTeX(SCLEX_TEX, ColouriseTeXDoc, "tex", FoldTexDoc, texWordListDesc); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexMySQL.cxx000444001750001750 4157011727344243 24566 0ustar00azawawiazawawi000000000000/** * Scintilla source code edit control * @file LexMySQL.cxx * Lexer for MySQL * * Improved by Mike Lischke * Adopted from LexSQL.cxx by Anders Karlsson * Original work by Neil Hodgson * Copyright 1998-2005 by Neil Hodgson * The License.txt file describes the conditions under which this software may be distributed. */ #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static inline bool IsAWordChar(int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '_'); } static inline bool IsAWordStart(int ch) { return (ch < 0x80) && (isalpha(ch) || ch == '_'); } static inline bool IsADoxygenChar(int ch) { return (islower(ch) || ch == '$' || ch == '@' || ch == '\\' || ch == '&' || ch == '<' || ch == '>' || ch == '#' || ch == '{' || ch == '}' || ch == '[' || ch == ']'); } static inline bool IsANumberChar(int ch) { // Not exactly following number definition (several dots are seen as OK, etc.) // but probably enough in most cases. return (ch < 0x80) && (isdigit(ch) || toupper(ch) == 'E' || ch == '.' || ch == '-' || ch == '+'); } //-------------------------------------------------------------------------------------------------- /** * Check if the current content context represent a keyword and set the context state if so. */ static void CheckForKeyword(StyleContext& sc, WordList* keywordlists[]) { int length = sc.LengthCurrent() + 1; // +1 for the next char char* s = new char[length]; sc.GetCurrentLowered(s, length); if (keywordlists[0]->InList(s)) sc.ChangeState(SCE_MYSQL_MAJORKEYWORD); else if (keywordlists[1]->InList(s)) sc.ChangeState(SCE_MYSQL_KEYWORD); else if (keywordlists[2]->InList(s)) sc.ChangeState(SCE_MYSQL_DATABASEOBJECT); else if (keywordlists[3]->InList(s)) sc.ChangeState(SCE_MYSQL_FUNCTION); else if (keywordlists[5]->InList(s)) sc.ChangeState(SCE_MYSQL_PROCEDUREKEYWORD); else if (keywordlists[6]->InList(s)) sc.ChangeState(SCE_MYSQL_USER1); else if (keywordlists[7]->InList(s)) sc.ChangeState(SCE_MYSQL_USER2); else if (keywordlists[8]->InList(s)) sc.ChangeState(SCE_MYSQL_USER3); delete [] s; } //-------------------------------------------------------------------------------------------------- static void ColouriseMySQLDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { StyleContext sc(startPos, length, initStyle, styler); for (; sc.More(); sc.Forward()) { // Determine if the current state should terminate. switch (sc.state) { case SCE_MYSQL_OPERATOR: sc.SetState(SCE_MYSQL_DEFAULT); break; case SCE_MYSQL_NUMBER: // We stop the number definition on non-numerical non-dot non-eE non-sign char. if (!IsANumberChar(sc.ch)) sc.SetState(SCE_MYSQL_DEFAULT); break; case SCE_MYSQL_IDENTIFIER: // Switch from identifier to keyword state and open a new state for the new char. if (!IsAWordChar(sc.ch)) { CheckForKeyword(sc, keywordlists); // Additional check for function keywords needed. // A function name must be followed by an opening parenthesis. if (sc.state == SCE_MYSQL_FUNCTION && sc.ch != '(') sc.ChangeState(SCE_MYSQL_DEFAULT); sc.SetState(SCE_MYSQL_DEFAULT); } break; case SCE_MYSQL_VARIABLE: if (!IsAWordChar(sc.ch)) sc.SetState(SCE_MYSQL_DEFAULT); break; case SCE_MYSQL_SYSTEMVARIABLE: if (!IsAWordChar(sc.ch)) { int length = sc.LengthCurrent() + 1; char* s = new char[length]; sc.GetCurrentLowered(s, length); // Check for known system variables here. if (keywordlists[4]->InList(&s[2])) sc.ChangeState(SCE_MYSQL_KNOWNSYSTEMVARIABLE); delete [] s; sc.SetState(SCE_MYSQL_DEFAULT); } break; case SCE_MYSQL_QUOTEDIDENTIFIER: if (sc.ch == '`') { if (sc.chNext == '`') sc.Forward(); // Ignore it else sc.ForwardSetState(SCE_MYSQL_DEFAULT); } break; case SCE_MYSQL_COMMENT: case SCE_MYSQL_HIDDENCOMMAND: if (sc.Match('*', '/')) { sc.Forward(); sc.ForwardSetState(SCE_MYSQL_DEFAULT); } break; case SCE_MYSQL_COMMENTLINE: if (sc.atLineStart) sc.SetState(SCE_MYSQL_DEFAULT); break; case SCE_MYSQL_SQSTRING: if (sc.ch == '\\') sc.Forward(); // Escape sequence else if (sc.ch == '\'') { // End of single quoted string reached? if (sc.chNext == '\'') sc.Forward(); else sc.ForwardSetState(SCE_MYSQL_DEFAULT); } break; case SCE_MYSQL_DQSTRING: if (sc.ch == '\\') sc.Forward(); // Escape sequence else if (sc.ch == '\"') { // End of single quoted string reached? if (sc.chNext == '\"') sc.Forward(); else sc.ForwardSetState(SCE_MYSQL_DEFAULT); } break; } // Determine if a new state should be entered. if (sc.state == SCE_MYSQL_DEFAULT) { switch (sc.ch) { case '@': if (sc.chNext == '@') { sc.SetState(SCE_MYSQL_SYSTEMVARIABLE); sc.Forward(2); // Skip past @@. } else if (IsAWordStart(sc.ch)) { sc.SetState(SCE_MYSQL_VARIABLE); sc.Forward(); // Skip past @. } else sc.SetState(SCE_MYSQL_OPERATOR); break; case '`': sc.SetState(SCE_MYSQL_QUOTEDIDENTIFIER); break; case '#': sc.SetState(SCE_MYSQL_COMMENTLINE); break; case '\'': sc.SetState(SCE_MYSQL_SQSTRING); break; case '\"': sc.SetState(SCE_MYSQL_DQSTRING); break; default: if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) sc.SetState(SCE_MYSQL_NUMBER); else if (IsAWordStart(sc.ch)) sc.SetState(SCE_MYSQL_IDENTIFIER); else if (sc.Match('/', '*')) { sc.SetState(SCE_MYSQL_COMMENT); // Skip comment introducer and check for hidden command. sc.Forward(2); if (sc.ch == '!') { sc.ChangeState(SCE_MYSQL_HIDDENCOMMAND); sc.Forward(); } } else if (sc.Match("--")) { // Special MySQL single line comment. sc.SetState(SCE_MYSQL_COMMENTLINE); sc.Forward(2); // Check the third character too. It must be a space or EOL. if (sc.ch != ' ' && sc.ch != '\n' && sc.ch != '\r') sc.ChangeState(SCE_MYSQL_OPERATOR); } else if (isoperator(static_cast(sc.ch))) sc.SetState(SCE_MYSQL_OPERATOR); } } } // Do a final check for keywords if we currently have an identifier, to highlight them // also at the end of a line. if (sc.state == SCE_MYSQL_IDENTIFIER) { CheckForKeyword(sc, keywordlists); // Additional check for function keywords needed. // A function name must be followed by an opening parenthesis. if (sc.state == SCE_MYSQL_FUNCTION && sc.ch != '(') sc.ChangeState(SCE_MYSQL_DEFAULT); } sc.Complete(); } //-------------------------------------------------------------------------------------------------- /** * Helper function to determine if we have a foldable comment currently. */ static bool IsStreamCommentStyle(int style) { return style == SCE_MYSQL_COMMENT; } //-------------------------------------------------------------------------------------------------- /** * Code copied from StyleContext and modified to work here. Should go into Accessor as a * companion to Match()... */ bool MatchIgnoreCase(Accessor &styler, int currentPos, const char *s) { for (int n = 0; *s; n++) { if (*s != tolower(styler.SafeGetCharAt(currentPos + n))) return false; s++; } return true; } //-------------------------------------------------------------------------------------------------- // Store both the current line's fold level and the next lines in the // level store to make it easy to pick up with each increment. static void FoldMySQLDoc(unsigned int startPos, int length, int initStyle, WordList *[], Accessor &styler) { bool foldComment = styler.GetPropertyInt("fold.comment") != 0; bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; bool foldOnlyBegin = styler.GetPropertyInt("fold.sql.only.begin", 0) != 0; int visibleChars = 0; int lineCurrent = styler.GetLine(startPos); int levelCurrent = SC_FOLDLEVELBASE; if (lineCurrent > 0) levelCurrent = styler.LevelAt(lineCurrent - 1) >> 16; int levelNext = levelCurrent; int styleNext = styler.StyleAt(startPos); int style = initStyle; bool endPending = false; bool whenPending = false; bool elseIfPending = false; char nextChar = styler.SafeGetCharAt(startPos); for (unsigned int i = startPos; length > 0; i++, length--) { int stylePrev = style; style = styleNext; styleNext = styler.StyleAt(i + 1); char currentChar = nextChar; nextChar = styler.SafeGetCharAt(i + 1); bool atEOL = (currentChar == '\r' && nextChar != '\n') || (currentChar == '\n'); switch (style) { case SCE_MYSQL_COMMENT: if (foldComment) { // Multiline comment style /* .. */. if (IsStreamCommentStyle(style)) { // Increase level if we just start a foldable comment. if (!IsStreamCommentStyle(stylePrev)) levelNext++; else // If we are in the middle of a foldable comment check if it ends now. // Don't end at the line end, though. if (!IsStreamCommentStyle(styleNext) && !atEOL) levelNext--; } } break; case SCE_MYSQL_COMMENTLINE: if (foldComment) { // Not really a standard, but we add support for single line comments // with special curly braces syntax as foldable comments too. // MySQL needs -- comments to be followed by space or control char if (styler.Match(i, "--")) { char chNext2 = styler.SafeGetCharAt(i + 2); char chNext3 = styler.SafeGetCharAt(i + 3); if (chNext2 == '{' || chNext3 == '{') levelNext++; else if (chNext2 == '}' || chNext3 == '}') levelNext--; } } break; case SCE_MYSQL_HIDDENCOMMAND: if (endPending) { // A conditional command is not a white space so it should end the current block // before opening a new one. endPending = false; levelNext--; if (levelNext < SC_FOLDLEVELBASE) levelNext = SC_FOLDLEVELBASE; } if (style != stylePrev) levelNext++; else if (style != styleNext) { levelNext--; if (levelNext < SC_FOLDLEVELBASE) levelNext = SC_FOLDLEVELBASE; } break; case SCE_MYSQL_OPERATOR: if (endPending) { endPending = false; levelNext--; if (levelNext < SC_FOLDLEVELBASE) levelNext = SC_FOLDLEVELBASE; } if (currentChar == '(') levelNext++; else if (currentChar == ')') { levelNext--; if (levelNext < SC_FOLDLEVELBASE) levelNext = SC_FOLDLEVELBASE; } break; case SCE_MYSQL_MAJORKEYWORD: case SCE_MYSQL_KEYWORD: case SCE_MYSQL_FUNCTION: case SCE_MYSQL_PROCEDUREKEYWORD: // Reserved and other keywords. if (style != stylePrev) { // END decreases the folding level, regardless which keyword follows. bool endFound = MatchIgnoreCase(styler, i, "end"); if (endPending) { levelNext--; if (levelNext < SC_FOLDLEVELBASE) levelNext = SC_FOLDLEVELBASE; } else if (!endFound) { if (MatchIgnoreCase(styler, i, "begin")) levelNext++; else { if (!foldOnlyBegin) { bool whileFound = MatchIgnoreCase(styler, i, "while"); bool loopFound = MatchIgnoreCase(styler, i, "loop"); bool repeatFound = MatchIgnoreCase(styler, i, "repeat"); bool caseFound = MatchIgnoreCase(styler, i, "case"); if (whileFound || loopFound || repeatFound || caseFound) levelNext++; else { // IF alone does not increase the fold level as it is also used in non-block'ed // code like DROP PROCEDURE blah IF EXISTS. // Instead THEN opens the new level (if not part of an ELSEIF or WHEN (case) branch). if (MatchIgnoreCase(styler, i, "then")) { if (!elseIfPending && !whenPending) levelNext++; else { elseIfPending = false; whenPending = false; } } else { // Neither of if/then/while/loop/repeat/case, so check for // sub parts of IF and CASE. if (MatchIgnoreCase(styler, i, "elseif")) elseIfPending = true; if (MatchIgnoreCase(styler, i, "when")) whenPending = true; } } } } } // Keep the current end state for the next round. endPending = endFound; } break; default: if (!isspace(currentChar) && endPending) { // END followed by a non-whitespace character (not covered by other cases like identifiers) // also should end a folding block. Typical case: END followed by self defined delimiter. levelNext--; if (levelNext < SC_FOLDLEVELBASE) levelNext = SC_FOLDLEVELBASE; } break; } if (atEOL) { // Apply the new folding level to this line. // Leave pending states as they are otherwise a line break will de-sync // code folding and valid syntax. int levelUse = levelCurrent; int lev = levelUse | levelNext << 16; if (visibleChars == 0 && foldCompact) lev |= SC_FOLDLEVELWHITEFLAG; if (levelUse < levelNext) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) styler.SetLevel(lineCurrent, lev); lineCurrent++; levelCurrent = levelNext; visibleChars = 0; } if (!isspacechar(currentChar)) visibleChars++; } } //-------------------------------------------------------------------------------------------------- static const char * const mysqlWordListDesc[] = { "Major Keywords", "Keywords", "Database Objects", "Functions", "System Variables", "Procedure keywords", "User Keywords 1", "User Keywords 2", "User Keywords 3", 0 }; LexerModule lmMySQL(SCLEX_MYSQL, ColouriseMySQLDoc, "mysql", FoldMySQLDoc, mysqlWordListDesc); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/ExternalLexer.h000444001750001750 443111727344242 25331 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file ExternalLexer.h ** Support external lexers in DLLs. **/ // Copyright 2001 Simon Steele , portions copyright Neil Hodgson. // The License.txt file describes the conditions under which this software may be distributed. #ifndef EXTERNALLEXER_H #define EXTERNALLEXER_H #if PLAT_WIN #define EXT_LEXER_DECL __stdcall #else #define EXT_LEXER_DECL #endif #ifdef SCI_NAMESPACE namespace Scintilla { #endif typedef void*(EXT_LEXER_DECL *GetLexerFunction)(unsigned int Index); typedef int (EXT_LEXER_DECL *GetLexerCountFn)(); typedef void (EXT_LEXER_DECL *GetLexerNameFn)(unsigned int Index, char *name, int buflength); typedef LexerFactoryFunction(EXT_LEXER_DECL *GetLexerFactoryFunction)(unsigned int Index); /// Sub-class of LexerModule to use an external lexer. class ExternalLexerModule : public LexerModule { protected: GetLexerFactoryFunction fneFactory; char name[100]; public: ExternalLexerModule(int language_, LexerFunction fnLexer_, const char *languageName_=0, LexerFunction fnFolder_=0) : LexerModule(language_, fnLexer_, 0, fnFolder_), fneFactory(0) { strncpy(name, languageName_, sizeof(name)); name[sizeof(name)-1] = '\0'; languageName = name; } virtual void SetExternal(GetLexerFactoryFunction fFactory, int index); }; /// LexerMinder points to an ExternalLexerModule - so we don't leak them. class LexerMinder { public: ExternalLexerModule *self; LexerMinder *next; }; /// LexerLibrary exists for every External Lexer DLL, contains LexerMinders. class LexerLibrary { DynamicLibrary *lib; LexerMinder *first; LexerMinder *last; public: LexerLibrary(const char *ModuleName); ~LexerLibrary(); void Release(); LexerLibrary *next; std::string m_sModuleName; }; /// LexerManager manages external lexers, contains LexerLibrarys. class LexerManager { public: ~LexerManager(); static LexerManager *GetInstance(); static void DeleteInstance(); void Load(const char *path); void Clear(); private: LexerManager(); static LexerManager *theInstance; void LoadLexerLibrary(const char *module); LexerLibrary *first; LexerLibrary *last; }; class LMMinder { public: ~LMMinder(); }; #ifdef SCI_NAMESPACE } #endif #endif Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexOthers.cxx000444001750001750 14441611727344243 25110 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexOthers.cxx ** Lexers for batch files, diff results, properties files, make files and error lists. ** Also lexer for LaTeX documents. **/ // Copyright 1998-2001 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static bool strstart(const char *haystack, const char *needle) { return strncmp(haystack, needle, strlen(needle)) == 0; } static bool Is0To9(char ch) { return (ch >= '0') && (ch <= '9'); } static bool Is1To9(char ch) { return (ch >= '1') && (ch <= '9'); } static bool IsAlphabetic(int ch) { return isascii(ch) && isalpha(ch); } static inline bool AtEOL(Accessor &styler, unsigned int i) { return (styler[i] == '\n') || ((styler[i] == '\r') && (styler.SafeGetCharAt(i + 1) != '\n')); } // Tests for BATCH Operators static bool IsBOperator(char ch) { return (ch == '=') || (ch == '+') || (ch == '>') || (ch == '<') || (ch == '|') || (ch == '?') || (ch == '*'); } // Tests for BATCH Separators static bool IsBSeparator(char ch) { return (ch == '\\') || (ch == '.') || (ch == ';') || (ch == '\"') || (ch == '\'') || (ch == '/'); } static void ColouriseBatchLine( char *lineBuffer, unsigned int lengthLine, unsigned int startLine, unsigned int endPos, WordList *keywordlists[], Accessor &styler) { unsigned int offset = 0; // Line Buffer Offset unsigned int cmdLoc; // External Command / Program Location char wordBuffer[81]; // Word Buffer - large to catch long paths unsigned int wbl; // Word Buffer Length unsigned int wbo; // Word Buffer Offset - also Special Keyword Buffer Length WordList &keywords = *keywordlists[0]; // Internal Commands WordList &keywords2 = *keywordlists[1]; // External Commands (optional) // CHOICE, ECHO, GOTO, PROMPT and SET have Default Text that may contain Regular Keywords // Toggling Regular Keyword Checking off improves readability // Other Regular Keywords and External Commands / Programs might also benefit from toggling // Need a more robust algorithm to properly toggle Regular Keyword Checking bool continueProcessing = true; // Used to toggle Regular Keyword Checking // Special Keywords are those that allow certain characters without whitespace after the command // Examples are: cd. cd\ md. rd. dir| dir> echo: echo. path= // Special Keyword Buffer used to determine if the first n characters is a Keyword char sKeywordBuffer[10]; // Special Keyword Buffer bool sKeywordFound; // Exit Special Keyword for-loop if found // Skip initial spaces while ((offset < lengthLine) && (isspacechar(lineBuffer[offset]))) { offset++; } // Colorize Default Text styler.ColourTo(startLine + offset - 1, SCE_BAT_DEFAULT); // Set External Command / Program Location cmdLoc = offset; // Check for Fake Label (Comment) or Real Label - return if found if (lineBuffer[offset] == ':') { if (lineBuffer[offset + 1] == ':') { // Colorize Fake Label (Comment) - :: is similar to REM, see http://content.techweb.com/winmag/columns/explorer/2000/21.htm styler.ColourTo(endPos, SCE_BAT_COMMENT); } else { // Colorize Real Label styler.ColourTo(endPos, SCE_BAT_LABEL); } return; // Check for Drive Change (Drive Change is internal command) - return if found } else if ((IsAlphabetic(lineBuffer[offset])) && (lineBuffer[offset + 1] == ':') && ((isspacechar(lineBuffer[offset + 2])) || (((lineBuffer[offset + 2] == '\\')) && (isspacechar(lineBuffer[offset + 3]))))) { // Colorize Regular Keyword styler.ColourTo(endPos, SCE_BAT_WORD); return; } // Check for Hide Command (@ECHO OFF/ON) if (lineBuffer[offset] == '@') { styler.ColourTo(startLine + offset, SCE_BAT_HIDE); offset++; } // Skip next spaces while ((offset < lengthLine) && (isspacechar(lineBuffer[offset]))) { offset++; } // Read remainder of line word-at-a-time or remainder-of-word-at-a-time while (offset < lengthLine) { if (offset > startLine) { // Colorize Default Text styler.ColourTo(startLine + offset - 1, SCE_BAT_DEFAULT); } // Copy word from Line Buffer into Word Buffer wbl = 0; for (; offset < lengthLine && wbl < 80 && !isspacechar(lineBuffer[offset]); wbl++, offset++) { wordBuffer[wbl] = static_cast(tolower(lineBuffer[offset])); } wordBuffer[wbl] = '\0'; wbo = 0; // Check for Comment - return if found if (CompareCaseInsensitive(wordBuffer, "rem") == 0) { styler.ColourTo(endPos, SCE_BAT_COMMENT); return; } // Check for Separator if (IsBSeparator(wordBuffer[0])) { // Check for External Command / Program if ((cmdLoc == offset - wbl) && ((wordBuffer[0] == ':') || (wordBuffer[0] == '\\') || (wordBuffer[0] == '.'))) { // Reset Offset to re-process remainder of word offset -= (wbl - 1); // Colorize External Command / Program if (!keywords2) { styler.ColourTo(startLine + offset - 1, SCE_BAT_COMMAND); } else if (keywords2.InList(wordBuffer)) { styler.ColourTo(startLine + offset - 1, SCE_BAT_COMMAND); } else { styler.ColourTo(startLine + offset - 1, SCE_BAT_DEFAULT); } // Reset External Command / Program Location cmdLoc = offset; } else { // Reset Offset to re-process remainder of word offset -= (wbl - 1); // Colorize Default Text styler.ColourTo(startLine + offset - 1, SCE_BAT_DEFAULT); } // Check for Regular Keyword in list } else if ((keywords.InList(wordBuffer)) && (continueProcessing)) { // ECHO, GOTO, PROMPT and SET require no further Regular Keyword Checking if ((CompareCaseInsensitive(wordBuffer, "echo") == 0) || (CompareCaseInsensitive(wordBuffer, "goto") == 0) || (CompareCaseInsensitive(wordBuffer, "prompt") == 0) || (CompareCaseInsensitive(wordBuffer, "set") == 0)) { continueProcessing = false; } // Identify External Command / Program Location for ERRORLEVEL, and EXIST if ((CompareCaseInsensitive(wordBuffer, "errorlevel") == 0) || (CompareCaseInsensitive(wordBuffer, "exist") == 0)) { // Reset External Command / Program Location cmdLoc = offset; // Skip next spaces while ((cmdLoc < lengthLine) && (isspacechar(lineBuffer[cmdLoc]))) { cmdLoc++; } // Skip comparison while ((cmdLoc < lengthLine) && (!isspacechar(lineBuffer[cmdLoc]))) { cmdLoc++; } // Skip next spaces while ((cmdLoc < lengthLine) && (isspacechar(lineBuffer[cmdLoc]))) { cmdLoc++; } // Identify External Command / Program Location for CALL, DO, LOADHIGH and LH } else if ((CompareCaseInsensitive(wordBuffer, "call") == 0) || (CompareCaseInsensitive(wordBuffer, "do") == 0) || (CompareCaseInsensitive(wordBuffer, "loadhigh") == 0) || (CompareCaseInsensitive(wordBuffer, "lh") == 0)) { // Reset External Command / Program Location cmdLoc = offset; // Skip next spaces while ((cmdLoc < lengthLine) && (isspacechar(lineBuffer[cmdLoc]))) { cmdLoc++; } } // Colorize Regular keyword styler.ColourTo(startLine + offset - 1, SCE_BAT_WORD); // No need to Reset Offset // Check for Special Keyword in list, External Command / Program, or Default Text } else if ((wordBuffer[0] != '%') && (wordBuffer[0] != '!') && (!IsBOperator(wordBuffer[0])) && (continueProcessing)) { // Check for Special Keyword // Affected Commands are in Length range 2-6 // Good that ERRORLEVEL, EXIST, CALL, DO, LOADHIGH, and LH are unaffected sKeywordFound = false; for (unsigned int keywordLength = 2; keywordLength < wbl && keywordLength < 7 && !sKeywordFound; keywordLength++) { wbo = 0; // Copy Keyword Length from Word Buffer into Special Keyword Buffer for (; wbo < keywordLength; wbo++) { sKeywordBuffer[wbo] = static_cast(wordBuffer[wbo]); } sKeywordBuffer[wbo] = '\0'; // Check for Special Keyword in list if ((keywords.InList(sKeywordBuffer)) && ((IsBOperator(wordBuffer[wbo])) || (IsBSeparator(wordBuffer[wbo])))) { sKeywordFound = true; // ECHO requires no further Regular Keyword Checking if (CompareCaseInsensitive(sKeywordBuffer, "echo") == 0) { continueProcessing = false; } // Colorize Special Keyword as Regular Keyword styler.ColourTo(startLine + offset - 1 - (wbl - wbo), SCE_BAT_WORD); // Reset Offset to re-process remainder of word offset -= (wbl - wbo); } } // Check for External Command / Program or Default Text if (!sKeywordFound) { wbo = 0; // Check for External Command / Program if (cmdLoc == offset - wbl) { // Read up to %, Operator or Separator while ((wbo < wbl) && (wordBuffer[wbo] != '%') && (wordBuffer[wbo] != '!') && (!IsBOperator(wordBuffer[wbo])) && (!IsBSeparator(wordBuffer[wbo]))) { wbo++; } // Reset External Command / Program Location cmdLoc = offset - (wbl - wbo); // Reset Offset to re-process remainder of word offset -= (wbl - wbo); // CHOICE requires no further Regular Keyword Checking if (CompareCaseInsensitive(wordBuffer, "choice") == 0) { continueProcessing = false; } // Check for START (and its switches) - What follows is External Command \ Program if (CompareCaseInsensitive(wordBuffer, "start") == 0) { // Reset External Command / Program Location cmdLoc = offset; // Skip next spaces while ((cmdLoc < lengthLine) && (isspacechar(lineBuffer[cmdLoc]))) { cmdLoc++; } // Reset External Command / Program Location if command switch detected if (lineBuffer[cmdLoc] == '/') { // Skip command switch while ((cmdLoc < lengthLine) && (!isspacechar(lineBuffer[cmdLoc]))) { cmdLoc++; } // Skip next spaces while ((cmdLoc < lengthLine) && (isspacechar(lineBuffer[cmdLoc]))) { cmdLoc++; } } } // Colorize External Command / Program if (!keywords2) { styler.ColourTo(startLine + offset - 1, SCE_BAT_COMMAND); } else if (keywords2.InList(wordBuffer)) { styler.ColourTo(startLine + offset - 1, SCE_BAT_COMMAND); } else { styler.ColourTo(startLine + offset - 1, SCE_BAT_DEFAULT); } // No need to Reset Offset // Check for Default Text } else { // Read up to %, Operator or Separator while ((wbo < wbl) && (wordBuffer[wbo] != '%') && (wordBuffer[wbo] != '!') && (!IsBOperator(wordBuffer[wbo])) && (!IsBSeparator(wordBuffer[wbo]))) { wbo++; } // Colorize Default Text styler.ColourTo(startLine + offset - 1 - (wbl - wbo), SCE_BAT_DEFAULT); // Reset Offset to re-process remainder of word offset -= (wbl - wbo); } } // Check for Argument (%n), Environment Variable (%x...%) or Local Variable (%%a) } else if (wordBuffer[0] == '%') { // Colorize Default Text styler.ColourTo(startLine + offset - 1 - wbl, SCE_BAT_DEFAULT); wbo++; // Search to end of word for second % (can be a long path) while ((wbo < wbl) && (wordBuffer[wbo] != '%') && (!IsBOperator(wordBuffer[wbo])) && (!IsBSeparator(wordBuffer[wbo]))) { wbo++; } // Check for Argument (%n) or (%*) if (((Is0To9(wordBuffer[1])) || (wordBuffer[1] == '*')) && (wordBuffer[wbo] != '%')) { // Check for External Command / Program if (cmdLoc == offset - wbl) { cmdLoc = offset - (wbl - 2); } // Colorize Argument styler.ColourTo(startLine + offset - 1 - (wbl - 2), SCE_BAT_IDENTIFIER); // Reset Offset to re-process remainder of word offset -= (wbl - 2); // Check for Expanded Argument (%~...) / Variable (%%~...) } else if (((wbl > 1) && (wordBuffer[1] == '~')) || ((wbl > 2) && (wordBuffer[1] == '%') && (wordBuffer[2] == '~'))) { // Check for External Command / Program if (cmdLoc == offset - wbl) { cmdLoc = offset - (wbl - wbo); } // Colorize Expanded Argument / Variable styler.ColourTo(startLine + offset - 1 - (wbl - wbo), SCE_BAT_IDENTIFIER); // Reset Offset to re-process remainder of word offset -= (wbl - wbo); // Check for Environment Variable (%x...%) } else if ((wordBuffer[1] != '%') && (wordBuffer[wbo] == '%')) { wbo++; // Check for External Command / Program if (cmdLoc == offset - wbl) { cmdLoc = offset - (wbl - wbo); } // Colorize Environment Variable styler.ColourTo(startLine + offset - 1 - (wbl - wbo), SCE_BAT_IDENTIFIER); // Reset Offset to re-process remainder of word offset -= (wbl - wbo); // Check for Local Variable (%%a) } else if ( (wbl > 2) && (wordBuffer[1] == '%') && (wordBuffer[2] != '%') && (!IsBOperator(wordBuffer[2])) && (!IsBSeparator(wordBuffer[2]))) { // Check for External Command / Program if (cmdLoc == offset - wbl) { cmdLoc = offset - (wbl - 3); } // Colorize Local Variable styler.ColourTo(startLine + offset - 1 - (wbl - 3), SCE_BAT_IDENTIFIER); // Reset Offset to re-process remainder of word offset -= (wbl - 3); } // Check for Environment Variable (!x...!) } else if (wordBuffer[0] == '!') { // Colorize Default Text styler.ColourTo(startLine + offset - 1 - wbl, SCE_BAT_DEFAULT); wbo++; // Search to end of word for second ! (can be a long path) while ((wbo < wbl) && (wordBuffer[wbo] != '!') && (!IsBOperator(wordBuffer[wbo])) && (!IsBSeparator(wordBuffer[wbo]))) { wbo++; } if (wordBuffer[wbo] == '!') { wbo++; // Check for External Command / Program if (cmdLoc == offset - wbl) { cmdLoc = offset - (wbl - wbo); } // Colorize Environment Variable styler.ColourTo(startLine + offset - 1 - (wbl - wbo), SCE_BAT_IDENTIFIER); // Reset Offset to re-process remainder of word offset -= (wbl - wbo); } // Check for Operator } else if (IsBOperator(wordBuffer[0])) { // Colorize Default Text styler.ColourTo(startLine + offset - 1 - wbl, SCE_BAT_DEFAULT); // Check for Comparison Operator if ((wordBuffer[0] == '=') && (wordBuffer[1] == '=')) { // Identify External Command / Program Location for IF cmdLoc = offset; // Skip next spaces while ((cmdLoc < lengthLine) && (isspacechar(lineBuffer[cmdLoc]))) { cmdLoc++; } // Colorize Comparison Operator styler.ColourTo(startLine + offset - 1 - (wbl - 2), SCE_BAT_OPERATOR); // Reset Offset to re-process remainder of word offset -= (wbl - 2); // Check for Pipe Operator } else if (wordBuffer[0] == '|') { // Reset External Command / Program Location cmdLoc = offset - wbl + 1; // Skip next spaces while ((cmdLoc < lengthLine) && (isspacechar(lineBuffer[cmdLoc]))) { cmdLoc++; } // Colorize Pipe Operator styler.ColourTo(startLine + offset - 1 - (wbl - 1), SCE_BAT_OPERATOR); // Reset Offset to re-process remainder of word offset -= (wbl - 1); // Check for Other Operator } else { // Check for > Operator if (wordBuffer[0] == '>') { // Turn Keyword and External Command / Program checking back on continueProcessing = true; } // Colorize Other Operator styler.ColourTo(startLine + offset - 1 - (wbl - 1), SCE_BAT_OPERATOR); // Reset Offset to re-process remainder of word offset -= (wbl - 1); } // Check for Default Text } else { // Read up to %, Operator or Separator while ((wbo < wbl) && (wordBuffer[wbo] != '%') && (wordBuffer[wbo] != '!') && (!IsBOperator(wordBuffer[wbo])) && (!IsBSeparator(wordBuffer[wbo]))) { wbo++; } // Colorize Default Text styler.ColourTo(startLine + offset - 1 - (wbl - wbo), SCE_BAT_DEFAULT); // Reset Offset to re-process remainder of word offset -= (wbl - wbo); } // Skip next spaces - nothing happens if Offset was Reset while ((offset < lengthLine) && (isspacechar(lineBuffer[offset]))) { offset++; } } // Colorize Default Text for remainder of line - currently not lexed styler.ColourTo(endPos, SCE_BAT_DEFAULT); } static void ColouriseBatchDoc( unsigned int startPos, int length, int /*initStyle*/, WordList *keywordlists[], Accessor &styler) { char lineBuffer[1024]; styler.StartAt(startPos); styler.StartSegment(startPos); unsigned int linePos = 0; unsigned int startLine = startPos; for (unsigned int i = startPos; i < startPos + length; i++) { lineBuffer[linePos++] = styler[i]; if (AtEOL(styler, i) || (linePos >= sizeof(lineBuffer) - 1)) { // End of line (or of line buffer) met, colourise it lineBuffer[linePos] = '\0'; ColouriseBatchLine(lineBuffer, linePos, startLine, i, keywordlists, styler); linePos = 0; startLine = i + 1; } } if (linePos > 0) { // Last line does not have ending characters lineBuffer[linePos] = '\0'; ColouriseBatchLine(lineBuffer, linePos, startLine, startPos + length - 1, keywordlists, styler); } } static void ColouriseDiffLine(char *lineBuffer, int endLine, Accessor &styler) { // It is needed to remember the current state to recognize starting // comment lines before the first "diff " or "--- ". If a real // difference starts then each line starting with ' ' is a whitespace // otherwise it is considered a comment (Only in..., Binary file...) if (0 == strncmp(lineBuffer, "diff ", 5)) { styler.ColourTo(endLine, SCE_DIFF_COMMAND); } else if (0 == strncmp(lineBuffer, "Index: ", 7)) { // For subversion's diff styler.ColourTo(endLine, SCE_DIFF_COMMAND); } else if (0 == strncmp(lineBuffer, "---", 3) && lineBuffer[3] != '-') { // In a context diff, --- appears in both the header and the position markers if (lineBuffer[3] == ' ' && atoi(lineBuffer + 4) && !strchr(lineBuffer, '/')) styler.ColourTo(endLine, SCE_DIFF_POSITION); else if (lineBuffer[3] == '\r' || lineBuffer[3] == '\n') styler.ColourTo(endLine, SCE_DIFF_POSITION); else styler.ColourTo(endLine, SCE_DIFF_HEADER); } else if (0 == strncmp(lineBuffer, "+++ ", 4)) { // I don't know of any diff where "+++ " is a position marker, but for // consistency, do the same as with "--- " and "*** ". if (atoi(lineBuffer+4) && !strchr(lineBuffer, '/')) styler.ColourTo(endLine, SCE_DIFF_POSITION); else styler.ColourTo(endLine, SCE_DIFF_HEADER); } else if (0 == strncmp(lineBuffer, "====", 4)) { // For p4's diff styler.ColourTo(endLine, SCE_DIFF_HEADER); } else if (0 == strncmp(lineBuffer, "***", 3)) { // In a context diff, *** appears in both the header and the position markers. // Also ******** is a chunk header, but here it's treated as part of the // position marker since there is no separate style for a chunk header. if (lineBuffer[3] == ' ' && atoi(lineBuffer+4) && !strchr(lineBuffer, '/')) styler.ColourTo(endLine, SCE_DIFF_POSITION); else if (lineBuffer[3] == '*') styler.ColourTo(endLine, SCE_DIFF_POSITION); else styler.ColourTo(endLine, SCE_DIFF_HEADER); } else if (0 == strncmp(lineBuffer, "? ", 2)) { // For difflib styler.ColourTo(endLine, SCE_DIFF_HEADER); } else if (lineBuffer[0] == '@') { styler.ColourTo(endLine, SCE_DIFF_POSITION); } else if (lineBuffer[0] >= '0' && lineBuffer[0] <= '9') { styler.ColourTo(endLine, SCE_DIFF_POSITION); } else if (lineBuffer[0] == '-' || lineBuffer[0] == '<') { styler.ColourTo(endLine, SCE_DIFF_DELETED); } else if (lineBuffer[0] == '+' || lineBuffer[0] == '>') { styler.ColourTo(endLine, SCE_DIFF_ADDED); } else if (lineBuffer[0] == '!') { styler.ColourTo(endLine, SCE_DIFF_CHANGED); } else if (lineBuffer[0] != ' ') { styler.ColourTo(endLine, SCE_DIFF_COMMENT); } else { styler.ColourTo(endLine, SCE_DIFF_DEFAULT); } } static void ColouriseDiffDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) { char lineBuffer[1024]; styler.StartAt(startPos); styler.StartSegment(startPos); unsigned int linePos = 0; for (unsigned int i = startPos; i < startPos + length; i++) { lineBuffer[linePos++] = styler[i]; if (AtEOL(styler, i) || (linePos >= sizeof(lineBuffer) - 1)) { // End of line (or of line buffer) met, colourise it lineBuffer[linePos] = '\0'; ColouriseDiffLine(lineBuffer, i, styler); linePos = 0; } } if (linePos > 0) { // Last line does not have ending characters ColouriseDiffLine(lineBuffer, startPos + length - 1, styler); } } static void FoldDiffDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) { int curLine = styler.GetLine(startPos); int curLineStart = styler.LineStart(curLine); int prevLevel = curLine > 0 ? styler.LevelAt(curLine - 1) : SC_FOLDLEVELBASE; int nextLevel; do { int lineType = styler.StyleAt(curLineStart); if (lineType == SCE_DIFF_COMMAND) nextLevel = SC_FOLDLEVELBASE | SC_FOLDLEVELHEADERFLAG; else if (lineType == SCE_DIFF_HEADER) nextLevel = (SC_FOLDLEVELBASE + 1) | SC_FOLDLEVELHEADERFLAG; else if (lineType == SCE_DIFF_POSITION && styler[curLineStart] != '-') nextLevel = (SC_FOLDLEVELBASE + 2) | SC_FOLDLEVELHEADERFLAG; else if (prevLevel & SC_FOLDLEVELHEADERFLAG) nextLevel = (prevLevel & SC_FOLDLEVELNUMBERMASK) + 1; else nextLevel = prevLevel; if ((nextLevel & SC_FOLDLEVELHEADERFLAG) && (nextLevel == prevLevel)) styler.SetLevel(curLine-1, prevLevel & ~SC_FOLDLEVELHEADERFLAG); styler.SetLevel(curLine, nextLevel); prevLevel = nextLevel; curLineStart = styler.LineStart(++curLine); } while (static_cast(startPos) + length > curLineStart); } static void ColourisePoLine( char *lineBuffer, unsigned int lengthLine, unsigned int startLine, unsigned int endPos, Accessor &styler) { unsigned int i = 0; static unsigned int state = SCE_PO_DEFAULT; unsigned int state_start = SCE_PO_DEFAULT; while ((i < lengthLine) && isspacechar(lineBuffer[i])) // Skip initial spaces i++; if (i < lengthLine) { if (lineBuffer[i] == '#') { // check if the comment contains any flags ("#, ") and // then whether the flags contain "fuzzy" if (strstart(lineBuffer, "#, ") && strstr(lineBuffer, "fuzzy")) styler.ColourTo(endPos, SCE_PO_FUZZY); else styler.ColourTo(endPos, SCE_PO_COMMENT); } else { if (lineBuffer[0] == '"') { // line continuation, use previous style styler.ColourTo(endPos, state); return; // this implicitly also matches "msgid_plural" } else if (strstart(lineBuffer, "msgid")) { state_start = SCE_PO_MSGID; state = SCE_PO_MSGID_TEXT; } else if (strstart(lineBuffer, "msgstr")) { state_start = SCE_PO_MSGSTR; state = SCE_PO_MSGSTR_TEXT; } else if (strstart(lineBuffer, "msgctxt")) { state_start = SCE_PO_MSGCTXT; state = SCE_PO_MSGCTXT_TEXT; } if (state_start != SCE_PO_DEFAULT) { // find the next space while ((i < lengthLine) && ! isspacechar(lineBuffer[i])) i++; styler.ColourTo(startLine + i - 1, state_start); styler.ColourTo(startLine + i, SCE_PO_DEFAULT); styler.ColourTo(endPos, state); } } } else { styler.ColourTo(endPos, SCE_PO_DEFAULT); } } static void ColourisePoDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) { char lineBuffer[1024]; styler.StartAt(startPos); styler.StartSegment(startPos); unsigned int linePos = 0; unsigned int startLine = startPos; for (unsigned int i = startPos; i < startPos + length; i++) { lineBuffer[linePos++] = styler[i]; if (AtEOL(styler, i) || (linePos >= sizeof(lineBuffer) - 1)) { // End of line (or of line buffer) met, colourise it lineBuffer[linePos] = '\0'; ColourisePoLine(lineBuffer, linePos, startLine, i, styler); linePos = 0; startLine = i + 1; } } if (linePos > 0) { // Last line does not have ending characters ColourisePoLine(lineBuffer, linePos, startLine, startPos + length - 1, styler); } } static inline bool isassignchar(unsigned char ch) { return (ch == '=') || (ch == ':'); } static void ColourisePropsLine( char *lineBuffer, unsigned int lengthLine, unsigned int startLine, unsigned int endPos, Accessor &styler, bool allowInitialSpaces) { unsigned int i = 0; if (allowInitialSpaces) { while ((i < lengthLine) && isspacechar(lineBuffer[i])) // Skip initial spaces i++; } else { if (isspacechar(lineBuffer[i])) // don't allow initial spaces i = lengthLine; } if (i < lengthLine) { if (lineBuffer[i] == '#' || lineBuffer[i] == '!' || lineBuffer[i] == ';') { styler.ColourTo(endPos, SCE_PROPS_COMMENT); } else if (lineBuffer[i] == '[') { styler.ColourTo(endPos, SCE_PROPS_SECTION); } else if (lineBuffer[i] == '@') { styler.ColourTo(startLine + i, SCE_PROPS_DEFVAL); if (isassignchar(lineBuffer[i++])) styler.ColourTo(startLine + i, SCE_PROPS_ASSIGNMENT); styler.ColourTo(endPos, SCE_PROPS_DEFAULT); } else { // Search for the '=' character while ((i < lengthLine) && !isassignchar(lineBuffer[i])) i++; if ((i < lengthLine) && isassignchar(lineBuffer[i])) { styler.ColourTo(startLine + i - 1, SCE_PROPS_KEY); styler.ColourTo(startLine + i, SCE_PROPS_ASSIGNMENT); styler.ColourTo(endPos, SCE_PROPS_DEFAULT); } else { styler.ColourTo(endPos, SCE_PROPS_DEFAULT); } } } else { styler.ColourTo(endPos, SCE_PROPS_DEFAULT); } } static void ColourisePropsDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) { char lineBuffer[1024]; styler.StartAt(startPos); styler.StartSegment(startPos); unsigned int linePos = 0; unsigned int startLine = startPos; // property lexer.props.allow.initial.spaces // For properties files, set to 0 to style all lines that start with whitespace in the default style. // This is not suitable for SciTE .properties files which use indentation for flow control but // can be used for RFC2822 text where indentation is used for continuation lines. bool allowInitialSpaces = styler.GetPropertyInt("lexer.props.allow.initial.spaces", 1) != 0; for (unsigned int i = startPos; i < startPos + length; i++) { lineBuffer[linePos++] = styler[i]; if (AtEOL(styler, i) || (linePos >= sizeof(lineBuffer) - 1)) { // End of line (or of line buffer) met, colourise it lineBuffer[linePos] = '\0'; ColourisePropsLine(lineBuffer, linePos, startLine, i, styler, allowInitialSpaces); linePos = 0; startLine = i + 1; } } if (linePos > 0) { // Last line does not have ending characters ColourisePropsLine(lineBuffer, linePos, startLine, startPos + length - 1, styler, allowInitialSpaces); } } // adaption by ksc, using the "} else {" trick of 1.53 // 030721 static void FoldPropsDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) { bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; unsigned int endPos = startPos + length; int visibleChars = 0; int lineCurrent = styler.GetLine(startPos); char chNext = styler[startPos]; int styleNext = styler.StyleAt(startPos); bool headerPoint = false; int lev; for (unsigned int i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler[i+1]; int style = styleNext; styleNext = styler.StyleAt(i + 1); bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); if (style == SCE_PROPS_SECTION) { headerPoint = true; } if (atEOL) { lev = SC_FOLDLEVELBASE; if (lineCurrent > 0) { int levelPrevious = styler.LevelAt(lineCurrent - 1); if (levelPrevious & SC_FOLDLEVELHEADERFLAG) { lev = SC_FOLDLEVELBASE + 1; } else { lev = levelPrevious & SC_FOLDLEVELNUMBERMASK; } } if (headerPoint) { lev = SC_FOLDLEVELBASE; } if (visibleChars == 0 && foldCompact) lev |= SC_FOLDLEVELWHITEFLAG; if (headerPoint) { lev |= SC_FOLDLEVELHEADERFLAG; } if (lev != styler.LevelAt(lineCurrent)) { styler.SetLevel(lineCurrent, lev); } lineCurrent++; visibleChars = 0; headerPoint = false; } if (!isspacechar(ch)) visibleChars++; } if (lineCurrent > 0) { int levelPrevious = styler.LevelAt(lineCurrent - 1); if (levelPrevious & SC_FOLDLEVELHEADERFLAG) { lev = SC_FOLDLEVELBASE + 1; } else { lev = levelPrevious & SC_FOLDLEVELNUMBERMASK; } } else { lev = SC_FOLDLEVELBASE; } int flagsNext = styler.LevelAt(lineCurrent); styler.SetLevel(lineCurrent, lev | (flagsNext & ~SC_FOLDLEVELNUMBERMASK)); } static void ColouriseMakeLine( char *lineBuffer, unsigned int lengthLine, unsigned int startLine, unsigned int endPos, Accessor &styler) { unsigned int i = 0; int lastNonSpace = -1; unsigned int state = SCE_MAKE_DEFAULT; bool bSpecial = false; // check for a tab character in column 0 indicating a command bool bCommand = false; if ((lengthLine > 0) && (lineBuffer[0] == '\t')) bCommand = true; // Skip initial spaces while ((i < lengthLine) && isspacechar(lineBuffer[i])) { i++; } if (lineBuffer[i] == '#') { // Comment styler.ColourTo(endPos, SCE_MAKE_COMMENT); return; } if (lineBuffer[i] == '!') { // Special directive styler.ColourTo(endPos, SCE_MAKE_PREPROCESSOR); return; } int varCount = 0; while (i < lengthLine) { if (lineBuffer[i] == '$' && lineBuffer[i + 1] == '(') { styler.ColourTo(startLine + i - 1, state); state = SCE_MAKE_IDENTIFIER; varCount++; } else if (state == SCE_MAKE_IDENTIFIER && lineBuffer[i] == ')') { if (--varCount == 0) { styler.ColourTo(startLine + i, state); state = SCE_MAKE_DEFAULT; } } // skip identifier and target styling if this is a command line if (!bSpecial && !bCommand) { if (lineBuffer[i] == ':') { if (((i + 1) < lengthLine) && (lineBuffer[i + 1] == '=')) { // it's a ':=', so style as an identifier if (lastNonSpace >= 0) styler.ColourTo(startLine + lastNonSpace, SCE_MAKE_IDENTIFIER); styler.ColourTo(startLine + i - 1, SCE_MAKE_DEFAULT); styler.ColourTo(startLine + i + 1, SCE_MAKE_OPERATOR); } else { // We should check that no colouring was made since the beginning of the line, // to avoid colouring stuff like /OUT:file if (lastNonSpace >= 0) styler.ColourTo(startLine + lastNonSpace, SCE_MAKE_TARGET); styler.ColourTo(startLine + i - 1, SCE_MAKE_DEFAULT); styler.ColourTo(startLine + i, SCE_MAKE_OPERATOR); } bSpecial = true; // Only react to the first ':' of the line state = SCE_MAKE_DEFAULT; } else if (lineBuffer[i] == '=') { if (lastNonSpace >= 0) styler.ColourTo(startLine + lastNonSpace, SCE_MAKE_IDENTIFIER); styler.ColourTo(startLine + i - 1, SCE_MAKE_DEFAULT); styler.ColourTo(startLine + i, SCE_MAKE_OPERATOR); bSpecial = true; // Only react to the first '=' of the line state = SCE_MAKE_DEFAULT; } } if (!isspacechar(lineBuffer[i])) { lastNonSpace = i; } i++; } if (state == SCE_MAKE_IDENTIFIER) { styler.ColourTo(endPos, SCE_MAKE_IDEOL); // Error, variable reference not ended } else { styler.ColourTo(endPos, SCE_MAKE_DEFAULT); } } static void ColouriseMakeDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) { char lineBuffer[1024]; styler.StartAt(startPos); styler.StartSegment(startPos); unsigned int linePos = 0; unsigned int startLine = startPos; for (unsigned int i = startPos; i < startPos + length; i++) { lineBuffer[linePos++] = styler[i]; if (AtEOL(styler, i) || (linePos >= sizeof(lineBuffer) - 1)) { // End of line (or of line buffer) met, colourise it lineBuffer[linePos] = '\0'; ColouriseMakeLine(lineBuffer, linePos, startLine, i, styler); linePos = 0; startLine = i + 1; } } if (linePos > 0) { // Last line does not have ending characters ColouriseMakeLine(lineBuffer, linePos, startLine, startPos + length - 1, styler); } } static int RecogniseErrorListLine(const char *lineBuffer, unsigned int lengthLine, int &startValue) { if (lineBuffer[0] == '>') { // Command or return status return SCE_ERR_CMD; } else if (lineBuffer[0] == '<') { // Diff removal. return SCE_ERR_DIFF_DELETION; } else if (lineBuffer[0] == '!') { return SCE_ERR_DIFF_CHANGED; } else if (lineBuffer[0] == '+') { if (strstart(lineBuffer, "+++ ")) { return SCE_ERR_DIFF_MESSAGE; } else { return SCE_ERR_DIFF_ADDITION; } } else if (lineBuffer[0] == '-') { if (strstart(lineBuffer, "--- ")) { return SCE_ERR_DIFF_MESSAGE; } else { return SCE_ERR_DIFF_DELETION; } } else if (strstart(lineBuffer, "cf90-")) { // Absoft Pro Fortran 90/95 v8.2 error and/or warning message return SCE_ERR_ABSF; } else if (strstart(lineBuffer, "fortcom:")) { // Intel Fortran Compiler v8.0 error/warning message return SCE_ERR_IFORT; } else if (strstr(lineBuffer, "File \"") && strstr(lineBuffer, ", line ")) { return SCE_ERR_PYTHON; } else if (strstr(lineBuffer, " in ") && strstr(lineBuffer, " on line ")) { return SCE_ERR_PHP; } else if ((strstart(lineBuffer, "Error ") || strstart(lineBuffer, "Warning ")) && strstr(lineBuffer, " at (") && strstr(lineBuffer, ") : ") && (strstr(lineBuffer, " at (") < strstr(lineBuffer, ") : "))) { // Intel Fortran Compiler error/warning message return SCE_ERR_IFC; } else if (strstart(lineBuffer, "Error ")) { // Borland error message return SCE_ERR_BORLAND; } else if (strstart(lineBuffer, "Warning ")) { // Borland warning message return SCE_ERR_BORLAND; } else if (strstr(lineBuffer, "at line ") && (strstr(lineBuffer, "at line ") < (lineBuffer + lengthLine)) && strstr(lineBuffer, "file ") && (strstr(lineBuffer, "file ") < (lineBuffer + lengthLine))) { // Lua 4 error message return SCE_ERR_LUA; } else if (strstr(lineBuffer, " at ") && (strstr(lineBuffer, " at ") < (lineBuffer + lengthLine)) && strstr(lineBuffer, " line ") && (strstr(lineBuffer, " line ") < (lineBuffer + lengthLine)) && (strstr(lineBuffer, " at ") < (strstr(lineBuffer, " line ")))) { // perl error message return SCE_ERR_PERL; } else if ((memcmp(lineBuffer, " at ", 6) == 0) && strstr(lineBuffer, ":line ")) { // A .NET traceback return SCE_ERR_NET; } else if (strstart(lineBuffer, "Line ") && strstr(lineBuffer, ", file ")) { // Essential Lahey Fortran error message return SCE_ERR_ELF; } else if (strstart(lineBuffer, "line ") && strstr(lineBuffer, " column ")) { // HTML tidy style: line 42 column 1 return SCE_ERR_TIDY; } else if (strstart(lineBuffer, "\tat ") && strstr(lineBuffer, "(") && strstr(lineBuffer, ".java:")) { // Java stack back trace return SCE_ERR_JAVA_STACK; } else { // Look for one of the following formats: // GCC: :: // Microsoft: () : // Common: (): warning|error|note|remark|catastrophic|fatal // Common: () warning|error|note|remark|catastrophic|fatal // Microsoft: (,) // CTags: \t // Lua 5 traceback: \t:: // Lua 5.1: : :: bool initialTab = (lineBuffer[0] == '\t'); bool initialColonPart = false; enum { stInitial, stGccStart, stGccDigit, stGccColumn, stGcc, stMsStart, stMsDigit, stMsBracket, stMsVc, stMsDigitComma, stMsDotNet, stCtagsStart, stCtagsStartString, stCtagsStringDollar, stCtags, stUnrecognized } state = stInitial; for (unsigned int i = 0; i < lengthLine; i++) { char ch = lineBuffer[i]; char chNext = ' '; if ((i + 1) < lengthLine) chNext = lineBuffer[i + 1]; if (state == stInitial) { if (ch == ':') { // May be GCC, or might be Lua 5 (Lua traceback same but with tab prefix) if ((chNext != '\\') && (chNext != '/') && (chNext != ' ')) { // This check is not completely accurate as may be on // GTK+ with a file name that includes ':'. state = stGccStart; } else if (chNext == ' ') { // indicates a Lua 5.1 error message initialColonPart = true; } } else if ((ch == '(') && Is1To9(chNext) && (!initialTab)) { // May be Microsoft // Check against '0' often removes phone numbers state = stMsStart; } else if ((ch == '\t') && (!initialTab)) { // May be CTags state = stCtagsStart; } } else if (state == stGccStart) { // : state = Is1To9(ch) ? stGccDigit : stUnrecognized; } else if (state == stGccDigit) { // : if (ch == ':') { state = stGccColumn; // :9.*: is GCC startValue = i + 1; } else if (!Is0To9(ch)) { state = stUnrecognized; } } else if (state == stGccColumn) { // :: if (!Is0To9(ch)) { state = stGcc; if (ch == ':') startValue = i + 1; break; } } else if (state == stMsStart) { // ( state = Is0To9(ch) ? stMsDigit : stUnrecognized; } else if (state == stMsDigit) { // ( if (ch == ',') { state = stMsDigitComma; } else if (ch == ')') { state = stMsBracket; } else if ((ch != ' ') && !Is0To9(ch)) { state = stUnrecognized; } } else if (state == stMsBracket) { // () if ((ch == ' ') && (chNext == ':')) { state = stMsVc; } else if ((ch == ':' && chNext == ' ') || (ch == ' ')) { // Possibly Delphi.. don't test against chNext as it's one of the strings below. char word[512]; unsigned int j, chPos; unsigned numstep; chPos = 0; if (ch == ' ') numstep = 1; // ch was ' ', handle as if it's a delphi errorline, only add 1 to i. else numstep = 2; // otherwise add 2. for (j = i + numstep; j < lengthLine && IsAlphabetic(lineBuffer[j]) && chPos < sizeof(word) - 1; j++) word[chPos++] = lineBuffer[j]; word[chPos] = 0; if (!CompareCaseInsensitive(word, "error") || !CompareCaseInsensitive(word, "warning") || !CompareCaseInsensitive(word, "fatal") || !CompareCaseInsensitive(word, "catastrophic") || !CompareCaseInsensitive(word, "note") || !CompareCaseInsensitive(word, "remark")) { state = stMsVc; } else state = stUnrecognized; } else { state = stUnrecognized; } } else if (state == stMsDigitComma) { // (, if (ch == ')') { state = stMsDotNet; break; } else if ((ch != ' ') && !Is0To9(ch)) { state = stUnrecognized; } } else if (state == stCtagsStart) { if ((lineBuffer[i - 1] == '\t') && ((ch == '/' && lineBuffer[i + 1] == '^') || Is0To9(ch))) { state = stCtags; break; } else if ((ch == '/') && (lineBuffer[i + 1] == '^')) { state = stCtagsStartString; } } else if ((state == stCtagsStartString) && ((lineBuffer[i] == '$') && (lineBuffer[i + 1] == '/'))) { state = stCtagsStringDollar; break; } } if (state == stGcc) { return initialColonPart ? SCE_ERR_LUA : SCE_ERR_GCC; } else if ((state == stMsVc) || (state == stMsDotNet)) { return SCE_ERR_MS; } else if ((state == stCtagsStringDollar) || (state == stCtags)) { return SCE_ERR_CTAG; } else { return SCE_ERR_DEFAULT; } } } static void ColouriseErrorListLine( char *lineBuffer, unsigned int lengthLine, unsigned int endPos, Accessor &styler, bool valueSeparate) { int startValue = -1; int style = RecogniseErrorListLine(lineBuffer, lengthLine, startValue); if (valueSeparate && (startValue >= 0)) { styler.ColourTo(endPos - (lengthLine - startValue), style); styler.ColourTo(endPos, SCE_ERR_VALUE); } else { styler.ColourTo(endPos, style); } } static void ColouriseErrorListDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) { char lineBuffer[10000]; styler.StartAt(startPos); styler.StartSegment(startPos); unsigned int linePos = 0; // property lexer.errorlist.value.separate // For lines in the output pane that are matches from Find in Files or GCC-style // diagnostics, style the path and line number separately from the rest of the // line with style 21 used for the rest of the line. // This allows matched text to be more easily distinguished from its location. bool valueSeparate = styler.GetPropertyInt("lexer.errorlist.value.separate", 0) != 0; for (unsigned int i = startPos; i < startPos + length; i++) { lineBuffer[linePos++] = styler[i]; if (AtEOL(styler, i) || (linePos >= sizeof(lineBuffer) - 1)) { // End of line (or of line buffer) met, colourise it lineBuffer[linePos] = '\0'; ColouriseErrorListLine(lineBuffer, linePos, i, styler, valueSeparate); linePos = 0; } } if (linePos > 0) { // Last line does not have ending characters ColouriseErrorListLine(lineBuffer, linePos, startPos + length - 1, styler, valueSeparate); } } static bool latexIsSpecial(int ch) { return (ch == '#') || (ch == '$') || (ch == '%') || (ch == '&') || (ch == '_') || (ch == '{') || (ch == '}') || (ch == ' '); } static bool latexIsBlank(int ch) { return (ch == ' ') || (ch == '\t'); } static bool latexIsBlankAndNL(int ch) { return (ch == ' ') || (ch == '\t') || (ch == '\r') || (ch == '\n'); } static bool latexIsLetter(int ch) { return isascii(ch) && isalpha(ch); } static bool latexIsTagValid(int &i, int l, Accessor &styler) { while (i < l) { if (styler.SafeGetCharAt(i) == '{') { while (i < l) { i++; if (styler.SafeGetCharAt(i) == '}') { return true; } else if (!latexIsLetter(styler.SafeGetCharAt(i)) && styler.SafeGetCharAt(i)!='*') { return false; } } } else if (!latexIsBlank(styler.SafeGetCharAt(i))) { return false; } i++; } return false; } static bool latexNextNotBlankIs(int i, int l, Accessor &styler, char needle) { char ch; while (i < l) { ch = styler.SafeGetCharAt(i); if (!latexIsBlankAndNL(ch) && ch != '*') { if (ch == needle) return true; else return false; } i++; } return false; } static bool latexLastWordIs(int start, Accessor &styler, const char *needle) { unsigned int i = 0; unsigned int l = static_cast(strlen(needle)); int ini = start-l+1; char s[32]; while (i < l && i < 32) { s[i] = styler.SafeGetCharAt(ini + i); i++; } s[i] = '\0'; return (strcmp(s, needle) == 0); } static void ColouriseLatexDoc(unsigned int startPos, int length, int initStyle, WordList *[], Accessor &styler) { styler.StartAt(startPos); int state = initStyle; char chNext = styler.SafeGetCharAt(startPos); styler.StartSegment(startPos); int lengthDoc = startPos + length; char chVerbatimDelim = '\0'; for (int i = startPos; i < lengthDoc; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); if (styler.IsLeadByte(ch)) { i++; chNext = styler.SafeGetCharAt(i + 1); continue; } switch (state) { case SCE_L_DEFAULT : switch (ch) { case '\\' : styler.ColourTo(i - 1, state); if (latexIsSpecial(chNext)) { state = SCE_L_SPECIAL; } else { if (latexIsLetter(chNext)) { state = SCE_L_COMMAND; } else { if (chNext == '(' || chNext == '[') { styler.ColourTo(i-1, state); styler.ColourTo(i+1, SCE_L_SHORTCMD); state = SCE_L_MATH; if (chNext == '[') state = SCE_L_MATH2; i++; chNext = styler.SafeGetCharAt(i+1); } else { state = SCE_L_SHORTCMD; } } } break; case '$' : styler.ColourTo(i - 1, state); state = SCE_L_MATH; if (chNext == '$') { state = SCE_L_MATH2; i++; chNext = styler.SafeGetCharAt(i + 1); } break; case '%' : styler.ColourTo(i - 1, state); state = SCE_L_COMMENT; break; } break; case SCE_L_ERROR: styler.ColourTo(i-1, state); state = SCE_L_DEFAULT; break; case SCE_L_SPECIAL: case SCE_L_SHORTCMD: styler.ColourTo(i, state); state = SCE_L_DEFAULT; break; case SCE_L_COMMAND : if (!latexIsLetter(chNext)) { styler.ColourTo(i, state); state = SCE_L_DEFAULT; if (latexNextNotBlankIs(i+1, lengthDoc, styler, '[' )) { state = SCE_L_CMDOPT; } else if (latexLastWordIs(i, styler, "\\begin")) { state = SCE_L_TAG; } else if (latexLastWordIs(i, styler, "\\end")) { state = SCE_L_TAG2; } else if (latexLastWordIs(i, styler, "\\verb") && chNext != '*' && chNext != ' ') { chVerbatimDelim = chNext; state = SCE_L_VERBATIM; } } break; case SCE_L_CMDOPT : if (ch == ']') { styler.ColourTo(i, state); state = SCE_L_DEFAULT; } break; case SCE_L_TAG : if (latexIsTagValid(i, lengthDoc, styler)) { styler.ColourTo(i, state); state = SCE_L_DEFAULT; if (latexLastWordIs(i, styler, "{verbatim}")) { state = SCE_L_VERBATIM; } else if (latexLastWordIs(i, styler, "{comment}")) { state = SCE_L_COMMENT2; } else if (latexLastWordIs(i, styler, "{math}")) { state = SCE_L_MATH; } else if (latexLastWordIs(i, styler, "{displaymath}")) { state = SCE_L_MATH2; } else if (latexLastWordIs(i, styler, "{equation}")) { state = SCE_L_MATH2; } } else { state = SCE_L_ERROR; styler.ColourTo(i, state); state = SCE_L_DEFAULT; } chNext = styler.SafeGetCharAt(i+1); break; case SCE_L_TAG2 : if (latexIsTagValid(i, lengthDoc, styler)) { styler.ColourTo(i, state); state = SCE_L_DEFAULT; } else { state = SCE_L_ERROR; } chNext = styler.SafeGetCharAt(i+1); break; case SCE_L_MATH : if (ch == '$') { styler.ColourTo(i, state); state = SCE_L_DEFAULT; } else if (ch == '\\' && chNext == ')') { styler.ColourTo(i-1, state); styler.ColourTo(i+1, SCE_L_SHORTCMD); i++; chNext = styler.SafeGetCharAt(i+1); state = SCE_L_DEFAULT; } else if (ch == '\\') { int match = i + 3; if (latexLastWordIs(match, styler, "\\end")) { match++; if (latexIsTagValid(match, lengthDoc, styler)) { if (latexLastWordIs(match, styler, "{math}")) { styler.ColourTo(i-1, state); state = SCE_L_COMMAND; } } } } break; case SCE_L_MATH2 : if (ch == '$') { if (chNext == '$') { i++; chNext = styler.SafeGetCharAt(i + 1); styler.ColourTo(i, state); state = SCE_L_DEFAULT; } else { styler.ColourTo(i, SCE_L_ERROR); state = SCE_L_DEFAULT; } } else if (ch == '\\' && chNext == ']') { styler.ColourTo(i-1, state); styler.ColourTo(i+1, SCE_L_SHORTCMD); i++; chNext = styler.SafeGetCharAt(i+1); state = SCE_L_DEFAULT; } else if (ch == '\\') { int match = i + 3; if (latexLastWordIs(match, styler, "\\end")) { match++; if (latexIsTagValid(match, lengthDoc, styler)) { if (latexLastWordIs(match, styler, "{displaymath}")) { styler.ColourTo(i-1, state); state = SCE_L_COMMAND; } else if (latexLastWordIs(match, styler, "{equation}")) { styler.ColourTo(i-1, state); state = SCE_L_COMMAND; } } } } break; case SCE_L_COMMENT : if (ch == '\r' || ch == '\n') { styler.ColourTo(i - 1, state); state = SCE_L_DEFAULT; } break; case SCE_L_COMMENT2 : if (ch == '\\') { int match = i + 3; if (latexLastWordIs(match, styler, "\\end")) { match++; if (latexIsTagValid(match, lengthDoc, styler)) { if (latexLastWordIs(match, styler, "{comment}")) { styler.ColourTo(i-1, state); state = SCE_L_COMMAND; } } } } break; case SCE_L_VERBATIM : if (ch == '\\') { int match = i + 3; if (latexLastWordIs(match, styler, "\\end")) { match++; if (latexIsTagValid(match, lengthDoc, styler)) { if (latexLastWordIs(match, styler, "{verbatim}")) { styler.ColourTo(i-1, state); state = SCE_L_COMMAND; } } } } else if (chNext == chVerbatimDelim) { styler.ColourTo(i+1, state); state = SCE_L_DEFAULT; chVerbatimDelim = '\0'; } else if (chVerbatimDelim != '\0' && (ch == '\n' || ch == '\r')) { styler.ColourTo(i, SCE_L_ERROR); state = SCE_L_DEFAULT; chVerbatimDelim = '\0'; } break; } } styler.ColourTo(lengthDoc-1, state); } static const char *const batchWordListDesc[] = { "Internal Commands", "External Commands", 0 }; static const char *const emptyWordListDesc[] = { 0 }; static void ColouriseNullDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) { // Null language means all style bytes are 0 so just mark the end - no need to fill in. if (length > 0) { styler.StartAt(startPos + length - 1); styler.StartSegment(startPos + length - 1); styler.ColourTo(startPos + length - 1, 0); } } LexerModule lmBatch(SCLEX_BATCH, ColouriseBatchDoc, "batch", 0, batchWordListDesc); LexerModule lmDiff(SCLEX_DIFF, ColouriseDiffDoc, "diff", FoldDiffDoc, emptyWordListDesc); LexerModule lmPo(SCLEX_PO, ColourisePoDoc, "po", 0, emptyWordListDesc); LexerModule lmProps(SCLEX_PROPERTIES, ColourisePropsDoc, "props", FoldPropsDoc, emptyWordListDesc); LexerModule lmMake(SCLEX_MAKEFILE, ColouriseMakeDoc, "makefile", 0, emptyWordListDesc); LexerModule lmErrorList(SCLEX_ERRORLIST, ColouriseErrorListDoc, "errorlist", 0, emptyWordListDesc); LexerModule lmLatex(SCLEX_LATEX, ColouriseLatexDoc, "latex", 0, emptyWordListDesc); LexerModule lmNull(SCLEX_NULL, ColouriseNullDoc, "null"); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexerSimple.cxx000444001750001750 305311727344243 25353 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexerSimple.cxx ** A simple lexer with no state. **/ // Copyright 1998-2010 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "PropSetSimple.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "LexerModule.h" #include "LexerBase.h" #include "LexerSimple.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif LexerSimple::LexerSimple(const LexerModule *module_) : module(module_) { for (int wl = 0; wl < module->GetNumWordLists(); wl++) { if (!wordLists.empty()) wordLists += "\n"; wordLists += module->GetWordListDescription(wl); } } const char * SCI_METHOD LexerSimple::DescribeWordListSets() { return wordLists.c_str(); } void SCI_METHOD LexerSimple::Lex(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess) { Accessor astyler(pAccess, &props); module->Lex(startPos, lengthDoc, initStyle, keyWordLists, astyler); astyler.Flush(); } void SCI_METHOD LexerSimple::Fold(unsigned int startPos, int lengthDoc, int initStyle, IDocument *pAccess) { if (props.GetInt("fold")) { Accessor astyler(pAccess, &props); module->Fold(startPos, lengthDoc, initStyle, keyWordLists, astyler); astyler.Flush(); } } Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/PerLine.h000444001750001750 605411727344243 24111 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file PerLine.h ** Manages data associated with each line of the document **/ // Copyright 1998-2009 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #ifndef PERLINE_H #define PERLINE_H #ifdef SCI_NAMESPACE namespace Scintilla { #endif /** * This holds the marker identifier and the marker type to display. * MarkerHandleNumbers are members of lists. */ struct MarkerHandleNumber { int handle; int number; MarkerHandleNumber *next; }; /** * A marker handle set contains any number of MarkerHandleNumbers. */ class MarkerHandleSet { MarkerHandleNumber *root; public: MarkerHandleSet(); ~MarkerHandleSet(); int Length() const; int NumberFromHandle(int handle) const; int MarkValue() const; ///< Bit set of marker numbers. bool Contains(int handle) const; bool InsertHandle(int handle, int markerNum); void RemoveHandle(int handle); bool RemoveNumber(int markerNum); void CombineWith(MarkerHandleSet *other); }; class LineMarkers : public PerLine { SplitVector markers; /// Handles are allocated sequentially and should never have to be reused as 32 bit ints are very big. int handleCurrent; public: LineMarkers() : handleCurrent(0) { } virtual ~LineMarkers(); virtual void Init(); virtual void InsertLine(int line); virtual void RemoveLine(int line); int MarkValue(int line); int MarkerNext(int lineStart, int mask) const; int AddMark(int line, int marker, int lines); void MergeMarkers(int pos); bool DeleteMark(int line, int markerNum, bool all); void DeleteMarkFromHandle(int markerHandle); int LineFromHandle(int markerHandle); }; class LineLevels : public PerLine { SplitVector levels; public: virtual ~LineLevels(); virtual void Init(); virtual void InsertLine(int line); virtual void RemoveLine(int line); void ExpandLevels(int sizeNew=-1); void ClearLevels(); int SetLevel(int line, int level, int lines); int GetLevel(int line); }; class LineState : public PerLine { SplitVector lineStates; public: LineState() { } virtual ~LineState(); virtual void Init(); virtual void InsertLine(int line); virtual void RemoveLine(int line); int SetLineState(int line, int state); int GetLineState(int line); int GetMaxLineState(); }; class LineAnnotation : public PerLine { SplitVector annotations; public: LineAnnotation() { } virtual ~LineAnnotation(); virtual void Init(); virtual void InsertLine(int line); virtual void RemoveLine(int line); bool AnySet() const; bool MultipleStyles(int line) const; int Style(int line); const char *Text(int line) const; const unsigned char *Styles(int line) const; void SetText(int line, const char *text); void ClearAll(); void SetStyle(int line, int style); void SetStyles(int line, const unsigned char *styles); int Length(int line) const; int Lines(int line) const; }; #ifdef SCI_NAMESPACE } #endif #endif Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexECL.cxx000444001750001750 3733311727344243 24226 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexECL.cxx ** Lexer for ECL. **/ // Copyright 1998-2001 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #ifdef _MSC_VER #pragma warning(disable: 4786) #endif #ifdef __BORLANDC__ // Borland C++ displays warnings in vector header without this #pragma option -w-ccc -w-rch #endif #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "PropSetSimple.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #include "OptionSet.h" #define SET_LOWER "abcdefghijklmnopqrstuvwxyz" #define SET_UPPER "ABCDEFGHIJKLMNOPQRSTUVWXYZ" #define SET_DIGITS "0123456789" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static bool IsSpaceEquiv(int state) { return (state <= SCE_ECL_COMMENTDOC) || // including SCE_ECL_DEFAULT, SCE_ECL_COMMENT, SCE_ECL_COMMENTLINE (state == SCE_ECL_COMMENTLINEDOC) || (state == SCE_ECL_COMMENTDOCKEYWORD) || (state == SCE_ECL_COMMENTDOCKEYWORDERROR); } static void ColouriseEclDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { WordList &keywords0 = *keywordlists[0]; WordList &keywords1 = *keywordlists[1]; WordList &keywords2 = *keywordlists[2]; WordList &keywords3 = *keywordlists[3]; //Value Types WordList &keywords4 = *keywordlists[4]; WordList &keywords5 = *keywordlists[5]; WordList &keywords6 = *keywordlists[6]; //Javadoc Tags WordList cplusplus; cplusplus.Set("beginc endc"); bool stylingWithinPreprocessor = false; CharacterSet setOKBeforeRE(CharacterSet::setNone, "(=,"); CharacterSet setDoxygen(CharacterSet::setLower, "$@\\&<>#{}[]"); CharacterSet setWordStart(CharacterSet::setAlpha, "_", 0x80, true); CharacterSet setWord(CharacterSet::setAlphaNum, "._", 0x80, true); CharacterSet setQualified(CharacterSet::setNone, "uUxX"); int chPrevNonWhite = ' '; int visibleChars = 0; bool lastWordWasUUID = false; int styleBeforeDCKeyword = SCE_ECL_DEFAULT; bool continuationLine = false; if (initStyle == SCE_ECL_PREPROCESSOR) { // Set continuationLine if last character of previous line is '\' int lineCurrent = styler.GetLine(startPos); if (lineCurrent > 0) { int chBack = styler.SafeGetCharAt(startPos-1, 0); int chBack2 = styler.SafeGetCharAt(startPos-2, 0); int lineEndChar = '!'; if (chBack2 == '\r' && chBack == '\n') { lineEndChar = styler.SafeGetCharAt(startPos-3, 0); } else if (chBack == '\n' || chBack == '\r') { lineEndChar = chBack2; } continuationLine = lineEndChar == '\\'; } } // look back to set chPrevNonWhite properly for better regex colouring if (startPos > 0) { int back = startPos; while (--back && IsSpaceEquiv(styler.StyleAt(back))) ; if (styler.StyleAt(back) == SCE_ECL_OPERATOR) { chPrevNonWhite = styler.SafeGetCharAt(back); } } StyleContext sc(startPos, length, initStyle, styler); for (; sc.More(); sc.Forward()) { if (sc.atLineStart) { if (sc.state == SCE_ECL_STRING) { // Prevent SCE_ECL_STRINGEOL from leaking back to previous line which // ends with a line continuation by locking in the state upto this position. sc.SetState(SCE_ECL_STRING); } // Reset states to begining of colourise so no surprises // if different sets of lines lexed. visibleChars = 0; lastWordWasUUID = false; } // Handle line continuation generically. if (sc.ch == '\\') { if (sc.chNext == '\n' || sc.chNext == '\r') { sc.Forward(); if (sc.ch == '\r' && sc.chNext == '\n') { sc.Forward(); } continuationLine = true; continue; } } // Determine if the current state should terminate. switch (sc.state) { case SCE_ECL_ADDED: case SCE_ECL_DELETED: case SCE_ECL_CHANGED: case SCE_ECL_MOVED: if (sc.atLineStart) sc.SetState(SCE_ECL_DEFAULT); break; case SCE_ECL_OPERATOR: sc.SetState(SCE_ECL_DEFAULT); break; case SCE_ECL_NUMBER: // We accept almost anything because of hex. and number suffixes if (!setWord.Contains(sc.ch)) { sc.SetState(SCE_ECL_DEFAULT); } break; case SCE_ECL_IDENTIFIER: if (!setWord.Contains(sc.ch) || (sc.ch == '.')) { char s[1000]; sc.GetCurrentLowered(s, sizeof(s)); if (keywords0.InList(s)) { lastWordWasUUID = strcmp(s, "uuid") == 0; sc.ChangeState(SCE_ECL_WORD0); } else if (keywords1.InList(s)) { sc.ChangeState(SCE_ECL_WORD1); } else if (keywords2.InList(s)) { sc.ChangeState(SCE_ECL_WORD2); } else if (keywords4.InList(s)) { sc.ChangeState(SCE_ECL_WORD4); } else if (keywords5.InList(s)) { sc.ChangeState(SCE_ECL_WORD5); } else //Data types are of from KEYWORD## { int i = static_cast(strlen(s)) - 1; while(i >= 0 && (isdigit(s[i]) || s[i] == '_')) --i; char s2[1000]; strncpy(s2, s, i + 1); s2[i + 1] = 0; if (keywords3.InList(s2)) { sc.ChangeState(SCE_ECL_WORD3); } } sc.SetState(SCE_ECL_DEFAULT); } break; case SCE_ECL_PREPROCESSOR: if (sc.atLineStart && !continuationLine) { sc.SetState(SCE_ECL_DEFAULT); } else if (stylingWithinPreprocessor) { if (IsASpace(sc.ch)) { sc.SetState(SCE_ECL_DEFAULT); } } else { if (sc.Match('/', '*') || sc.Match('/', '/')) { sc.SetState(SCE_ECL_DEFAULT); } } break; case SCE_ECL_COMMENT: if (sc.Match('*', '/')) { sc.Forward(); sc.ForwardSetState(SCE_ECL_DEFAULT); } break; case SCE_ECL_COMMENTDOC: if (sc.Match('*', '/')) { sc.Forward(); sc.ForwardSetState(SCE_ECL_DEFAULT); } else if (sc.ch == '@' || sc.ch == '\\') { // JavaDoc and Doxygen support // Verify that we have the conditions to mark a comment-doc-keyword if ((IsASpace(sc.chPrev) || sc.chPrev == '*') && (!IsASpace(sc.chNext))) { styleBeforeDCKeyword = SCE_ECL_COMMENTDOC; sc.SetState(SCE_ECL_COMMENTDOCKEYWORD); } } break; case SCE_ECL_COMMENTLINE: if (sc.atLineStart) { sc.SetState(SCE_ECL_DEFAULT); } break; case SCE_ECL_COMMENTLINEDOC: if (sc.atLineStart) { sc.SetState(SCE_ECL_DEFAULT); } else if (sc.ch == '@' || sc.ch == '\\') { // JavaDoc and Doxygen support // Verify that we have the conditions to mark a comment-doc-keyword if ((IsASpace(sc.chPrev) || sc.chPrev == '/' || sc.chPrev == '!') && (!IsASpace(sc.chNext))) { styleBeforeDCKeyword = SCE_ECL_COMMENTLINEDOC; sc.SetState(SCE_ECL_COMMENTDOCKEYWORD); } } break; case SCE_ECL_COMMENTDOCKEYWORD: if ((styleBeforeDCKeyword == SCE_ECL_COMMENTDOC) && sc.Match('*', '/')) { sc.ChangeState(SCE_ECL_COMMENTDOCKEYWORDERROR); sc.Forward(); sc.ForwardSetState(SCE_ECL_DEFAULT); } else if (!setDoxygen.Contains(sc.ch)) { char s[1000]; sc.GetCurrentLowered(s, sizeof(s)); if (!IsASpace(sc.ch) || !keywords6.InList(s+1)) { sc.ChangeState(SCE_ECL_COMMENTDOCKEYWORDERROR); } sc.SetState(styleBeforeDCKeyword); } break; case SCE_ECL_STRING: if (sc.atLineEnd) { sc.ChangeState(SCE_ECL_STRINGEOL); } else if (sc.ch == '\\') { if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') { sc.Forward(); } } else if (sc.ch == '\"') { sc.ForwardSetState(SCE_ECL_DEFAULT); } break; case SCE_ECL_CHARACTER: if (sc.atLineEnd) { sc.ChangeState(SCE_ECL_STRINGEOL); } else if (sc.ch == '\\') { if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') { sc.Forward(); } } else if (sc.ch == '\'') { sc.ForwardSetState(SCE_ECL_DEFAULT); } break; case SCE_ECL_REGEX: if (sc.atLineStart) { sc.SetState(SCE_ECL_DEFAULT); } else if (sc.ch == '/') { sc.Forward(); while ((sc.ch < 0x80) && islower(sc.ch)) sc.Forward(); // gobble regex flags sc.SetState(SCE_ECL_DEFAULT); } else if (sc.ch == '\\') { // Gobble up the quoted character if (sc.chNext == '\\' || sc.chNext == '/') { sc.Forward(); } } break; case SCE_ECL_STRINGEOL: if (sc.atLineStart) { sc.SetState(SCE_ECL_DEFAULT); } break; case SCE_ECL_VERBATIM: if (sc.ch == '\"') { if (sc.chNext == '\"') { sc.Forward(); } else { sc.ForwardSetState(SCE_ECL_DEFAULT); } } break; case SCE_ECL_UUID: if (sc.ch == '\r' || sc.ch == '\n' || sc.ch == ')') { sc.SetState(SCE_ECL_DEFAULT); } break; } // Determine if a new state should be entered. int lineCurrent = styler.GetLine(sc.currentPos); int lineState = styler.GetLineState(lineCurrent); if (sc.state == SCE_ECL_DEFAULT) { if (lineState) { sc.SetState(lineState); } else if (sc.Match('@', '\"')) { sc.SetState(SCE_ECL_VERBATIM); sc.Forward(); } else if (setQualified.Contains(sc.ch) && sc.chNext == '\'') { sc.SetState(SCE_ECL_CHARACTER); sc.Forward(); } else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) { if (lastWordWasUUID) { sc.SetState(SCE_ECL_UUID); lastWordWasUUID = false; } else { sc.SetState(SCE_ECL_NUMBER); } } else if (setWordStart.Contains(sc.ch) || (sc.ch == '@')) { if (lastWordWasUUID) { sc.SetState(SCE_ECL_UUID); lastWordWasUUID = false; } else { sc.SetState(SCE_ECL_IDENTIFIER); } } else if (sc.Match('/', '*')) { if (sc.Match("/**") || sc.Match("/*!")) { // Support of Qt/Doxygen doc. style sc.SetState(SCE_ECL_COMMENTDOC); } else { sc.SetState(SCE_ECL_COMMENT); } sc.Forward(); // Eat the * so it isn't used for the end of the comment } else if (sc.Match('/', '/')) { if ((sc.Match("///") && !sc.Match("////")) || sc.Match("//!")) // Support of Qt/Doxygen doc. style sc.SetState(SCE_ECL_COMMENTLINEDOC); else sc.SetState(SCE_ECL_COMMENTLINE); } else if (sc.ch == '/' && setOKBeforeRE.Contains(chPrevNonWhite)) { sc.SetState(SCE_ECL_REGEX); // JavaScript's RegEx // } else if (sc.ch == '\"') { // sc.SetState(SCE_ECL_STRING); } else if (sc.ch == '\'') { sc.SetState(SCE_ECL_CHARACTER); } else if (sc.ch == '#' && visibleChars == 0) { // Preprocessor commands are alone on their line sc.SetState(SCE_ECL_PREPROCESSOR); // Skip whitespace between # and preprocessor word do { sc.Forward(); } while ((sc.ch == ' ' || sc.ch == '\t') && sc.More()); if (sc.atLineEnd) { sc.SetState(SCE_ECL_DEFAULT); } } else if (isoperator(static_cast(sc.ch))) { sc.SetState(SCE_ECL_OPERATOR); } } if (!IsASpace(sc.ch) && !IsSpaceEquiv(sc.state)) { chPrevNonWhite = sc.ch; visibleChars++; } continuationLine = false; } sc.Complete(); } static bool IsStreamCommentStyle(int style) { return style == SCE_ECL_COMMENT || style == SCE_ECL_COMMENTDOC || style == SCE_ECL_COMMENTDOCKEYWORD || style == SCE_ECL_COMMENTDOCKEYWORDERROR; } bool MatchNoCase(Accessor & styler, unsigned int & pos, const char *s) { int i=0; for (; *s; i++) { char compare_char = tolower(*s); char styler_char = tolower(styler.SafeGetCharAt(pos+i)); if (compare_char != styler_char) return false; s++; } pos+=i-1; return true; } // Store both the current line's fold level and the next lines in the // level store to make it easy to pick up with each increment // and to make it possible to fiddle the current level for "} else {". static void FoldEclDoc(unsigned int startPos, int length, int initStyle, WordList *[], Accessor &styler) { bool foldComment = true; bool foldPreprocessor = true; bool foldCompact = true; bool foldAtElse = true; unsigned int endPos = startPos + length; int visibleChars = 0; int lineCurrent = styler.GetLine(startPos); int levelCurrent = SC_FOLDLEVELBASE; if (lineCurrent > 0) levelCurrent = styler.LevelAt(lineCurrent-1) >> 16; int levelMinCurrent = levelCurrent; int levelNext = levelCurrent; char chNext = styler[startPos]; int styleNext = styler.StyleAt(startPos); int style = initStyle; for (unsigned int i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); int stylePrev = style; style = styleNext; styleNext = styler.StyleAt(i + 1); bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); if (foldComment && IsStreamCommentStyle(style)) { if (!IsStreamCommentStyle(stylePrev) && (stylePrev != SCE_ECL_COMMENTLINEDOC)) { levelNext++; } else if (!IsStreamCommentStyle(styleNext) && (styleNext != SCE_ECL_COMMENTLINEDOC) && !atEOL) { // Comments don't end at end of line and the next character may be unstyled. levelNext--; } } if (foldComment && (style == SCE_ECL_COMMENTLINE)) { if ((ch == '/') && (chNext == '/')) { char chNext2 = styler.SafeGetCharAt(i + 2); if (chNext2 == '{') { levelNext++; } else if (chNext2 == '}') { levelNext--; } } } if (foldPreprocessor && (style == SCE_ECL_PREPROCESSOR)) { if (ch == '#') { unsigned int j = i + 1; while ((j < endPos) && IsASpaceOrTab(styler.SafeGetCharAt(j))) { j++; } if (MatchNoCase(styler, j, "region") || MatchNoCase(styler, j, "if")) { levelNext++; } else if (MatchNoCase(styler, j, "endregion") || MatchNoCase(styler, j, "end")) { levelNext--; } } } if (style == SCE_ECL_OPERATOR) { if (ch == '{') { // Measure the minimum before a '{' to allow // folding on "} else {" if (levelMinCurrent > levelNext) { levelMinCurrent = levelNext; } levelNext++; } else if (ch == '}') { levelNext--; } } if (style == SCE_ECL_WORD2) { if (MatchNoCase(styler, i, "record") || MatchNoCase(styler, i, "transform") || MatchNoCase(styler, i, "type") || MatchNoCase(styler, i, "function") || MatchNoCase(styler, i, "module") || MatchNoCase(styler, i, "service") || MatchNoCase(styler, i, "interface") || MatchNoCase(styler, i, "ifblock") || MatchNoCase(styler, i, "macro") || MatchNoCase(styler, i, "beginc++")) { levelNext++; } else if (MatchNoCase(styler, i, "endmacro") || MatchNoCase(styler, i, "endc++") || MatchNoCase(styler, i, "end")) { levelNext--; } } if (atEOL || (i == endPos-1)) { int levelUse = levelCurrent; if (foldAtElse) { levelUse = levelMinCurrent; } int lev = levelUse | levelNext << 16; if (visibleChars == 0 && foldCompact) lev |= SC_FOLDLEVELWHITEFLAG; if (levelUse < levelNext) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) { styler.SetLevel(lineCurrent, lev); } lineCurrent++; levelCurrent = levelNext; levelMinCurrent = levelCurrent; if (atEOL && (i == static_cast(styler.Length()-1))) { // There is an empty line at end of file so give it same level and empty styler.SetLevel(lineCurrent, (levelCurrent | levelCurrent << 16) | SC_FOLDLEVELWHITEFLAG); } visibleChars = 0; } if (!IsASpace(ch)) visibleChars++; } } static const char * const EclWordListDesc[] = { "Keywords", 0 }; LexerModule lmECL( SCLEX_ECL, ColouriseEclDoc, "ecl", FoldEclDoc, EclWordListDesc); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexGui4Cli.cxx000444001750001750 2210711727344243 25054 0ustar00azawawiazawawi000000000000// Scintilla source code edit control // Copyright 1998-2002 by Neil Hodgson /* This is the Lexer for Gui4Cli, included in SciLexer.dll - by d. Keletsekis, 2/10/2003 To add to SciLexer.dll: 1. Add the values below to INCLUDE\Scintilla.iface 2. Run the include/HFacer.py script 3. Run the src/lexGen.py script val SCE_GC_DEFAULT=0 val SCE_GC_COMMENTLINE=1 val SCE_GC_COMMENTBLOCK=2 val SCE_GC_GLOBAL=3 val SCE_GC_EVENT=4 val SCE_GC_ATTRIBUTE=5 val SCE_GC_CONTROL=6 val SCE_GC_COMMAND=7 val SCE_GC_STRING=8 val SCE_GC_OPERATOR=9 */ #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif #define debug Platform::DebugPrintf static inline bool IsAWordChar(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_' || ch =='\\'); } static inline bool IsAWordStart(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '.'); } inline bool isGCOperator(int ch) { if (isalnum(ch)) return false; // '.' left out as it is used to make up numbers if (ch == '*' || ch == '/' || ch == '-' || ch == '+' || ch == '(' || ch == ')' || ch == '=' || ch == '%' || ch == '[' || ch == ']' || ch == '<' || ch == '>' || ch == ',' || ch == ';' || ch == ':') return true; return false; } #define isSpace(x) ((x)==' ' || (x)=='\t') #define isNL(x) ((x)=='\n' || (x)=='\r') #define isSpaceOrNL(x) (isSpace(x) || isNL(x)) #define BUFFSIZE 500 #define isFoldPoint(x) ((styler.LevelAt(x) & SC_FOLDLEVELNUMBERMASK) == 1024) static void colorFirstWord(WordList *keywordlists[], Accessor &styler, StyleContext *sc, char *buff, int length, int) { int c = 0; while (sc->More() && isSpaceOrNL(sc->ch)) { sc->Forward(); } styler.ColourTo(sc->currentPos - 1, sc->state); if (!IsAWordChar(sc->ch)) // comment, marker, etc.. return; while (sc->More() && !isSpaceOrNL(sc->ch) && (c < length-1) && !isGCOperator(sc->ch)) { buff[c] = static_cast(sc->ch); ++c; sc->Forward(); } buff[c] = '\0'; char *p = buff; while (*p) // capitalize.. { if (islower(*p)) *p = static_cast(toupper(*p)); ++p; } WordList &kGlobal = *keywordlists[0]; // keyword lists set by the user WordList &kEvent = *keywordlists[1]; WordList &kAttribute = *keywordlists[2]; WordList &kControl = *keywordlists[3]; WordList &kCommand = *keywordlists[4]; int state = 0; // int level = styler.LevelAt(line) & SC_FOLDLEVELNUMBERMASK; // debug ("line = %d, level = %d", line, level); if (kGlobal.InList(buff)) state = SCE_GC_GLOBAL; else if (kAttribute.InList(buff)) state = SCE_GC_ATTRIBUTE; else if (kControl.InList(buff)) state = SCE_GC_CONTROL; else if (kCommand.InList(buff)) state = SCE_GC_COMMAND; else if (kEvent.InList(buff)) state = SCE_GC_EVENT; if (state) { sc->ChangeState(state); styler.ColourTo(sc->currentPos - 1, sc->state); sc->ChangeState(SCE_GC_DEFAULT); } else { sc->ChangeState(SCE_GC_DEFAULT); styler.ColourTo(sc->currentPos - 1, sc->state); } } // Main colorizing function called by Scintilla static void ColouriseGui4CliDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { styler.StartAt(startPos); int quotestart = 0, oldstate, currentline = styler.GetLine(startPos); styler.StartSegment(startPos); bool noforward; char buff[BUFFSIZE+1]; // buffer for command name StyleContext sc(startPos, length, initStyle, styler); buff[0] = '\0'; // cbuff = 0; if (sc.state != SCE_GC_COMMENTBLOCK) // colorize 1st word.. colorFirstWord(keywordlists, styler, &sc, buff, BUFFSIZE, currentline); while (sc.More()) { noforward = 0; switch (sc.ch) { case '/': if (sc.state == SCE_GC_COMMENTBLOCK || sc.state == SCE_GC_STRING) break; if (sc.chNext == '/') // line comment { sc.SetState (SCE_GC_COMMENTLINE); sc.Forward(); styler.ColourTo(sc.currentPos, sc.state); } else if (sc.chNext == '*') // block comment { sc.SetState(SCE_GC_COMMENTBLOCK); sc.Forward(); styler.ColourTo(sc.currentPos, sc.state); } else styler.ColourTo(sc.currentPos, sc.state); break; case '*': // end of comment block, or operator.. if (sc.state == SCE_GC_STRING) break; if (sc.state == SCE_GC_COMMENTBLOCK && sc.chNext == '/') { sc.Forward(); styler.ColourTo(sc.currentPos, sc.state); sc.ChangeState (SCE_GC_DEFAULT); } else styler.ColourTo(sc.currentPos, sc.state); break; case '\'': case '\"': // strings.. if (sc.state == SCE_GC_COMMENTBLOCK || sc.state == SCE_GC_COMMENTLINE) break; if (sc.state == SCE_GC_STRING) { if (sc.ch == quotestart) // match same quote char.. { styler.ColourTo(sc.currentPos, sc.state); sc.ChangeState(SCE_GC_DEFAULT); quotestart = 0; } } else { styler.ColourTo(sc.currentPos - 1, sc.state); sc.ChangeState(SCE_GC_STRING); quotestart = sc.ch; } break; case ';': // end of commandline character if (sc.state != SCE_GC_COMMENTBLOCK && sc.state != SCE_GC_COMMENTLINE && sc.state != SCE_GC_STRING) { styler.ColourTo(sc.currentPos - 1, sc.state); styler.ColourTo(sc.currentPos, SCE_GC_OPERATOR); sc.ChangeState(SCE_GC_DEFAULT); sc.Forward(); colorFirstWord(keywordlists, styler, &sc, buff, BUFFSIZE, currentline); noforward = 1; // don't move forward - already positioned at next char.. } break; case '+': case '-': case '=': case '!': // operators.. case '<': case '>': case '&': case '|': case '$': if (sc.state != SCE_GC_COMMENTBLOCK && sc.state != SCE_GC_COMMENTLINE && sc.state != SCE_GC_STRING) { styler.ColourTo(sc.currentPos - 1, sc.state); styler.ColourTo(sc.currentPos, SCE_GC_OPERATOR); sc.ChangeState(SCE_GC_DEFAULT); } break; case '\\': // escape - same as operator, but also mark in strings.. if (sc.state != SCE_GC_COMMENTBLOCK && sc.state != SCE_GC_COMMENTLINE) { oldstate = sc.state; styler.ColourTo(sc.currentPos - 1, sc.state); sc.Forward(); // mark also the next char.. styler.ColourTo(sc.currentPos, SCE_GC_OPERATOR); sc.ChangeState(oldstate); } break; case '\n': case '\r': ++currentline; if (sc.state == SCE_GC_COMMENTLINE) { styler.ColourTo(sc.currentPos, sc.state); sc.ChangeState (SCE_GC_DEFAULT); } else if (sc.state != SCE_GC_COMMENTBLOCK) { colorFirstWord(keywordlists, styler, &sc, buff, BUFFSIZE, currentline); noforward = 1; // don't move forward - already positioned at next char.. } break; // case ' ': case '\t': // default : } if (!noforward) sc.Forward(); } sc.Complete(); } // Main folding function called by Scintilla - (based on props (.ini) files function) static void FoldGui4Cli(unsigned int startPos, int length, int, WordList *[], Accessor &styler) { bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; unsigned int endPos = startPos + length; int visibleChars = 0; int lineCurrent = styler.GetLine(startPos); char chNext = styler[startPos]; int styleNext = styler.StyleAt(startPos); bool headerPoint = false; for (unsigned int i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler[i+1]; int style = styleNext; styleNext = styler.StyleAt(i + 1); bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); if (style == SCE_GC_EVENT || style == SCE_GC_GLOBAL) { headerPoint = true; // fold at events and globals } if (atEOL) { int lev = SC_FOLDLEVELBASE+1; if (headerPoint) lev = SC_FOLDLEVELBASE; if (visibleChars == 0 && foldCompact) lev |= SC_FOLDLEVELWHITEFLAG; if (headerPoint) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) // set level, if not already correct { styler.SetLevel(lineCurrent, lev); } lineCurrent++; // re-initialize our flags visibleChars = 0; headerPoint = false; } if (!(isspacechar(ch))) // || (style == SCE_GC_COMMENTLINE) || (style != SCE_GC_COMMENTBLOCK))) visibleChars++; } int lev = headerPoint ? SC_FOLDLEVELBASE : SC_FOLDLEVELBASE+1; int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; styler.SetLevel(lineCurrent, lev | flagsNext); } // I have no idea what these are for.. probably accessible by some message. static const char * const gui4cliWordListDesc[] = { "Globals", "Events", "Attributes", "Control", "Commands", 0 }; // Declare language & pass our function pointers to Scintilla LexerModule lmGui4Cli(SCLEX_GUI4CLI, ColouriseGui4CliDoc, "gui4cli", FoldGui4Cli, gui4cliWordListDesc); #undef debug Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/Accessor.h000444001750001750 157411727344243 24317 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file Accessor.h ** Interfaces between Scintilla and lexers. **/ // Copyright 1998-2010 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #ifndef ACCESSOR_H #define ACCESSOR_H #ifdef SCI_NAMESPACE namespace Scintilla { #endif enum { wsSpace = 1, wsTab = 2, wsSpaceTab = 4, wsInconsistent=8}; class Accessor; class WordList; class PropSetSimple; typedef bool (*PFNIsCommentLeader)(Accessor &styler, int pos, int len); class Accessor : public LexAccessor { public: PropSetSimple *pprops; Accessor(IDocument *pAccess_, PropSetSimple *pprops_); int GetPropertyInt(const char *, int defaultValue=0); int IndentAmount(int line, int *flags, PFNIsCommentLeader pfnIsCommentLeader = 0); }; #ifdef SCI_NAMESPACE } #endif #endif Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/ViewStyle.h000444001750001750 1011411727344243 24516 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file ViewStyle.h ** Store information on how the document is to be viewed. **/ // Copyright 1998-2001 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #ifndef VIEWSTYLE_H #define VIEWSTYLE_H #ifdef SCI_NAMESPACE namespace Scintilla { #endif /** */ class MarginStyle { public: int style; int width; int mask; bool sensitive; int cursor; MarginStyle(); }; /** */ class FontNames { private: char **names; int size; int max; public: FontNames(); ~FontNames(); void Clear(); const char *Save(const char *name); }; class FontRealised : public FontSpecification, public FontMeasurements { // Private so FontRealised objects can not be copied FontRealised(const FontRealised &); FontRealised &operator=(const FontRealised &); public: Font font; FontRealised *frNext; FontRealised(const FontSpecification &fs); virtual ~FontRealised(); void Realise(Surface &surface, int zoomLevel, int technology); FontRealised *Find(const FontSpecification &fs); void FindMaxAscentDescent(unsigned int &maxAscent, unsigned int &maxDescent); }; enum IndentView {ivNone, ivReal, ivLookForward, ivLookBoth}; enum WhiteSpaceVisibility {wsInvisible=0, wsVisibleAlways=1, wsVisibleAfterIndent=2}; /** */ class ViewStyle { public: FontNames fontNames; FontRealised *frFirst; size_t stylesSize; Style *styles; LineMarker markers[MARKER_MAX + 1]; int largestMarkerHeight; Indicator indicators[INDIC_MAX + 1]; int technology; int lineHeight; unsigned int maxAscent; unsigned int maxDescent; XYPOSITION aveCharWidth; XYPOSITION spaceWidth; bool selforeset; ColourDesired selforeground; ColourDesired selAdditionalForeground; bool selbackset; ColourDesired selbackground; ColourDesired selAdditionalBackground; ColourDesired selbackground2; int selAlpha; int selAdditionalAlpha; bool selEOLFilled; bool whitespaceForegroundSet; ColourDesired whitespaceForeground; bool whitespaceBackgroundSet; ColourDesired whitespaceBackground; ColourDesired selbar; ColourDesired selbarlight; bool foldmarginColourSet; ColourDesired foldmarginColour; bool foldmarginHighlightColourSet; ColourDesired foldmarginHighlightColour; bool hotspotForegroundSet; ColourDesired hotspotForeground; bool hotspotBackgroundSet; ColourDesired hotspotBackground; bool hotspotUnderline; bool hotspotSingleLine; /// Margins are ordered: Line Numbers, Selection Margin, Spacing Margin enum { margins=5 }; int leftMarginWidth; ///< Spacing margin on left of text int rightMarginWidth; ///< Spacing margin on left of text int maskInLine; ///< Mask for markers to be put into text because there is nowhere for them to go in margin MarginStyle ms[margins]; int fixedColumnWidth; int zoomLevel; WhiteSpaceVisibility viewWhitespace; int whitespaceSize; IndentView viewIndentationGuides; bool viewEOL; bool showMarkedLines; ColourDesired caretcolour; ColourDesired additionalCaretColour; bool showCaretLineBackground; ColourDesired caretLineBackground; int caretLineAlpha; ColourDesired edgecolour; int edgeState; int caretStyle; int caretWidth; bool someStylesProtected; bool someStylesForceCase; int extraFontFlag; int extraAscent; int extraDescent; int marginStyleOffset; int annotationVisible; int annotationStyleOffset; bool braceHighlightIndicatorSet; int braceHighlightIndicator; bool braceBadLightIndicatorSet; int braceBadLightIndicator; ViewStyle(); ViewStyle(const ViewStyle &source); ~ViewStyle(); void Init(size_t stylesSize_=64); void CreateFont(const FontSpecification &fs); void Refresh(Surface &surface); void AllocStyles(size_t sizeNew); void EnsureStyle(size_t index); void ResetDefaultStyle(); void ClearStyles(); void SetStyleFontName(int styleIndex, const char *name); bool ProtectionActive() const; bool ValidStyle(size_t styleIndex) const; void CalcLargestMarkerHeight(); }; #ifdef SCI_NAMESPACE } #endif #endif Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexD.cxx000444001750001750 4135111727344243 24001 0ustar00azawawiazawawi000000000000/** @file LexD.cxx ** Lexer for D. ** ** Copyright (c) 2006 by Waldemar Augustyn ** Converted to lexer object and added further folding features/properties by "Udo Lechner" **/ // Copyright 1998-2005 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #include "OptionSet.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif /* Nested comments require keeping the value of the nesting level for every position in the document. But since scintilla always styles line by line, we only need to store one value per line. The non-negative number indicates nesting level at the end of the line. */ // Underscore, letter, digit and universal alphas from C99 Appendix D. static bool IsWordStart(int ch) { return (isascii(ch) && (isalpha(ch) || ch == '_')) || !isascii(ch); } static bool IsWord(int ch) { return (isascii(ch) && (isalnum(ch) || ch == '_')) || !isascii(ch); } static bool IsDoxygen(int ch) { if (isascii(ch) && islower(ch)) return true; if (ch == '$' || ch == '@' || ch == '\\' || ch == '&' || ch == '#' || ch == '<' || ch == '>' || ch == '{' || ch == '}' || ch == '[' || ch == ']') return true; return false; } static bool IsStringSuffix(int ch) { return ch == 'c' || ch == 'w' || ch == 'd'; } static bool IsStreamCommentStyle(int style) { return style == SCE_D_COMMENT || style == SCE_D_COMMENTDOC || style == SCE_D_COMMENTDOCKEYWORD || style == SCE_D_COMMENTDOCKEYWORDERROR; } // An individual named option for use in an OptionSet // Options used for LexerD struct OptionsD { bool fold; bool foldSyntaxBased; bool foldComment; bool foldCommentMultiline; bool foldCommentExplicit; std::string foldExplicitStart; std::string foldExplicitEnd; bool foldExplicitAnywhere; bool foldCompact; int foldAtElseInt; bool foldAtElse; OptionsD() { fold = false; foldSyntaxBased = true; foldComment = false; foldCommentMultiline = true; foldCommentExplicit = true; foldExplicitStart = ""; foldExplicitEnd = ""; foldExplicitAnywhere = false; foldCompact = true; foldAtElseInt = -1; foldAtElse = false; } }; static const char * const dWordLists[] = { "Primary keywords and identifiers", "Secondary keywords and identifiers", "Documentation comment keywords", "Type definitions and aliases", "Keywords 5", "Keywords 6", "Keywords 7", 0, }; struct OptionSetD : public OptionSet { OptionSetD() { DefineProperty("fold", &OptionsD::fold); DefineProperty("fold.d.syntax.based", &OptionsD::foldSyntaxBased, "Set this property to 0 to disable syntax based folding."); DefineProperty("fold.comment", &OptionsD::foldComment); DefineProperty("fold.d.comment.multiline", &OptionsD::foldCommentMultiline, "Set this property to 0 to disable folding multi-line comments when fold.comment=1."); DefineProperty("fold.d.comment.explicit", &OptionsD::foldCommentExplicit, "Set this property to 0 to disable folding explicit fold points when fold.comment=1."); DefineProperty("fold.d.explicit.start", &OptionsD::foldExplicitStart, "The string to use for explicit fold start points, replacing the standard //{."); DefineProperty("fold.d.explicit.end", &OptionsD::foldExplicitEnd, "The string to use for explicit fold end points, replacing the standard //}."); DefineProperty("fold.d.explicit.anywhere", &OptionsD::foldExplicitAnywhere, "Set this property to 1 to enable explicit fold points anywhere, not just in line comments."); DefineProperty("fold.compact", &OptionsD::foldCompact); DefineProperty("lexer.d.fold.at.else", &OptionsD::foldAtElseInt, "This option enables D folding on a \"} else {\" line of an if statement."); DefineProperty("fold.at.else", &OptionsD::foldAtElse); DefineWordListSets(dWordLists); } }; class LexerD : public ILexer { bool caseSensitive; WordList keywords; WordList keywords2; WordList keywords3; WordList keywords4; WordList keywords5; WordList keywords6; WordList keywords7; OptionsD options; OptionSetD osD; public: LexerD(bool caseSensitive_) : caseSensitive(caseSensitive_) { } ~LexerD() { } void SCI_METHOD Release() { delete this; } int SCI_METHOD Version() const { return lvOriginal; } const char * SCI_METHOD PropertyNames() { return osD.PropertyNames(); } int SCI_METHOD PropertyType(const char *name) { return osD.PropertyType(name); } const char * SCI_METHOD DescribeProperty(const char *name) { return osD.DescribeProperty(name); } int SCI_METHOD PropertySet(const char *key, const char *val); const char * SCI_METHOD DescribeWordListSets() { return osD.DescribeWordListSets(); } int SCI_METHOD WordListSet(int n, const char *wl); void SCI_METHOD Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess); void SCI_METHOD Fold(unsigned int startPos, int length, int initStyle, IDocument *pAccess); void * SCI_METHOD PrivateCall(int, void *) { return 0; } static ILexer *LexerFactoryD() { return new LexerD(true); } static ILexer *LexerFactoryDInsensitive() { return new LexerD(false); } }; int SCI_METHOD LexerD::PropertySet(const char *key, const char *val) { if (osD.PropertySet(&options, key, val)) { return 0; } return -1; } int SCI_METHOD LexerD::WordListSet(int n, const char *wl) { WordList *wordListN = 0; switch (n) { case 0: wordListN = &keywords; break; case 1: wordListN = &keywords2; break; case 2: wordListN = &keywords3; break; case 3: wordListN = &keywords4; break; case 4: wordListN = &keywords5; break; case 5: wordListN = &keywords6; break; case 6: wordListN = &keywords7; break; } int firstModification = -1; if (wordListN) { WordList wlNew; wlNew.Set(wl); if (*wordListN != wlNew) { wordListN->Set(wl); firstModification = 0; } } return firstModification; } void SCI_METHOD LexerD::Lex(unsigned int startPos, int length, int initStyle, IDocument *pAccess) { LexAccessor styler(pAccess); int styleBeforeDCKeyword = SCE_D_DEFAULT; StyleContext sc(startPos, length, initStyle, styler); int curLine = styler.GetLine(startPos); int curNcLevel = curLine > 0? styler.GetLineState(curLine-1): 0; bool numFloat = false; // Float literals have '+' and '-' signs bool numHex = false; for (; sc.More(); sc.Forward()) { if (sc.atLineStart) { curLine = styler.GetLine(sc.currentPos); styler.SetLineState(curLine, curNcLevel); } // Determine if the current state should terminate. switch (sc.state) { case SCE_D_OPERATOR: sc.SetState(SCE_D_DEFAULT); break; case SCE_D_NUMBER: // We accept almost anything because of hex. and number suffixes if (isascii(sc.ch) && (isalnum(sc.ch) || sc.ch == '_')) { continue; } else if (sc.ch == '.' && sc.chNext != '.' && !numFloat) { // Don't parse 0..2 as number. numFloat=true; continue; } else if ( ( sc.ch == '-' || sc.ch == '+' ) && ( /*sign and*/ ( !numHex && ( sc.chPrev == 'e' || sc.chPrev == 'E' ) ) || /*decimal or*/ ( sc.chPrev == 'p' || sc.chPrev == 'P' ) ) ) { /*hex*/ // Parse exponent sign in float literals: 2e+10 0x2e+10 continue; } else { sc.SetState(SCE_D_DEFAULT); } break; case SCE_D_IDENTIFIER: if (!IsWord(sc.ch)) { char s[1000]; if (caseSensitive) { sc.GetCurrent(s, sizeof(s)); } else { sc.GetCurrentLowered(s, sizeof(s)); } if (keywords.InList(s)) { sc.ChangeState(SCE_D_WORD); } else if (keywords2.InList(s)) { sc.ChangeState(SCE_D_WORD2); } else if (keywords4.InList(s)) { sc.ChangeState(SCE_D_TYPEDEF); } else if (keywords5.InList(s)) { sc.ChangeState(SCE_D_WORD5); } else if (keywords6.InList(s)) { sc.ChangeState(SCE_D_WORD6); } else if (keywords7.InList(s)) { sc.ChangeState(SCE_D_WORD7); } sc.SetState(SCE_D_DEFAULT); } break; case SCE_D_COMMENT: if (sc.Match('*', '/')) { sc.Forward(); sc.ForwardSetState(SCE_D_DEFAULT); } break; case SCE_D_COMMENTDOC: if (sc.Match('*', '/')) { sc.Forward(); sc.ForwardSetState(SCE_D_DEFAULT); } else if (sc.ch == '@' || sc.ch == '\\') { // JavaDoc and Doxygen support // Verify that we have the conditions to mark a comment-doc-keyword if ((IsASpace(sc.chPrev) || sc.chPrev == '*') && (!IsASpace(sc.chNext))) { styleBeforeDCKeyword = SCE_D_COMMENTDOC; sc.SetState(SCE_D_COMMENTDOCKEYWORD); } } break; case SCE_D_COMMENTLINE: if (sc.atLineStart) { sc.SetState(SCE_D_DEFAULT); } break; case SCE_D_COMMENTLINEDOC: if (sc.atLineStart) { sc.SetState(SCE_D_DEFAULT); } else if (sc.ch == '@' || sc.ch == '\\') { // JavaDoc and Doxygen support // Verify that we have the conditions to mark a comment-doc-keyword if ((IsASpace(sc.chPrev) || sc.chPrev == '/' || sc.chPrev == '!') && (!IsASpace(sc.chNext))) { styleBeforeDCKeyword = SCE_D_COMMENTLINEDOC; sc.SetState(SCE_D_COMMENTDOCKEYWORD); } } break; case SCE_D_COMMENTDOCKEYWORD: if ((styleBeforeDCKeyword == SCE_D_COMMENTDOC) && sc.Match('*', '/')) { sc.ChangeState(SCE_D_COMMENTDOCKEYWORDERROR); sc.Forward(); sc.ForwardSetState(SCE_D_DEFAULT); } else if (!IsDoxygen(sc.ch)) { char s[100]; if (caseSensitive) { sc.GetCurrent(s, sizeof(s)); } else { sc.GetCurrentLowered(s, sizeof(s)); } if (!IsASpace(sc.ch) || !keywords3.InList(s + 1)) { sc.ChangeState(SCE_D_COMMENTDOCKEYWORDERROR); } sc.SetState(styleBeforeDCKeyword); } break; case SCE_D_COMMENTNESTED: if (sc.Match('+', '/')) { if (curNcLevel > 0) curNcLevel -= 1; curLine = styler.GetLine(sc.currentPos); styler.SetLineState(curLine, curNcLevel); sc.Forward(); if (curNcLevel == 0) { sc.ForwardSetState(SCE_D_DEFAULT); } } else if (sc.Match('/','+')) { curNcLevel += 1; curLine = styler.GetLine(sc.currentPos); styler.SetLineState(curLine, curNcLevel); sc.Forward(); } break; case SCE_D_STRING: if (sc.ch == '\\') { if (sc.chNext == '"' || sc.chNext == '\\') { sc.Forward(); } } else if (sc.ch == '"') { if(IsStringSuffix(sc.chNext)) sc.Forward(); sc.ForwardSetState(SCE_D_DEFAULT); } break; case SCE_D_CHARACTER: if (sc.atLineEnd) { sc.ChangeState(SCE_D_STRINGEOL); } else if (sc.ch == '\\') { if (sc.chNext == '\'' || sc.chNext == '\\') { sc.Forward(); } } else if (sc.ch == '\'') { // Char has no suffixes sc.ForwardSetState(SCE_D_DEFAULT); } break; case SCE_D_STRINGEOL: if (sc.atLineStart) { sc.SetState(SCE_D_DEFAULT); } break; case SCE_D_STRINGB: if (sc.ch == '`') { if(IsStringSuffix(sc.chNext)) sc.Forward(); sc.ForwardSetState(SCE_D_DEFAULT); } break; case SCE_D_STRINGR: if (sc.ch == '"') { if(IsStringSuffix(sc.chNext)) sc.Forward(); sc.ForwardSetState(SCE_D_DEFAULT); } break; } // Determine if a new state should be entered. if (sc.state == SCE_D_DEFAULT) { if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) { sc.SetState(SCE_D_NUMBER); numFloat = sc.ch == '.'; // Remember hex literal numHex = sc.ch == '0' && ( sc.chNext == 'x' || sc.chNext == 'X' ); } else if ( (sc.ch == 'r' || sc.ch == 'x' || sc.ch == 'q') && sc.chNext == '"' ) { // Limited support for hex and delimited strings: parse as r"" sc.SetState(SCE_D_STRINGR); sc.Forward(); } else if (IsWordStart(sc.ch) || sc.ch == '$') { sc.SetState(SCE_D_IDENTIFIER); } else if (sc.Match('/','+')) { curNcLevel += 1; curLine = styler.GetLine(sc.currentPos); styler.SetLineState(curLine, curNcLevel); sc.SetState(SCE_D_COMMENTNESTED); sc.Forward(); } else if (sc.Match('/', '*')) { if (sc.Match("/**") || sc.Match("/*!")) { // Support of Qt/Doxygen doc. style sc.SetState(SCE_D_COMMENTDOC); } else { sc.SetState(SCE_D_COMMENT); } sc.Forward(); // Eat the * so it isn't used for the end of the comment } else if (sc.Match('/', '/')) { if ((sc.Match("///") && !sc.Match("////")) || sc.Match("//!")) // Support of Qt/Doxygen doc. style sc.SetState(SCE_D_COMMENTLINEDOC); else sc.SetState(SCE_D_COMMENTLINE); } else if (sc.ch == '"') { sc.SetState(SCE_D_STRING); } else if (sc.ch == '\'') { sc.SetState(SCE_D_CHARACTER); } else if (sc.ch == '`') { sc.SetState(SCE_D_STRINGB); } else if (isoperator(static_cast(sc.ch))) { sc.SetState(SCE_D_OPERATOR); if (sc.ch == '.' && sc.chNext == '.') sc.Forward(); // Range operator } } } sc.Complete(); } // Store both the current line's fold level and the next lines in the // level store to make it easy to pick up with each increment // and to make it possible to fiddle the current level for "} else {". void SCI_METHOD LexerD::Fold(unsigned int startPos, int length, int initStyle, IDocument *pAccess) { if (!options.fold) return; LexAccessor styler(pAccess); unsigned int endPos = startPos + length; int visibleChars = 0; int lineCurrent = styler.GetLine(startPos); int levelCurrent = SC_FOLDLEVELBASE; if (lineCurrent > 0) levelCurrent = styler.LevelAt(lineCurrent-1) >> 16; int levelMinCurrent = levelCurrent; int levelNext = levelCurrent; char chNext = styler[startPos]; int styleNext = styler.StyleAt(startPos); int style = initStyle; bool foldAtElse = options.foldAtElseInt >= 0 ? options.foldAtElseInt != 0 : options.foldAtElse; const bool userDefinedFoldMarkers = !options.foldExplicitStart.empty() && !options.foldExplicitEnd.empty(); for (unsigned int i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); int stylePrev = style; style = styleNext; styleNext = styler.StyleAt(i + 1); bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); if (options.foldComment && options.foldCommentMultiline && IsStreamCommentStyle(style)) { if (!IsStreamCommentStyle(stylePrev)) { levelNext++; } else if (!IsStreamCommentStyle(styleNext) && !atEOL) { // Comments don't end at end of line and the next character may be unstyled. levelNext--; } } if (options.foldComment && options.foldCommentExplicit && ((style == SCE_D_COMMENTLINE) || options.foldExplicitAnywhere)) { if (userDefinedFoldMarkers) { if (styler.Match(i, options.foldExplicitStart.c_str())) { levelNext++; } else if (styler.Match(i, options.foldExplicitEnd.c_str())) { levelNext--; } } else { if ((ch == '/') && (chNext == '/')) { char chNext2 = styler.SafeGetCharAt(i + 2); if (chNext2 == '{') { levelNext++; } else if (chNext2 == '}') { levelNext--; } } } } if (options.foldSyntaxBased && (style == SCE_D_OPERATOR)) { if (ch == '{') { // Measure the minimum before a '{' to allow // folding on "} else {" if (levelMinCurrent > levelNext) { levelMinCurrent = levelNext; } levelNext++; } else if (ch == '}') { levelNext--; } } if (atEOL || (i == endPos-1)) { if (options.foldComment && options.foldCommentMultiline) { // Handle nested comments int nc; nc = styler.GetLineState(lineCurrent); nc -= lineCurrent>0? styler.GetLineState(lineCurrent-1): 0; levelNext += nc; } int levelUse = levelCurrent; if (options.foldSyntaxBased && foldAtElse) { levelUse = levelMinCurrent; } int lev = levelUse | levelNext << 16; if (visibleChars == 0 && options.foldCompact) lev |= SC_FOLDLEVELWHITEFLAG; if (levelUse < levelNext) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) { styler.SetLevel(lineCurrent, lev); } lineCurrent++; levelCurrent = levelNext; levelMinCurrent = levelCurrent; visibleChars = 0; } if (!IsASpace(ch)) visibleChars++; } } LexerModule lmD(SCLEX_D, LexerD::LexerFactoryD, "d", dWordLists); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/PositionCache.h000444001750001750 1074411727344243 25324 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file PositionCache.h ** Classes for caching layout information. **/ // Copyright 1998-2009 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #ifndef POSITIONCACHE_H #define POSITIONCACHE_H #ifdef SCI_NAMESPACE namespace Scintilla { #endif static inline bool IsEOLChar(char ch) { return (ch == '\r') || (ch == '\n'); } /** */ class LineLayout { private: friend class LineLayoutCache; int *lineStarts; int lenLineStarts; /// Drawing is only performed for @a maxLineLength characters on each line. int lineNumber; bool inCache; public: enum { wrapWidthInfinite = 0x7ffffff }; int maxLineLength; int numCharsInLine; int numCharsBeforeEOL; enum validLevel { llInvalid, llCheckTextAndStyle, llPositions, llLines } validity; int xHighlightGuide; bool highlightColumn; Selection *psel; bool containsCaret; int edgeColumn; char *chars; unsigned char *styles; int styleBitsSet; char *indicators; XYPOSITION *positions; char bracePreviousStyles[2]; // Hotspot support int hsStart; int hsEnd; // Wrapped line support int widthLine; int lines; XYPOSITION wrapIndent; // In pixels LineLayout(int maxLineLength_); virtual ~LineLayout(); void Resize(int maxLineLength_); void Free(); void Invalidate(validLevel validity_); int LineStart(int line) const; int LineLastVisible(int line) const; bool InLine(int offset, int line) const; void SetLineStart(int line, int start); void SetBracesHighlight(Range rangeLine, Position braces[], char bracesMatchStyle, int xHighlight, bool ignoreStyle); void RestoreBracesHighlight(Range rangeLine, Position braces[], bool ignoreStyle); int FindBefore(XYPOSITION x, int lower, int upper) const; int EndLineStyle() const; }; /** */ class LineLayoutCache { int level; int length; int size; LineLayout **cache; bool allInvalidated; int styleClock; int useCount; void Allocate(int length_); void AllocateForLevel(int linesOnScreen, int linesInDoc); public: LineLayoutCache(); virtual ~LineLayoutCache(); void Deallocate(); enum { llcNone=SC_CACHE_NONE, llcCaret=SC_CACHE_CARET, llcPage=SC_CACHE_PAGE, llcDocument=SC_CACHE_DOCUMENT }; void Invalidate(LineLayout::validLevel validity_); void SetLevel(int level_); int GetLevel() const { return level; } LineLayout *Retrieve(int lineNumber, int lineCaret, int maxChars, int styleClock_, int linesOnScreen, int linesInDoc); void Dispose(LineLayout *ll); }; class PositionCacheEntry { unsigned int styleNumber:8; unsigned int len:8; unsigned int clock:16; XYPOSITION *positions; public: PositionCacheEntry(); ~PositionCacheEntry(); void Set(unsigned int styleNumber_, const char *s_, unsigned int len_, XYPOSITION *positions_, unsigned int clock); void Clear(); bool Retrieve(unsigned int styleNumber_, const char *s_, unsigned int len_, XYPOSITION *positions_) const; static int Hash(unsigned int styleNumber_, const char *s, unsigned int len); bool NewerThan(const PositionCacheEntry &other) const; void ResetClock(); }; // Class to break a line of text into shorter runs at sensible places. class BreakFinder { LineLayout *ll; int lineStart; int lineEnd; int posLineStart; int nextBreak; int *selAndEdge; unsigned int saeSize; unsigned int saeLen; unsigned int saeCurrentPos; int saeNext; int subBreak; Document *pdoc; void Insert(int val); public: // If a whole run is longer than lengthStartSubdivision then subdivide // into smaller runs at spaces or punctuation. enum { lengthStartSubdivision = 300 }; // Try to make each subdivided run lengthEachSubdivision or shorter. enum { lengthEachSubdivision = 100 }; BreakFinder(LineLayout *ll_, int lineStart_, int lineEnd_, int posLineStart_, int xStart, bool breakForSelection, Document *pdoc_); ~BreakFinder(); int First() const; int Next(); }; class PositionCache { PositionCacheEntry *pces; size_t size; unsigned int clock; bool allClear; public: PositionCache(); ~PositionCache(); void Clear(); void SetSize(size_t size_); size_t GetSize() const { return size; } void MeasureWidths(Surface *surface, ViewStyle &vstyle, unsigned int styleNumber, const char *s, unsigned int len, XYPOSITION *positions, Document *pdoc); }; inline bool IsSpaceOrTab(int ch) { return ch == ' ' || ch == '\t'; } #ifdef SCI_NAMESPACE } #endif #endif Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexNsis.cxx000444001750001750 4570511727344243 24541 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexNsis.cxx ** Lexer for NSIS **/ // Copyright 2003 - 2005 by Angelo Mandato // Last Updated: 03/13/2005 // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif /* // located in SciLexer.h #define SCLEX_NSIS 43 #define SCE_NSIS_DEFAULT 0 #define SCE_NSIS_COMMENT 1 #define SCE_NSIS_STRINGDQ 2 #define SCE_NSIS_STRINGLQ 3 #define SCE_NSIS_STRINGRQ 4 #define SCE_NSIS_FUNCTION 5 #define SCE_NSIS_VARIABLE 6 #define SCE_NSIS_LABEL 7 #define SCE_NSIS_USERDEFINED 8 #define SCE_NSIS_SECTIONDEF 9 #define SCE_NSIS_SUBSECTIONDEF 10 #define SCE_NSIS_IFDEFINEDEF 11 #define SCE_NSIS_MACRODEF 12 #define SCE_NSIS_STRINGVAR 13 #define SCE_NSIS_NUMBER 14 // ADDED for Scintilla v1.63 #define SCE_NSIS_SECTIONGROUP 15 #define SCE_NSIS_PAGEEX 16 #define SCE_NSIS_FUNCTIONDEF 17 #define SCE_NSIS_COMMENTBOX 18 */ static bool isNsisNumber(char ch) { return (ch >= '0' && ch <= '9'); } static bool isNsisChar(char ch) { return (ch == '.' ) || (ch == '_' ) || isNsisNumber(ch) || (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z'); } static bool isNsisLetter(char ch) { return (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z'); } static bool NsisNextLineHasElse(unsigned int start, unsigned int end, Accessor &styler) { int nNextLine = -1; for( unsigned int i = start; i < end; i++ ) { char cNext = styler.SafeGetCharAt( i ); if( cNext == '\n' ) { nNextLine = i+1; break; } } if( nNextLine == -1 ) // We never found the next line... return false; for( unsigned int firstChar = nNextLine; firstChar < end; firstChar++ ) { char cNext = styler.SafeGetCharAt( firstChar ); if( cNext == ' ' ) continue; if( cNext == '\t' ) continue; if( cNext == '!' ) { if( styler.Match(firstChar, "!else") ) return true; } break; } return false; } static int NsisCmp( const char *s1, const char *s2, bool bIgnoreCase ) { if( bIgnoreCase ) return CompareCaseInsensitive( s1, s2); return strcmp( s1, s2 ); } static int calculateFoldNsis(unsigned int start, unsigned int end, int foldlevel, Accessor &styler, bool bElse, bool foldUtilityCmd ) { int style = styler.StyleAt(end); // If the word is too long, it is not what we are looking for if( end - start > 20 ) return foldlevel; if( foldUtilityCmd ) { // Check the style at this point, if it is not valid, then return zero if( style != SCE_NSIS_FUNCTIONDEF && style != SCE_NSIS_SECTIONDEF && style != SCE_NSIS_SUBSECTIONDEF && style != SCE_NSIS_IFDEFINEDEF && style != SCE_NSIS_MACRODEF && style != SCE_NSIS_SECTIONGROUP && style != SCE_NSIS_PAGEEX ) return foldlevel; } else { if( style != SCE_NSIS_FUNCTIONDEF && style != SCE_NSIS_SECTIONDEF && style != SCE_NSIS_SUBSECTIONDEF && style != SCE_NSIS_SECTIONGROUP && style != SCE_NSIS_PAGEEX ) return foldlevel; } int newFoldlevel = foldlevel; bool bIgnoreCase = false; if( styler.GetPropertyInt("nsis.ignorecase") == 1 ) bIgnoreCase = true; char s[20]; // The key word we are looking for has atmost 13 characters s[0] = '\0'; for (unsigned int i = 0; i < end - start + 1 && i < 19; i++) { s[i] = static_cast( styler[ start + i ] ); s[i + 1] = '\0'; } if( s[0] == '!' ) { if( NsisCmp(s, "!ifndef", bIgnoreCase) == 0 || NsisCmp(s, "!ifdef", bIgnoreCase ) == 0 || NsisCmp(s, "!ifmacrodef", bIgnoreCase ) == 0 || NsisCmp(s, "!ifmacrondef", bIgnoreCase ) == 0 || NsisCmp(s, "!if", bIgnoreCase ) == 0 || NsisCmp(s, "!macro", bIgnoreCase ) == 0 ) newFoldlevel++; else if( NsisCmp(s, "!endif", bIgnoreCase) == 0 || NsisCmp(s, "!macroend", bIgnoreCase ) == 0 ) newFoldlevel--; else if( bElse && NsisCmp(s, "!else", bIgnoreCase) == 0 ) newFoldlevel++; } else { if( NsisCmp(s, "Section", bIgnoreCase ) == 0 || NsisCmp(s, "SectionGroup", bIgnoreCase ) == 0 || NsisCmp(s, "Function", bIgnoreCase) == 0 || NsisCmp(s, "SubSection", bIgnoreCase ) == 0 || NsisCmp(s, "PageEx", bIgnoreCase ) == 0 ) newFoldlevel++; else if( NsisCmp(s, "SectionGroupEnd", bIgnoreCase ) == 0 || NsisCmp(s, "SubSectionEnd", bIgnoreCase ) == 0 || NsisCmp(s, "FunctionEnd", bIgnoreCase) == 0 || NsisCmp(s, "SectionEnd", bIgnoreCase ) == 0 || NsisCmp(s, "PageExEnd", bIgnoreCase ) == 0 ) newFoldlevel--; } return newFoldlevel; } static int classifyWordNsis(unsigned int start, unsigned int end, WordList *keywordLists[], Accessor &styler ) { bool bIgnoreCase = false; if( styler.GetPropertyInt("nsis.ignorecase") == 1 ) bIgnoreCase = true; bool bUserVars = false; if( styler.GetPropertyInt("nsis.uservars") == 1 ) bUserVars = true; char s[100]; WordList &Functions = *keywordLists[0]; WordList &Variables = *keywordLists[1]; WordList &Lables = *keywordLists[2]; WordList &UserDefined = *keywordLists[3]; for (unsigned int i = 0; i < end - start + 1 && i < 99; i++) { if( bIgnoreCase ) s[i] = static_cast( tolower(styler[ start + i ] ) ); else s[i] = static_cast( styler[ start + i ] ); s[i + 1] = '\0'; } // Check for special words... if( NsisCmp(s, "!macro", bIgnoreCase ) == 0 || NsisCmp(s, "!macroend", bIgnoreCase) == 0 ) // Covers !macro and !macroend return SCE_NSIS_MACRODEF; if( NsisCmp(s, "!ifdef", bIgnoreCase ) == 0 || NsisCmp(s, "!ifndef", bIgnoreCase) == 0 || NsisCmp(s, "!endif", bIgnoreCase) == 0 ) // Covers !ifdef, !ifndef and !endif return SCE_NSIS_IFDEFINEDEF; if( NsisCmp(s, "!if", bIgnoreCase ) == 0 || NsisCmp(s, "!else", bIgnoreCase ) == 0 ) // Covers !if and else return SCE_NSIS_IFDEFINEDEF; if (NsisCmp(s, "!ifmacrodef", bIgnoreCase ) == 0 || NsisCmp(s, "!ifmacrondef", bIgnoreCase ) == 0 ) // Covers !ifmacrodef and !ifnmacrodef return SCE_NSIS_IFDEFINEDEF; if( NsisCmp(s, "SectionGroup", bIgnoreCase) == 0 || NsisCmp(s, "SectionGroupEnd", bIgnoreCase) == 0 ) // Covers SectionGroup and SectionGroupEnd return SCE_NSIS_SECTIONGROUP; if( NsisCmp(s, "Section", bIgnoreCase ) == 0 || NsisCmp(s, "SectionEnd", bIgnoreCase) == 0 ) // Covers Section and SectionEnd return SCE_NSIS_SECTIONDEF; if( NsisCmp(s, "SubSection", bIgnoreCase) == 0 || NsisCmp(s, "SubSectionEnd", bIgnoreCase) == 0 ) // Covers SubSection and SubSectionEnd return SCE_NSIS_SUBSECTIONDEF; if( NsisCmp(s, "PageEx", bIgnoreCase) == 0 || NsisCmp(s, "PageExEnd", bIgnoreCase) == 0 ) // Covers PageEx and PageExEnd return SCE_NSIS_PAGEEX; if( NsisCmp(s, "Function", bIgnoreCase) == 0 || NsisCmp(s, "FunctionEnd", bIgnoreCase) == 0 ) // Covers Function and FunctionEnd return SCE_NSIS_FUNCTIONDEF; if ( Functions.InList(s) ) return SCE_NSIS_FUNCTION; if ( Variables.InList(s) ) return SCE_NSIS_VARIABLE; if ( Lables.InList(s) ) return SCE_NSIS_LABEL; if( UserDefined.InList(s) ) return SCE_NSIS_USERDEFINED; if( strlen(s) > 3 ) { if( s[1] == '{' && s[strlen(s)-1] == '}' ) return SCE_NSIS_VARIABLE; } // See if the variable is a user defined variable if( s[0] == '$' && bUserVars ) { bool bHasSimpleNsisChars = true; for (unsigned int j = 1; j < end - start + 1 && j < 99; j++) { if( !isNsisChar( s[j] ) ) { bHasSimpleNsisChars = false; break; } } if( bHasSimpleNsisChars ) return SCE_NSIS_VARIABLE; } // To check for numbers if( isNsisNumber( s[0] ) ) { bool bHasSimpleNsisNumber = true; for (unsigned int j = 1; j < end - start + 1 && j < 99; j++) { if( !isNsisNumber( s[j] ) ) { bHasSimpleNsisNumber = false; break; } } if( bHasSimpleNsisNumber ) return SCE_NSIS_NUMBER; } return SCE_NSIS_DEFAULT; } static void ColouriseNsisDoc(unsigned int startPos, int length, int, WordList *keywordLists[], Accessor &styler) { int state = SCE_NSIS_DEFAULT; if( startPos > 0 ) state = styler.StyleAt(startPos-1); // Use the style from the previous line, usually default, but could be commentbox styler.StartAt( startPos ); styler.GetLine( startPos ); unsigned int nLengthDoc = startPos + length; styler.StartSegment( startPos ); char cCurrChar; bool bVarInString = false; bool bClassicVarInString = false; unsigned int i; for( i = startPos; i < nLengthDoc; i++ ) { cCurrChar = styler.SafeGetCharAt( i ); char cNextChar = styler.SafeGetCharAt(i+1); switch(state) { case SCE_NSIS_DEFAULT: if( cCurrChar == ';' || cCurrChar == '#' ) // we have a comment line { styler.ColourTo(i-1, state ); state = SCE_NSIS_COMMENT; break; } if( cCurrChar == '"' ) { styler.ColourTo(i-1, state ); state = SCE_NSIS_STRINGDQ; bVarInString = false; bClassicVarInString = false; break; } if( cCurrChar == '\'' ) { styler.ColourTo(i-1, state ); state = SCE_NSIS_STRINGRQ; bVarInString = false; bClassicVarInString = false; break; } if( cCurrChar == '`' ) { styler.ColourTo(i-1, state ); state = SCE_NSIS_STRINGLQ; bVarInString = false; bClassicVarInString = false; break; } // NSIS KeyWord,Function, Variable, UserDefined: if( cCurrChar == '$' || isNsisChar(cCurrChar) || cCurrChar == '!' ) { styler.ColourTo(i-1,state); state = SCE_NSIS_FUNCTION; // If it is a number, we must check and set style here first... if( isNsisNumber(cCurrChar) && (cNextChar == '\t' || cNextChar == ' ' || cNextChar == '\r' || cNextChar == '\n' ) ) styler.ColourTo( i, SCE_NSIS_NUMBER); break; } if( cCurrChar == '/' && cNextChar == '*' ) { styler.ColourTo(i-1,state); state = SCE_NSIS_COMMENTBOX; break; } break; case SCE_NSIS_COMMENT: if( cNextChar == '\n' || cNextChar == '\r' ) { // Special case: if( cCurrChar == '\\' ) { styler.ColourTo(i-2,state); styler.ColourTo(i,SCE_NSIS_DEFAULT); } else { styler.ColourTo(i,state); state = SCE_NSIS_DEFAULT; } } break; case SCE_NSIS_STRINGDQ: case SCE_NSIS_STRINGLQ: case SCE_NSIS_STRINGRQ: if( styler.SafeGetCharAt(i-1) == '\\' && styler.SafeGetCharAt(i-2) == '$' ) break; // Ignore the next character, even if it is a quote of some sort if( cCurrChar == '"' && state == SCE_NSIS_STRINGDQ ) { styler.ColourTo(i,state); state = SCE_NSIS_DEFAULT; break; } if( cCurrChar == '`' && state == SCE_NSIS_STRINGLQ ) { styler.ColourTo(i,state); state = SCE_NSIS_DEFAULT; break; } if( cCurrChar == '\'' && state == SCE_NSIS_STRINGRQ ) { styler.ColourTo(i,state); state = SCE_NSIS_DEFAULT; break; } if( cNextChar == '\r' || cNextChar == '\n' ) { int nCurLine = styler.GetLine(i+1); int nBack = i; // We need to check if the previous line has a \ in it... bool bNextLine = false; while( nBack > 0 ) { if( styler.GetLine(nBack) != nCurLine ) break; char cTemp = styler.SafeGetCharAt(nBack, 'a'); // Letter 'a' is safe here if( cTemp == '\\' ) { bNextLine = true; break; } if( cTemp != '\r' && cTemp != '\n' && cTemp != '\t' && cTemp != ' ' ) break; nBack--; } if( bNextLine ) { styler.ColourTo(i+1,state); } if( bNextLine == false ) { styler.ColourTo(i,state); state = SCE_NSIS_DEFAULT; } } break; case SCE_NSIS_FUNCTION: // NSIS KeyWord: if( cCurrChar == '$' ) state = SCE_NSIS_DEFAULT; else if( cCurrChar == '\\' && (cNextChar == 'n' || cNextChar == 'r' || cNextChar == 't' ) ) state = SCE_NSIS_DEFAULT; else if( (isNsisChar(cCurrChar) && !isNsisChar( cNextChar) && cNextChar != '}') || cCurrChar == '}' ) { state = classifyWordNsis( styler.GetStartSegment(), i, keywordLists, styler ); styler.ColourTo( i, state); state = SCE_NSIS_DEFAULT; } else if( !isNsisChar( cCurrChar ) && cCurrChar != '{' && cCurrChar != '}' ) { if( classifyWordNsis( styler.GetStartSegment(), i-1, keywordLists, styler) == SCE_NSIS_NUMBER ) styler.ColourTo( i-1, SCE_NSIS_NUMBER ); state = SCE_NSIS_DEFAULT; if( cCurrChar == '"' ) { state = SCE_NSIS_STRINGDQ; bVarInString = false; bClassicVarInString = false; } else if( cCurrChar == '`' ) { state = SCE_NSIS_STRINGLQ; bVarInString = false; bClassicVarInString = false; } else if( cCurrChar == '\'' ) { state = SCE_NSIS_STRINGRQ; bVarInString = false; bClassicVarInString = false; } else if( cCurrChar == '#' || cCurrChar == ';' ) { state = SCE_NSIS_COMMENT; } } break; case SCE_NSIS_COMMENTBOX: if( styler.SafeGetCharAt(i-1) == '*' && cCurrChar == '/' ) { styler.ColourTo(i,state); state = SCE_NSIS_DEFAULT; } break; } if( state == SCE_NSIS_COMMENT || state == SCE_NSIS_COMMENTBOX ) { styler.ColourTo(i,state); } else if( state == SCE_NSIS_STRINGDQ || state == SCE_NSIS_STRINGLQ || state == SCE_NSIS_STRINGRQ ) { bool bIngoreNextDollarSign = false; bool bUserVars = false; if( styler.GetPropertyInt("nsis.uservars") == 1 ) bUserVars = true; if( bVarInString && cCurrChar == '$' ) { bVarInString = false; bIngoreNextDollarSign = true; } else if( bVarInString && cCurrChar == '\\' && (cNextChar == 'n' || cNextChar == 'r' || cNextChar == 't' || cNextChar == '"' || cNextChar == '`' || cNextChar == '\'' ) ) { styler.ColourTo( i+1, SCE_NSIS_STRINGVAR); bVarInString = false; bIngoreNextDollarSign = false; } // Covers "$INSTDIR and user vars like $MYVAR" else if( bVarInString && !isNsisChar(cNextChar) ) { int nWordState = classifyWordNsis( styler.GetStartSegment(), i, keywordLists, styler); if( nWordState == SCE_NSIS_VARIABLE ) styler.ColourTo( i, SCE_NSIS_STRINGVAR); else if( bUserVars ) styler.ColourTo( i, SCE_NSIS_STRINGVAR); bVarInString = false; } // Covers "${TEST}..." else if( bClassicVarInString && cNextChar == '}' ) { styler.ColourTo( i+1, SCE_NSIS_STRINGVAR); bClassicVarInString = false; } // Start of var in string if( !bIngoreNextDollarSign && cCurrChar == '$' && cNextChar == '{' ) { styler.ColourTo( i-1, state); bClassicVarInString = true; bVarInString = false; } else if( !bIngoreNextDollarSign && cCurrChar == '$' ) { styler.ColourTo( i-1, state); bVarInString = true; bClassicVarInString = false; } } } // Colourise remaining document styler.ColourTo(nLengthDoc-1,state); } static void FoldNsisDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) { // No folding enabled, no reason to continue... if( styler.GetPropertyInt("fold") == 0 ) return; bool foldAtElse = styler.GetPropertyInt("fold.at.else", 0) == 1; bool foldUtilityCmd = styler.GetPropertyInt("nsis.foldutilcmd", 1) == 1; bool blockComment = false; int lineCurrent = styler.GetLine(startPos); unsigned int safeStartPos = styler.LineStart( lineCurrent ); bool bArg1 = true; int nWordStart = -1; int levelCurrent = SC_FOLDLEVELBASE; if (lineCurrent > 0) levelCurrent = styler.LevelAt(lineCurrent-1) >> 16; int levelNext = levelCurrent; int style = styler.StyleAt(safeStartPos); if( style == SCE_NSIS_COMMENTBOX ) { if( styler.SafeGetCharAt(safeStartPos) == '/' && styler.SafeGetCharAt(safeStartPos+1) == '*' ) levelNext++; blockComment = true; } for (unsigned int i = safeStartPos; i < startPos + length; i++) { char chCurr = styler.SafeGetCharAt(i); style = styler.StyleAt(i); if( blockComment && style != SCE_NSIS_COMMENTBOX ) { levelNext--; blockComment = false; } else if( !blockComment && style == SCE_NSIS_COMMENTBOX ) { levelNext++; blockComment = true; } if( bArg1 && !blockComment) { if( nWordStart == -1 && (isNsisLetter(chCurr) || chCurr == '!') ) { nWordStart = i; } else if( isNsisLetter(chCurr) == false && nWordStart > -1 ) { int newLevel = calculateFoldNsis( nWordStart, i-1, levelNext, styler, foldAtElse, foldUtilityCmd ); if( newLevel == levelNext ) { if( foldAtElse && foldUtilityCmd ) { if( NsisNextLineHasElse(i, startPos + length, styler) ) levelNext--; } } else levelNext = newLevel; bArg1 = false; } } if( chCurr == '\n' ) { if( bArg1 && foldAtElse && foldUtilityCmd && !blockComment ) { if( NsisNextLineHasElse(i, startPos + length, styler) ) levelNext--; } // If we are on a new line... int levelUse = levelCurrent; int lev = levelUse | levelNext << 16; if (levelUse < levelNext ) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) styler.SetLevel(lineCurrent, lev); lineCurrent++; levelCurrent = levelNext; bArg1 = true; // New line, lets look at first argument again nWordStart = -1; } } int levelUse = levelCurrent; int lev = levelUse | levelNext << 16; if (levelUse < levelNext) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) styler.SetLevel(lineCurrent, lev); } static const char * const nsisWordLists[] = { "Functions", "Variables", "Lables", "UserDefined", 0, }; LexerModule lmNsis(SCLEX_NSIS, ColouriseNsisDoc, "nsis", FoldNsisDoc, nsisWordLists); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/Decoration.h000444001750001750 270311727344243 24637 0ustar00azawawiazawawi000000000000/** @file Decoration.h ** Visual elements added over text. **/ // Copyright 1998-2007 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #ifndef DECORATION_H #define DECORATION_H #ifdef SCI_NAMESPACE namespace Scintilla { #endif class Decoration { public: Decoration *next; RunStyles rs; int indicator; Decoration(int indicator_); ~Decoration(); bool Empty(); }; class DecorationList { int currentIndicator; int currentValue; Decoration *current; int lengthDocument; Decoration *DecorationFromIndicator(int indicator); Decoration *Create(int indicator, int length); void Delete(int indicator); void DeleteAnyEmpty(); public: Decoration *root; bool clickNotified; DecorationList(); ~DecorationList(); void SetCurrentIndicator(int indicator); int GetCurrentIndicator() const { return currentIndicator; } void SetCurrentValue(int value); int GetCurrentValue() const { return currentValue; } // Returns true if some values may have changed bool FillRange(int &position, int value, int &fillLength); void InsertSpace(int position, int insertLength); void DeleteRange(int position, int deleteLength); int AllOnFor(int position); int ValueAt(int indicator, int position); int Start(int indicator, int position); int End(int indicator, int position); }; #ifdef SCI_NAMESPACE } #endif #endif Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexErlang.cxx000444001750001750 4116511727344243 25031 0ustar00azawawiazawawi000000000000// Scintilla source code edit control // Copyright 1998-2001 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. /** @file LexErlang.cxx ** Lexer for Erlang. ** Enhanced by Etienne 'Lenain' Girondel (lenaing@gmail.com) ** Originally wrote by Peter-Henry Mander, ** based on Matlab lexer by José Fonseca. **/ #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static int is_radix(int radix, int ch) { int digit; if (36 < radix || 2 > radix) return 0; if (isdigit(ch)) { digit = ch - '0'; } else if (isalnum(ch)) { digit = toupper(ch) - 'A' + 10; } else { return 0; } return (digit < radix); } typedef enum { STATE_NULL, COMMENT, COMMENT_FUNCTION, COMMENT_MODULE, COMMENT_DOC, COMMENT_DOC_MACRO, ATOM_UNQUOTED, ATOM_QUOTED, NODE_NAME_UNQUOTED, NODE_NAME_QUOTED, MACRO_START, MACRO_UNQUOTED, MACRO_QUOTED, RECORD_START, RECORD_UNQUOTED, RECORD_QUOTED, NUMERAL_START, NUMERAL_BASE_VALUE, NUMERAL_FLOAT, NUMERAL_EXPONENT, PREPROCESSOR } atom_parse_state_t; static inline bool IsAWordChar(const int ch) { return (ch < 0x80) && (ch != ' ') && (isalnum(ch) || ch == '_'); } static void ColouriseErlangDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { StyleContext sc(startPos, length, initStyle, styler); WordList &reservedWords = *keywordlists[0]; WordList &erlangBIFs = *keywordlists[1]; WordList &erlangPreproc = *keywordlists[2]; WordList &erlangModulesAtt = *keywordlists[3]; WordList &erlangDoc = *keywordlists[4]; WordList &erlangDocMacro = *keywordlists[5]; int radix_digits = 0; int exponent_digits = 0; atom_parse_state_t parse_state = STATE_NULL; atom_parse_state_t old_parse_state = STATE_NULL; bool to_late_to_comment = false; char cur[100]; int old_style = SCE_ERLANG_DEFAULT; styler.StartAt(startPos); for (; sc.More(); sc.Forward()) { int style = SCE_ERLANG_DEFAULT; if (STATE_NULL != parse_state) { switch (parse_state) { case STATE_NULL : sc.SetState(SCE_ERLANG_DEFAULT); break; /* COMMENTS ------------------------------------------------------*/ case COMMENT : { if (sc.ch != '%') { to_late_to_comment = true; } else if (!to_late_to_comment && sc.ch == '%') { // Switch to comment level 2 (Function) sc.ChangeState(SCE_ERLANG_COMMENT_FUNCTION); old_style = SCE_ERLANG_COMMENT_FUNCTION; parse_state = COMMENT_FUNCTION; sc.Forward(); } } // V--- Falling through! case COMMENT_FUNCTION : { if (sc.ch != '%') { to_late_to_comment = true; } else if (!to_late_to_comment && sc.ch == '%') { // Switch to comment level 3 (Module) sc.ChangeState(SCE_ERLANG_COMMENT_MODULE); old_style = SCE_ERLANG_COMMENT_MODULE; parse_state = COMMENT_MODULE; sc.Forward(); } } // V--- Falling through! case COMMENT_MODULE : { if (parse_state != COMMENT) { // Search for comment documentation if (sc.chNext == '@') { old_parse_state = parse_state; parse_state = ('{' == sc.ch) ? COMMENT_DOC_MACRO : COMMENT_DOC; sc.ForwardSetState(sc.state); } } // All comments types fall here. if (sc.atLineEnd) { to_late_to_comment = false; sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } } break; case COMMENT_DOC : // V--- Falling through! case COMMENT_DOC_MACRO : { if (!isalnum(sc.ch)) { // Try to match documentation comment sc.GetCurrent(cur, sizeof(cur)); if (parse_state == COMMENT_DOC_MACRO && erlangDocMacro.InList(cur)) { sc.ChangeState(SCE_ERLANG_COMMENT_DOC_MACRO); while (sc.ch != '}' && !sc.atLineEnd) sc.Forward(); } else if (erlangDoc.InList(cur)) { sc.ChangeState(SCE_ERLANG_COMMENT_DOC); } else { sc.ChangeState(old_style); } // Switch back to old state sc.SetState(old_style); parse_state = old_parse_state; } if (sc.atLineEnd) { to_late_to_comment = false; sc.ChangeState(old_style); sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } } break; /* -------------------------------------------------------------- */ /* Atoms ---------------------------------------------------------*/ case ATOM_UNQUOTED : { if ('@' == sc.ch){ parse_state = NODE_NAME_UNQUOTED; } else if (sc.ch == ':') { // Searching for module name if (sc.chNext == ' ') { // error sc.ChangeState(SCE_ERLANG_UNKNOWN); parse_state = STATE_NULL; } else { sc.Forward(); if (isalnum(sc.ch)) { sc.GetCurrent(cur, sizeof(cur)); sc.ChangeState(SCE_ERLANG_MODULES); sc.SetState(SCE_ERLANG_MODULES); } } } else if (!IsAWordChar(sc.ch)) { sc.GetCurrent(cur, sizeof(cur)); if (reservedWords.InList(cur)) { style = SCE_ERLANG_KEYWORD; } else if (erlangBIFs.InList(cur) && strcmp(cur,"erlang:")){ style = SCE_ERLANG_BIFS; } else if (sc.ch == '(' || '/' == sc.ch){ style = SCE_ERLANG_FUNCTION_NAME; } else { style = SCE_ERLANG_ATOM; } sc.ChangeState(style); sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } } break; case ATOM_QUOTED : { if ( '@' == sc.ch ){ parse_state = NODE_NAME_QUOTED; } else if ('\'' == sc.ch && '\\' != sc.chPrev) { sc.ChangeState(SCE_ERLANG_ATOM); sc.ForwardSetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } } break; /* -------------------------------------------------------------- */ /* Node names ----------------------------------------------------*/ case NODE_NAME_UNQUOTED : { if ('@' == sc.ch) { sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } else if (!IsAWordChar(sc.ch)) { sc.ChangeState(SCE_ERLANG_NODE_NAME); sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } } break; case NODE_NAME_QUOTED : { if ('@' == sc.ch) { sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } else if ('\'' == sc.ch && '\\' != sc.chPrev) { sc.ChangeState(SCE_ERLANG_NODE_NAME_QUOTED); sc.ForwardSetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } } break; /* -------------------------------------------------------------- */ /* Records -------------------------------------------------------*/ case RECORD_START : { if ('\'' == sc.ch) { parse_state = RECORD_QUOTED; } else if (isalpha(sc.ch) && islower(sc.ch)) { parse_state = RECORD_UNQUOTED; } else { // error sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } } break; case RECORD_UNQUOTED : { if (!IsAWordChar(sc.ch)) { sc.ChangeState(SCE_ERLANG_RECORD); sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } } break; case RECORD_QUOTED : { if ('\'' == sc.ch && '\\' != sc.chPrev) { sc.ChangeState(SCE_ERLANG_RECORD_QUOTED); sc.ForwardSetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } } break; /* -------------------------------------------------------------- */ /* Macros --------------------------------------------------------*/ case MACRO_START : { if ('\'' == sc.ch) { parse_state = MACRO_QUOTED; } else if (isalpha(sc.ch)) { parse_state = MACRO_UNQUOTED; } else { // error sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } } break; case MACRO_UNQUOTED : { if (!IsAWordChar(sc.ch)) { sc.ChangeState(SCE_ERLANG_MACRO); sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } } break; case MACRO_QUOTED : { if ('\'' == sc.ch && '\\' != sc.chPrev) { sc.ChangeState(SCE_ERLANG_MACRO_QUOTED); sc.ForwardSetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } } break; /* -------------------------------------------------------------- */ /* Numerics ------------------------------------------------------*/ /* Simple integer */ case NUMERAL_START : { if (isdigit(sc.ch)) { radix_digits *= 10; radix_digits += sc.ch - '0'; // Assuming ASCII here! } else if ('#' == sc.ch) { if (2 > radix_digits || 36 < radix_digits) { sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } else { parse_state = NUMERAL_BASE_VALUE; } } else if ('.' == sc.ch && isdigit(sc.chNext)) { radix_digits = 0; parse_state = NUMERAL_FLOAT; } else if ('e' == sc.ch || 'E' == sc.ch) { exponent_digits = 0; parse_state = NUMERAL_EXPONENT; } else { radix_digits = 0; sc.ChangeState(SCE_ERLANG_NUMBER); sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } } break; /* Integer in other base than 10 (x#yyy) */ case NUMERAL_BASE_VALUE : { if (!is_radix(radix_digits,sc.ch)) { radix_digits = 0; if (!isalnum(sc.ch)) sc.ChangeState(SCE_ERLANG_NUMBER); sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } } break; /* Float (x.yyy) */ case NUMERAL_FLOAT : { if ('e' == sc.ch || 'E' == sc.ch) { exponent_digits = 0; parse_state = NUMERAL_EXPONENT; } else if (!isdigit(sc.ch)) { sc.ChangeState(SCE_ERLANG_NUMBER); sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } } break; /* Exponent, either integer or float (xEyy, x.yyEzzz) */ case NUMERAL_EXPONENT : { if (('-' == sc.ch || '+' == sc.ch) && (isdigit(sc.chNext))) { sc.Forward(); } else if (!isdigit(sc.ch)) { if (0 < exponent_digits) sc.ChangeState(SCE_ERLANG_NUMBER); sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } else { ++exponent_digits; } } break; /* -------------------------------------------------------------- */ /* Preprocessor --------------------------------------------------*/ case PREPROCESSOR : { if (!IsAWordChar(sc.ch)) { sc.GetCurrent(cur, sizeof(cur)); if (erlangPreproc.InList(cur)) { style = SCE_ERLANG_PREPROC; } else if (erlangModulesAtt.InList(cur)) { style = SCE_ERLANG_MODULES_ATT; } sc.ChangeState(style); sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } } break; } } /* End of : STATE_NULL != parse_state */ else { switch (sc.state) { case SCE_ERLANG_VARIABLE : { if (!IsAWordChar(sc.ch)) sc.SetState(SCE_ERLANG_DEFAULT); } break; case SCE_ERLANG_STRING : { if (sc.ch == '\"' && sc.chPrev != '\\') sc.ForwardSetState(SCE_ERLANG_DEFAULT); } break; case SCE_ERLANG_COMMENT : { if (sc.atLineEnd) sc.SetState(SCE_ERLANG_DEFAULT); } break; case SCE_ERLANG_CHARACTER : { if (sc.chPrev == '\\') { sc.ForwardSetState(SCE_ERLANG_DEFAULT); } else if (sc.ch != '\\') { sc.ForwardSetState(SCE_ERLANG_DEFAULT); } } break; case SCE_ERLANG_OPERATOR : { if (sc.chPrev == '.') { if (sc.ch == '*' || sc.ch == '/' || sc.ch == '\\' || sc.ch == '^') { sc.ForwardSetState(SCE_ERLANG_DEFAULT); } else if (sc.ch == '\'') { sc.ForwardSetState(SCE_ERLANG_DEFAULT); } else { sc.SetState(SCE_ERLANG_DEFAULT); } } else { sc.SetState(SCE_ERLANG_DEFAULT); } } break; } } if (sc.state == SCE_ERLANG_DEFAULT) { bool no_new_state = false; switch (sc.ch) { case '\"' : sc.SetState(SCE_ERLANG_STRING); break; case '$' : sc.SetState(SCE_ERLANG_CHARACTER); break; case '%' : { parse_state = COMMENT; sc.SetState(SCE_ERLANG_COMMENT); } break; case '#' : { parse_state = RECORD_START; sc.SetState(SCE_ERLANG_UNKNOWN); } break; case '?' : { parse_state = MACRO_START; sc.SetState(SCE_ERLANG_UNKNOWN); } break; case '\'' : { parse_state = ATOM_QUOTED; sc.SetState(SCE_ERLANG_UNKNOWN); } break; case '+' : case '-' : { if (IsADigit(sc.chNext)) { parse_state = NUMERAL_START; radix_digits = 0; sc.SetState(SCE_ERLANG_UNKNOWN); } else if (sc.ch != '+') { parse_state = PREPROCESSOR; sc.SetState(SCE_ERLANG_UNKNOWN); } } break; default : no_new_state = true; } if (no_new_state) { if (isdigit(sc.ch)) { parse_state = NUMERAL_START; radix_digits = sc.ch - '0'; sc.SetState(SCE_ERLANG_UNKNOWN); } else if (isupper(sc.ch) || '_' == sc.ch) { sc.SetState(SCE_ERLANG_VARIABLE); } else if (isalpha(sc.ch)) { parse_state = ATOM_UNQUOTED; sc.SetState(SCE_ERLANG_UNKNOWN); } else if (isoperator(static_cast(sc.ch)) || sc.ch == '\\') { sc.SetState(SCE_ERLANG_OPERATOR); } } } } sc.Complete(); } static int ClassifyErlangFoldPoint( Accessor &styler, int styleNext, int keyword_start ) { int lev = 0; if (styler.Match(keyword_start,"case") || ( styler.Match(keyword_start,"fun") && (SCE_ERLANG_FUNCTION_NAME != styleNext) ) || styler.Match(keyword_start,"if") || styler.Match(keyword_start,"query") || styler.Match(keyword_start,"receive") ) { ++lev; } else if (styler.Match(keyword_start,"end")) { --lev; } return lev; } static void FoldErlangDoc( unsigned int startPos, int length, int initStyle, WordList** /*keywordlists*/, Accessor &styler ) { unsigned int endPos = startPos + length; int currentLine = styler.GetLine(startPos); int lev; int previousLevel = styler.LevelAt(currentLine) & SC_FOLDLEVELNUMBERMASK; int currentLevel = previousLevel; int styleNext = styler.StyleAt(startPos); int style = initStyle; int stylePrev; int keyword_start = 0; char ch; char chNext = styler.SafeGetCharAt(startPos); bool atEOL; for (unsigned int i = startPos; i < endPos; i++) { ch = chNext; chNext = styler.SafeGetCharAt(i + 1); // Get styles stylePrev = style; style = styleNext; styleNext = styler.StyleAt(i + 1); atEOL = ((ch == '\r') && (chNext != '\n')) || (ch == '\n'); if (stylePrev != SCE_ERLANG_KEYWORD && style == SCE_ERLANG_KEYWORD) { keyword_start = i; } // Fold on keywords if (stylePrev == SCE_ERLANG_KEYWORD && style != SCE_ERLANG_KEYWORD && style != SCE_ERLANG_ATOM ) { currentLevel += ClassifyErlangFoldPoint(styler, styleNext, keyword_start); } // Fold on comments if (style == SCE_ERLANG_COMMENT || style == SCE_ERLANG_COMMENT_MODULE || style == SCE_ERLANG_COMMENT_FUNCTION) { if (ch == '%' && chNext == '{') { currentLevel++; } else if (ch == '%' && chNext == '}') { currentLevel--; } } // Fold on braces if (style == SCE_ERLANG_OPERATOR) { if (ch == '{' || ch == '(' || ch == '[') { currentLevel++; } else if (ch == '}' || ch == ')' || ch == ']') { currentLevel--; } } if (atEOL) { lev = previousLevel; if (currentLevel > previousLevel) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(currentLine)) styler.SetLevel(currentLine, lev); currentLine++; previousLevel = currentLevel; } } // Fill in the real level of the next line, keeping the current flags as they will be filled in later styler.SetLevel(currentLine, previousLevel | (styler.LevelAt(currentLine) & ~SC_FOLDLEVELNUMBERMASK)); } static const char * const erlangWordListDesc[] = { "Erlang Reserved words", "Erlang BIFs", "Erlang Preprocessor", "Erlang Module Attributes", "Erlang Documentation", "Erlang Documentation Macro", 0 }; LexerModule lmErlang( SCLEX_ERLANG, ColouriseErlangDoc, "erlang", FoldErlangDoc, erlangWordListDesc); Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/Style.cxx000444001750001750 733211727344243 24226 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file Style.cxx ** Defines the font and colour style for a class of text. **/ // Copyright 1998-2001 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include "Platform.h" #include "Scintilla.h" #include "Style.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif FontAlias::FontAlias() { } FontAlias::~FontAlias() { SetID(0); // ~Font will not release the actual font resource sine it is now 0 } void FontAlias::MakeAlias(Font &fontOrigin) { SetID(fontOrigin.GetID()); } void FontAlias::ClearFont() { SetID(0); } bool FontSpecification::EqualTo(const FontSpecification &other) const { return weight == other.weight && italic == other.italic && size == other.size && characterSet == other.characterSet && fontName == other.fontName; } FontMeasurements::FontMeasurements() { Clear(); } void FontMeasurements::Clear() { ascent = 1; descent = 1; aveCharWidth = 1; spaceWidth = 1; sizeZoomed = 2; } Style::Style() : FontSpecification() { Clear(ColourDesired(0, 0, 0), ColourDesired(0xff, 0xff, 0xff), Platform::DefaultFontSize() * SC_FONT_SIZE_MULTIPLIER, 0, SC_CHARSET_DEFAULT, SC_WEIGHT_NORMAL, false, false, false, caseMixed, true, true, false); } Style::Style(const Style &source) : FontSpecification(), FontMeasurements() { Clear(ColourDesired(0, 0, 0), ColourDesired(0xff, 0xff, 0xff), 0, 0, 0, SC_WEIGHT_NORMAL, false, false, false, caseMixed, true, true, false); fore = source.fore; back = source.back; characterSet = source.characterSet; weight = source.weight; italic = source.italic; size = source.size; eolFilled = source.eolFilled; underline = source.underline; caseForce = source.caseForce; visible = source.visible; changeable = source.changeable; hotspot = source.hotspot; } Style::~Style() { } Style &Style::operator=(const Style &source) { if (this == &source) return * this; Clear(ColourDesired(0, 0, 0), ColourDesired(0xff, 0xff, 0xff), 0, 0, SC_CHARSET_DEFAULT, SC_WEIGHT_NORMAL, false, false, false, caseMixed, true, true, false); fore = source.fore; back = source.back; characterSet = source.characterSet; weight = source.weight; italic = source.italic; size = source.size; eolFilled = source.eolFilled; underline = source.underline; caseForce = source.caseForce; visible = source.visible; changeable = source.changeable; return *this; } void Style::Clear(ColourDesired fore_, ColourDesired back_, int size_, const char *fontName_, int characterSet_, int weight_, bool italic_, bool eolFilled_, bool underline_, ecaseForced caseForce_, bool visible_, bool changeable_, bool hotspot_) { fore = fore_; back = back_; characterSet = characterSet_; weight = weight_; italic = italic_; size = size_; fontName = fontName_; eolFilled = eolFilled_; underline = underline_; caseForce = caseForce_; visible = visible_; changeable = changeable_; hotspot = hotspot_; font.ClearFont(); FontMeasurements::Clear(); } void Style::ClearTo(const Style &source) { Clear( source.fore, source.back, source.size, source.fontName, source.characterSet, source.weight, source.italic, source.eolFilled, source.underline, source.caseForce, source.visible, source.changeable, source.hotspot); } void Style::Copy(Font &font_, const FontMeasurements &fm_) { font.MakeAlias(font_); #if PLAT_WX font.SetAscent(fm_.ascent); #endif (FontMeasurements &)(*this) = fm_; } Wx-Scintilla-0.38/wx-scintilla/src/scintilla/src/LexLua.cxx000444001750001750 3337411727344243 24345 0ustar00azawawiazawawi000000000000// Scintilla source code edit control /** @file LexLua.cxx ** Lexer for Lua language. ** ** Written by Paul Winwood. ** Folder by Alexey Yutkin. ** Modified by Marcos E. Wurzius & Philippe Lhoste **/ #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif // Test for [=[ ... ]=] delimiters, returns 0 if it's only a [ or ], // return 1 for [[ or ]], returns >=2 for [=[ or ]=] and so on. // The maximum number of '=' characters allowed is 254. static int LongDelimCheck(StyleContext &sc) { int sep = 1; while (sc.GetRelative(sep) == '=' && sep < 0xFF) sep++; if (sc.GetRelative(sep) == sc.ch) return sep; return 0; } static void ColouriseLuaDoc( unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { WordList &keywords = *keywordlists[0]; WordList &keywords2 = *keywordlists[1]; WordList &keywords3 = *keywordlists[2]; WordList &keywords4 = *keywordlists[3]; WordList &keywords5 = *keywordlists[4]; WordList &keywords6 = *keywordlists[5]; WordList &keywords7 = *keywordlists[6]; WordList &keywords8 = *keywordlists[7]; // Accepts accented characters CharacterSet setWordStart(CharacterSet::setAlpha, "_", 0x80, true); CharacterSet setWord(CharacterSet::setAlphaNum, "_", 0x80, true); // Not exactly following number definition (several dots are seen as OK, etc.) // but probably enough in most cases. [pP] is for hex floats. CharacterSet setNumber(CharacterSet::setDigits, ".-+abcdefpABCDEFP"); CharacterSet setExponent(CharacterSet::setNone, "eEpP"); CharacterSet setLuaOperator(CharacterSet::setNone, "*/-+()={}~[];<>,.^%:#"); CharacterSet setEscapeSkip(CharacterSet::setNone, "\"'\\"); int currentLine = styler.GetLine(startPos); // Initialize long string [[ ... ]] or block comment --[[ ... ]] nesting level, // if we are inside such a string. Block comment was introduced in Lua 5.0, // blocks with separators [=[ ... ]=] in Lua 5.1. // Continuation of a string (\z whitespace escaping) is controlled by stringWs. int nestLevel = 0; int sepCount = 0; int stringWs = 0; if (initStyle == SCE_LUA_LITERALSTRING || initStyle == SCE_LUA_COMMENT || initStyle == SCE_LUA_STRING || initStyle == SCE_LUA_CHARACTER) { int lineState = styler.GetLineState(currentLine - 1); nestLevel = lineState >> 9; sepCount = lineState & 0xFF; stringWs = lineState & 0x100; } // Do not leak onto next line if (initStyle == SCE_LUA_STRINGEOL || initStyle == SCE_LUA_COMMENTLINE || initStyle == SCE_LUA_PREPROCESSOR) { initStyle = SCE_LUA_DEFAULT; } StyleContext sc(startPos, length, initStyle, styler); if (startPos == 0 && sc.ch == '#') { // shbang line: # is a comment only if first char of the script sc.SetState(SCE_LUA_COMMENTLINE); } for (; sc.More(); sc.Forward()) { if (sc.atLineEnd) { // Update the line state, so it can be seen by next line currentLine = styler.GetLine(sc.currentPos); switch (sc.state) { case SCE_LUA_LITERALSTRING: case SCE_LUA_COMMENT: case SCE_LUA_STRING: case SCE_LUA_CHARACTER: // Inside a literal string, block comment or string, we set the line state styler.SetLineState(currentLine, (nestLevel << 9) | stringWs | sepCount); break; default: // Reset the line state styler.SetLineState(currentLine, 0); break; } } if (sc.atLineStart && (sc.state == SCE_LUA_STRING)) { // Prevent SCE_LUA_STRINGEOL from leaking back to previous line sc.SetState(SCE_LUA_STRING); } // Handle string line continuation if ((sc.state == SCE_LUA_STRING || sc.state == SCE_LUA_CHARACTER) && sc.ch == '\\') { if (sc.chNext == '\n' || sc.chNext == '\r') { sc.Forward(); if (sc.ch == '\r' && sc.chNext == '\n') { sc.Forward(); } continue; } } // Determine if the current state should terminate. if (sc.state == SCE_LUA_OPERATOR) { if (sc.ch == ':' && sc.chPrev == ':') { // ::