Skip to content

Commit

Permalink
Extract Rust numbers into a separate markup test. (And fix them.)
Browse files Browse the repository at this point in the history
  • Loading branch information
isagalaev committed Nov 4, 2014
1 parent fb9baf8 commit f7111ca
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 27 deletions.
2 changes: 1 addition & 1 deletion src/languages/rust.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function(hljs) {
},
{
className: 'number',
begin: '\\b(0[xb][A-Za-z0-9_]+|[0-9_]+(\\.[0-9_]+)?([uif](8|16|32|64)?)?)',
begin: /\b(0[xb][A-Za-z0-9_]+|[0-9_]+(\.[0-9_]+)?([eE][+-]?[0-9_]+)?)([uif](8|16|32|64)?)?/,
relevance: 0
},
{
Expand Down
16 changes: 2 additions & 14 deletions src/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -3223,18 +3223,6 @@ <h2>Automatically detected languages</h2>
<pre>
<code>use std;

123; // type int
123u; // type uint
123_u; // type uint
0xff00; // type int
0xff_u8; // type u8
0b1111_1111_1001_0000_i32; // type i32
123.0; // type float
0.1; // type float
3f; // type float
0.1f32; // type f32
12E+99_f64; // type f64

'a';
'\n';
'\x1A';
Expand Down Expand Up @@ -4013,15 +4001,15 @@ <h2>Automatically detected languages</h2>
name: VM_;
count: 3;
my-instance-property: whatever;

instance of cluster-node {
name: cluster node; # An in-line comment
}
}

instance of VM_openstack {
name: VM_database;

instance of mysql {
name: mysql;
}
Expand Down
12 changes: 0 additions & 12 deletions test/detect/rust/default.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
use std;

123; // type int
123u; // type uint
123_u; // type uint
0xff00; // type int
0xff_u8; // type u8
0b1111_1111_1001_0000_i32; // type i32
123.0; // type float
0.1; // type float
3f; // type float
0.1f32; // type f32
12E+99_f64; // type f64

'a';
'\n';
'\x1A';
Expand Down
11 changes: 11 additions & 0 deletions test/markup/rust/numbers.expect.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<span class="hljs-number">123</span>;
<span class="hljs-number">123u</span>;
<span class="hljs-number">123_u</span>;
<span class="hljs-number">0xff00</span>;
<span class="hljs-number">0xff_u8</span>;
<span class="hljs-number">0b1111_1111_1001_0000_i32</span>;
<span class="hljs-number">123.0</span>;
<span class="hljs-number">0.1</span>;
<span class="hljs-number">3f</span>;
<span class="hljs-number">0.1f32</span>;
<span class="hljs-number">12E+99_f64</span>;
11 changes: 11 additions & 0 deletions test/markup/rust/numbers.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
123;
123u;
123_u;
0xff00;
0xff_u8;
0b1111_1111_1001_0000_i32;
123.0;
0.1;
3f;
0.1f32;
12E+99_f64;

0 comments on commit f7111ca

Please sign in to comment.