Skip to content

Commit 9cf4cb6

Browse files
committed
stylo: Change the macro invocation strategy due to rust-lang/rust#35560
1 parent 6be4d45 commit 9cf4cb6

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

ports/geckolib/binding_tools/regen_atoms.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class CSSPseudoElementsAtomSource:
3939
class CSSAnonBoxesAtomSource:
4040
PATTERN = re.compile('^CSS_ANON_BOX\((.+),\s*"(.*)"\)')
4141
FILE = "dist/include/nsCSSAnonBoxList.h"
42-
CLASS = "nsGKAtoms"
42+
CLASS = "nsCSSAnonBoxes"
4343
TYPE = "nsICSSAnonBoxPseudo"
4444

4545
@staticmethod
@@ -168,34 +168,35 @@ def write_items(f, func):
168168
* ```
169169
* fn have_to_use_pseudo_elements() {
170170
* macro_rules pseudo_element! {
171-
* ($pseudo_str_with_colon:expr, $pseudo_atom:expr, $is_anon_box:true) => {
171+
* ($pseudo_str_with_colon:expr, $pseudo_atom:expr, $is_anon_box:true) => {{
172172
* // Stuff stuff stuff.
173-
* }
173+
* }}
174174
* }
175175
* include!("path/to/helper.rs")
176176
* }
177177
* ```
178+
*
178179
*/
179180
"""
180181

181182
PSEUDO_ELEMENT_MACRO_INVOCATION = """
182-
pseudo_element!(\"{}\",
183-
atom!(\"{}\"),
184-
{});
185-
""".strip()
183+
pseudo_element!(\"{}\",
184+
atom!(\"{}\"),
185+
{});
186+
"""[1:]
186187

187188

188189
def write_pseudo_element_helper(atoms, target_filename):
189190
with open(target_filename, "wb") as f:
190191
f.write(PRELUDE)
191192
f.write(PSEUDO_ELEMENT_HEADER)
193+
f.write("{\n")
192194
for atom in atoms:
193195
if atom.get_type() == "nsICSSPseudoElement":
194196
f.write(PSEUDO_ELEMENT_MACRO_INVOCATION.format(atom.value, atom.value, "false"))
195-
f.write("\n")
196197
elif atom.get_type() == "nsICSSAnonBoxPseudo":
197198
f.write(PSEUDO_ELEMENT_MACRO_INVOCATION.format(atom.value, atom.value, "true"))
198-
f.write("\n")
199+
f.write("}\n")
199200

200201

201202
def build(objdir, verbose=False):

0 commit comments

Comments
 (0)