(let ((i 0)
(len (length tokens)))
(while (< i len)
- (let ((token (elt tokens i)))
- (let ((start (elt token 0))
- (end (elt token 1))
- (face (context-coloring-level-face (elt token 2) (elt token 3))))
- (add-text-properties start end `(face ,face rear-nonsticky t))))
- (setq i (+ i 1))))))
+ (let ((start (elt tokens i))
+ (end (elt tokens (+ i 1)))
+ (face (context-coloring-level-face (elt tokens (+ i 2))
+ (elt tokens (+ i 3)))))
+ (add-text-properties start end `(face ,face rear-nonsticky t)))
+ (setq i (+ i 4))))))
(defun context-coloring-kill-scopifier ()
"Kills the currently-running scopifier process for this
(with-current-buffer buffer
(context-coloring-apply-tokens tokens))
(setq context-coloring-scopifier-process nil)
- ;; (message "Colorized (after %f seconds)." (- (float-time) start-time))
+ (message "Colorized (after %f seconds)." (- (float-time) start-time))
)))))
;; Give the process its input.
"Colors the current buffer by function context."
(interactive)
(setq context-coloring-colorize-start-time (float-time))
- ;; (message "%s" "Colorizing.")
+ (message "%s" "Colorizing.")
(context-coloring-scopify))
(defun context-coloring-change-function (start end length)
// done now.
if (!scope.functionExpressionScope) {
range = scope.block.range;
- scopes.push([
+ scopes.push(
range[0] + 1,
range[1] + 1,
scope.level,
normal
- ]);
+ );
definitionsIndex = tokens.length;
definitionsCount = 0;
for (j = 0; j < scope.variables.length; j += 1) {
for (k = 0; k < variable.defs.length; k += 1) {
definition = variable.defs[k];
range = definition.name.range;
- tokens.push([
+ tokens.push(
range[0] + 1,
range[1] + 1,
scope.level,
bold
- ]);
+ );
}
}
for (j = 0; j < scope.references.length; j += 1) {
}
}
if (!isDefined) {
- tokens.push([
+ tokens.push(
// Handle global references too.
range[0] + 1,
range[1] + 1,
reference.resolved ? reference.resolved.scope.level : 0,
reference.__maybeImplicitGlobal ? bold : normal
- ]);
+ );
}
}
}
for (i = 0; i < ast.comments.length; i += 1) {
comment = ast.comments[i];
range = comment.range;
- tokens.push([
+ tokens.push(
range[0] + 1,
range[1] + 1,
-1,
italic
- ]);
+ );
}
return scopes.concat(tokens);