summaryrefslogtreecommitdiff
path: root/tools/Scanner/Processor.lean
diff options
context:
space:
mode:
Diffstat (limited to 'tools/Scanner/Processor.lean')
-rw-r--r--tools/Scanner/Processor.lean18
1 files changed, 9 insertions, 9 deletions
diff --git a/tools/Scanner/Processor.lean b/tools/Scanner/Processor.lean
index 22148ed..513d89f 100644
--- a/tools/Scanner/Processor.lean
+++ b/tools/Scanner/Processor.lean
@@ -13,7 +13,7 @@ from other protocols. Thus, this needs to be done after parsing all protocols.
namespace WaylandScanner
private structure InterfaceInfo where
- moduleName : Identifier
+ protocol : Identifier
enums : Array Identifier
private abbrev InterfaceMap := Std.TreeMap String InterfaceInfo
@@ -45,8 +45,8 @@ private def interfaceInfo (name : String) : Processor InterfaceInfo := do
private def resolveInterface (name : String) : TrackingProcessor Client.InterfaceRef := do
let info ← interfaceInfo name
let ref := {
- moduleName := info.moduleName
- typeName := name
+ protocol := info.protocol
+ interface := name
}
let old ← get
set { old with referencedInterfaces := old.referencedInterfaces.insert ref }
@@ -55,16 +55,16 @@ private def resolveInterface (name : String) : TrackingProcessor Client.Interfac
private def resolveEnum (name : String) : Processor Client.EnumRef := do
let (interface, enum) ←
match (name.split ".").toArray with
- | #[enum] => pure ((← read).currentInterface.typeName, enum.toString)
+ | #[enum] => pure ((← read).currentInterface.interface, enum.toString)
| #[interface, enum] => pure (interface.toString, enum.toString)
| _ => throw s!"Malformed enum reference {name}"
let info ← interfaceInfo interface
if not (info.enums.contains enum) then
throw s!"Interface {repr interface} does not contain enum {repr enum}"
return {
- moduleName := info.moduleName
- typeName := interface
- enumName := enum
+ protocol := info.protocol
+ interface
+ enum
}
private def processEnum (raw : Raw.EnumDesc) : Processor Client.EnumDesc := do
@@ -82,7 +82,7 @@ private def processArgument (raw : Raw.ArgumentDesc) : TrackingProcessor Client.
type :=
← match raw.type with
| .int => Client.ArgumentType.int <$> raw.enum.mapM (liftM ∘ resolveEnum)
- | .uInt => Client.ArgumentType.uInt <$> raw.enum.mapM (liftM ∘ resolveEnum)
+ | .uint => Client.ArgumentType.uint <$> raw.enum.mapM (liftM ∘ resolveEnum)
| .fixed => Client.ArgumentType.fixed |> pure
| .string => Client.ArgumentType.string (.ofAllowNull raw.allowNull) |> pure
| .array => Client.ArgumentType.array |> pure
@@ -148,7 +148,7 @@ private def processProtocol (interfaces : InterfaceMap) (raw : Raw.ProtocolDesc)
interfaces := ← raw.interfaces.mapM
fun iface ↦ (processInterface iface).run {
interfaces := interfaces
- currentInterface := { moduleName := raw.name, typeName := iface.name }
+ currentInterface := { protocol := raw.name, interface := iface.name }
}
}