mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Keep source code order for module items
This commit is contained in:
1 parent
1f8213082c
commit
d54cfaf3f4
3 files changed
+4
-1
No files matched your search
Generated
+1
@@ -1670,6 +1670,7 @@ dependencies = [
|
||||
name = "rustpython-derive"
|
||||
version = "0.1.2"
|
||||
dependencies = [
|
||||
"indexmap",
|
||||
"maplit",
|
||||
"once_cell",
|
||||
"proc-macro2",
|
||||
|
||||
@@ -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
@@ -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(
|
||||
|
||||
Reference in new issue
Block a user