{
    "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
    "name": "NovaLang",
    "scopeName": "source.nova",
    "patterns": [
        {
            "include": "#keywords"
        },
        {
            "include": "#decorators"
        },
        {
            "include": "#strings"
        },
        {
            "include": "#comments"
        },
        {
            "include": "#numbers"
        },
        {
            "include": "#functions"
        },
        {
            "include": "#classes"
        },
        {
            "include": "#operators"
        },
        {
            "include": "#variables"
        }
    ],
    "repository": {
        "keywords": {
            "patterns": [
                {
                    "name": "keyword.control.novalang",
                    "match": "\\b(if|else|while|for|return|break|continue|switch|case|default)\\b"
                },
                {
                    "name": "keyword.declaration.novalang",
                    "match": "\\b(function|class|let|const|var)\\b"
                },
                {
                    "name": "keyword.other.novalang",
                    "match": "\\b(new|this|super|extends|implements)\\b"
                },
                {
                    "name": "constant.language.novalang",
                    "match": "\\b(null|undefined|true|false)\\b"
                },
                {
                    "name": "storage.type.novalang",
                    "match": "\\b(string|number|boolean|array|object|date)\\b"
                }
            ]
        },
        "decorators": {
            "patterns": [
                {
                    "name": "entity.name.tag.decorator.novalang",
                    "match": "@(Component|Entity|Service|Repository|Controller|Application|Configuration|Autowired|RestController|RequestMapping|GetMapping|PostMapping|PutMapping|DeleteMapping)\\b"
                }
            ]
        },
        "strings": {
            "patterns": [
                {
                    "name": "string.quoted.double.novalang",
                    "begin": "\"",
                    "end": "\"",
                    "patterns": [
                        {
                            "name": "constant.character.escape.novalang",
                            "match": "\\\\."
                        },
                        {
                            "name": "variable.other.placeholder.novalang",
                            "match": "\\$\\{[^}]*\\}"
                        }
                    ]
                },
                {
                    "name": "string.quoted.single.novalang",
                    "begin": "'",
                    "end": "'",
                    "patterns": [
                        {
                            "name": "constant.character.escape.novalang",
                            "match": "\\\\."
                        }
                    ]
                },
                {
                    "name": "string.quoted.template.novalang",
                    "begin": "`",
                    "end": "`",
                    "patterns": [
                        {
                            "name": "variable.other.placeholder.novalang",
                            "match": "\\$\\{[^}]*\\}"
                        },
                        {
                            "name": "constant.character.escape.novalang",
                            "match": "\\\\."
                        }
                    ]
                }
            ]
        },
        "comments": {
            "patterns": [
                {
                    "name": "comment.line.double-slash.novalang",
                    "match": "//.*$"
                },
                {
                    "name": "comment.block.novalang",
                    "begin": "/\\*",
                    "end": "\\*/",
                    "patterns": [
                        {
                            "name": "comment.block.documentation.novalang",
                            "match": "\\*.*"
                        }
                    ]
                }
            ]
        },
        "numbers": {
            "patterns": [
                {
                    "name": "constant.numeric.float.novalang",
                    "match": "\\b\\d+\\.\\d+([eE][+-]?\\d+)?\\b"
                },
                {
                    "name": "constant.numeric.integer.novalang",
                    "match": "\\b\\d+([eE][+-]?\\d+)?\\b"
                },
                {
                    "name": "constant.numeric.hex.novalang",
                    "match": "\\b0[xX][a-fA-F0-9]+\\b"
                }
            ]
        },
        "functions": {
            "patterns": [
                {
                    "name": "entity.name.function.novalang",
                    "match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\s*(?=\\()"
                },
                {
                    "name": "support.function.builtin.novalang",
                    "match": "\\b(print|len|str|num|Math|Date|Object|Array)\\b"
                }
            ]
        },
        "classes": {
            "patterns": [
                {
                    "name": "entity.name.class.novalang",
                    "match": "(?<=class\\s+)[a-zA-Z_][a-zA-Z0-9_]*"
                },
                {
                    "name": "entity.name.class.novalang",
                    "match": "(?<=new\\s+)[a-zA-Z_][a-zA-Z0-9_]*"
                }
            ]
        },
        "operators": {
            "patterns": [
                {
                    "name": "keyword.operator.arithmetic.novalang",
                    "match": "\\+|\\-|\\*|\\/|\\%|\\+\\+|\\-\\-"
                },
                {
                    "name": "keyword.operator.comparison.novalang",
                    "match": "==|!=|<|<=|>|>=|===|!=="
                },
                {
                    "name": "keyword.operator.logical.novalang",
                    "match": "&&|\\|\\||!"
                },
                {
                    "name": "keyword.operator.assignment.novalang",
                    "match": "=|\\+=|\\-=|\\*=|\\/=|\\%="
                },
                {
                    "name": "keyword.operator.other.novalang",
                    "match": "\\?|:|\\.|\\->"
                }
            ]
        },
        "variables": {
            "patterns": [
                {
                    "name": "variable.other.property.novalang",
                    "match": "(?<=\\.)([a-zA-Z_][a-zA-Z0-9_]*)"
                },
                {
                    "name": "variable.other.novalang",
                    "match": "\\b[a-zA-Z_][a-zA-Z0-9_]*\\b"
                }
            ]
        }
    }
}
