From 608fe6cc628de887d4754798c2d99541953c2ee2 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Thu, 15 Apr 2021 12:47:02 -0400 Subject: [PATCH] Improve c language highlighting --- src/FileType.php | 2 +- src/Row.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/FileType.php b/src/FileType.php index 27cd61c..d30ac72 100644 --- a/src/FileType.php +++ b/src/FileType.php @@ -36,7 +36,7 @@ class FileType { '#include', 'unsigned', '#define', '#ifndef', 'double', 'signed', '#endif', '#ifdef', 'float', '#error', '#undef', '#elif', 'long', 'char', 'int', 'void', '#if', 'uint32_t', 'wchar_t', 'int32_t', 'int64_t', 'uint64_t', 'int16_t', 'uint16_t', - 'uint8_t', 'int8_t', + 'uint8_t', 'int8_t', 'time_t', 'size_t', ], [ '<=>', '<<=', '>>=', diff --git a/src/Row.php b/src/Row.php index 98219f9..91fe8ba 100644 --- a/src/Row.php +++ b/src/Row.php @@ -380,7 +380,7 @@ class Row { { return $this->highlightChar( $i, - ['+', '-', '*', '/', '<', '^', '>', '%', '=', ':', ',', ';', '&', '~'], + ['+', '-', '*', '/', '<', '^', '>', '%', '=', ':', ',', ';', '&', '~', '!', '|', '.'], Highlight::OPERATOR ); } @@ -406,7 +406,7 @@ class Row { if ($opts->characters() && $char === "'") { - $offset = ($nextChar === '\\') ? $i + 2 : $i + 1; + $offset = ($nextChar === '\\') ? $i + 3 : $i + 1; $closingIndex = strpos($this->render, "'", $offset); if ($closingIndex === false) {