{
    "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
    "name": "pip requirements",
    "scopeName": "source.pip-requirements",
    "patterns": [
        {
            "explanation": "Line continuation",
            "match": "\\s*\\\\s*$",
            "name": "constant.character.escape"
        },
        {
            "match": "#.*",
            "name": "comment.line.number-sign"
        },
        {
            "begin": "'",
            "end": "'",
            "name": "string.quoted.single"
        },
        {
            "begin": "\"",
            "end": "\"",
            "name": "string.quoted.double"
        },
        {
            "match": "/?(\\S+/)+\\S*",
            "name": "string.path"
        },
        {
            "explanation": "project name",
            "match": "^\\s*([A-Za-z0-9][A-Za-z0-9._-]*[A-Za-z0-9]|[A-Za-z0-9])",
            "captures": {
                "1": {
                    "name": "entity.name.class"
                }
            }
        },
        {
            "explanation": "extras",
            "match": "\\[([^\\]]+)\\]",
            "captures": {
                "1": {
                    "name": "entity.name.tag"
                }
            }
        },
        {
            "explanation": "version specification",
            "match": "(<|<=|!=|==|>=|>|~=|===)\\s*([\\w.*+!-]+)",
            "captures": {
                "1": {
                    "name": "keyword.operator.comparison"
                },
                "2": {
                    "name": "constant.numeric"
                }
            }
        },
        {
            "explanation": "environment markers",
            "match": ";\\s*(python_version|python_full_version|os_name|sys_platform|platform_release|platform_system|platform_version|platform_machine|platform_python_implementation|implementation_name|implementation_version|extra)\\s*(<|<=|!=|==|>=|>|~=|===)",
            "captures": {
                "1": {
                    "name": "entity.name.selector"
                },
                "2": {
                    "name": "keyword.operator.comparison"
                }
            }
        },
        {
            "explanation": "command-line options (e.g. `--no-links` or `-c`)",
            "match": "-[^\\s=]+",
            "name": "entity.other.attribute-name"
        }
    ]
}
