Skip to content

Commit bacf9ae

Browse files
authoredDec 10, 2021
Prolog: Removed variable token + minor improvements (#3247)
1 parent 7d740c4 commit bacf9ae

File tree

3 files changed

+6
-22
lines changed

3 files changed

+6
-22
lines changed
 

‎components/prism-prolog.js

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
Prism.languages.prolog = {
22
// Syntax depends on the implementation
3-
'comment': [
4-
/%.+/,
5-
/\/\*[\s\S]*?\*\//
6-
],
3+
'comment': {
4+
pattern: /\/\*[\s\S]*?\*\/|%.*/,
5+
greedy: true
6+
},
77
// Depending on the implementation, strings may allow escaped newlines and quote-escape
88
'string': {
9-
pattern: /(["'])(?:\1\1|\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
9+
pattern: /(["'])(?:\1\1|\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1(?!\1)/,
1010
greedy: true
1111
},
1212
'builtin': /\b(?:fx|fy|xf[xy]?|yfx?)\b/,
13-
'variable': /\b[A-Z_]\w*/,
1413
// FIXME: Should we list all null-ary predicates (not followed by a parenthesis) like halt, trace, etc.?
1514
'function': /\b[a-z]\w*(?:(?=\()|\/\d+)/,
1615
'number': /\b\d+(?:\.\d*)?/,

‎components/prism-prolog.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tests/languages/prolog/variable_feature.test

-15
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.