Changeset View
Changeset View
Standalone View
Standalone View
data/syntax/prolog.xml
Show First 20 Lines • Show All 99 Lines • ▼ Show 20 Line(s) | 83 | <!-- Char classes for AnyChar, NOT RegExpr: no esc seqs, ranges, etc. pp. here! | |||
---|---|---|---|---|---|
100 | <!-- Some solo chars for DetectChar --> | 100 | <!-- Some solo chars for DetectChar --> | ||
101 | <!ENTITY comma ","> | 101 | <!ENTITY comma ","> | ||
102 | <!ENTITY cut "!"> | 102 | <!ENTITY cut "!"> | ||
103 | <!ENTITY bar "|"> | 103 | <!ENTITY bar "|"> | ||
104 | <!ENTITY tab " "> | 104 | <!ENTITY tab " "> | ||
105 | <!ENTITY bs "\"> | 105 | <!ENTITY bs "\"> | ||
106 | ]> | 106 | ]> | ||
107 | <language name="Prolog" section="Sources" | 107 | <language name="Prolog" section="Sources" | ||
108 | version="9" kateversion="3.4" | 108 | version="10" kateversion="3.4" | ||
109 | mimetype="text/x-prolog" | 109 | mimetype="text/x-prolog" | ||
110 | extensions="*.prolog;*.dcg;*.pro" | 110 | extensions="*.prolog;*.dcg;*.pro" | ||
111 | author="Torsten Eichstädt (torsten.eichstaedt@web.de)" | 111 | author="Torsten Eichstädt (torsten.eichstaedt@web.de)" | ||
112 | license="LGPLv2+"> | 112 | license="LGPLv2+"> | ||
113 | 113 | | |||
114 | <!-- [Terminology & Abbreviations In The Comments] | 114 | <!-- [Terminology & Abbreviations In The Comments] | ||
115 | - Literal text is in double quotes "like this", single quotes sometimes used | 115 | - Literal text is in double quotes "like this", single quotes sometimes used | ||
116 | for a 'terminus technicus'. | 116 | for a 'terminus technicus'. | ||
117 | - "w/", "w/o", "s/t" mean 'with', 'without', and "sometimes" resp. | 117 | - "w/", "w/o", "s/t" mean 'with', 'without', and "sometimes" resp. | ||
118 | - Use "brace" instead of 'bracket'/'parenthesis' for any of "()[]{}" | 118 | - Use "brace" instead of 'bracket'/'parenthesis' for any of "()[]{}" | ||
119 | - Specify "round", "list/squared", "curly", "opening" and "closing" brace. | 119 | - Specify "round", "list/squared", "curly", "opening" and "closing" brace. | ||
120 | - "quote/quoted/string" mean any of single-, double-, or back-quote(d) | 120 | - "quote/quoted/string" mean any of single-, double-, or back-quote(d) | ||
121 | - "seq" sequence, "nl" newline, "bs" backslash, "q" quote(d), "cc" char code | 121 | - "seq" sequence, "nl" newline, "bs" backslash, "q" quote(d), "cc" char code | ||
122 | - "KISS" Keep it simple, stupid! (be pragmatic) | 122 | - "KISS" Keep it simple, stupid! (be pragmatic) | ||
123 | - "style" = "attribute" (the applied text style) | 123 | - "style" = "attribute" (the applied text style) | ||
124 | - Keep comments as short as possible and as descriptive as neccessary LOL | 124 | - Keep comments as short as possible and as descriptive as neccessary LOL | ||
125 | --> | 125 | --> | ||
126 | <!-- [Documentation, Bugs, Limitations & Solutions, TODOs] | 126 | <!-- [Documentation, Bugs, Limitations & Solutions, TODOs] | ||
127 | ################################################################################ | 127 | ################################################################################ | ||
128 | All bugs except three by the author. !FOLD THIS AWAY if long comments annoy you. | 128 | All bugs except three by the author. !FOLD THIS AWAY if long comments annoy you. | ||
129 | 129 | | |||
130 | BUG - Nobody's perfect - If I knew about the bug you found, it would have been | 130 | BUG - Nobody's perfect - If I knew about the bug you found, it would have been | ||
131 | fixed already. | 131 | fixed already. | ||
132 | one- Takes a "shebang" at the start of text on other than the 1st line (Kate). | 132 | one- Indentation-based folding is not reliable (Kate; fixed in KDE 4.9?). | ||
133 | two- Indentation-based folding is not reliable (Kate; fixed in KDE 4.9?). | 133 | two- Folding is sometimes broken (Kate?). See SOLUTIONS below. | ||
134 | three- Folding is sometimes broken (Kate?). See SOLUTIONS below. | 134 | three- An optional leading sign is not highlighted as part of the number. | ||
135 | 4 - An optional leading sign is not highlighted as part of the number. | 135 | 4 - A float w/o fractional part and exponent is highlighted as an integer. | ||
136 | 5 - A float w/o fractional part and exponent is highlighted as an integer. | 136 | 5 - Detection of whitespace may not be 100% correct, only space/tab/newline. | ||
137 | 6 - Detection of whitespace may not be 100% correct, only space/tab/newline. | 137 | 6 - Handling inside arithmetic expressions might not be 100%. See "AL GUSTO". | ||
138 | 7 - Handling inside arithmetic expressions might not be 100%. See "AL GUSTO". | | |||
139 | inf- see TODOs below. | 138 | inf- see TODOs below. | ||
140 | 139 | | |||
141 | LIMITS of this parser | 140 | LIMITS of this parser | ||
142 | - Highlighting of syntax errors is as intuitive as possible, i.e. for an | 141 | - Highlighting of syntax errors is as intuitive as possible, i.e. for an | ||
143 | invalid newline highlight the last token before and leading white of the | 142 | invalid newline highlight the last token before and leading white of the | ||
144 | next line - but that's not always possible. Use your built-in problem | 143 | next line - but that's not always possible. Use your built-in problem | ||
145 | solver (between your ears) when you do not know what the exact error is. | 144 | solver (between your ears) when you do not know what the exact error is. | ||
146 | - The parser knows nothing about currently defined dynamic ops, but has to | 145 | - The parser knows nothing about currently defined dynamic ops, but has to | ||
▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Line(s) | 219 | - integer/float/mixed arithmetics, so one can see the type of the result | |||
231 | - Über-correct handling of quoted, escape seqs and "0'" (char code integer): | 230 | - Über-correct handling of quoted, escape seqs and "0'" (char code integer): | ||
232 | - detection of valid/invalid newline in quoted 'strings'. | 231 | - detection of valid/invalid newline in quoted 'strings'. | ||
233 | - highlight whitespace after esc'd newline in quoted so it differs from | 232 | - highlight whitespace after esc'd newline in quoted so it differs from | ||
234 | whitespace contained in the quoted 'string'. | 233 | whitespace contained in the quoted 'string'. | ||
235 | - Highlight esc'd tab and tab in quoted as "Warning" because some text | 234 | - Highlight esc'd tab and tab in quoted as "Warning" because some text | ||
236 | editors may convert them to space and it is easy to use "\t" instead. | 235 | editors may convert them to space and it is easy to use "\t" instead. | ||
237 | - Preliminary: most names end w/ ISO; prepared to be included in syntax | 236 | - Preliminary: most names end w/ ISO; prepared to be included in syntax | ||
238 | files adapted for Prolog dialects. | 237 | files adapted for Prolog dialects. | ||
238 | - The Shebang is highlighted only in the first line (with lineEmptyContext). | ||||
239 | 239 | | |||
240 | FIXME When katepart can supply line numbers, fix the "shebang" rule. | 240 | FIXME When katepart can supply line numbers, fix the "shebang" rule. | ||
241 | 241 | | |||
242 | TODO sorted by priority | 242 | TODO sorted by priority | ||
243 | 1 - [always] Cruise over all FIXMEs. | 243 | 1 - [always] Cruise over all FIXMEs. | ||
244 | 2 - Check if comma, cut & bar are really solo chars (where's the red book?). | 244 | 2 - Check if comma, cut & bar are really solo chars (where's the red book?). | ||
245 | 3 - Check final Technical Corrigendum 2: Prolog - Part 1: General Core | 245 | 3 - Check final Technical Corrigendum 2: Prolog - Part 1: General Core | ||
246 | 4 - Buy ISO Prolog standard - Part 2: Modules. Likely only keywords. Need it | 246 | 4 - Buy ISO Prolog standard - Part 2: Modules. Likely only keywords. Need it | ||
▲ Show 20 Lines • Show All 250 Lines • ▼ Show 20 Line(s) | 436 | <!--GNU (see pi) <item>epsilon</item> --> | |||
497 | debuging aid. Note that (naturally) some of the syntax rules given in | 497 | debuging aid. Note that (naturally) some of the syntax rules given in | ||
498 | EBNF are simplified and do not describe 100% valid Prolog. | 498 | EBNF are simplified and do not describe 100% valid Prolog. | ||
499 | 499 | | |||
500 | prolog text := shebang clause_seq | clause_seq | 500 | prolog text := shebang clause_seq | clause_seq | ||
501 | clause_seq := clause clause_seq | empty | 501 | clause_seq := clause clause_seq | empty | ||
502 | clause := layout term_seq fullstop | term_seq fullstop | 502 | clause := layout term_seq fullstop | term_seq fullstop | ||
503 | --> | 503 | --> | ||
504 | <!-- shebang: ("#!") Detect shebang and fallthrough to clause_seq --> | 504 | <!-- shebang: ("#!") Detect shebang and fallthrough to clause_seq --> | ||
505 | <context name="shebang" lineEndContext="clause" attribute="Syntax Error" > | 505 | <context name="shebang" lineEndContext="clause" lineEmptyContext="clause" attribute="Syntax Error" > | ||
506 | <!-- no way: fallthrough="1" fallthroughContext="clause_seq" > --> | 506 | <!-- no way: fallthrough="1" fallthroughContext="clause_seq" > --> | ||
507 | <Detect2Chars column="0" char="#" char1="!" context="1-comment" attribute="% italic predicates: w/ side effects" /> | 507 | <Detect2Chars column="0" char="#" char1="!" context="1-comment" attribute="% italic predicates: w/ side effects" /> | ||
508 | <!-- else fallthrough (workaround broken fallthrough) --> | 508 | <!-- else fallthrough (workaround broken fallthrough) --> | ||
509 | <RegExpr String="&any;" lookAhead="true" context="clause" attribute="Syntax Error" /> | 509 | <RegExpr String="&any;" lookAhead="true" context="clause" attribute="Syntax Error" /> | ||
510 | </context> | 510 | </context> | ||
511 | 511 | | |||
512 | <!-- syntax error (Test & Debug Aid, too): it's enough to highlight next token --> | 512 | <!-- syntax error (Test & Debug Aid, too): it's enough to highlight next token --> | ||
513 | <context name="syntax_error" lineEndContext="#stay" attribute="Syntax Error" noIndentationBasedFolding="true" > | 513 | <context name="syntax_error" lineEndContext="#stay" attribute="Syntax Error" noIndentationBasedFolding="true" > | ||
▲ Show 20 Lines • Show All 518 Lines • Show Last 20 Lines |