diff --git a/autotests/folding/test.markdown.fold b/autotests/folding/test.markdown.fold
index b7ab868..5a70384 100644
--- a/autotests/folding/test.markdown.fold
+++ b/autotests/folding/test.markdown.fold
@@ -1,182 +1,182 @@
# H1
## H2
### H3
Multi-line paragraph bla bla bla
bla bla bla.
Intentional line break
via two spaces at line.
Formats: _italic_, **bold**, `monospace`, ~~strikeout~~
Bullet list:
* item1
* item2
Numbered list:
1. item 1
2. item 2
[link](http://kde.org)
code 1
code 2
normal text
> block quote _italic_
> more block quote
normal text
Title: some text
normal text
# Fenced code blocks (bug 356974)
## Bash
```bash
#!/usr/bin/env bash
for f in *; do
echo "$f"
done
```
## C++
```cpp
#include
class Q : public QObject {
Q_OBJECT
public:
Q();
}
Q::Q() :QObject(NULL) {}
```
## CMake
```cmake
cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
project (hello_world)
set(QT_MIN_VERSION "5.6.0")
```
## CSS
```css
h1.main::hover {
font-size: 100;
color: green;
}
```
## Email
```email
From: Konqi Dragon
To: All
Subject: highlights
```
## Haskell
```haskell
module Main (main) where
main :: IO ()
main = putStrLn "Hello, World!"
```
## HTML
```html
Hello world!
```
## JSON
```json
[{
"hello": "world",
"count": 1,
"bool": true
}]
```
## KConfig
```kconfig
[General]
Toggle=true
Count=1
```
## PHP
```php
namespace Application\Controller;
use Zend\Mvc\Controller\AbstractActionController;
class IndexController extends AbstractActionController
{}
```
## Python
```python
def addXToY(x, y):
total = x + y
print total
```
## QML
```qml
Text {
id: hello
width: 100
text: "Hello world!"
}
```
## Rust
```rust
-fn main() {
+fn main() {
println!("Hello world!");
-}
+}
```
## XML
```xml
attribute="3">
/>>
```
## No language specified
```
No language is specified, but it should be still rendered as code block.
```
diff --git a/autotests/folding/test.rs.fold b/autotests/folding/test.rs.fold
index 74ceb9f..cde144c 100644
--- a/autotests/folding/test.rs.fold
+++ b/autotests/folding/test.rs.fold
@@ -1,87 +1,106 @@
// Comment NOTE
-/* Comment FIXME ALERT
- */
+/* Comment FIXME ALERT
+ */
// Identifiers
hellóñαωΑΩµo!();
HellóñαωΑΩµ::Hello;
'hellóñαωΑΩµo
pub use self::PathParameters::*;
-pub use symbol::{Ident, Symbol as Name};
-use serialize::{self, Encoder, Decoder};
+pub use symbol::{Ident, Symbol as Name};
+use serialize::{self, Encoder, Decoder};
use std::u32;
-#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Copy)]
+#[derive(Clone, PartialEq, Eq, Hash, Copy)]
-pub struct Lifetime {
+pub struct Lifetime {
pub id: NodeId,
pub span: Span,
pub bounds: Vec
-}
+}
-impl fmt::Debug for Lifetime {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+impl fmt::Debug for Lifetime {
+ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "lifetime({}: {})", self.id, pprust::lifetime_to_string(self))
- }
-}
-impl<'a> PartialEq<&'a str> for Path {
- fn eq(&self, string: &&'a str) -> bool {
- self.segments.len() == 1 && self.segments[0].identifier.name == *string
- }
-}
-
-enum TraitBoundModifier {
+ }
+}
+impl<'a> PartialEq<&'a str> for Path {
+ fn eq(&self, string: &&'a str) -> bool {
+ self.segments.len() == 1 && self.segments[0].identifier.name == *string
+ }
+}
+
+enum TraitBoundModifier {
None,
Maybe,
-}
+}
-union tests {
+union tests {
a: i128,
b: isize,
-}
+}
+
+// Self vs self
+trait T {
+ type Item;
+ // `Self` will be whatever type that implements `T`.
+ fn new() -> Self;
+ // `Self::Item` will be the type alias in the implementation.
+ fn f(&self) -> Self::Item;
+}
-#[valid types]
-fn types() {
+// Raw identifiers
+extern crate foo;
+fn main() {
+ foo::r#try();
+}
+
+#[valid types]
+fn types() {
let num = 333_3_;
let num_u8: u8 = 333u8;
let num_u16: u16 = 333u16;
let num_u32: u32 = 333u32;
let num_u64: u64 = 333u64;
let num_u128: u128 = 333u128;
let num_usize: usize = 333usize;
let num_float: f32 = 333.45f32;
let binary = 0b1_010;
- let invalid_binary= 0b1_015;
-
let octal = 0o21535;
- let invalid_octal = 0o64_92;
-
let hexadecimal = 0x73A2_F;
- let invalid_hexadecimal = 0x7_3AY;
let char1: char = 'a';
let char2: char = '\n';
let char3: char = '\u{123_AF}';
- let invalid_char1: char = '\y';
+
+ let byte1: u8 = b'a';
+ let byte2: u8 = b'\x13';
+
+ let string: str = "hello \n \r \u{123_________fd_} \
+ bye";
+ let byte_string: str = b"hello \t \0 \u{123} \b bye";
+ let raw_string1: str = r"hello \t \b";
+ let raw_string2: str = r####"hello \n "### bye"########;
+ let raw_string3: str = br####"hello \n"####;
+
+ // Invalid
+
+ let invalid_binary= 0b1_015;
+ let invalid_octal = 0o64_92;
+ let invalid_hexadecimal = 0x7_3AY;
+
+ let invalid_char1: char = '\y';
let invalid_char2: char = '\324';
let invalid_char3: char = '%%';
let invalid_char4: char = '\n\dfd';
let invalid_char5: char = 'aaaaa';
let open_char: char = '&&&;
- let byte1: u8 = b'a';
- let byte2: u8 = b'\x13';
let invalid_byte1: u8 = b'ab';
let invalid_byte2: u8 = b'\b';
let invalid_byte2: u8 = b'\u{123}';
- let string: str = "hello \n \r \u{123_________fd_} \
- bye";
let invalid_string: str = "hello \b \u{_123} \u{1234567} \ bye";
- let byte_string: str = b"hello \t \0 \u{123} \b bye";
- let raw_string1: str = r"hello \t \b";
- let raw_string2: str = r####"hello \n "### bye"########;
- let raw_string3: str = br####"hello \n"####;
-}
+}
diff --git a/autotests/html/test.rs.html b/autotests/html/test.rs.html
index 2d6bb4d..ab485d4 100644
--- a/autotests/html/test.rs.html
+++ b/autotests/html/test.rs.html
@@ -1,94 +1,113 @@
test.rs
// Comment NOTE/* Comment FIXMEALERT */// IdentifiershellóñαωΑΩµo!();
HellóñαωΑΩµ::Hello;
'hellóñαωΑΩµo
-pubuseself::PathParameters::*;
+pubuseself::PathParameters::*;
pubusesymbol::{Ident, Symbol as Name};
useserialize::{self, Encoder, Decoder};
usestd::u32;
-#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Copy)]
+#[derive(Clone,PartialEq,Eq,Hash,Copy)]pubstruct Lifetime {
pub id: NodeId,
pub span: Span,
pub bounds: Vec<PathSegment>
}
implfmt::Debugfor Lifetime {
fn fmt(&self, f: &mutfmt::Formatter) -> fmt::Result {
write!(f, "lifetime({}: {})", self.id, pprust::lifetime_to_string(self))
}
}
impl<'a> PartialEq<&'astr> forPath {
fn eq(&self, string: &&'astr) -> bool {
self.segments.len() == 1 && self.segments[0].identifier.name == *string
}
}
enum TraitBoundModifier {
None,
Maybe,
}
union tests {
a: i128,
b: isize,
}
+// Self vs self
+trait T {
+ type Item;
+ // `Self` will be whatever type that implements `T`.
+ fn new() -> Self;
+ // `Self::Item` will be the type alias in the implementation.
+ fn f(&self) -> Self::Item;
+}
+
+// Raw identifiers
+externcrate foo;
+fn main() {
+ foo::r#try();
+}
+
#[valid types]fn types() {
let num = 333_3_;
let num_u8: u8 = 333u8;
let num_u16: u16 = 333u16;
let num_u32: u32 = 333u32;
let num_u64: u64 = 333u64;
let num_u128: u128 = 333u128;
let num_usize: usize = 333usize;
let num_float: f32 = 333.45f32;
let binary = 0b1_010;
- let invalid_binary= 0b1_015;
-
let octal = 0o21535;
- let invalid_octal = 0o64_92;
-
let hexadecimal = 0x73A2_F;
- let invalid_hexadecimal = 0x7_3AY;
let char1: char = 'a';
let char2: char = '\n';
let char3: char = '\u{123_AF}';
- let invalid_char1: char = '\y';
+
+ let byte1: u8 = b'a';
+ let byte2: u8 = b'\x13';
+
+ let string: str = "hello \n\r\u{123_________fd_}\
+ bye";
+ let byte_string: str = b"hello \t\0\u{123} \b bye";
+ let raw_string1: str = r"hello \t \b";
+ let raw_string2: str = r####"hello \n "### bye"########;
+ let raw_string3: str = br####"hello \n"####;
+
+ // Invalid
+
+ let invalid_binary= 0b1_015;
+ let invalid_octal = 0o64_92;
+ let invalid_hexadecimal = 0x7_3AY;
+
+ let invalid_char1: char = '\y';
let invalid_char2: char = '\324';
let invalid_char3: char = '%%';
let invalid_char4: char = '\n\dfd';
let invalid_char5: char = 'aaaaa';
let open_char: char = '&&&;
- let byte1: u8 = b'a';
- let byte2: u8 = b'\x13';
let invalid_byte1: u8 = b'ab';
let invalid_byte2: u8 = b'\b';
let invalid_byte2: u8 = b'\u{123}';
- let string: str = "hello \n\r\u{123_________fd_}\
- bye";
let invalid_string: str = "hello \b\u{_123} \u{1234567} \ bye";
- let byte_string: str = b"hello \t\0\u{123} \b bye";
- let raw_string1: str = r"hello \t \b";
- let raw_string2: str = r####"hello \n "### bye"########;
- let raw_string3: str = br####"hello \n"####;
}
diff --git a/autotests/input/test.rs b/autotests/input/test.rs
index 9da7b47..7bb5429 100644
--- a/autotests/input/test.rs
+++ b/autotests/input/test.rs
@@ -1,87 +1,106 @@
// Comment NOTE
/* Comment FIXME ALERT
*/
// Identifiers
hellóñαωΑΩµo!();
HellóñαωΑΩµ::Hello;
'hellóñαωΑΩµo
pub use self::PathParameters::*;
pub use symbol::{Ident, Symbol as Name};
use serialize::{self, Encoder, Decoder};
use std::u32;
-#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Copy)]
+#[derive(Clone, PartialEq, Eq, Hash, Copy)]
pub struct Lifetime {
pub id: NodeId,
pub span: Span,
pub bounds: Vec
}
impl fmt::Debug for Lifetime {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "lifetime({}: {})", self.id, pprust::lifetime_to_string(self))
}
}
impl<'a> PartialEq<&'a str> for Path {
fn eq(&self, string: &&'a str) -> bool {
self.segments.len() == 1 && self.segments[0].identifier.name == *string
}
}
enum TraitBoundModifier {
None,
Maybe,
}
union tests {
a: i128,
b: isize,
}
+// Self vs self
+trait T {
+ type Item;
+ // `Self` will be whatever type that implements `T`.
+ fn new() -> Self;
+ // `Self::Item` will be the type alias in the implementation.
+ fn f(&self) -> Self::Item;
+}
+
+// Raw identifiers
+extern crate foo;
+fn main() {
+ foo::r#try();
+}
+
#[valid types]
fn types() {
let num = 333_3_;
let num_u8: u8 = 333u8;
let num_u16: u16 = 333u16;
let num_u32: u32 = 333u32;
let num_u64: u64 = 333u64;
let num_u128: u128 = 333u128;
let num_usize: usize = 333usize;
let num_float: f32 = 333.45f32;
let binary = 0b1_010;
- let invalid_binary= 0b1_015;
-
let octal = 0o21535;
- let invalid_octal = 0o64_92;
-
let hexadecimal = 0x73A2_F;
- let invalid_hexadecimal = 0x7_3AY;
let char1: char = 'a';
let char2: char = '\n';
let char3: char = '\u{123_AF}';
- let invalid_char1: char = '\y';
+
+ let byte1: u8 = b'a';
+ let byte2: u8 = b'\x13';
+
+ let string: str = "hello \n \r \u{123_________fd_} \
+ bye";
+ let byte_string: str = b"hello \t \0 \u{123} \b bye";
+ let raw_string1: str = r"hello \t \b";
+ let raw_string2: str = r####"hello \n "### bye"########;
+ let raw_string3: str = br####"hello \n"####;
+
+ // Invalid
+
+ let invalid_binary= 0b1_015;
+ let invalid_octal = 0o64_92;
+ let invalid_hexadecimal = 0x7_3AY;
+
+ let invalid_char1: char = '\y';
let invalid_char2: char = '\324';
let invalid_char3: char = '%%';
let invalid_char4: char = '\n\dfd';
let invalid_char5: char = 'aaaaa';
let open_char: char = '&&&;
- let byte1: u8 = b'a';
- let byte2: u8 = b'\x13';
let invalid_byte1: u8 = b'ab';
let invalid_byte2: u8 = b'\b';
let invalid_byte2: u8 = b'\u{123}';
- let string: str = "hello \n \r \u{123_________fd_} \
- bye";
let invalid_string: str = "hello \b \u{_123} \u{1234567} \ bye";
- let byte_string: str = b"hello \t \0 \u{123} \b bye";
- let raw_string1: str = r"hello \t \b";
- let raw_string2: str = r####"hello \n "### bye"########;
- let raw_string3: str = br####"hello \n"####;
}
diff --git a/autotests/reference/test.markdown.ref b/autotests/reference/test.markdown.ref
index e626f85..fdf2e1e 100644
--- a/autotests/reference/test.markdown.ref
+++ b/autotests/reference/test.markdown.ref
@@ -1,182 +1,182 @@
# H1
## H2
### H3
Multi-line paragraph bla bla bla bla bla bla. Intentional line break via two spaces at line. Formats: _italic_, **bold**,`monospace`, ~~strikeout~~ Bullet list: * item1 * item2 Numbered list: 1. item 1 2. item 2 [link](http://kde.org) code 1 code 2 normal text