5 Replies
      Latest reply on Jan 14, 2020 6:32 PM by OCS1
      zaomaster Level 1 Level 1 (0 points)

        Hey all,

         

        I was wondering if anyone else had run into this issue or not. One project that I work on uses Pascal as its primary language. Previous Xcode versions allowed me to load an xclangspec file that had basic syntax coloring and commenting capability.

         

        However, after updating to Xcode 11 I no longer have either of those options. The program recognizes the "Pascal Source" under "Identity and Type" in the File Inspector, but under "Syntax Coloring" in the Editor menu there is no Pascal option and I cannot comment any lines out.

         

        Below are, respectively, the plugin data entry and the xclangspec

         

                <dict>

                    <key>Xcode.SourceCodeLanguage.Pascal</key>

                    <dict>

                        <key>commentSyntax</key>

                        <array>

                            <dict>

                                <key>prefix</key>

                                <string>{</string>

                                <key>suffix</key>

                                <string>}</string>

                            </dict>

                            <dict>

                                <key>prefix</key>

                                <string>//</string>

                            </dict>

                        </array>

                        <key>conformsTo</key>

                        <array>

                            <dict>

                                <key>identifier</key>

                                <string>Xcode.SourceCodeLanguage.Generic</string>

                            </dict>

                        </array>

                        <key>documentationAbbreviation</key>

                        <string>pascal</string>

                        <key>fileDataType</key>

                        <array>

                            <dict>

                                <key>identifier</key>

                                <string>public.pascal-source</string>

                            </dict>

                        </array>

                        <key>id</key>

                        <string>Xcode.SourceCodeLanguage.Pascal</string>

                        <key>languageName</key>

                        <string>Pascal</string>

                        <key>languageSpecification</key>

                        <string>xcode.lang.pascal</string>

                        <key>name</key>

                        <string>The Pascal Programming Language</string>

                        <key>point</key>

                        <string>Xcode.SourceCodeLanguage</string>

                        <key>version</key>

                        <string>1.1.4</string>

                    </dict>

                </dict>

         

        ////////////////////////

         

        (

         

         

        /****************************************************************************/

        // MARK: Pascal Top-Level

        /****************************************************************************/

         

         

            {

                Identifier = "xcode.lang.pascal";

                Description = "Pascal Coloring";

                BasedOn = "xcode.lang.simpleColoring";

                IncludeInMenu = YES;

                Name = "Pascal";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer.toplevel";

                    IncludeRules = (

                        "xcode.lang.pascal.section.interface",

                        "xcode.lang.pascal.section.implementation",

                        "xcode.lang.pascal.section.initialization",

                        "xcode.lang.pascal.section.finalization",

                    );

                    Type = "xcode.syntax.plain";

                };

            },

          

        /****************************************************************************/

        // MARK: Lexers

        /****************************************************************************/

         

         

            {

                Identifier = "xcode.lang.pascal.lexer";

                Syntax = {

                    IncludeRules = (

                        "xcode.lang.pascal.comment",

                        "xcode.lang.pascal.comment.curlybrace",

                        "xcode.lang.comment.singleline",

                        "xcode.lang.string.singlequote",

                        "xcode.lang.pascal.identifier",

                        "xcode.lang.number",

                    );

                };

            },

            {

                Identifier = "xcode.lang.pascal.lexer.toplevel";

                Syntax = {

                    IncludeRules = (

                        "xcode.lang.pascal.comment",

                        "xcode.lang.pascal.comment.curlybrace",

                        "xcode.lang.comment.singleline",

                        "xcode.lang.string.singlequote",

                        "xcode.lang.pascal.identifier",

                 );

                };

            },

            {

                Identifier = "xcode.lang.pascal.lexer.section.interface";

                Syntax = {

                    IncludeRules = (

                        "xcode.lang.pascal.comment",

                        "xcode.lang.pascal.comment.curlybrace",

                        "xcode.lang.comment.singleline",

                        "xcode.lang.string.singlequote",

                        "xcode.lang.pascal.identifier",

                        "xcode.lang.pascal.record.declarator",

                        "xcode.lang.pascal.typeclassforward",

                        "xcode.lang.pascal.typeinterfaceforward",

                        "xcode.lang.pascal.class.declarator",

                        "xcode.lang.pascal.interface.declarator",

                        "xcode.lang.pascal.function.declarator",

                 );

                };

            },

            {

                Identifier = "xcode.lang.pascal.lexer.section.implementation";

                Syntax = {

                    IncludeRules = (

                        "xcode.lang.pascal.comment",

                        "xcode.lang.pascal.comment.curlybrace",

                        "xcode.lang.comment.singleline",

                        "xcode.lang.string.singlequote",

                        "xcode.lang.pascal.identifier",

                        "xcode.lang.pascal.record.declarator",

                        "xcode.lang.pascal.typeclassforward",

                        "xcode.lang.pascal.typeinterfaceforward",

                        "xcode.lang.pascal.class.declarator",

                        "xcode.lang.pascal.interface.declarator",

                        "xcode.lang.pascal.classmethod.definition.name",

                        "xcode.lang.pascal.method.definition.name",

                        "xcode.lang.pascal.function.definition.name",

                        "xcode.lang.pascal.classmethod.definition.declarator",

                        "xcode.lang.pascal.method.definition.declarator",

                        "xcode.lang.pascal.function.declarator",

                 );

                };

            },

            {

                Identifier = "xcode.lang.pascal.lexer.class";

                Syntax = {

                    IncludeRules = (

                        "xcode.lang.comment.singleline",

                        "xcode.lang.pascal.comment",

                        "xcode.lang.pascal.comment.curlybrace",

                        "xcode.lang.pascal.property.declarator",

                        "xcode.lang.pascal.keyword.class",

                        "xcode.lang.pascal.identifier",

                 );

                };

            },

            {

                Identifier = "xcode.lang.pascal.lexer.interface";

                Syntax = {

                    IncludeRules = (

                        "xcode.lang.comment.singleline",

                        "xcode.lang.pascal.guid.declarator",

                        "xcode.lang.pascal.comment",

                        "xcode.lang.pascal.comment.curlybrace",

                        "xcode.lang.pascal.property.declarator",

                        "xcode.lang.pascal.identifier",

                 );

                };

            },

            {

                Identifier = "xcode.lang.pascal.lexer.property";

                Syntax = {

                    IncludeRules = (

                        "xcode.lang.pascal.comment",

                        "xcode.lang.pascal.comment.curlybrace",

                        "xcode.lang.comment.singleline",

                        "xcode.lang.pascal.keyword.property",

                 );

                };

            },

          

        /****************************************************************************/

        // MARK: Keywords

        /****************************************************************************/

         

         

            {

                Identifier = "xcode.lang.pascal.identifier";

                Syntax = {

                    StartChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_";

                    Chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_";

                    CaseSensitive = NO;

                    Words = (

                        "absolute",

                        "abstract",

                        "alias",

                        "and",

                        "assembler",

                        "asm",

                        "array",

                        "as",

                        "begin",

                        "break",

                        "case",

                        "class",

                        "const",

                        "constref",

                        "constructor",

                        "continue",

                        "cdecl",

                        "cppdecl",

                        "deprecated",

                        "destructor",

                        "dispose",

                        "div",

                        "do",

                        "downto",

                        "else",

                        "end",

                        "except",

                        "exit",

                        "experimental",

                        "export",

                        "exports",

                        "external",

                        "far",

                        "far16",

                        "false",

                        "file",

                        "finalization",

                        "finally",

                        "for",

                        "forward",

                        "function",

                        "generic",

                        "goto",

                        "helper",

                        "if",

                        "implementation",

                        "in",

                        "inherited",

                        "inline",

                        "initialization",

                        "interface",

                        "interrupt",

                        "is",

                        "label",

                        "library",

                        "local",

                        "mod",

                        "mwpascal",

        //               "name",

                        "near",

                        "new",

                        "nil",

                        "not",

                        "nostackframe",

                        "object",

                        "objccategory",

                        "objcclass",

                        "of",

                        "oldfpccall",

                        "on",

                        "operator",

                        "or",

                        "otherwise",

                        "out",

                        "overload",

                        "packed",

                        "pascal",

                        "platform",

                        "procedure",

                        "program",

                        "public",

                        "raise",

                        "record",

                        "register",

                        "repeat",

                        "safecall",

                        "saveregisters",

                        "sealed",

                        "self",

                        "set",

                        "shl",

                        "shr",

                        "softfloat",

                        "specialize",

                        "stdcall",

                        "then",

                        "threadvar",

                        "to",

                        "true",

                        "try",

                        "type",

                        "unimplemented",

                        "unit",

                        "until",

                        "uses",

                        "var",

                        "while",

                        "with",

                        "xor",

                        "varargs",

                     );

                    Type = "xcode.syntax.keyword";

                    AltType = "xcode.syntax.identifier";

                };

            },

            {

                Identifier = "xcode.lang.pascal.keyword.class";

                Syntax = {

                   StartChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_";

                    Chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_";

                    CaseSensitive = NO;

                    Words = (

                        "abstract",

                        "dynamic",

                        "end",

                        "final",

                        "message",

                        "override",

                        "private",

                        "protected",

                        "public",

                        "published",

                        "reintroduce",

                        "strict",

                        "virtual",

                   );

                    Type = "xcode.syntax.keyword";

                };

            },

            {

                Identifier = "xcode.lang.pascal.keyword.property";

                Syntax = {

                    StartChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_";

                    Chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_";

                    CaseSensitive = NO;

                    Words = (

                        "default",

                        "index",

                        "property",

                        "read",

                        "write",

                        "implements",

                        "stored",

                   );

                    Type = "xcode.syntax.keyword";

                };

            },

            {

                Identifier = "xcode.lang.pascal.interestingOperators";  //not used at the moment

                Syntax = {

                    Words = (

                        "..",

                        "^",

                        ":=",

                     );

                    Type = "xcode.syntax.plain";

                };

            },

         

         

        /****************************************************************************/

        // MARK: Sections

        /****************************************************************************/

         

         

            {

                Identifier = "xcode.lang.pascal.section.interface";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer.section.interface";

                    Start = "interface";

                    Until = "implementation";

              //      Foldable = YES;

                    IncludeRules = (

                        "xcode.lang.pascal.uses",

                        "xcode.lang.pascal.record",

                        "xcode.lang.pascal.class",

                        "xcode.lang.pascal.interface",

                        "xcode.lang.pascal.vars",

                        "xcode.lang.pascal.consts",

                        "xcode.lang.pascal.function.declaration",

                   );

                };

            },

            {

                Identifier = "xcode.lang.pascal.section.implementation";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer.section.implementation";

                    Start = "implementation";

                    Until = "initialization";

                    AltUntil = "end.";

              //      Foldable = YES;

                    IncludeRules = (

                        "xcode.lang.pascal.uses",

                        "xcode.lang.pascal.record",

                        "xcode.lang.pascal.class",

                        "xcode.lang.pascal.interface",

                        "xcode.lang.pascal.classmethod.definition",

                        "xcode.lang.pascal.method.definition",

                        "xcode.lang.pascal.function.definition",

                    );

                };

            },

            {

                Identifier = "xcode.lang.pascal.section.initialization";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer.toplevel";

                    Start = "initialization";

                    Until = "finalization";

                    AltUntil = "end.";

            //        Foldable = YES;

                    IncludeRules = (

                   );

                };

            },

         

         

            {

                Identifier = "xcode.lang.pascal.section.finalization";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer.toplevel";

                    Start = "finalization";

                    Until = "end.";

            //        Foldable = YES;

                    IncludeRules = (

                   );

                };

            },

         

         

        /****************************************************************************/

        // MARK: Blocks

        /****************************************************************************/

         

         

            {

                Identifier = "xcode.lang.pascal.uses";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer.toplevel";

                    Start = "uses";

                    End = ";";

            //        Foldable = YES;

                    IncludeRules = (

                        "xcode.lang.pascal.identifier",

                    );

                };

            },

            {

                Identifier = "xcode.lang.pascal.record";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer.toplevel";

                    Start = "xcode.lang.pascal.record.declarator";

                    End = "end";

                    Recursive = YES;

                    Foldable = YES;

                    IncludeRules = (

                        "xcode.lang.pascal.class.field",

                    );

                };

            },

            {

                Identifier = "xcode.lang.pascal.record.declarator";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer";

                    Rules = (

                        "xcode.lang.pascal.identifier",

                        "=",

                        "record",

                    );

                };

            },

            {

                Identifier = "xcode.lang.pascal.vars";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer";

           //          Foldable = YES;

                    Rules = (

                        "var",

                        "xcode.lang.pascal.vars.declaration*",

                    );

                };

            },

            {

                Identifier = "xcode.lang.pascal.vars.declaration";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer";

                    Rules = (

                        "xcode.lang.pascal.identifier",

                        "xcode.lang.pascal.identifiers*",

                        ":",

                        "xcode.lang.pascal.identifier",

                        "xcode.lang.pascal.const.expression?",

                        ";",

                    );

                };

            },

            {

                Identifier = "xcode.lang.pascal.identifiers";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer";

                    Rules = (

                        ",",

                        "xcode.lang.pascal.identifier",

                    );

                };

            },

            {

                Identifier = "xcode.lang.pascal.consts";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer.toplevel";

             //        Foldable = YES;

                     Rules = (

                        "const",

                        "xcode.lang.pascal.consts.declaration*",

                    );

                };

            },

            {

                Identifier = "xcode.lang.pascal.consts.declaration";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer.toplevel";

                     Rules = (

                        "xcode.lang.pascal.identifier",

                        "xcode.lang.pascal.const.expression",

                        ";",

                    );

                };

            },

            {

                Identifier = "xcode.lang.pascal.const.expression";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer.toplevel";

                     Rules = (

                        "=",

                        "xcode.lang.number?",

                        "true|false|nil?",

                        "xcode.lang.pascal.identifier?",

                        "xcode.lang.string.singlequote?",

                        "xcode.lang.pascal.parenexpr?",

                    );

                };

            },

          

        /****************************************************************************/

        // MARK: Types

        /****************************************************************************/

         

         

          // types are work in progress

         

         

            {

                Identifier = "xcode.lang.pascal.types";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer";

                    Foldable = YES;

                    Rules = (

                        "type",

                        "xcode.lang.pascal.types.enum*",

                        "xcode.lang.pascal.types.simple*",

                    );

                };

            },

            {

                Identifier = "xcode.lang.pascal.types.simple";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer";

                    IncludeRules = (

                        "xcode.lang.pascal.identifier",

                        "=",

                        "xcode.lang.pascal.identifier",

                        ";",

                    );

                };

            },

            {

                Identifier = "xcode.lang.pascal.types.enum";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer";

                    Foldable = YES;

                    Rules = (

                        "xcode.lang.pascal.identifier",

                        "=",

                        "(",

                        "xcode.lang.pascal.identifier",

                        "xcode.lang.pascal.identifiers*",

                        ")",

                        ";",

                    );

                };

            },

         

         

        /****************************************************************************/

        // MARK: Interface

        /****************************************************************************/

         

         

            {

                Identifier = "xcode.lang.pascal.interface";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer.interface";

                    Start = "xcode.lang.pascal.interface.declarator";

                    End = "end";

                    Foldable = YES;

                    IncludeRules = (

                        "xcode.lang.pascal.interface.method.declaration",

                        "xcode.lang.pascal.property.declaration",

                    );

                    Type = "xcode.syntax.declaration.class";

                };

            },

            {

                Identifier = "xcode.lang.pascal.interface.declarator";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer";

                    Rules = (

                        "xcode.lang.pascal.class.name",

                        "=",

                        "interface",

                        "xcode.lang.pascal.class.heritage?",

                    );

                };

            },

         

         

        /****************************************************************************/

        // MARK: Class

        /****************************************************************************/

         

         

            {

                Identifier = "xcode.lang.pascal.class";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer.class";

                    Start = "xcode.lang.pascal.class.declarator";

                    End = "end";

                    Foldable = YES;

                    IncludeRules = (

                        "xcode.lang.pascal.class.scope",

                        "xcode.lang.pascal.class.field",

                        "xcode.lang.pascal.class.classmethod.declaration",

                        "xcode.lang.pascal.class.method.declaration",

                        "xcode.lang.pascal.property.declaration",

                    );

                    Type = "xcode.syntax.declaration.class";

                };

            },

            {

                Identifier = "xcode.lang.pascal.class.generic";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer";

                    Rules = (

                        "<",

                        "xcode.lang.pascal.class.name",

                        ">",

                    );

                };

            },

            {

                Identifier = "xcode.lang.pascal.class.declarator";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer";

                    Rules = (

                        "generic?",

                        "xcode.lang.pascal.class.name",

                        "xcode.lang.pascal.class.generic?",

                        "=",

                        "class|objcclass|objccategory",

                        "xcode.lang.pascal.class.heritage?",

                    );

                };

            },

            {

                Identifier = "xcode.lang.pascal.typeclassforward";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer";

                    Rules = (

                        "xcode.lang.pascal.identifier",

                        "=",

                        "class",

                        "of?",

                        "(?",

                        "xcode.lang.pascal.identifier?",

                        ")?",

                        ";",

                    );

                };

            },

            {

                Identifier = "xcode.lang.pascal.typeinterfaceforward";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer";

                    Rules = (

                        "xcode.lang.pascal.identifier",

                        "=",

                        "interface",

                        "xcode.lang.pascal.class.heritage?",

                        ";",

                    );

                };

            },

            {

                Identifier = "xcode.lang.pascal.class.name";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer";

                    Rules = (

                        "xcode.lang.pascal.identifier",

                    );

                    Type = "xcode.syntax.name.partial";

                };

            },

            {

                Identifier = "xcode.lang.pascal.class.heritage";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer";

                    Start = "(";

                    End = ")";

                    Recursive = NO;

                    Rules = (

                        "xcode.lang.pascal.identifier",

                    );

                };

            },

            {

                Identifier = "xcode.lang.pascal.class.field";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer";

                    Rules = (

                        "xcode.lang.pascal.identifier",

                        ":",

                        "xcode.lang.pascal.identifier",

                        ";",

                    );

                };

            },

            {

                Identifier = "xcode.lang.pascal.class.scope";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer";

                    Rules = (

                        "public|private|protected|published",

                    );

                };

            },

         

         

        /****************************************************************************/

        // MARK: Property

        /****************************************************************************/

         

         

             {

                Identifier = "xcode.lang.pascal.property.declaration";

                Syntax = {

                  Tokenizer = "xcode.lang.pascal.lexer.property";

                    Rules = (

                            "xcode.lang.pascal.property.declarator",

                            "xcode.lang.pascal.property.indexer?",

                            "xcode.lang.pascal.property.getter?",

                            "xcode.lang.pascal.property.setter?",

                            "xcode.lang.pascal.property.implementer?",

                            "xcode.lang.pascal.property.defaulter?",

                            "xcode.lang.pascal.property.stored?",

                            ";",

                           "xcode.lang.pascal.property.specifier?",

                        );

                 //   Type = "xcode.syntax.declaration.property";

                    Type = "xcode.syntax.declaration.method";  // remove to stop property appearing in the popup

                };

            },

            {

                Identifier = "xcode.lang.pascal.property.declarator";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer.property";

                    Rules = (

                        "property",

                        "xcode.lang.pascal.identifier",

                        "xcode.lang.pascal.bracketexpr?",

                        ":",

                        "xcode.lang.pascal.identifier",

                    );

                    Type = "xcode.syntax.name.partial";

                };

            },

            {

                Identifier = "xcode.lang.pascal.property.indexer";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer.toplevel";

                    Rules = (

                        "index",

                        "xcode.lang.number?",

                        "xcode.lang.pascal.identifier?",

                    );

                };

            },

            {

                Identifier = "xcode.lang.pascal.property.getter";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer";

                    Rules = (

                        "read",

                        "xcode.lang.pascal.identifier",

                    );

                };

            },

            {

                Identifier = "xcode.lang.pascal.property.setter";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer";

                    Rules = (

                        "write",

                        "xcode.lang.pascal.identifier",

                    );

                };

            },

            {

                Identifier = "xcode.lang.pascal.property.implementer";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer";

                    Rules = (

                        "implements",

                        "xcode.lang.pascal.identifier",

                    );

                };

            },

            {

                Identifier = "xcode.lang.pascal.property.defaulter";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer.toplevel";

                    Rules = (

                        "default",

                        "-?",

                        "xcode.lang.pascal.property.defaulter.expression",

                    );

                };

            },

            {

                Identifier = "xcode.lang.pascal.property.defaulter.expression";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer.toplevel";

                     Rules = (

                        "xcode.lang.number?",

                        "true|false|nil?",

                        "xcode.lang.pascal.identifier?",

                        "xcode.lang.string.singlequote?",

                    );

                };

            },

            {

                Identifier = "xcode.lang.pascal.property.stored";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer.toplevel";

                    Rules = (

                        "stored",

                        "xcode.lang.pascal.property.stored.expression",

                    );

                };

            },

            {

                Identifier = "xcode.lang.pascal.property.stored.expression";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer.toplevel";

                     Rules = (

                        "true|false|nil?",

                        "xcode.lang.pascal.identifier?",

                    );

                };

            },

            {

                Identifier = "xcode.lang.pascal.property.specifier";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer";

                    Rules = (

                        "default",

                        ";",

                    );

                };

             },

         

         

        /****************************************************************************/

        // MARK: Method/Function Declaration

        /****************************************************************************/

         

         

            {

                Identifier = "xcode.lang.pascal.interface.method.declaration";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer.interface";

                    Rules = (

                        "function|procedure",

                        "xcode.lang.pascal.method.declarator",

                        "xcode.lang.pascal.method.result?",

                        ";",

                   );

                    Type = "xcode.syntax.declaration.method";

                };

            },

            {

                Identifier = "xcode.lang.pascal.class.classmethod.declaration";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer.class";

                    Rules = (

                        "class",

                        "function|procedure",

                        "xcode.lang.pascal.method.declarator",

                        "xcode.lang.pascal.method.result?",

                        ";",

                        "virtual;|override;?",

                        " abstract;?",

                        " reintroduce;?",

                        "xcode.lang.pascal.objcmessage.declarator?",

                   );

                    Type = "xcode.syntax.declaration.method";

                };

            },

            {

                Identifier = "xcode.lang.pascal.class.method.declaration";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer.class";

                    Rules = (

                        "function|procedure|constructor|destructor",

                        "xcode.lang.pascal.method.declarator",

                        "xcode.lang.pascal.method.result?",

                        ";",

                        "virtual;|override;?",

                        " abstract;?",

                        " reintroduce;?",

                   );

                    Type = "xcode.syntax.declaration.method";

                };

            },

            {

                Identifier = "xcode.lang.pascal.method.declarator";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer";

                    Rules = (

                        "xcode.lang.pascal.method.name",

                        "xcode.lang.pascal.parenexpr?",

                    );

                    Type = "xcode.syntax.method.declarator";

                };

            },

            {

                Identifier = "xcode.lang.pascal.parenexpr";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer";

                    Start = "(";

                    End = ")";

                    Recursive = YES;

                    IncludeRules = (

                    );

                };

            },

            {

                Identifier = "xcode.lang.pascal.bracketexpr";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer";

                    Start = "[";

                    End = "]";

                    Recursive = YES;

                    IncludeRules = (

                        "xcode.lang.pascal.parenexpr",

                    );

                };

            },

            {

                Identifier = "xcode.lang.pascal.method.name";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer";

                    Rules = (

                        "xcode.lang.pascal.identifier",

                    );

                };

            },

            {

                Identifier = "xcode.lang.pascal.method.result";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer";

                    Rules = (

                        ":",

                        "xcode.lang.pascal.identifier",

                    );

                };

            },

            {

                Identifier = "xcode.lang.pascal.function.declaration";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer";

                    Rules = (

                        "xcode.lang.pascal.function.declarator",

                   );

                     Type = "xcode.syntax.declaration.function";    // delete this to stop function declarations appearing in the popup

                };

            },

         

         

        /****************************************************************************/

        // MARK: Method/Function Definition

        /****************************************************************************/

         

         

            {

                Identifier = "xcode.lang.pascal.method.definition";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer";

                    Rules = (

                        "xcode.lang.pascal.method.definition.declarator",

                        "xcode.lang.pascal.method.block",

                    );

                     Type = "xcode.syntax.definition.method";

                };

            },

            {

                Identifier = "xcode.lang.pascal.classmethod.definition";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer";

                    Rules = (

                        "xcode.lang.pascal.classmethod.definition.declarator",

                        "xcode.lang.pascal.method.block",

                    );

                     Type = "xcode.syntax.definition.method";

                };

            },

            {

                Identifier = "xcode.lang.pascal.method.definition.name";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer";

                    Rules = (

                        "function|procedure|constructor|destructor",

                        "xcode.lang.pascal.identifier",

                        ".",

                        "xcode.lang.pascal.identifier",

                    );

                };

            },

            {

                Identifier = "xcode.lang.pascal.classmethod.definition.name";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer";

                    Rules = (

                        "class",

                        "function|procedure",

                        "xcode.lang.pascal.identifier",

                        ".",

                        "xcode.lang.pascal.identifier",

                    );

                };

            },

            {

                Identifier = "xcode.lang.pascal.function.definition.name";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer";

                    Rules = (

                        "function|procedure",

                        "xcode.lang.pascal.identifier",

                    );

                };

            },

            {

                Identifier = "xcode.lang.pascal.function.modifiers";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer";

                    Rules = (

                        "cdecl|export|inline|interrupt|local|nostackframe|pascal|public|mwpascal|register|safecall|saveregisters|softfloat|stdcall|varargs",

                        ";",

                    );

                };

            },

            {

                Identifier = "xcode.lang.pascal.method.block";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer.toplevel";

                    Foldable = YES;

                    Rules = (

                        "xcode.lang.pascal.function.modifiers*",

                        "xcode.lang.pascal.consts?",

                        "xcode.lang.pascal.vars?",

                        "xcode.lang.pascal.consts?",

                        "xcode.lang.pascal.vars?",

                        "xcode.lang.pascal.sub*",  // hardwire three levels of subs as easier than making framework recursive

                        "xcode.lang.pascal.consts?",

                        "xcode.lang.pascal.vars?",

                        "xcode.lang.pascal.consts?",

                        "xcode.lang.pascal.vars?",

                        "xcode.lang.pascal.beginexpr",

                        ";",

                    );

                };

            },

            {

                Identifier = "xcode.lang.pascal.sub";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer.toplevel";

                    Foldable = YES;

                    Rules = (

                        "xcode.lang.pascal.function.declarator",

                        "xcode.lang.pascal.consts?",

                        "xcode.lang.pascal.vars?",

                        "xcode.lang.pascal.consts?",

                        "xcode.lang.pascal.vars?",

                        "xcode.lang.pascal.subsub*",  // hardwire three levels of subs as easier than making framework recursive

                        "xcode.lang.pascal.consts?",

                        "xcode.lang.pascal.vars?",

                        "xcode.lang.pascal.consts?",

                        "xcode.lang.pascal.vars?",

                        "xcode.lang.pascal.beginexpr",

                        ";",

                    );

                     Type = "xcode.syntax.definition.function";

                };

           },

            {

                Identifier = "xcode.lang.pascal.subsub";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer.toplevel";

                    Foldable = YES;

                    Rules = (

                        "xcode.lang.pascal.function.declarator",

                        "xcode.lang.pascal.consts?",

                        "xcode.lang.pascal.vars?",

                        "xcode.lang.pascal.consts?",

                        "xcode.lang.pascal.vars?",

                        "xcode.lang.pascal.subsubsub*",  // hardwire three levels of subs as easier than making framework recursive

                        "xcode.lang.pascal.consts?",

                        "xcode.lang.pascal.vars?",

                        "xcode.lang.pascal.consts?",

                        "xcode.lang.pascal.vars?",

                        "xcode.lang.pascal.beginexpr",

                        ";",

                    );

                     Type = "xcode.syntax.definition.function";

                };

           },

           {

                Identifier = "xcode.lang.pascal.subsubsub";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer.toplevel";

                    Foldable = YES;

                    Rules = (

                        "xcode.lang.pascal.function.declarator",

                        "xcode.lang.pascal.consts?",

                        "xcode.lang.pascal.vars?",

                        "xcode.lang.pascal.consts?",

                        "xcode.lang.pascal.vars?",

                        "xcode.lang.pascal.beginexpr",

                        ";",

                    );

                     Type = "xcode.syntax.definition.function";

                };

            },

            {

                Identifier = "xcode.lang.pascal.function.definition";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer";

                    Rules = (

                        "xcode.lang.pascal.function.declarator",

                        "xcode.lang.pascal.method.block",

                    );

                     Type = "xcode.syntax.definition.function";

                };

            },

            {

                Identifier = "xcode.lang.pascal.method.definition.declarator";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer";

                    Rules = (

                        "xcode.lang.pascal.method.definition.name",

                        "xcode.lang.pascal.parenexpr?",

                        "xcode.lang.pascal.method.result?",

                        ";",

                    );

                      Type = "xcode.syntax.name.partial";

              };

            },

            {

                Identifier = "xcode.lang.pascal.classmethod.definition.declarator";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer";

                    Rules = (

                        "xcode.lang.pascal.classmethod.definition.name",

                        "xcode.lang.pascal.parenexpr?",

                        "xcode.lang.pascal.method.result?",

                        ";",

                    );

                      Type = "xcode.syntax.name.partial";

              };

            },

            {

                Identifier = "xcode.lang.pascal.function.declarator";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer";

                    Rules = (

                        "xcode.lang.pascal.function.definition.name",

                        "xcode.lang.pascal.parenexpr?",

                        "xcode.lang.pascal.method.result?",

                        ";",

                    );

                    Type = "xcode.syntax.name.partial";

               };

            },

            {

                Identifier = "xcode.lang.pascal.beginexpr";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer";

                    Start = "begin";

                    End = "end";

                    Foldable = YES;

                    Recursive = YES;

                    IncludeRules = (

                        "xcode.lang.pascal.repeatexpr",

                        "xcode.lang.pascal.caseexpr",

                        "xcode.lang.pascal.beginexpr",

                        "xcode.lang.pascal.tryexpr",

                    );

               };

            },

            {

                Identifier = "xcode.lang.pascal.caseexpr";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer";

                    Start = "case";

                    End = "end";

                    Recursive = YES;

                    Foldable = YES;

                    IncludeRules = (

                        "xcode.lang.pascal.repeatexpr",

                        "xcode.lang.pascal.caseexpr",

                        "xcode.lang.pascal.beginexpr",

                        "xcode.lang.pascal.tryexpr",

                    );

                };

            },

            {

                Identifier = "xcode.lang.pascal.tryexpr";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer";

                    Start = "try";

                    End = "end";

                    Recursive = YES;

                    Foldable = YES;

                    IncludeRules = (

                        "xcode.lang.pascal.repeatexpr",

                        "xcode.lang.pascal.caseexpr",

                        "xcode.lang.pascal.beginexpr",

                        "xcode.lang.pascal.tryexpr",

                    );

                };

            },

            {

                Identifier = "xcode.lang.pascal.repeatexpr";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer";

                    Start = "repeat";

                    End = "until";

                    Recursive = YES;

                    Foldable = YES;

                    IncludeRules = (

                        "xcode.lang.pascal.repeatexpr",

                        "xcode.lang.pascal.caseexpr",

                        "xcode.lang.pascal.beginexpr",

                        "xcode.lang.pascal.tryexpr",

                    );

                };

            },

         

         

        /****************************************************************************/

        // MARK: General

        /****************************************************************************/

         

         

            {

                Identifier = "xcode.lang.pascal.identifiers";

                Syntax = {

                    Tokenizer = "xcode.lang.pascal.lexer";

                    Rules = (

                        ",",

                        "xcode.lang.pascal.identifier",

                    );

                };

            },

            {

                Identifier = "xcode.lang.pascal.objcmessage.declarator";

                Syntax = {

                    Start = "'";

                    End = "'";

                    IncludeRules = (

                         "xcode.lang.pascal.objcmessage",

                       );

                    Type = "xcode.syntax.number";

                };

            },

            {

                Identifier = "xcode.lang.pascal.objcmessage";

                Syntax = {

                    StartChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";

                    Chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_:";

                };

            },

            {

                Identifier = "xcode.lang.pascal.guid.declarator";

                Syntax = {

                    Start = "['{";

                    End = "}']";

                    IncludeRules = (

                         "xcode.lang.pascal.guid",

                       );

                    Type = "xcode.syntax.number";

                };

            },

            {

                Identifier = "xcode.lang.pascal.guid";

                Syntax = {

                    StartChars = "abcdefABCDEF0123456789";

                    Chars = "abcdefABCDEF0123456789-";

                };

            },

            {

                Identifier = "xcode.lang.pascal.comment";

                Syntax = {

                    Start = "(*";

                    End = "*)";

                    Foldable = YES;

                    IncludeRules = ( "xcode.lang.url", "xcode.lang.url.mail", "xcode.lang.comment.mark" );

                    Type = "xcode.syntax.comment";

                };

            },

            {

                Identifier = "xcode.lang.pascal.comment.curlybrace";

                Syntax = {

                    Start = "{";

                    End = "}";

                    Foldable = YES;

                    IncludeRules = ( "xcode.lang.url", "xcode.lang.url.mail", "xcode.lang.comment.mark" );

                    Type = "xcode.syntax.comment";

                };

            },

        )