From dc6ff6d8997f31fa0aec1fd0b41977f97b763b2a Mon Sep 17 00:00:00 2001 From: Sebastian Godelet Date: Mon, 1 Dec 2014 18:54:54 +0800 Subject: [PATCH 1/2] small adjustments to Prolog grammar - fixed greedy eating of newline for one-line comments - s/.prolog/.source.prolog/g - function name detection --- Syntaxes/Prolog.tmLanguage | 49 +++++++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 17 deletions(-) diff --git a/Syntaxes/Prolog.tmLanguage b/Syntaxes/Prolog.tmLanguage index 49844d0..fe2c676 100644 --- a/Syntaxes/Prolog.tmLanguage +++ b/Syntaxes/Prolog.tmLanguage @@ -18,7 +18,7 @@ 0 name - punctuation.definition.string.begin.prolog + punctuation.definition.string.begin.source.prolog end @@ -28,24 +28,24 @@ 0 name - punctuation.definition.string.end.prolog + punctuation.definition.string.end.source.prolog name - string.quoted.single.prolog + string.quoted.single.source.prolog patterns match \\. name - constant.character.escape.prolog + constant.character.escape.source.prolog match '' name - constant.character.escape.quote.prolog + constant.character.escape.quote.source.prolog @@ -57,13 +57,13 @@ 0 name - punctuation.definition.comment.prolog + punctuation.definition.comment.source.prolog end \*/ name - comment.block.prolog + comment.block.source.prolog begin @@ -73,7 +73,7 @@ 1 name - punctuation.whitespace.comment.leading.prolog + punctuation.whitespace.comment.leading.source.prolog end @@ -88,27 +88,39 @@ 0 name - punctuation.definition.comment.prolog + punctuation.definition.comment.source.prolog end - \n + (?=\n) name - comment.line.percentage.prolog + comment.line.percentage.source.prolog match - :- + :- ((use_)?module) name - keyword.operator.definition.prolog + keyword.operator.definition.source.prolog match \b[A-Z][a-zA-Z0-9_]*\b name - variable.other.prolog + variable.other.source.prolog + + + match + \b[a-z][a-zA-Z0-9_]*(?=:) + name + module.namespace.other.source.prolog + + + match + \b[a-z][a-zA-Z0-9_]*(?=\() + name + module.function.other.source.prolog comment @@ -116,15 +128,18 @@ I changed this from entity to storage.type, but have no idea what it is -- Allan And I changed this to constant.other.symbol after glancing over the docs, might still be wrong. -- Infininight + symbol fits better than storage.type, + since lower-case constants represent atoms, + i.e. fixed entities. -- sebgod match - \b[a-z][a-zA-Z0-9_]*\b + \b[a-z][a-zA-Z0-9_]*(?!\() name - constant.other.symbol.prolog + constant.other.symbol.source.prolog scopeName - source.prolog + source.source.prolog uuid C0E2ADB0-1706-4A28-8DB7-263BDC8B5C5C From 25b79aa99404412ea91f7739f34e58d0b5ec391f Mon Sep 17 00:00:00 2001 From: Sebastian Godelet Date: Mon, 1 Dec 2014 20:57:06 +0800 Subject: [PATCH 2/2] Update Prolog.tmLanguage source.source.prolog -> source.prolog --- Syntaxes/Prolog.tmLanguage | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Syntaxes/Prolog.tmLanguage b/Syntaxes/Prolog.tmLanguage index fe2c676..baa0a0f 100644 --- a/Syntaxes/Prolog.tmLanguage +++ b/Syntaxes/Prolog.tmLanguage @@ -128,7 +128,7 @@ I changed this from entity to storage.type, but have no idea what it is -- Allan And I changed this to constant.other.symbol after glancing over the docs, might still be wrong. -- Infininight - symbol fits better than storage.type, + constant fits better than storage.type, since lower-case constants represent atoms, i.e. fixed entities. -- sebgod @@ -139,7 +139,7 @@ scopeName - source.source.prolog + source.prolog uuid C0E2ADB0-1706-4A28-8DB7-263BDC8B5C5C