// COPYRIGHT ANSYS. ALL RIGHTS RESERVED //

'use strict';

ace.define(
    'ace/mode/apdl',
    [
        'require',
        'exports',
        'module',
        'ace/lib/oop',
        'ace/mode/text',
        'ace/mode/apdl_highlight_rules'
    ],
    function(require, exports, module) {
        var oop = require("../lib/oop");
        var TextMode = require("./text").Mode;
        var ApdlHighlightRules = require("./apdl_highlight_rules").ApdlHighlightRules;

        var Mode = function() {
            this.HighlightRules = ApdlHighlightRules;
        };
        oop.inherits(Mode, TextMode);

        (function() {

            this.lineCommentStart = "!";

        }).call(Mode.prototype);

        exports.Mode = Mode;
    }
);

ace.define(
    'ace/mode/apdl_highlight_rules',
    [
        'require',
        'exports',
        'module',
        'ace/lib/oop',
        'ace/mode/text_highlight_rules'
    ],
    function(require, exports, module) {
        var oop = require("../lib/oop");
        var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;

        var ApdlHighlightRules = function() {
            this.$rules = {
                "start": [
                    {
                        token: "comment",
                        regex: /!.*$/
                    }, {
                        token: "comment",
                        regex: /^\s*\/com,.*$/
                    }, {
                        token: ["other", "identifier", "keyword.operator"],
                        regex: /^(\s*)(\w+)(=)/
                    }, {
                        token: ["other", "variable.language", "punctuation.operator"],
                        regex: /^(\s*)(\w+)(,?)/
                    }, {
                        token: ["other", "keyword", "punctuation.operator"],
                        regex: /^(\s*)(\*\w+)(,?)/
                    }, {
                        token: ["", "keyword", "punctuation.operator"],
                        regex: /^(\s*)(\/\w+)(,?)/
                    }, {
                        token: "punctuation.operator",
                        regex: ","
                    }, {
                        token: "identifier",
                        regex: /%\w+%/
                    }, {
                        token: "constant.numeric", // float
                        regex: /[+\-]?[\d]+(?:\.?\d*(?:[eE][+\-]?\d+)?)?/
                    }
                ]
            };
        };

        oop.inherits(ApdlHighlightRules, TextHighlightRules);
        exports.ApdlHighlightRules = ApdlHighlightRules;
    }
);