comment: "This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain" fileTypes: [ "yap" "yss" "prolog" "pl" "pro" ] firstLineMatch: "^(#!/.*\\byap|\\%.*prolog.*)" foldingStartMarker: "^(([a-z]\\w*|\\'\\$\\w\\')\\(|\\s*\\(|\\s*\\/\\*)" foldingStopMarker: "(\\)|\\.|\\*\\/)\\s*$" name: "YAP-Prolog" patterns: [ { include: "#comments" } { begin: "^(:-)\\s*(([a-z]\\w*:)?([a-z]\\w*|\\'\\$\\w*\\'))(?=(\\(|\\s))" beginCaptures: "1": name: "keyword.control.directive.begin.prolog" "2": name: "entity.directivesss.prolog" end: "(\\.)(\\s|$)" endCaptures: "2": name: "keyword.control.directive.end.prolog" name: "meta.directive.prolog" patterns: [ { include: "#functor" } { include: "#atom" } { include: "#variable" } { include: "#constants" } { match: "." } ] } { begin: "^\\s*(([a-z]\\w*)(:))?([a-z]\\w*|\\'\\$\\w*\\')\\(" beginCaptures: "0": name: "meta.clause.prolog.head" "2": name: "entity.name.module.clause.prolog" "3": name: "keyword.control.module.prolog" "4": name: "entity.name.predicate.prolog" end: "((\\.)(\\s|$))" endCaptures: "2": name: "keyword.control.clause.end.prolog" name: "meta.clause.prolog" patterns: [ { include: "#clause_head_arguments" } { include: "#clause_body" } ] } { begin: "^\\s*(([a-z]\\w*)(:))?([a-z]\\w*|\\'\\$\\w*\\')\\s*" beginCaptures: "0": name: "meta.clause.prolog.head" "2": name: "entity.name.module.clause.prolog" "3": name: "keyword.control.module.prolog" "4": name: "entity.name.predicate.prolog" end: "((\\.)(\\s|$))" endCaptures: "2": name: "keyword.control.clause.end.prolog" name: "meta.clause.prolog" patterns: [ { include: "#clause_body" } ] } ] repository: args: name: "meta.term.arguments" patterns: [ { include: "#term" } { match: "\\," } ] atom: patterns: [ { match: "\\[\\]" name: "constant.other.atom.emptylist.prolog" } { match: "\\b[a-z]\\w*\\b" name: "support.atom.simple.prolog" } { begin: "(?)" beginCaptures: "1": name: "keyword.control.clause.neck.prolog" end: "(?=((\\.)(\\s|$)))" name: "meta.clause.prolog.body" patterns: [ { include: "#conj" } { include: "#conj" } { include: "#base_call" } ] clause_head_arguments: begin: "(?<=\\()" end: "(\\))\\s*(?=(:-|-->|\\.))" name: "meta.clause.prolog.head" patterns: [ { include: "#args" } ] comments: comment: "All comment types" patterns: [ { include: "#documentation-comment" } { include: "#block-comment" } { include: "#in-line-comment" } { include: "#in-line-documentation" } ] conj: begin: "\\," beginCaptures: "0": name: "keyword.control.and.prolog" end: "(?=(\\,|\\)|\\}|\\]|\\.))" name: "meta.clause.body.conjunction" patterns: [ { include: "#disj" } { include: "#conj" } { include: "#base_call" } ] constants: patterns: [ { match: "0\\'(.)" name: "constant.character.code.prolog" } { match: "0x\\h+0x" name: "constant.numeric.hexa.prolog" } { match: "0[0-7]+" name: "constant.numeric.octal.prolog" } { match: "[+-]?\\d+" name: "constant.numeric.integer.prolog" } { match: "([0-9_]+)(\\.([0-9]+))?([eE][+\\-]?([0-9]+))?" name: "constant.numeric.floating-point.prolog" } { begin: "\\\"" beginCaptures: "0": name: "string.quoted.double.prolog" end: "\\\"" endCaptures: "0": name: "string.quoted.double.prolog" name: "string.quoted.double.prolog" patterns: [ { match: "\\\\[abcfnrstv\\'\\\"\\`\\\\]" name: "constant.character.doubleescape.prolog" } { match: "\\\\(x\\h{2}|u\\h{4}|U\\h{8})" name: "constant.character.double_code.prolog" } { match: "\\\"\\\"" name: "constant.character.double_qu.prolog" } { match: "(.)" name: "string.quoted.double.prolog" } ] } { begin: "\\`" beginCaptures: "0": name: "string.quoted.back.prolog" end: "\\`" endCaptures: "0": name: "string.quoted.back.prolog" name: "string.quoted.back.prolog" patterns: [ { match: "\\\\[abcfnrstv\\'\\\"\\`\\\\]" name: "constant.character.backescape.prolog" } { match: "\\\\(x\\h{2}|u\\h{4}|U\\h{8})" name: "constant.character.back_code.prolog" } { match: "\\`\\`" name: "constant.character.back_qu.prolog" } { match: "(.)" name: "string.quoted.back.prolog" } ] } ] crlbrackets: begin: "(\\{)" end: "(\\})" name: "curly.brackets" patterns: [ { include: "#comments" } { match: "\\s*\\,\\s*" } { include: "#term" } ] disj: begin: "((\\;)|(->))" beginCaptures: "2": name: "keyword.control.or.prolog" "3": name: "keyword.control.if.prolog" end: "\\s*(?=(\\,|\\;|\\.|\\)|\\}|\\|\\.\\]))" name: "meta.clause.disjunction" patterns: [ { include: "#disj" } { include: "#base_call" } ] "documentation-comment": begin: "/\\*[*!]\\s" beginCaptures: "0": name: "punctuation.definition.comment.block.documentation.begin.prolog" comment: "Documentation comment" end: "\\*/" endCaptures: "0": name: "punctuation.definition.comment.block.documentation.end.prolog" name: "comment.block.documentation.prolog" patterns: [ { include: "#dox" } { include: "pred" } { match: "." } ] dox: patterns: [ { captures: "1": name: "keyword.language.doxygen.prolog" "2": name: "string.unquoted.file.prolog" match: "(@file)(.*$)" } { captures: "1": name: "keyword.language.doxygen.prolog" "2": name: "variable.label.group.prolog" match: "(@ingroup)(.*$)" } { captures: "1": name: "keyword.language.doxygen.prolog" "2": name: "variable.label.group.prolog" "3": name: "string.text.group.prolog" match: "(@defgroup)\\s+(\\w+)\\s+(.*$)" } { captures: "1": name: "keyword.language.doxygen.prolog" "2": name: "string.unquoted.text.prolog" match: "(@pred)(.*$)" } { captures: "1": name: "keyword.language.doxygen.prolog" match: "(@\\w+\\b|\\\\w*)" } ] eot: captures: "1": name: "keyword.control.eot.prolog" match: "(\\.\\s*(\\s|$))" functor: captures: "1": name: "constant.functor.prolog" "2": name: "constant.functor.name.prolog" "3": name: "constant.functor.arity.prolog" match: "(([a-z]\\w*|\\'\\$\\w*\\')/\\d+)" "in-line-comment": captures: "1": name: "punctuation.definition.comment.line.double-slash.prolog" comment: "In-line comment" match: "\\%.*" name: "comment.line.percentage.prolog" "in-line-documentation": captures: "1": name: "punctuation.definition.comment.line.percent.prolog" comment: "In-line comment" match: "\\%\\%\\s.*" name: "comment.line.percentage.documentation.prolog" patterns: [ { include: "#dox" } { match: "." } ] op_infix: match: "(same|\\^|\\*\\*|rem|mod|\\>\\>| \\<\\<|\\/\\/|\\/|\\*|xor|div|rdiv|\\#| ><|\\\\\\/|\\/\\\\|\\\\-|\\\\+|:|as|>=|=<| >|<|=\\\\=|=:=|\\\\=@=|=@=|@>=|@=<|@>|@<| \\\\==|==|=\\.\\.|is|\\\\=|=|->|\\;|\\,|\\||-->|\\?-)" name: "keyword.control.op.infix.prolog" op_prefix: match: "(spy|nospy|block|\\\\|\\-|\\+|not|\\\\\\+|uncutable| table|discontiguous|module_transparent|meta_predicate|multifile| public|mode|volatile|initialization|thread_local| dynamic|\\?-|\\?-)" name: "keyword.control.op.prefix.prolog" protected_term: begin: "\\b" beginCaptures: "1": name: "meta.term.prolog" end: "\\b" name: "meta.call.user.prolog" patterns: [ { include: "#term" } ] "shebang-line": captures: "1": name: "punctuation.definition.comment.line.shebang.prolog" comment: "Shebang line" match: "^(#!).*$" name: "comment.line.shebang.prolog" sqrbrackets: begin: "(\\[)" end: "(\\])" name: "sqr.brackets" patterns: [ { include: "#comments" } { match: "\\s*(\\,|\\|)\\s*" } { include: "#term" } ] term: name: "meta.term.prolog" patterns: [ { include: "#comments" } { include: "#op_infix" } { include: "#op_prefix" } { include: "#atom" } { include: "#variable" } { include: "#constants" } { include: "#brackets" } { include: "#sqrbrackets" } { include: "#crlbrackets" } { match: "\\s" } ] user_call: begin: "([a-z]]w*:)?([a-z]\\w*|\\'\\$\\w*\\')(\\()" beginCaptures: "1": name: "meta.term.prolog" end: "\\s*(\\))\\s*" name: "meta.call.user.prolog" patterns: [ { include: "#comments" } { include: "#args" } ] variable: patterns: [ { match: "(?