Permalink
Browse files

Fix syntax coloring of the new `instantiation_error` method

  • Loading branch information...
pmoura committed Nov 13, 2017
1 parent c29fac5 commit 3bfe252fa7c9597bf04df62c87289331ab6cacbb
View
@@ -135,7 +135,8 @@
("\\<\\(ca\\(?:ll\\|tch\\)\\|throw\\)\\([(]\\)" 1 'logtalk-built-in-predicate-face)
("\\<\\(fa\\(?:il\\|lse\\)\\|true\\)\\>" 0 'logtalk-built-in-predicate-face)
("\\(!\\|->\\|;\\)" 0 'logtalk-built-in-predicate-face)
("\\<\\(\\(?:instantiation\\|type\\|domain\\|existence\\|permission\\|representation\\|evaluation\\|resource\\)_error\\)\\([(]\\)" 1 'logtalk-built-in-predicate-face)
("\\<instantiation_error\\>" 0 'logtalk-built-in-predicate-face)
("\\<\\(\\(?:type\\|domain\\|existence\\|permission\\|representation\\|evaluation\\|resource\\)_error\\)\\([(]\\)" 1 'logtalk-built-in-predicate-face)
;;
;; multi-threading:
;;
View
@@ -172,7 +172,7 @@
'abolish', 'asserta', 'assertz', 'clause', 'retract', 'retractall',
// control
'call', 'catch', 'ignore', 'once', 'throw',
'instantiation_error', 'type_error', 'domain_error', 'existence_error', 'permission_error',
'type_error', 'domain_error', 'existence_error', 'permission_error',
'representation_error', 'evaluation_error', 'resource_error'
// all solutions predicates
'bagof', 'findall', 'forall', 'setof',
@@ -219,7 +219,7 @@
// Built-in predicates (no arguments)
5 => array(
// control
'fail', 'false', 'repeat', 'true',
'fail', 'false', 'repeat', 'true', 'instantiation_error',
// character and byte input/output predicates
'nl',
// implementation defined hooks functions
@@ -254,8 +254,8 @@
<keyword>((current_)?char_conversion)(?=[(])</keyword>
<!-- Logic and control -->
<keyword>(ca(ll|tch)|ignore|once|throw)(?=[(])</keyword>
<keyword>(true|fa(il|lse)|repeat)(?![-!(^~])</keyword>
<keyword>((instantiation|type|domain|existence|permission|representation|evaluation|resource)_error)(?=[(])</keyword>
<keyword>(true|fa(il|lse)|repeat|instantiation_error)(?![-!(^~])</keyword>
<keyword>((type|domain|existence|permission|representation|evaluation|resource)_error)(?=[(])</keyword>
<!-- Atomic term processing -->
<keyword>(atom_(length|c(hars|o(ncat|des))))(?=[(])</keyword>
<keyword>(sub_atom)(?=[(])</keyword>
@@ -61,8 +61,8 @@ $KEYWORDS(kwc)=regex((clause|retract(all)?)(?=[(]), 1)
$KEYWORDS(kwc)=regex((a(bolish|ssert(a|z)))(?=[(]), 1)
# control
$KEYWORDS(kwc)=regex((throw|ca(ll|tch))(?=[(]), 1)
$KEYWORDS(kwc)=regex((fa(il|lse)|true), 1)
$KEYWORDS(kwc)=regex(((instantiation|type|domain|existence|permission|representation|evaluation|resource)_error)(?=[(]), 1)
$KEYWORDS(kwc)=regex((fa(il|lse)|true|instantiation_error), 1)
$KEYWORDS(kwc)=regex(((type|domain|existence|permission|representation|evaluation|resource)_error)(?=[(]), 1)
# all solutions
$KEYWORDS(kwc)=regex((bagof|setof|findall|forall)(?=[(]), 1)
# multi-threading predicates
@@ -15,7 +15,7 @@
public static final Set<String> ATOM_KEYWORDS = new HashSet<>(asList( //newHashSet(
"else" , "endif" , "dynamic" ,
"end_category" , "end_object" , "end_protocol" , "threaded" , "eos" , "logtalk_make" , "built_in" , "halt" ,
"flush_output" , "at_end_of_stream" , "true" , "fail" , "false" , "repeat" , "nl" , "pi" , "e"));
"flush_output" , "at_end_of_stream" , "true" , "fail" , "false" , "repeat" , "instantiation_error" , "nl" , "pi" , "e"));
public static final Set<String> COMPOUND_NAME_KEYWORDS = new HashSet<>(asList( //newHashSet
"encoding" , "initialization" , "op" ,
@@ -25,7 +25,7 @@
"multifile" , "private" , "protected" , "public" , "synchronized" , "use_module" ,
"context", "parameter" , "self" , "sender" , "this" , "current_op" , "current_predicate" , "predicate_property" , "abolish" , "asserta" ,
"assertz" , "clause" , "retract" , "retractall" , "call" , "once" , "catch" , "throw" ,
"instantiation_error" , "type_error" , "domain_error" , "existence_error" ,
"type_error" , "domain_error" , "existence_error" ,
"permission_error" , "representation_error" , "evaluation_error", "resource_error" ,
"bagof" , "findall" , "forall" , "setof" ,
"before" , "after" , "forward" , "phrase" , "expand_term" , "term_expansion" , "expand_goal" ,
View
@@ -85,8 +85,8 @@
<SEQ_REGEXP AT_WORD_START="TRUE" TYPE="KEYWORD2">\ba(bolish|ssert(a|z))(?=[(])</SEQ_REGEXP>
<!-- Control -->
<SEQ_REGEXP AT_WORD_START="TRUE" TYPE="KEYWORD2">\b(ca(ll|tch)|throw)(?=[(])</SEQ_REGEXP>
<SEQ_REGEXP AT_WORD_START="TRUE" TYPE="KEYWORD2">\b(fa(il|lse)|true)\b</SEQ_REGEXP>
<SEQ_REGEXP AT_WORD_START="TRUE" TYPE="KEYWORD2">\b(instantiation|type|domain|existence|permission|representation|evaluation|resource)_error(?=[(])</SEQ_REGEXP>
<SEQ_REGEXP AT_WORD_START="TRUE" TYPE="KEYWORD2">\b(fa(il|lse)|true|instantiation_error)\b</SEQ_REGEXP>
<SEQ_REGEXP AT_WORD_START="TRUE" TYPE="KEYWORD2">\b(type|domain|existence|permission|representation|evaluation|resource)_error(?=[(])</SEQ_REGEXP>
<!-- All solutions -->
<SEQ_REGEXP AT_WORD_START="TRUE" TYPE="KEYWORD2">\b((bag|set)of|f(ind|or)all)(?=[(])</SEQ_REGEXP>
<!-- Multi-threading predicates -->
View
@@ -40,8 +40,8 @@
<RegExpr String = "\ba(bolish|ssert(a|z))(?=[(])" attribute = "Built-in" context = "#stay" />
<!-- Control -->
<RegExpr String = "\b(ca(ll|tch)|throw)(?=[(])" attribute = "Built-in" context = "#stay" />
<RegExpr String = "\b(fa(il|lse)|true)\b" attribute = "Built-in" context = "#stay" />
<RegExpr String = "\b(instantiation|type|domain|existence|permission|representation|evaluation|resource)_error(?=[(])" attribute = "Built-in" context = "#stay" />
<RegExpr String = "\b(fa(il|lse)|true|instantiation_error)\b" attribute = "Built-in" context = "#stay" />
<RegExpr String = "\b(type|domain|existence|permission|representation|evaluation|resource)_error(?=[(])" attribute = "Built-in" context = "#stay" />
<!-- All solutions -->
<RegExpr String = "\b((bag|set)of|f(ind|or)all)(?=[(])" attribute = "Built-in" context = "#stay" />
<!-- Multi-threading predicates -->
@@ -33,9 +33,9 @@ nedit.highlightPatterns: Logtalk:1:0{\n\
Message sending operators:"::|\\^\\^":::Keyword::\n\
Category predicate direct call:":":::Keyword::\n\
External call:"[{}]":::Keyword::\n\
Control constructs:"!|;|\\-\\-\\>|\\-\\>|<(true|fail|false)>":::Subroutine::\n\
Control constructs:"!|;|\\-\\-\\>|\\-\\>|<(true|fail|false|instantiation_error)>":::Subroutine::\n\
Control constructs:"<(call|catch|throw)(?=[(])":::Subroutine::\n\
Control constructs:"<(instantiation_error|type_error|domain_error|existence_error|permission_error|representation_error|evaluation_error|resource_error)(?=[(])":::Subroutine::\n\
Control constructs:"<(type_error|domain_error|existence_error|permission_error|representation_error|evaluation_error|resource_error)(?=[(])":::Subroutine::\n\
Block comment:"/\\*":"\\*/"::Comment::\n\
Line comment:"%":"$"::Comment::\n\
Number:"0'.":::Numeric Const::\n\
@@ -72,8 +72,8 @@ class LogtalkLexer(RegexLexer):
(r'a(bolish|ssert(a|z))(?=[(])', Keyword),
# Control constructs
(r'(ca(ll|tch)|throw)(?=[(])', Keyword),
(r'(fa(il|lse)|true)\b', Keyword),
(r'(instantiation|type|domain|existence|permission|representation|evaluation|resource)_error(?=[(])', Keyword),
(r'(fa(il|lse)|true|instantiation_error)\b', Keyword),
(r'(type|domain|existence|permission|representation|evaluation|resource)_error(?=[(])', Keyword),
# All solutions
(r'((bag|set)of|f(ind|or)all)(?=[(])', Keyword),
# Multi-threading predicates
@@ -61,8 +61,8 @@ def self.analyze_text(text)
rule /(abolish|asserta|assertz)(?=[(])/, Keyword
# Control constructs
rule /(call|catch|throw)(?=[(])/, Keyword
rule /(fail|false|true)\b/, Keyword
rule /(instantiation_error|type_error|domain_error|existence_error|permission_error|representation_error|evaluation_error|resource_error)(?=[(])/, Keyword
rule /(fail|false|true|instantiation_error)\b/, Keyword
rule /(type_error|domain_error|existence_error|permission_error|representation_error|evaluation_error|resource_error)(?=[(])/, Keyword
# All solutions
rule /(bagof|setof|findall|forall)(?=[(])/, Keyword
# Multi-threading meta-predicates
@@ -24,7 +24,7 @@ sh_languages['logtalk'] = [
4
],
[
/\b(?:abolish|c(?:urrent|reate))_(?:object|protocol|category)(?=\()|\b(?:object|protocol|category)_property(?=\()|\bco(?:mplements_object|nforms_to_protocol)(?=\()|\bextends_(?:object|protocol|category)(?=\()|\bimp(?:lements_protocol|orts_category)(?=\()|\b(?:instantiat|specializ)es_class(?=\()|\b(?:current_event|(?:abolish|define)_events)(?=\()|\b(?:create|current|set)_logtalk_flag(?=\()|\blogtalk_(?:compile|l(?:oad|oad_context|ibrary_path)|make)(?=\()|\b(?:logtalk_make)\b|\b(?:after|before)(?=\()|\bforward(?=\()|\b(?:context|parameter|this|se(?:lf|nder))(?=\()|\b(?:current_predicate|predicate_property)(?=\()|\b(?:expand_(?:goal|term)|(?:goal|term)_expansion|phrase)(?=\()|\b(?:clause|retract(?:all)?)(?=\()|\ba(?:bolish|ssert(?:a|z))(?=\()|\b(?:ca(?:ll|tch)|throw)(?=\()|\b(?:instantiation|type|domain|existence|permission|representation|evaluation|resource)_error(?=\()|\b(?:(?:bag|set)of|f(?:ind|or)all)(?=\()|\bthreaded(?:_(?:call|once|ignore|exit|peek|wait|notify))?(?=\()|\bthreaded_engine(?:_(?:create|destroy|self|next|next_reified|yield|post|fetch))?(?=\()|\b(subsumes_term|unify_with_occurs_check)(?=\()|\b(?:functor|arg|copy_term|numbervars|term_variables)(?=\()|\b(?:div|rem|m(?:ax|in|od)|abs|sign)(?=\()|\b(?:float_(?:integer|fractional)_part|float)(?=\()|\b(?:floor|t(?:an|runcate)|round|ceiling|xor)(?=\()|\b(?:cos|a(?:cos|sin|tan|tan2)|exp|log|s(?:in|qrt))(?=\()|\b(?:var|atom(?:ic)?|integer|float|c(?:allable|ompound)|n(?:onvar|umber)|ground|acyclic_term)(?=\()|\bcompare(?=\()|\b(?:curren|se)t_(?:in|out)put(?=\()|\b(?:open|close)(?=\()|\bflush_output(?=\()|\b(?:flush_output|at_end_of_stream)\b|\b(?:stream_property|at_end_of_stream|set_stream_position)(?=\()|\b(?:get|p(?:eek|ut))_(?:byte|c(?:har|ode))(?=\()|\bnl(?=\()|\b(?:nl)\b|\b(?:read(?:_term)?)(?=\()|\b(?:write(?:q|_(?:canonical|term))?)(?=\()|\b(?:op|current_op)(?=\()|\b(?:(?:current_)?char_conversion)(?=\()|\batom_(?:length|c(?:hars|o(?:ncat|des)))(?=\()|\b(?:char_code|sub_atom)(?=\()|\bnumber_(?:c(?:har|ode)s)(?=\()|\b(?:set|current)_prolog_flag(?=\()|\bhalt(?=\()|\b(?:halt)\b|\b(?:ignore|once)(?=\()|\b(?:(?:key)?sort)(?=\()|\b(?:true|fa(?:il|lse)|repeat)\b|\b(?:e|pi|as|is|rem|mod|div)\b/g,
/\b(?:abolish|c(?:urrent|reate))_(?:object|protocol|category)(?=\()|\b(?:object|protocol|category)_property(?=\()|\bco(?:mplements_object|nforms_to_protocol)(?=\()|\bextends_(?:object|protocol|category)(?=\()|\bimp(?:lements_protocol|orts_category)(?=\()|\b(?:instantiat|specializ)es_class(?=\()|\b(?:current_event|(?:abolish|define)_events)(?=\()|\b(?:create|current|set)_logtalk_flag(?=\()|\blogtalk_(?:compile|l(?:oad|oad_context|ibrary_path)|make)(?=\()|\b(?:logtalk_make)\b|\b(?:after|before)(?=\()|\bforward(?=\()|\b(?:context|parameter|this|se(?:lf|nder))(?=\()|\b(?:current_predicate|predicate_property)(?=\()|\b(?:expand_(?:goal|term)|(?:goal|term)_expansion|phrase)(?=\()|\b(?:clause|retract(?:all)?)(?=\()|\ba(?:bolish|ssert(?:a|z))(?=\()|\b(?:ca(?:ll|tch)|throw)(?=\()|\b(?:type|domain|existence|permission|representation|evaluation|resource)_error(?=\()|\b(?:(?:bag|set)of|f(?:ind|or)all)(?=\()|\bthreaded(?:_(?:call|once|ignore|exit|peek|wait|notify))?(?=\()|\bthreaded_engine(?:_(?:create|destroy|self|next|next_reified|yield|post|fetch))?(?=\()|\b(subsumes_term|unify_with_occurs_check)(?=\()|\b(?:functor|arg|copy_term|numbervars|term_variables)(?=\()|\b(?:div|rem|m(?:ax|in|od)|abs|sign)(?=\()|\b(?:float_(?:integer|fractional)_part|float)(?=\()|\b(?:floor|t(?:an|runcate)|round|ceiling|xor)(?=\()|\b(?:cos|a(?:cos|sin|tan|tan2)|exp|log|s(?:in|qrt))(?=\()|\b(?:var|atom(?:ic)?|integer|float|c(?:allable|ompound)|n(?:onvar|umber)|ground|acyclic_term)(?=\()|\bcompare(?=\()|\b(?:curren|se)t_(?:in|out)put(?=\()|\b(?:open|close)(?=\()|\bflush_output(?=\()|\b(?:flush_output|at_end_of_stream)\b|\b(?:stream_property|at_end_of_stream|set_stream_position)(?=\()|\b(?:get|p(?:eek|ut))_(?:byte|c(?:har|ode))(?=\()|\bnl(?=\()|\b(?:nl)\b|\b(?:read(?:_term)?)(?=\()|\b(?:write(?:q|_(?:canonical|term))?)(?=\()|\b(?:op|current_op)(?=\()|\b(?:(?:current_)?char_conversion)(?=\()|\batom_(?:length|c(?:hars|o(?:ncat|des)))(?=\()|\b(?:char_code|sub_atom)(?=\()|\bnumber_(?:c(?:har|ode)s)(?=\()|\b(?:set|current)_prolog_flag(?=\()|\bhalt(?=\()|\b(?:halt)\b|\b(?:ignore|once)(?=\()|\b(?:(?:key)?sort)(?=\()|\b(?:true|fa(?:il|lse)|repeat|instantiation_error)\b|\b(?:e|pi|as|is|rem|mod|div)\b/g,
'sh_keyword',
-1
],
@@ -31,7 +31,7 @@ keyword = '\<(after|before)(?=\()',
'\<(clause|retract(all)?)(?=\()',
'\<a(bolish|ssert(a|z))(?=\()',
'\<(ca(ll|tch)|throw)(?=\()',
'\<(instantiation|type|domain|existence|permission|representation|evaluation|resource)_error(?=\()',
'\<(type|domain|existence|permission|representation|evaluation|resource)_error(?=\()',
'\<((bag|set)of|f(ind|or)all)(?=\()',
'\<threaded(_(call|once|ignore|exit|peek|wait|notify))?(?=\()',
'\<threaded_engine(_(create|destroy|self|next|next_reified|yield|post|fetch))?(?=\()',
@@ -61,7 +61,7 @@ keyword = '\<(after|before)(?=\()',
'\<halt(?=\()', '\<(halt)\>',
'\<(ignore|once)(?=\()',
'\<((key)?sort)(?=\()',
'\<(true|fa(il|lse)|repeat)\>',
'\<(true|fa(il|lse)|repeat|instantiation_error)\>',
'\<(e|pi|as|is|rem|mod|div)\>'
@@ -198,7 +198,6 @@
<string>[^A-Za-z0-9_](call)\(</string>
<string>[^A-Za-z0-9_](catch)\(</string>
<string>[^A-Za-z0-9_](throw)\(</string>
<string>[^A-Za-z0-9_](instantiation_error)\(</string>
<string>[^A-Za-z0-9_](type_error)\(</string>
<string>[^A-Za-z0-9_](domain_error)\(</string>
<string>[^A-Za-z0-9_](existence_error)\(</string>
@@ -212,6 +211,7 @@
<string>true</string>
<string>fail</string>
<string>false</string>
<string>instantiation_error</string>
</array>
</dict>
@@ -50,7 +50,7 @@
<regex>\s(-&gt;)\s</regex>
<regex>(!)</regex>
<regex>(;)</regex>
<regex>\b(instantiation_error)\(</regex>
<regex>\b(instantiation_error)[^[(A-Za-z_]]</regex>
<regex>\b(type_error)\(</regex>
<regex>\b(domain_error)\(</regex>
<regex>\b(existence_error)\(</regex>
@@ -94,9 +94,9 @@
{ regex: new RegExp("\\b((key)?sort)(?=[(])", 'g'), css: 'keyword'},
// built-in control constructs
{ regex: new RegExp("\\b(ca(ll|tch)|throw)(?=[(])", 'g'), css: 'keyword'},
{ regex: new RegExp("\\b(true|fa(il|lse)|repeat)\\b", 'g'), css: 'keyword'},
{ regex: new RegExp("\\b(true|fa(il|lse)|repeat|instantiation_error)\\b", 'g'), css: 'keyword'},
{ regex: new RegExp("\\b(ignore|once)(?=[(])", 'g'), css: 'keyword'},
{ regex: new RegExp("\\b(instantiation|type|domain|existence|permission|representation|evaluation|resource)_error(?=[(])", 'g'), css: 'keyword'},
{ regex: new RegExp("\\b(type|domain|existence|permission|representation|evaluation|resource)_error(?=[(])", 'g'), css: 'keyword'},
// directives
{ regex: new RegExp("^\\s*:\-\\s(c(a(lls|tegory)|oinductive)|p(ublic|r(ot(ocol|ected)|ivate))|e(l(if|se)|n(coding|sure_loaded)|xport)|i(f|n(clude|itialization|fo))|alias|d(ynamic|iscontiguous)|m(eta_(non_terminal|predicate)|od(e|ule)|ultifile)|reexport|s(et_(logtalk|prolog)_flag|ynchronized)|o(bject|p)|use(s|_module))(?=[(])", 'gm'), css: 'preprocessor' },
{ regex: new RegExp("^\\s*:\-\\s(e(lse|nd(if|_(category|object|protocol)))|built_in|dynamic|synchronized|threaded)\.", 'gm'), css: 'preprocessor' },
@@ -193,7 +193,7 @@
</dict>
<dict>
<key>match</key>
<string>\b(true|fa(il|lse)|repeat)\b(?![-!(^~])</string>
<string>\b(true|fa(il|lse)|repeat|instantiation_error)\b(?![-!(^~])</string>
<key>name</key>
<string>support.function.control.logtalk</string>
</dict>
@@ -205,7 +205,7 @@
</dict>
<dict>
<key>match</key>
<string>\b((instantiation|type|domain|existence|permission|representation|evaluation|resource)_error)(?=[(])</string>
<string>\b((type|domain|existence|permission|representation|evaluation|resource)_error)(?=[(])</string>
<key>name</key>
<string>support.function.control.logtalk</string>
</dict>
@@ -189,7 +189,7 @@
</dict>
<dict>
<key>match</key>
<string>\b(true|fa(il|lse)|repeat)\b(?![-!(^~])</string>
<string>\b(true|fa(il|lse)|repeat|instantiation_error)\b(?![-!(^~])</string>
<key>name</key>
<string>support.function.control.logtalk</string>
</dict>
@@ -201,7 +201,7 @@
</dict>
<dict>
<key>match</key>
<string>\b((instantiation|type|domain|existence|permission|representation|evaluation|resource)_error)(?=[(])</string>
<string>\b((type|domain|existence|permission|representation|evaluation|resource)_error)(?=[(])</string>
<key>name</key>
<string>support.function.control.logtalk</string>
</dict>
@@ -191,7 +191,8 @@ syn match logtalkOperator ";"
syn match logtalkOperator "-->"
syn match logtalkOperator "->"
syn match logtalkKeyword "\<throw\ze("
syn match logtalkKeyword "\<\(instantiation\|type\|domain\|existence\|permission\|representation\|evaluation\|resource\)_error\ze("
syn match logtalkKeyword "\<\instantiation_error\>"
syn match logtalkKeyword "\<\(type\|domain\|existence\|permission\|representation\|evaluation\|resource\)_error\ze("
" Term unification

0 comments on commit 3bfe252

Please sign in to comment.