diff options
Diffstat (limited to 'tools/Scanner/Generator.lean')
| -rw-r--r-- | tools/Scanner/Generator.lean | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/Scanner/Generator.lean b/tools/Scanner/Generator.lean index 1ac8139..5884a0d 100644 --- a/tools/Scanner/Generator.lean +++ b/tools/Scanner/Generator.lean @@ -61,12 +61,12 @@ private def Generator.runIndex (rootModule : String) (gen : Generator Unit) : St gen.run.run { rootModule, currentModule := rootModule } private def resolveInterface (iface : InterfaceRef) (suffix : String := ".Header") : Generator String := do - emitLocalImport iface.moduleName suffix - return iface.typeName.pascalCase + emitLocalImport iface.protocol suffix + return iface.interface.pascalCase private def resolveEnum (enum : EnumRef) : Generator String := do let iface ← resolveInterface enum.toInterfaceRef - return s!"{iface}.{enum.enumName.pascalCase}" + return s!"{iface}.{enum.enum.pascalCase}" section Header @@ -114,8 +114,8 @@ private def emitEventDefinitions (protocol : ProtocolDesc) : Generator Unit := d match arg.type with | .int .none => emitLine s!" ({argName} : Int32)" | .int (.some enum) => emitLine s!" ({argName} : {← resolveEnum enum})" - | .uInt .none => emitLine s!" ({argName} : UInt32)" - | .uInt (.some enum) => emitLine s!" ({argName} : {← resolveEnum enum})" + | .uint .none => emitLine s!" ({argName} : UInt32)" + | .uint (.some enum) => emitLine s!" ({argName} : {← resolveEnum enum})" | .fixed => emitLine s!" ({argName} : Float)" | .string .nullable => emitLine s!" ({argName} : Option String)" | .string .notNull => emitLine s!" ({argName} : String)" @@ -140,7 +140,7 @@ private def emitInterfaceInstances (protocol : ProtocolDesc) : Generator Unit := let argumentDesc (arg : Raw.ArgumentDesc) : String := match arg.type with | .int => ".int" - | .uInt => ".uint" + | .uint => ".uint" | .fixed => ".fixed" | .string => s!".string {nullability arg}" | .object => s!".object {nullability arg} {interfaceName arg}" @@ -216,8 +216,8 @@ private def emitRequests (protocol : ProtocolDesc) : Generator Unit := do match arg.type with | .int .none => emitLine s!" ({argName} : Int32)" | .int (.some enum) => emitLine s!" ({argName} : {← resolveEnum enum})" - | .uInt .none => emitLine s!" ({argName} : UInt32)" - | .uInt (.some enum) => emitLine s!" ({argName} : {← resolveEnum enum})" + | .uint .none => emitLine s!" ({argName} : UInt32)" + | .uint (.some enum) => emitLine s!" ({argName} : {← resolveEnum enum})" | .fixed => emitLine s!" ({argName} : Float)" | .string .nullable => emitLine s!" ({argName} : Option String)" | .string .notNull => emitLine s!" ({argName} : String)" |
