summaryrefslogtreecommitdiff
path: root/tools/Scanner/Protocol.lean
diff options
context:
space:
mode:
authorHannes Schulze <haschu0103@outlook.de>2026-04-06 07:19:48 +0200
committerHannes Schulze <haschu0103@outlook.de>2026-04-06 07:20:06 +0200
commit92da08078a5459ca1089743eb58385e752bdb5fa (patch)
treee1c63ba933610dbee41182c547a4a1f04d95723b /tools/Scanner/Protocol.lean
parent578b90344c4e9be44955d4c4779f452c0b8dc036 (diff)
fix generic new_ids
Diffstat (limited to 'tools/Scanner/Protocol.lean')
-rw-r--r--tools/Scanner/Protocol.lean13
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/Scanner/Protocol.lean b/tools/Scanner/Protocol.lean
index 183ef6a..7661f1e 100644
--- a/tools/Scanner/Protocol.lean
+++ b/tools/Scanner/Protocol.lean
@@ -155,8 +155,10 @@ inductive ArgumentType where
| array
| fd
| object (nullability : Nullability) (interface : Option InterfaceRef)
+ | newID (interface : Option InterfaceRef)
deriving Repr, BEq, Inhabited
+/-- Logical argument (i.e., if there is a newID without an interface, this only includes the newID, not the string and uint). -/
structure ArgumentDesc where
name : Identifier
type : ArgumentType
@@ -171,7 +173,6 @@ structure MessageDesc where
since : Nat
deprecatedSince : Option Nat
arguments : Array ArgumentDesc
- rawArguments : Array Raw.ArgumentDesc
deriving Repr, BEq, Inhabited
inductive ReturnType where
@@ -179,10 +180,20 @@ inductive ReturnType where
| object (type : Option InterfaceRef)
deriving Repr, BEq, Inhabited
+def ReturnType.isWlCallback : ReturnType → Bool
+ | .object (.some iface) => iface.interface == "wl_callback"
+ | _ => false
+
structure RequestDesc extends MessageDesc where
returnType : ReturnType
deriving Repr, BEq, Inhabited
+def RequestDesc.inputArguments (req : RequestDesc) : Array ArgumentDesc :=
+ req.arguments.filter fun arg ↦
+ match arg.type with
+ | .newID _ => false
+ | _ => true
+
structure EventDesc extends MessageDesc
deriving Repr, BEq, Inhabited