main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
838 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | 'use strict'
|
---|
| 2 |
|
---|
| 3 | module.exports = prolog
|
---|
| 4 | prolog.displayName = 'prolog'
|
---|
| 5 | prolog.aliases = []
|
---|
| 6 | function prolog(Prism) {
|
---|
| 7 | Prism.languages.prolog = {
|
---|
| 8 | // Syntax depends on the implementation
|
---|
| 9 | comment: {
|
---|
| 10 | pattern: /\/\*[\s\S]*?\*\/|%.*/,
|
---|
| 11 | greedy: true
|
---|
| 12 | },
|
---|
| 13 | // Depending on the implementation, strings may allow escaped newlines and quote-escape
|
---|
| 14 | string: {
|
---|
| 15 | pattern: /(["'])(?:\1\1|\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1(?!\1)/,
|
---|
| 16 | greedy: true
|
---|
| 17 | },
|
---|
| 18 | builtin: /\b(?:fx|fy|xf[xy]?|yfx?)\b/,
|
---|
| 19 | // FIXME: Should we list all null-ary predicates (not followed by a parenthesis) like halt, trace, etc.?
|
---|
| 20 | function: /\b[a-z]\w*(?:(?=\()|\/\d+)/,
|
---|
| 21 | number: /\b\d+(?:\.\d*)?/,
|
---|
| 22 | // Custom operators are allowed
|
---|
| 23 | operator: /[:\\=><\-?*@\/;+^|!$.]+|\b(?:is|mod|not|xor)\b/,
|
---|
| 24 | punctuation: /[(){}\[\],]/
|
---|
| 25 | }
|
---|
| 26 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.