Keep source code order for module items

This commit is contained in:
Jeong YunWon committed 2020-10-19 18:21:04 +09:00
1 parent 1f8213082c
commit d54cfaf3f4
3 files changed
+4 -1

No files matched your search

Generated
+1
View File
@@ -1670,6 +1670,7 @@ dependencies = [
name = "rustpython-derive"
version = "0.1.2"
dependencies = [
"indexmap",
"maplit",
"once_cell",
"proc-macro2",
+1
View File
@@ -20,3 +20,4 @@ rustpython-bytecode = { path = "../bytecode", version = "0.1.1" }
maplit = "1.0"
once_cell = "1.3.1"
textwrap = "0.12.1"
indexmap = "^1"
+2 -1
View File
@@ -1,3 +1,4 @@
use indexmap::map::IndexMap;
use proc_macro2::{Span, TokenStream};
use quote::{quote, ToTokens};
use std::collections::HashMap;
@@ -18,7 +19,7 @@ pub(crate) const ALL_ALLOWED_NAMES: &[&str] = &[
];
#[derive(Default)]
pub(crate) struct ItemNursery(HashMap<(String, Vec<Attribute>), TokenStream>);
pub(crate) struct ItemNursery(IndexMap<(String, Vec<Attribute>), TokenStream>);
impl ItemNursery {
pub fn add_item(