@@ -270,6 +270,8 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
270270 "static else struct switch extern typedef union for goto while enum const " +
271271 "volatile inline restrict asm fortran" ;
272272 var cTypes = "int long char short double float unsigned signed void size_t ptrdiff_t" ;
273+ var cBlockKeywords = "case do else for if switch while struct enum union" ;
274+ var cDefKeywords = "struct enum union" ;
273275
274276 function cppHook ( stream , state ) {
275277 if ( ! state . startOfLine ) return false
@@ -383,8 +385,8 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
383385 keywords : words ( cKeywords ) ,
384386 types : words ( cTypes + " bool float_t double_t intptr_t intmax_t int8_t int16_t " +
385387 "int32_t int64_t uintptr_t uintmax_t uint8_t uint16_t uint32_t uint64_t" ) ,
386- blockKeywords : words ( "case do else for if switch while struct" ) ,
387- defKeywords : words ( "struct" ) ,
388+ blockKeywords : words ( cBlockKeywords ) ,
389+ defKeywords : words ( cDefKeywords ) ,
388390 typeFirstDefinitions : true ,
389391 atoms : words ( "NULL true false" ) ,
390392 isReservedIdentifier : cIsReservedIdentifier ,
@@ -403,8 +405,8 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
403405 "alignas alignof constexpr decltype nullptr noexcept thread_local final " +
404406 "static_assert override" ) ,
405407 types : words ( cTypes + " bool wchar_t" ) ,
406- blockKeywords : words ( "catch class do else finally for if struct switch try while ") ,
407- defKeywords : words ( "class namespace struct enum union ") ,
408+ blockKeywords : words ( cBlockKeywords + " class try catch finally") ,
409+ defKeywords : words ( cDefKeywords + " class namespace ") ,
408410 typeFirstDefinitions : true ,
409411 atoms : words ( "true false NULL" ) ,
410412 dontIndentStatements : / ^ t e m p l a t e $ / ,
@@ -729,31 +731,35 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
729731 "implementation includes interface module new norace nx_struct nx_union post provides " +
730732 "signal task uses abstract extends" ) ,
731733 types : words ( cTypes ) ,
732- blockKeywords : words ( "case do else for if switch while struct" ) ,
734+ blockKeywords : words ( cBlockKeywords ) ,
733735 atoms : words ( "null true false" ) ,
734736 hooks : { "#" : cppHook } ,
735737 modeProps : { fold : [ "brace" , "include" ] }
736738 } ) ;
737739
738740 def ( "text/x-objectivec" , {
739741 name : "clike" ,
740- keywords : words ( cKeywords + " bycopy byref in inout oneway out self " +
741- "super atomic nonatomic retain copy readwrite readonly " +
742- "strong weak assign typeof nullable nonnull instancetype" ) ,
743- types : words ( cTypes ) ,
742+ keywords : words ( cKeywords + " bycopy byref in inout oneway out self super atomic nonatomic retain copy " +
743+ "readwrite readonly strong weak assign typeof nullable nonnull null_resettable _cmd " +
744+ "@interface @implementation @end @protocol @encode @property @synthesize @dynamic @class " +
745+ "@public @package @private @protected @required @optional @try @catch @finally @import " +
746+ "@selector @encode @defs @synchronized @autoreleasepool @compatibility_alias @available" ) ,
747+ types : words ( cTypes + " instancetype SEL id BOOL IMP Class" ) ,
748+ builtin : words ( "FOUNDATION_EXPORT FOUNDATION_EXTERN NS_INLINE NS_FORMAT_FUNCTION NS_RETURNS_RETAINED " +
749+ "NS_ERROR_ENUM NS_RETURNS_NOT_RETAINED NS_RETURNS_INNER_POINTER NS_DESIGNATED_INITIALIZER " +
750+ "NS_ENUM NS_OPTIONS NS_REQUIRES_NIL_TERMINATION NS_ASSUME_NONNULL_BEGIN " +
751+ "NS_ASSUME_NONNULL_END NS_SWIFT_NAME NS_REFINED_FOR_SWIFT" ) ,
752+ blockKeywords : words ( cBlockKeywords + " @synthesize @try @catch @finally @autoreleasepool @synchronized" ) ,
753+ defKeywords : words ( cDefKeywords + " @interface @implementation @protocol @class" ) ,
754+ dontIndentStatements : / ^ @ .* $ / ,
755+ typeFirstDefinitions : true ,
744756 atoms : words ( "YES NO NULL Nil nil true false" ) ,
745757 isReservedIdentifier : cIsReservedIdentifier ,
746758 hooks : {
747- "@" : function ( stream ) {
748- stream . eatWhile ( / [ \w \$ ] / ) ;
749- return "keyword" ;
750- } ,
751759 "#" : cppHook ,
752- indent : function ( _state , ctx , textAfter ) {
753- if ( ctx . type == "statement" && / ^ @ \w / . test ( textAfter ) ) return ctx . indented
754- }
760+ "*" : pointerHook ,
755761 } ,
756- modeProps : { fold : "brace" }
762+ modeProps : { fold : [ "brace" , "include" ] }
757763 } ) ;
758764
759765 def ( "text/x-squirrel" , {
0 commit comments