"Fossies" - the Fresh Open Source Software Archive

Member "highlight-3.57-x64/langDefs/logtalk.lang" (12 May 2020, 7432 Bytes) of package /windows/www/highlight-3.57-x64.zip:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "logtalk.lang": 3.53_vs_3.54.

    1 
    2 Description="Logtalk"
    3 
    4 -- Syntax file created by Paulo Moura
    5 
    6 Categories = {"source"}
    7 
    8 Keywords={
    9   { Id=1, --conditional compilation directives
   10     Regex=[[^\s*:-\s((el)?if)(?=[(])]],
   11     Group=1,
   12   },
   13   { Id=1, --conditional compilation directives
   14     Regex=[[^\s*:-\s(e(lse|ndif))(?=\.)]],
   15     Group=1,
   16   },
   17   { Id=2, --variables
   18     Regex=[[(?<!0')[A-Z_]\w*]],
   19   },
   20   { Id=3, -- event handlers
   21     Regex=[[(after|before)(?=[(])]],
   22     Group=1,
   23   },
   24   { Id=3, -- forward message handler
   25     Regex=[[(forward)(?=[(])]],
   26     Group=1,
   27   },
   28 
   29   { Id=1, --encapsulation directives
   30     Regex=[[ ^\s*:-\s(category|protocol|object)(?=[(]) ]],
   31     Group=1,
   32   },
   33   { Id=1,
   34     Regex=[[ ^\s+((extend|i(mp(or|lemen)t|nstantiate)|specialize)s)(?=[(]) ]],
   35     Group=1,
   36   },
   37   { Id=1,
   38     Regex=[[ ^\s*:-\s(end_(protocol|category|object))(?=\.) ]],
   39     Group=1,
   40   },
   41   { Id=1, -- entity and predicate directives
   42     Regex=[[ ^\s*:-\s(calls|coinductive|public|protected|private|encoding|ensure_loaded|export|in(clude|fo|itialization)|alias|dynamic|discontiguous|meta_(non_terminal|predicate)|mode|module|multifile|reexport|set_(logtalk|prolog)_flag|synchronized|op|uses|use_module)(?=[(]) ]],
   43     Group=1,
   44   },
   45   { Id=1,
   46     Regex=[[ ^\s*:-\s(built_in|dynamic|synchronized|threaded)(?=\.) ]],
   47     Group=1,
   48   },
   49   { Id=3, --event handlers
   50     Regex=[[ (after|before)(?=[(]) ]],
   51     Group=1
   52   },
   53   { Id=3,
   54     Regex=[[ (context|parameter|this|se(lf|nder))(?=[(]) ]],
   55     Group=1
   56   },
   57   { Id=3, --reflection
   58     Regex=[[ (current_predicate|predicate_property)(?=[(]) ]],
   59     Group=1
   60   },
   61   { Id=3, --dcgs
   62     Regex=[[ (expand_(goal|term))(?=[(]) ]],
   63     Group=1
   64   },
   65   { Id=3,
   66     Regex=[[ ((?:goal|term)_expansion|phrase)(?=[(]) ]],
   67     Group=1
   68   },
   69   { Id=3, --entity
   70     Regex=[[ ((abolish|c(reate|urrent))_(object|protocol|category))(?=[(]) ]],
   71     Group=1
   72   },
   73   { Id=3,
   74     Regex=[[ ((object|protocol|category)_property)(?=[(]) ]],
   75     Group=1
   76   },
   77   { Id=3, --entity relations
   78     Regex=[[ (co(mplements_object|nforms_to_protocol))(?=[(]) ]],
   79     Group=1
   80   },
   81   { Id=3,
   82     Regex=[[ (extends_(object|protocol|category))(?=[(]) ]],
   83     Group=1
   84   },
   85   { Id=3,
   86     Regex=[[ (imp(lements_protocol|orts_category))(?=[(]) ]],
   87     Group=1
   88   },
   89   { Id=3,
   90     Regex=[[ ((instantiat|specializ)es_class)(?=[(]) ]],
   91     Group=1
   92   },
   93   { Id=3, --events
   94     Regex=[[ (current_event|(abolish|define)_events)(?=[(]) ]],
   95     Group=1
   96   },
   97   { Id=3, --flags
   98     Regex=[[ ((create|current|set)_logtalk_flag)(?=[\(]) ]],
   99     Group=1
  100   },
  101   { Id=3, --compiling, loading, and library paths
  102     Regex=[[ (logtalk_(compile|l(ibrary_path|oad|oad_context)|make(_target_action)?))(?=[(]) ]],
  103     Group=1
  104   },
  105   { Id=3, --compiling, loading, and library paths
  106     Regex=[[ (logtalk_make) ]],
  107     Group=1
  108   },
  109   { Id=3, --database
  110     Regex=[[ (clause|retract(all)?)(?=[(]) ]],
  111     Group=1
  112   },
  113   { Id=3,
  114     Regex=[[ (a(bolish|ssert(a|z)))(?=[(])  ]],
  115     Group=1
  116   },
  117   { Id=3, --control
  118     Regex=[[ (call|catch|throw|(type|domain|existence|permission|representation|evaluation|resource|syntax)_error)(?=[(]) ]],
  119     Group=1
  120   },
  121   { Id=3, --control
  122     Regex=[[ (fa(il|lse|)|true|(instantiation|system)_error) ]],
  123     Group=1
  124   },
  125   { Id=3, --all solutions
  126     Regex=[[ (bagof|setof|findall|forall)(?=[(]) ]],
  127     Group=1
  128   },
  129   { Id=3, --multi-threading predicates
  130     Regex=[[ (threaded(_(call|once|ignore|exit|peek|wait|notify))?)(?=[(]) ]],
  131     Group=1
  132   },
  133   { Id=3, --engine predicates
  134     Regex=[[ (threaded_engine(_(create|destroy|self|next|next_reified|yield|post|fetch))?)(?=[(]) ]],
  135     Group=1
  136   },
  137   { Id=3, --term unification
  138     Regex=[[ (subsumes_term|unify_with_occurs_check)(?=[(]) ]],
  139     Group=1
  140   },
  141   { Id=3, -- term creation and decomposition
  142     Regex=[[ (functor|arg|copy_term|numbervars|term_variables)(?=[(]) ]],
  143     Group=1
  144   },
  145   { Id=3, -- term comparision
  146     Regex=[[ (compare)(?=[(]) ]],
  147     Group=1
  148   },
  149   { Id=3, --evaluable functors
  150     Regex=[[ (div|rem|mod|abs|sign)(?=[(]) ]],
  151     Group=1
  152   },
  153   { Id=3,
  154     Regex=[[ (float(_(integer|fractional)_part)?)(?=[(]) ]],
  155     Group=1
  156   },
  157   { Id=3,
  158     Regex=[[ (floor|truncate|round|ceiling)(?=[(]) ]],
  159     Group=1
  160   },
  161   { Id=3,
  162     Regex=[[ (cos|a(cos|sin|tan|tan2)|exp|log|s(in|qrt)|tan|xor)(?=[(]) ]],
  163     Group=1
  164   },
  165   { Id=3,
  166     Regex=[[ (max|min)(?=[(]) ]],
  167     Group=1
  168   },
  169   { Id=3, --term testing
  170     Regex=[[ (var|atomic|atom|integer|float|callable|compound|nonvar|number|ground|acyclic_term)(?=[(]) ]],
  171     Group=1
  172   },
  173   { Id=3, -- stream selection and control
  174     Regex=[[ ((curren|se)t_(in|out)put)(?=[(]) ]],
  175     Group=1
  176   },
  177   { Id=3,
  178     Regex=[[ (open|close)(?=[(]) ]],
  179     Group=1
  180   },
  181   { Id=3,
  182     Regex=[[ (flush_output)(?=[(]) ]],
  183     Group=1
  184   },
  185   { Id=3,
  186     Regex=[[ \b(flush_output)\b ]],
  187     Group=1
  188   },
  189   { Id=3,
  190     Regex=[[ (stream_property|at_end_of_stream|set_stream_position)(?=[(]) ]],
  191     Group=1
  192   },
  193   { Id=3,
  194     Regex=[[ (at_end_of_stream) ]],
  195     Group=1
  196   },
  197   { Id=3, -- character and byte input/output
  198     Regex=[[ (nl|(get|peek|put)_(byte|char|code))(?=[(]) ]],
  199     Group=1
  200   },
  201   { Id=3,
  202     Regex=[[ (nl) ]],
  203     Group=1
  204   },
  205   { Id=3, -- term input/output
  206     Regex=[[ (read(_term)?)(?=[(]) ]],
  207     Group=1
  208   },
  209   { Id=3,
  210     Regex=[[ (write(q|_(canonical|term))?)(?=[(]) ]],
  211     Group=1
  212   },
  213   { Id=3,
  214     Regex=[[ ((current_)?op)(?=[(]) ]],
  215     Group=1
  216   },
  217   { Id=3,
  218     Regex=[[ ((current_)?char_conversion)(?=[(]) ]],
  219     Group=1
  220   },
  221   { Id=3, --atomic term processing
  222     Regex=[[ (atom_(length|c(hars|o(ncat|des))))(?=[(]) ]],
  223     Group=1
  224   },
  225   { Id=3,
  226     Regex=[[ (char_code|sub_atom)(?=[(]) ]],
  227     Group=1
  228   },
  229   { Id=3,
  230     Regex=[[ (number_c(har|ode)s)(?=[(]) ]],
  231     Group=1
  232   },
  233   { Id=3, --implementation defined hooks functions
  234     Regex=[[ ((?:se|curren)t_prolog_flag)(?=[(]) ]],
  235     Group=1
  236   },
  237   { Id=3,
  238     Regex=[[ (halt) ]],
  239     Group=1
  240   },
  241   { Id=3,
  242     Regex=[[ (halt)(?=[(]) ]],
  243     Group=1
  244   },
  245   { Id=3, --logic and control
  246     Regex=[[ (once|ignore)(?=[(]) ]],
  247     Group=1
  248   },
  249   { Id=3,
  250     Regex=[[ (repeat) ]],
  251     Group=1
  252   },
  253   { Id=3, --sorting
  254     Regex=[[ (keysort|sort)(?=[(]) ]],
  255     Group=1
  256   },
  257 
  258   { Id=4, --Logtalk message sending operators
  259     Regex=[[ (::|\^\^|<<|:(?!\-)) ]],
  260   },
  261   { Id=4, --Logtalk external-call control construct
  262     Regex=[[ ([{}]) ]],
  263   },
  264   { Id=4, --Logtalk predicate aliases operator
  265     Regex=[[ \b(as)\b ]],
  266   },
  267   { Id=4, --arithmetic evaluation operator
  268     Regex=[[ \b(is)\b ]],
  269   },
  270   { Id=4, --arithmetic functions
  271     Regex=[[ \b(div|mod|rem|e|pi)\b ]],
  272   },
  273   { Id=4, --operators
  274     Regex=[[ (\\\+|-->|->|=\.\.|;|!|:-|\^) ]],
  275   },
  276   { Id=4,
  277     Regex=[[ (=<|<|=:=|=\\=|>=|>) ]],
  278   },
  279   { Id=4,
  280     Regex=[[ (@<|@=<|==|\\==|@>|@>=) ]],
  281   },
  282   { Id=4,
  283     Regex=[[ (=|\\=) ]],
  284   },
  285   { Id=4,
  286     Regex=[[ (\?|@) ]],
  287   },
  288   { Id=4,
  289     Regex=[[ (/\\|\\/|>>|\\) ]],
  290   },
  291   { Id=5,
  292     Regex=[[ (0['][\\].) ]],
  293   },
  294   { Id=5,
  295     Regex=[[ (0['].) ]],
  296   },
  297   { Id=5,
  298     Regex=[[ (0b[0-1]+|0o[0-7]+) ]],
  299   },
  300   { Id=5,
  301     Regex=[=[0x[[:xdigit:]]+]=],
  302   },
  303   { Id=5,
  304     Regex=[[ ([:digit:]+(\.[:digit:]+)?([eE][+-]?[:digit:]+)?) ]],
  305   },
  306 }
  307 
  308 
  309 -- disable highlighting of numbers
  310 Digits = Identifiers
  311 
  312 
  313 Strings={
  314   Delimiter=[["|']],
  315   Escape=[=[ \\[0-7]+\\|\\x[[:xdigit:]]+\\|\\[abfnrtv\\\'"] ]=]
  316 }
  317 
  318 IgnoreCase=false
  319 
  320 Comments={
  321   { Block=false,
  322     Delimiter= { [[%]] },
  323   },
  324   { Block=true,
  325     Nested=false,
  326     Delimiter= { [[\/\*]],[[\*\/]],}
  327   }
  328 }