Skip to content

Commit

Permalink
Better raw string SH
Browse files Browse the repository at this point in the history
  • Loading branch information
elbeno committed May 15, 2017
1 parent 9acdb0d commit b7a5b5f
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions presentation/presentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ <h2 id="org6d2ef76">Don't Bury The Lead</h2>
<div class="org-src-container">

<pre class="src src-c++"><span style="color: #a020f0;">constexpr</span> <span style="color: #a020f0;">auto</span> jsv
= R<span style="color: #000000; background-color: #ffa500; font-weight: bold;">"</span><span style="color: #b22222;">({</span>
<span style="color: #b22222;"> "</span>feature-x-enabled<span style="color: #000000; background-color: #ffa500; font-weight: bold;">"</span><span style="color: #b22222;">: true,</span>
<span style="color: #b22222;"> "</span>value-of-y<span style="color: #000000; background-color: #ffa500; font-weight: bold;">"</span><span style="color: #b22222;">: 1729,</span>
<span style="color: #b22222;"> "</span>z-options<span style="color: #b22222;">": {"</span>a<span style="color: #000000; background-color: #ffa500; font-weight: bold;">"</span><span style="color: #b22222;">: null,</span>
<span style="color: #b22222;"> "</span>b<span style="color: #b22222;">": "</span><span style="color: #008b8b;">220</span> <span style="color: #a020f0;">and</span> <span style="color: #008b8b;">284</span><span style="color: #000000; background-color: #ffa500; font-weight: bold;">"</span><span style="color: #b22222;">,</span>
<span style="color: #b22222;"> "</span>c<span style="color: #000000; background-color: #ffa500; font-weight: bold;">"</span><span style="color: #b22222;">: [6, 28, 496]}</span>
= R<span style="color: #b22222;">"({</span>
<span style="color: #b22222;"> "</span>feature-x-enabled<span style="color: #b22222;">"</span><span style="color: #b22222;">: true,</span>
<span style="color: #b22222;"> "</span>value-of-y<span style="color: #b22222;">": 1729,</span>
<span style="color: #b22222;"> "</span>z-options<span style="color: #b22222;">": {"</span>a<span style="color: #b22222;">": null,</span>
<span style="color: #b22222;"> "</span>b<span style="color: #b22222;">": "</span><span style="color: #008b8b;">220</span> <span style="color: #a020f0;">and</span> <span style="color: #008b8b;">284</span><span style="color: #b22222;">",</span>
<span style="color: #b22222;"> "</span>c<span style="color: #b22222;">": [6, 28, 496]}</span>
<span style="color: #b22222;"> })"</span>_json;
<span style="color: #a020f0;">if</span> <span style="color: #a020f0;">constexpr</span> <span style="color: #707183;">(</span>jsv<span style="color: #7388d6;">[</span><span style="color: #b22222;">"feature-x-enabled"</span><span style="color: #7388d6;">]</span><span style="color: #707183;">)</span> <span style="color: #707183;">{</span>
<span style="color: #bebebe;">// </span><span style="color: #bebebe;">code for feature x</span>
Expand Down Expand Up @@ -368,12 +368,12 @@ <h2 id="org267b989">Building <code>constexpr</code> JSON Values</h2>
<div class="org-src-container">

<pre class="src src-c++"><span style="color: #a020f0;">constexpr</span> <span style="color: #a020f0;">auto</span> jsv
= R<span style="color: #000000; background-color: #ffa500; font-weight: bold;">"</span><span style="color: #b22222;">({</span>
<span style="color: #b22222;"> "</span>feature-x-enabled<span style="color: #000000; background-color: #ffa500; font-weight: bold;">"</span><span style="color: #b22222;">: true,</span>
<span style="color: #b22222;"> "</span>value-of-y<span style="color: #000000; background-color: #ffa500; font-weight: bold;">"</span><span style="color: #b22222;">: 1729,</span>
<span style="color: #b22222;"> "</span>z-options<span style="color: #b22222;">": {"</span>a<span style="color: #000000; background-color: #ffa500; font-weight: bold;">"</span><span style="color: #b22222;">: null,</span>
<span style="color: #b22222;"> "</span>b<span style="color: #b22222;">": "</span><span style="color: #008b8b;">220</span> <span style="color: #a020f0;">and</span> <span style="color: #008b8b;">284</span><span style="color: #000000; background-color: #ffa500; font-weight: bold;">"</span><span style="color: #b22222;">,</span>
<span style="color: #b22222;"> "</span>c<span style="color: #000000; background-color: #ffa500; font-weight: bold;">"</span><span style="color: #b22222;">: [6, 28, 496]}</span>
= R<span style="color: #b22222;">"({</span>
<span style="color: #b22222;"> "</span>feature-x-enabled<span style="color: #b22222;">": true,</span>
<span style="color: #b22222;"> "</span>value-of-y<span style="color: #b22222;">": 1729,</span>
<span style="color: #b22222;"> "</span>z-options<span style="color: #b22222;">": {"</span>a<span style="color: #b22222;">": null,</span>
<span style="color: #b22222;"> "</span>b<span style="color: #b22222;">": "</span><span style="color: #008b8b;">220</span> <span style="color: #a020f0;">and</span> <span style="color: #008b8b;">284</span><span style="color: #b22222;">",</span>
<span style="color: #b22222;"> "</span>c<span style="color: #b22222;">": [6, 28, 496]}</span>
<span style="color: #b22222;"> })"</span>_json;
</pre>
</div>
Expand Down Expand Up @@ -2775,7 +2775,7 @@ <h3 id="org09f9dc2">Compile-time Cost - Comparison</h3>

<span style="color: #228b22;">int</span> <span style="color: #0000ff;">main</span><span style="color: #707183;">()</span>
<span style="color: #707183;">{</span>
<span style="color: #008b8b;">std</span>::<span style="color: #228b22;">regex</span> <span style="color: #0000ff;">attribute</span><span style="color: #7388d6;">(</span>R<span style="color: #b22222;">"(\s+(\S+)\s*=\s*('|"</span><span style="color: #7388d6;">)(</span>.*?<span style="color: #7388d6;">)</span>\<span style="color: #008b8b;">2</span><span style="color: #88090B;">)</span><span style="color: #000000; background-color: #ffa500; font-weight: bold;">"</span><span style="color: #b22222;">);</span>
<span style="color: #008b8b;">std</span>::<span style="color: #228b22;">regex</span> <span style="color: #0000ff;">attribute</span><span style="color: #7388d6;">(</span>R<span style="color: #b22222;">"(\s+(\S+)\s*=\s*('|"</span><span style="color: #7388d6;">)(</span>.*?<span style="color: #7388d6;">)</span>\<span style="color: #008b8b;">2</span><span style="color: #88090B;">)</span><span style="color: #b22222;">");</span>
<span style="color: #b22222;">}</span>
</pre>
</div>
Expand Down

1 comment on commit b7a5b5f

@elbeno
Copy link
Collaborator Author

@elbeno elbeno commented on b7a5b5f May 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit tidies up the odd syntax highlighting with the raw strings output.

I tagged this commit with "raw-string-sh" so it can be easily cherry-picked after future updates.

Please sign in to comment.