Merge remote-tracking branch 'kinetik/namespace_enums' into namespace_enums

This commit is contained in:
Ralph Giles 2017-04-04 08:25:45 -07:00
Родитель ae47f9cc0e e944b8dc0f
Коммит bdd5151708
4 изменённых файлов: 21 добавлений и 21 удалений

Просмотреть файл

@ -147,10 +147,10 @@ Header:
```C
// Some boilerplate omitted.
typedef enum Colours {
Red = -6,
Blue,
Green = 7,
Yellow,
Colours_Red = -6,
Colours_Blue,
Colours_Green = 7,
Colours_Yellow,
} Colours;
// Some more boilerplate omitted.
```

Просмотреть файл

@ -136,10 +136,10 @@
//! ```C
//! // Some boilerplate omitted.
//! typedef enum Colours {
//! Red = -6,
//! Blue,
//! Green = 7,
//! Yellow,
//! Colours_Red = -6,
//! Colours_Blue,
//! Colours_Green = 7,
//! Colours_Yellow,
//! } Colours;
//! // Some more boilerplate omitted.
//! ```

Просмотреть файл

@ -186,7 +186,7 @@ fn parse_enum(item: &ast::Item) -> Result<Option<String>, Error> {
let (_, docs) = parse_attr(&var.node.attrs, |_| true, |attr| retrieve_docstring(attr, "\t"));
buffer.push_str(&docs);
buffer.push_str(&format!("\t{},\n", print::pprust::variant_to_string(var)));
buffer.push_str(&format!("\t{}_{},\n", name, print::pprust::variant_to_string(var)));
}
} else {
return Err(Error {

Просмотреть файл

@ -129,18 +129,18 @@ cheddar_cmp_test! { compilable_typedefs,
cheddar_cmp_test! { compilable_enums,
"
typedef enum Colours {
Red,
Orange,
Yellow,
Green,
Blue,
Indigo,
Violet,
Colours_Red,
Colours_Orange,
Colours_Yellow,
Colours_Green,
Colours_Blue,
Colours_Indigo,
Colours_Violet,
} Colours;
typedef enum TypesOfLabrador {
Stupid = -8,
Braindead,
TypesOfLabrador_Stupid = -8,
TypesOfLabrador_Braindead,
} TypesOfLabrador;
",
"
@ -477,9 +477,9 @@ cheddar_cmp_test! { general_interplay,
typedef float Ins;
typedef enum Eye {
Blue = -1,
Green,
Red,
Eye_Blue = -1,
Eye_Green,
Eye_Red,
} Eye;
typedef struct Person {