Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ These changes should be for the better and should not be super noticeable but if
Grammars:

- enh(php) add PHP 8.1 keywords [Wojciech Kania][]
- fix(cpp) fix `vector<<` template false positive (#3437) [Josh Goebel][]
- enh(php) support First-class Callable Syntax (#3427) [Wojciech Kania][]
- enh(php) support class constructor call (#3427) [Wojciech Kania][]
- enh(php) support function invoke (#3427) [Wojciech Kania][]
Expand Down
2 changes: 1 addition & 1 deletion src/languages/cpp.js
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ export default function(hljs) {
[
PREPROCESSOR,
{ // containers: ie, `vector <int> rooms (9);`
begin: '\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\s*<',
begin: '\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\s*<(?!<)',
end: '>',
keywords: CPP_KEYWORDS,
contains: [
Expand Down
6 changes: 6 additions & 0 deletions test/markup/cpp/bugs.expect.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<span class="hljs-comment">//4. 对角矩阵</span>
<span class="hljs-comment">//4.1 构造对角矩阵</span>
<span class="hljs-function">Eigen::VectorXd <span class="hljs-title">vector</span><span class="hljs-params">(<span class="hljs-number">5</span>)</span></span>; <span class="hljs-comment">//构建5维向量</span>
vector&lt;&lt;<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>,<span class="hljs-number">4</span>,<span class="hljs-number">5</span>; <span class="hljs-comment">//向量赋值</span>
<span class="hljs-function">Eigen::MatrixXd <span class="hljs-title">C</span><span class="hljs-params">(vector.asDiagonal())</span></span>; <span class="hljs-comment">//使用向量生成对角阵</span>
std::cout &lt;&lt; <span class="hljs-string">&quot;\nC= \n&quot;</span> &lt;&lt; C &lt;&lt; std::endl;
6 changes: 6 additions & 0 deletions test/markup/cpp/bugs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
//4. 对角矩阵
//4.1 构造对角矩阵
Eigen::VectorXd vector(5); //构建5维向量
vector<<1,2,3,4,5; //向量赋值
Eigen::MatrixXd C(vector.asDiagonal()); //使用向量生成对角阵
std::cout << "\nC= \n" << C << std::endl;