Add SWIFT language support
This commit is contained in:
parent
4f81261a85
commit
c8969b773f
|
@ -40,7 +40,7 @@ enum LangType {L_TEXT, L_PHP , L_C, L_CPP, L_CS, L_OBJC, L_JAVA, L_RC,\
|
|||
L_CAML, L_ADA, L_VERILOG, L_MATLAB, L_HASKELL, L_INNO, L_SEARCHRESULT,\
|
||||
L_CMAKE, L_YAML, L_COBOL, L_GUI4CLI, L_D, L_POWERSHELL, L_R, L_JSP,\
|
||||
L_COFFEESCRIPT, L_JSON, L_JAVASCRIPT, L_FORTRAN_77, L_BAANC, L_SREC,\
|
||||
L_IHEX, L_TEHEX,\
|
||||
L_IHEX, L_TEHEX, L_SWIFT,\
|
||||
// Don't use L_JS, use L_JAVASCRIPT instead
|
||||
// The end of enumated language type, so it should be always at the end
|
||||
L_EXTERNAL};
|
||||
|
|
|
@ -2844,6 +2844,8 @@ LangType Notepad_plus::menuID2LangType(int cmdID)
|
|||
return L_IHEX;
|
||||
case IDM_LANG_TEHEX :
|
||||
return L_TEHEX;
|
||||
case IDM_LANG_SWIFT:
|
||||
return L_SWIFT;
|
||||
|
||||
case IDM_LANG_USER :
|
||||
return L_USER;
|
||||
|
|
|
@ -721,6 +721,7 @@ BEGIN
|
|||
MENUITEM "Scheme", IDM_LANG_SCHEME
|
||||
MENUITEM "Smalltalk", IDM_LANG_SMALLTALK
|
||||
MENUITEM "SQL", IDM_LANG_SQL
|
||||
MENUITEM "Swiift", IDM_LANG_SWIFT
|
||||
MENUITEM "S-Record", IDM_LANG_SREC
|
||||
MENUITEM "TCL", IDM_LANG_TCL
|
||||
MENUITEM "Tektronix extended HEX", IDM_LANG_TEHEX
|
||||
|
@ -830,6 +831,7 @@ BEGIN
|
|||
MENUITEM "Scheme", IDM_LANG_SCHEME
|
||||
MENUITEM "Smalltalk", IDM_LANG_SMALLTALK
|
||||
MENUITEM "SQL", IDM_LANG_SQL
|
||||
MENUITEM "Swiift", IDM_LANG_SWIFT
|
||||
MENUITEM "S-Record", IDM_LANG_SREC
|
||||
END
|
||||
POPUP "T"
|
||||
|
|
|
@ -2786,6 +2786,7 @@ void Notepad_plus::command(int id)
|
|||
case IDM_LANG_SREC:
|
||||
case IDM_LANG_IHEX:
|
||||
case IDM_LANG_TEHEX:
|
||||
case IDM_LANG_SWIFT:
|
||||
case IDM_LANG_USER :
|
||||
{
|
||||
setLanguage(menuID2LangType(id));
|
||||
|
|
|
@ -5934,12 +5934,16 @@ int NppParameters::langTypeToCommandID(LangType lt) const
|
|||
case L_TEHEX :
|
||||
id = IDM_LANG_TEHEX; break;
|
||||
|
||||
case L_SWIFT:
|
||||
id = IDM_LANG_SWIFT; break;
|
||||
|
||||
case L_SEARCHRESULT :
|
||||
id = -1; break;
|
||||
|
||||
case L_TEXT :
|
||||
id = IDM_LANG_TEXT; break;
|
||||
|
||||
|
||||
default :
|
||||
if(lt >= L_EXTERNAL && lt < L_END)
|
||||
id = lt - L_EXTERNAL + IDM_LANG_EXTERNAL;
|
||||
|
|
|
@ -145,6 +145,7 @@ LanguageName ScintillaEditView::langNames[L_EXTERNAL+1] = {
|
|||
{TEXT("srec"), TEXT("S-Record"), TEXT("Motorola S-Record binary data"), L_SREC, SCLEX_SREC},
|
||||
{TEXT("ihex"), TEXT("Intel HEX"), TEXT("Intel HEX binary data"), L_IHEX, SCLEX_IHEX},
|
||||
{TEXT("tehex"), TEXT("Tektronix extended HEX"), TEXT("Tektronix extended HEX binary data"), L_TEHEX, SCLEX_TEHEX},
|
||||
{TEXT("swift"), TEXT("Swift"), TEXT("Swift file"), L_SWIFT, SCLEX_CPP},
|
||||
{TEXT("ext"), TEXT("External"), TEXT("External"), L_EXTERNAL, SCLEX_NULL}
|
||||
};
|
||||
|
||||
|
@ -1077,7 +1078,6 @@ void ScintillaEditView::setTclLexer()
|
|||
execute(SCI_SETKEYWORDS, 1, reinterpret_cast<LPARAM>(tclTypes));
|
||||
}
|
||||
|
||||
//used by Objective-C and Actionscript
|
||||
void ScintillaEditView::setObjCLexer(LangType langType)
|
||||
{
|
||||
execute(SCI_SETLEXER, SCLEX_OBJC);
|
||||
|
@ -1414,6 +1414,7 @@ void ScintillaEditView::defineDocType(LangType typeDoc)
|
|||
case L_RC :
|
||||
case L_CS :
|
||||
case L_FLASH :
|
||||
case L_SWIFT:
|
||||
setCppLexer(typeDoc); break;
|
||||
|
||||
case L_JS:
|
||||
|
|
|
@ -234,6 +234,11 @@
|
|||
<Keywords name="instre1">abs absolute access acos add add_months adddate admin after aggregate all allocate alter and any app_name are array as asc ascii asin assertion at atan atn2 audit authid authorization autonomous_transaction avg before begin benchmark between bfilename bigint bin binary binary_checksum binary_integer bit bit_count bit_and bit_or blob body boolean both breadth bulk by call cascade cascaded case cast catalog ceil ceiling char char_base character charindex chartorowid check checksum checksum_agg chr class clob close cluster coalesce col_length col_name collate collation collect column comment commit completion compress concat concat_ws connect connection constant constraint constraints constructorcreate contains containsable continue conv convert corr corresponding cos cot count count_big covar_pop covar_samp create cross cube cume_dist current current_date current_path current_role current_time current_timestamp current_user currval cursor cycle data datalength databasepropertyex date date_add date_format date_sub dateadd datediff datename datepart datetime day db_id db_name deallocate dec declare decimal decode default deferrable deferred degrees delete dense_rank depth deref desc describe descriptor destroy destructor deterministic diagnostics dictionary disconnect difference distinct do domain double drop dump dynamic each else elsif empth encode encrypt end end-exec equals escape every except exception exclusive exec execute exists exit exp export_set extends external extract false fetch first first_value file float floor file_id file_name filegroup_id filegroup_name filegroupproperty fileproperty for forall foreign format formatmessage found freetexttable from from_days fulltextcatalog fulltextservice function general get get_lock getdate getansinull getutcdate global go goto grant greatest group grouping having heap hex hextoraw host host_id host_name hour ident_incr ident_seed ident_current identified identity if ifnull ignore immediate in increment index index_col indexproperty indicator initcap initial initialize initially inner inout input insert instr instrb int integer interface intersect interval into is is_member is_srvrolemember is_null is_numeric isdate isnull isolation iterate java join key lag language large last last_day last_value lateral lcase lead leading least left len length lengthb less level like limit limited ln lpad local localtime localtimestamp locator lock log log10 long loop lower ltrim make_ref map match max maxextents merge mid min minus minute mlslabel mod mode modifies modify module month months_between names national natural naturaln nchar nclob new new_time newid next next_day nextval no noaudit nocompress nocopy none not nowait null nullif number number_base numeric nvl nvl2 nvarchar object object_id object_name object_property ocirowid oct of off offline old on online only opaque open operator operation option or ord order ordinalityorganization others out outer output package pad parameter parameters partial partition path pctfree percent_rank pi pls_integer positive positiven postfix pow power pragma precision prefix preorder prepare preserve primary prior private privileges procedure public radians raise rand range rank ratio_to_export raw rawtohex read reads real record recursive ref references referencing reftohex relative release release_lock rename repeat replace resource restrict result return returns reverse revoke right rollback rollup round routine row row_number rowid rowidtochar rowlabel rownum rows rowtype rpad rtrim savepoint schema scroll scope search second section seddev_samp select separate sequence session session_user set sets share sign sin sinh size smallint some soundex space specific specifictype sql sqlcode sqlerrm sqlexception sqlstate sqlwarning sqrt start state statement static std stddev stdev_pop strcmp structure subdate substr substrb substring substring_index subtype successful sum synonym sys_context sys_guid sysdate system_user table tan tanh temporary terminate than then time timestamp timezone_abbr timezone_minute timezone_hour timezone_region tinyint to to_char to_date to_days to_number to_single_byte trailing transaction translate translation treat trigger trim true trunc truncate type ucase uid under union unique uniqueidentifier unknown unnest update upper usage use user userenv using validate value values var_pop var_samp varbinary varchar varchar2 variable variance varying view vsize when whenever where with without while work write year zone</Keywords>
|
||||
</Language>
|
||||
<Language name="srec" ext="mot srec" />
|
||||
<Language name="swift" ext="swift" commentLine="//" commentStart="/*" commentEnd="*/">
|
||||
<Keywords name="instre1">class deinit enum extension func import init internal let operator private protocol public static struct subscript typealias var keywordclass.swift.statements=break case continue default do else fallthrough for if in return switch where while</Keywords>
|
||||
<Keywords name="type1">as dynamicType false is nil self Self super true __COLUMN__ __FILE__ __FUNCTION__ __LINE__</Keywords>
|
||||
<Keywords name="type2">associativity convenience dynamic didSet final get infix inout lazy left mutating none nonmutating optional override postfix precedence prefix Protocol required right set Type unowned weak willSet</Keywords>
|
||||
</Language>
|
||||
<Language name="tcl" ext="tcl" commentLine="#">
|
||||
<Keywords name="instre1">after append array auto_execok auto_import auto_load auto_load_index auto_qualify beep binary break case catch cd clock close concat continue dde default echo else elseif encoding eof error eval exec exit expr fblocked fconfigure fcopy file fileevent flush for foreach format gets glob global history if incr info interp join lappend lindex linsert list llength load lrange lreplace lsearch lsort namespace open package pid pkg_mkIndex proc puts pwd read regexp regsub rename resource return scan seek set socket source split string subst switch tclLog tclMacPkgSearch tclPkgSetup tclPkgUnknown tell time trace unknown unset update uplevel upvar variable vwait while</Keywords>
|
||||
<Keywords name="instre2">bell bind bindtags button canvas checkbutton console destroy entry event focus font frame grab grid image label listbox menu menubutton message pack place radiobutton raise scale scrollbar text tk tkwait toplevel winfo wm</Keywords>
|
||||
|
|
|
@ -486,6 +486,7 @@
|
|||
#define IDM_LANG_SREC (IDM_LANG + 60)
|
||||
#define IDM_LANG_IHEX (IDM_LANG + 61)
|
||||
#define IDM_LANG_TEHEX (IDM_LANG + 62)
|
||||
#define IDM_LANG_SWIFT (IDM_LANG + 63)
|
||||
|
||||
#define IDM_LANG_EXTERNAL (IDM_LANG + 65)
|
||||
#define IDM_LANG_EXTERNAL_LIMIT (IDM_LANG + 79)
|
||||
|
|
|
@ -809,6 +809,26 @@
|
|||
<WordsStyle name="CHECKSUM_WRONG" styleID="17" fgColor="FFFF00" bgColor="FF0000" fontName="" fontStyle="0" fontSize="" />
|
||||
<WordsStyle name="GARBAGE" styleID="18" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="2" fontSize="" />
|
||||
</LexerType>
|
||||
<LexerType name="swift" desc="SWIFT" ext="">
|
||||
<WordsStyle name="PREPROCESSOR" styleID="9" fgColor="804000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
|
||||
<WordsStyle name="DEFAULT" styleID="11" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
|
||||
<WordsStyle name="INSTRUCTION WORD" styleID="5" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="1" fontSize="" keywordClass="instre1" />
|
||||
<WordsStyle name="TYPE WORD" styleID="16" fgColor="8000FF" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" keywordClass="type1" />
|
||||
<WordsStyle name="NUMBER" styleID="4" fgColor="FF8000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
|
||||
<WordsStyle name="STRING" styleID="6" fgColor="808080" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
|
||||
<WordsStyle name="CHARACTER" styleID="7" fgColor="808080" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
|
||||
<WordsStyle name="OPERATOR" styleID="10" fgColor="000080" bgColor="FFFFFF" fontName="" fontStyle="1" fontSize="" />
|
||||
<WordsStyle name="VERBATIM" styleID="13" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
|
||||
<WordsStyle name="REGEX" styleID="14" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="1" fontSize="" />
|
||||
<WordsStyle name="COMMENT" styleID="1" fgColor="008000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
|
||||
<WordsStyle name="COMMENT LINE" styleID="2" fgColor="008000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
|
||||
<WordsStyle name="COMMENT DOC" styleID="3" fgColor="008080" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
|
||||
<WordsStyle name="COMMENT LINE DOC" styleID="15" fgColor="008080" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
|
||||
<WordsStyle name="COMMENT DOC KEYWORD" styleID="17" fgColor="008080" bgColor="FFFFFF" fontName="" fontStyle="1" fontSize="" />
|
||||
<WordsStyle name="COMMENT DOC KEYWORD ERROR" styleID="18" fgColor="008080" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
|
||||
<WordsStyle name="PREPROCESSOR COMMENT" styleID="23" fgColor="008000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
|
||||
<WordsStyle name="PREPROCESSOR COMMENT DOC" styleID="24" fgColor="008080" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
|
||||
</LexerType>
|
||||
<LexerType name="tcl" desc="TCL" ext="">
|
||||
<WordsStyle name="DEFAULT" styleID="0" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
|
||||
<WordsStyle name="MODIFIER" styleID="10" fgColor="804000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
|
||||
|
|
Loading…
Reference in New Issue