mirror of
https://github.com/servo/servo.git
synced 2025-08-07 22:45:34 +01:00
Handle RawGeckoElement and friends, add support for types which are used in both maybe-null and non-null forms
This commit is contained in:
parent
de90f5fce8
commit
0d4c5674ec
6 changed files with 260 additions and 256 deletions
|
@ -156,11 +156,15 @@ COMPILATION_TARGETS = {
|
|||
],
|
||||
"servo_owned_types": [
|
||||
"RawServoStyleSet",
|
||||
"RawGeckoNode",
|
||||
],
|
||||
"servo_maybe_owned_types": [
|
||||
"ServoNodeData",
|
||||
],
|
||||
"servo_immutable_borrow_types": [
|
||||
"RawGeckoNode",
|
||||
"RawGeckoElement",
|
||||
"RawGeckoDocument",
|
||||
],
|
||||
},
|
||||
|
||||
"atoms": {
|
||||
|
@ -329,9 +333,19 @@ def build(objdir, target_name, debug, debugger, kind_name=None,
|
|||
flags.append("--raw-line")
|
||||
flags.append("pub type {0}Strong = ::sugar::ownership::Strong<{0}>;".format(ty))
|
||||
flags.append("--blacklist-type")
|
||||
flags.append("{}MaybeBorrowed".format(ty))
|
||||
flags.append("-raw-line")
|
||||
flags.append("pub type {0}MaybeBorrowed<'a> = ::sugar::ownership::Borrowed<'a, {0}>;".format(ty))
|
||||
if "servo_immutable_borrow_types" in current_target:
|
||||
for ty in current_target["servo_immutable_borrow_types"]:
|
||||
flags.append("-blacklist-type")
|
||||
flags.append("{}Borrowed".format(ty))
|
||||
flags.append("--raw-line")
|
||||
flags.append("pub type {0}Borrowed<'a> = ::sugar::ownership::Borrowed<'a, {0}>;".format(ty))
|
||||
flags.append("pub type {0}Borrowed<'a> = &'a {0};".format(ty))
|
||||
flags.append("--blacklist-type")
|
||||
flags.append("{}MaybeBorrowed".format(ty))
|
||||
flags.append("--raw-line")
|
||||
flags.append("pub type {0}MaybeBorrowed<'a> = ::sugar::ownership::Borrowed<'a, {0}>;".format(ty))
|
||||
if "servo_owned_types" in current_target:
|
||||
for ty in current_target["servo_owned_types"]:
|
||||
flags.append("--blacklist-type")
|
||||
|
@ -349,19 +363,19 @@ def build(objdir, target_name, debug, debugger, kind_name=None,
|
|||
if "servo_maybe_owned_types" in current_target:
|
||||
for ty in current_target["servo_maybe_owned_types"]:
|
||||
flags.append("--blacklist-type")
|
||||
flags.append("{}Borrowed".format(ty))
|
||||
flags.append("{}MaybeBorrowed".format(ty))
|
||||
flags.append("--raw-line")
|
||||
flags.append("pub type {0}Borrowed<'a> = ::sugar::ownership::Borrowed<'a, {0}>;"
|
||||
flags.append("pub type {0}MaybeBorrowed<'a> = ::sugar::ownership::Borrowed<'a, {0}>;"
|
||||
.format(ty))
|
||||
flags.append("--blacklist-type")
|
||||
flags.append("{}BorrowedMut".format(ty))
|
||||
flags.append("{}MaybeBorrowedMut".format(ty))
|
||||
flags.append("--raw-line")
|
||||
flags.append("pub type {0}BorrowedMut<'a> = ::sugar::ownership::BorrowedMut<'a, {0}>;"
|
||||
flags.append("pub type {0}MaybeBorrowedMut<'a> = ::sugar::ownership::BorrowedMut<'a, {0}>;"
|
||||
.format(ty))
|
||||
flags.append("--blacklist-type")
|
||||
flags.append("{}Owned".format(ty))
|
||||
flags.append("{}MaybeOwned".format(ty))
|
||||
flags.append("--raw-line")
|
||||
flags.append("pub type {0}Owned = ::sugar::ownership::MaybeOwned<{0}>;".format(ty))
|
||||
flags.append("pub type {0}MaybeOwned = ::sugar::ownership::MaybeOwned<{0}>;".format(ty))
|
||||
if "structs_types" in current_target:
|
||||
for ty in current_target["structs_types"]:
|
||||
ty_fragments = ty.split("::")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue