{ "comment": "This Source Code Form is subject to the terms of the Mozilla Public License,\nv. 2.0. If a copy of the MPL was not distributed with this file, You can obtain\none at http://mozilla.org/MPL/2.0/.", "name": "SWI-Prolog", "scopeName": "source.prolog", "fileTypes": [ "pl", "pro" ], "uuid": "df89928b-6612-475a-b414-f319d9b98664", "patterns": [ { "include": "#comments" }, { "name": "meta.clause.body.prolog", "begin": "(?<=:-)\\s*", "end": "(\\.)", "endCaptures": { "1": { "name": "keyword.control.clause.bodyend.prolog" } }, "patterns": [ { "include": "#comments" }, { "include": "#builtin" }, { "include": "#controlandkeywords" }, { "include": "#atom" }, { "include": "#variable" }, { "include": "#constants" }, { "name": "meta.clause.body.prolog", "match": "." } ] }, { "name": "meta.clause.head.prolog", "begin": "^\\s*([a-z][a-zA-Z0-9_]*)(\\(?)(?=.*:-.*)", "beginCaptures": { "1": { "name": "entity.name.function.clause.prolog" }, "2": { "name": "punctuation.definition.parameters.begin" } }, "end": "((\\)?))\\s*(:-)", "endCaptures": { "1": { "name": "punctuation.definition.parameters.end" }, "3": { "name": "keyword.control.clause.bodybegin.prolog" } }, "patterns": [ { "include": "#atom" }, { "include": "#variable" }, { "include": "#constants" } ] }, { "name": "meta.dcg.head.prolog", "begin": "^\\s*([a-z][a-zA-Z0-9_]*)(\\(?)(?=.*-->.*)", "beginCaptures": { "1": { "name": "entity.name.function.dcg.prolog" }, "2": { "name": "punctuation.definition.parameters.begin" } }, "end": "((\\)?))\\s*(-->)", "endCaptures": { "1": { "name": "punctuation.definition.parameters.end" }, "3": { "name": "keyword.control.dcg.bodybegin.prolog" } }, "patterns": [ { "include": "#atom" }, { "include": "#variable" }, { "include": "#constants" } ] }, { "name": "meta.dcg.body.prolog", "begin": "(?<=-->)\\s*", "end": "(\\.)", "endCaptures": { "1": { "name": "keyword.control.dcg.bodyend.prolog" } }, "patterns": [ { "include": "#comments" }, { "include": "#controlandkeywords" }, { "include": "#atom" }, { "include": "#variable" }, { "include": "#constants" }, { "name": "meta.dcg.body.prolog", "match": "." } ] }, { "name": "meta.fact.prolog", "begin": "^\\s*([a-zA-Z][a-zA-Z0-9_]*)(\\(?)(?!.*(:-|-->).*)", "beginCaptures": { "1": { "name": "entity.name.function.fact.prolog" }, "2": { "name": "punctuation.definition.parameters.begin" } }, "end": "((\\)?))\\s*(\\.)(?!\\d+)", "endCaptures": { "1": { "name": "punctuation.definition.parameters.end" }, "3": { "name": "keyword.control.fact.end.prolog" } }, "patterns": [ { "include": "#atom" }, { "include": "#variable" }, { "include": "#constants" }, { "include": "#comments" } ] } ], "repository": { "atom": { "patterns": [ { "name": "constant.other.atom.simple.prolog", "match": "(?)", "beginCaptures": { "1": { "name": "keyword.control.if.prolog" } }, "end": "(;)", "endCaptures": { "1": { "name": "keyword.control.else.prolog" } }, "patterns": [ { "include": "$self" }, { "include": "#builtin" }, { "include": "#comments" }, { "include": "#atom" }, { "include": "#variable" }, { "name": "meta.if.body.prolog", "match": "." } ] }, { "name": "keyword.control.cut.prolog", "match": "!" }, { "name": "keyword.operator.prolog", "match": "(\\s(is)\\s)|=:=|=?\\\\?=|\\\\\\+|@?>|@?=?<|\\+|\\*|\\-|#?=" } ] }, "variable": { "patterns": [ { "name": "variable.parameter.uppercase.prolog", "match": "(?