Bug 1519629 - Document a few more macros.
authorEmilio Cobos Álvarez <emilio@crisal.io>
Sun, 13 Jan 2019 21:42:38 +0100
changeset 510797 1a1d8b9f1a3ab704ab277407823f6f42dd63a3d4
parent 510796 a2f691714d70fa6a9119503270809fa0eb8df6c6
child 510798 7ccafc4ab34ce5980b056c72f7e1a91f34320626
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1519629
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1519629 - Document a few more macros.
servo/components/style/gecko/regen_atoms.py
servo/components/style/gecko_string_cache/namespace.rs
--- a/servo/components/style/gecko/regen_atoms.py
+++ b/servo/components/style/gecko/regen_atoms.py
@@ -125,16 +125,17 @@ PRELUDE = '''
 RULE_TEMPLATE = '''
     ("{atom}") => {{{{
         #[allow(unsafe_code)] #[allow(unused_unsafe)]
         unsafe {{ $crate::string_cache::Atom::from_index({index}) }}
     }}}};
 '''[1:]
 
 MACRO_TEMPLATE = '''
+/// Returns a static atom by passing the literal string it represents.
 #[macro_export]
 macro_rules! atom {{
 {body}\
 }}
 '''
 
 def write_atom_macro(atoms, file_name):
     with FileAvoidWrite(file_name) as f:
--- a/servo/components/style/gecko_string_cache/namespace.rs
+++ b/servo/components/style/gecko_string_cache/namespace.rs
@@ -6,16 +6,18 @@
 
 use crate::gecko_bindings::structs::nsAtom;
 use crate::string_cache::{Atom, WeakAtom};
 use precomputed_hash::PrecomputedHash;
 use std::borrow::Borrow;
 use std::fmt;
 use std::ops::Deref;
 
+/// In Gecko namespaces are just regular atoms, so this is a simple macro to
+/// forward one macro to the other.
 #[macro_export]
 macro_rules! ns {
     () => {
         $crate::string_cache::Namespace(atom!(""))
     };
     ($s:tt) => {
         $crate::string_cache::Namespace(atom!($s))
     };