Skip to content
This repository was archived by the owner on Apr 22, 2020. It is now read-only.

Update Logtalk language support for highlighting 0'\Char numbers #557

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 18 additions & 20 deletions src/lang-logtalk.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
/**
* @license
* Copyright (C) 2014 Paulo Moura
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright (C) 2014 Paulo Moura
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.


/**
* @fileoverview
* Registers a language handler for Logtalk.
* http://logtalk.org/
* https://logtalk.org/
* @author Paulo Moura
*/

Expand All @@ -32,16 +30,16 @@ PR['registerLangHandler'](
// quoted atoms
[PR['PR_LITERAL'], /^\'(?:[^\'\\\n\x0C\r]|\\[^&])+\'?/, null, "'"],
// numbers
[PR['PR_LITERAL'], /^(?:0'.|0b[0-1]+|0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+\-]?\d+)?)/i, null, '0123456789']
[PR['PR_LITERAL'], /^(?:0'\\.|0'.|0b[0-1]+|0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+\-]?\d+)?)/i, null, '0123456789']
],
[
// single-line comments begin with %
[PR['PR_COMMENT'], /^%[^\r\n]*/, null, '%'],
// block comments are delimited by /* and */
[PR['PR_COMMENT'], /^\/\*[\s\S]*?\*\//],
// directives
[PR['PR_KEYWORD'], /^\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))/],
[PR['PR_KEYWORD'], /^\s*:-\s(e(lse|nd(if|_(category|object|protocol)))|built_in|dynamic|synchronized|threaded)/],
[PR['PR_KEYWORD'], /^\s*:-\s(?:category|coinductive|public|protocol|protected|private|elif|encoding|ensure_loaded|export|if|include|initialization|info|imports|alias|dynamic|discontiguous|meta_non_terminal|meta_predicate|mode|module|multifile|reexport|set_logtalk_flag|set_prolog_flag|synchronized|object|op|uses|use_module)\b/],
[PR['PR_KEYWORD'], /^\s*:-\s(?:else|endif|end_category|end_object|end_protocol|built_in|dynamic|threaded)\./],
// variables
[PR['PR_TYPE'], /^[A-Z_][a-zA-Z0-9_]*/],
// operators
Expand Down