diff options
Diffstat (limited to 'vtab.zig')
| -rw-r--r-- | vtab.zig | 70 |
1 files changed, 35 insertions, 35 deletions
| @@ -315,9 +315,9 @@ fn validateCursorType(comptime Table: type) void { | |||
| 315 | 315 | ||
| 316 | const info = @typeInfo(@TypeOf(Cursor.init)).Fn; | 316 | const info = @typeInfo(@TypeOf(Cursor.init)).Fn; |
| 317 | 317 | ||
| 318 | if (info.args.len != 2) @compileError(error_message); | 318 | if (info.params.len != 2) @compileError(error_message); |
| 319 | if (info.args[0].arg_type.? != mem.Allocator) @compileError(error_message); | 319 | if (info.params[0].type.? != mem.Allocator) @compileError(error_message); |
| 320 | if (info.args[1].arg_type.? != *Table) @compileError(error_message); | 320 | if (info.params[1].type.? != *Table) @compileError(error_message); |
| 321 | if (info.return_type.? != Cursor.InitError!*Cursor) @compileError(error_message); | 321 | if (info.return_type.? != Cursor.InitError!*Cursor) @compileError(error_message); |
| 322 | } | 322 | } |
| 323 | 323 | ||
| @@ -333,8 +333,8 @@ fn validateCursorType(comptime Table: type) void { | |||
| 333 | 333 | ||
| 334 | const info = @typeInfo(@TypeOf(Cursor.deinit)).Fn; | 334 | const info = @typeInfo(@TypeOf(Cursor.deinit)).Fn; |
| 335 | 335 | ||
| 336 | if (info.args.len != 1) @compileError(error_message); | 336 | if (info.params.len != 1) @compileError(error_message); |
| 337 | if (info.args[0].arg_type.? != *Cursor) @compileError(error_message); | 337 | if (info.params[0].type.? != *Cursor) @compileError(error_message); |
| 338 | if (info.return_type.? != void) @compileError(error_message); | 338 | if (info.return_type.? != void) @compileError(error_message); |
| 339 | } | 339 | } |
| 340 | 340 | ||
| @@ -354,9 +354,9 @@ fn validateCursorType(comptime Table: type) void { | |||
| 354 | 354 | ||
| 355 | const info = @typeInfo(@TypeOf(Cursor.next)).Fn; | 355 | const info = @typeInfo(@TypeOf(Cursor.next)).Fn; |
| 356 | 356 | ||
| 357 | if (info.args.len != 2) @compileError(error_message); | 357 | if (info.params.len != 2) @compileError(error_message); |
| 358 | if (info.args[0].arg_type.? != *Cursor) @compileError(error_message); | 358 | if (info.params[0].type.? != *Cursor) @compileError(error_message); |
| 359 | if (info.args[1].arg_type.? != *VTabDiagnostics) @compileError(error_message); | 359 | if (info.params[1].type.? != *VTabDiagnostics) @compileError(error_message); |
| 360 | if (info.return_type.? != Cursor.NextError!void) @compileError(error_message); | 360 | if (info.return_type.? != Cursor.NextError!void) @compileError(error_message); |
| 361 | } | 361 | } |
| 362 | 362 | ||
| @@ -376,9 +376,9 @@ fn validateCursorType(comptime Table: type) void { | |||
| 376 | 376 | ||
| 377 | const info = @typeInfo(@TypeOf(Cursor.hasNext)).Fn; | 377 | const info = @typeInfo(@TypeOf(Cursor.hasNext)).Fn; |
| 378 | 378 | ||
| 379 | if (info.args.len != 2) @compileError(error_message); | 379 | if (info.params.len != 2) @compileError(error_message); |
| 380 | if (info.args[0].arg_type.? != *Cursor) @compileError(error_message); | 380 | if (info.params[0].type.? != *Cursor) @compileError(error_message); |
| 381 | if (info.args[1].arg_type.? != *VTabDiagnostics) @compileError(error_message); | 381 | if (info.params[1].type.? != *VTabDiagnostics) @compileError(error_message); |
| 382 | if (info.return_type.? != Cursor.HasNextError!bool) @compileError(error_message); | 382 | if (info.return_type.? != Cursor.HasNextError!bool) @compileError(error_message); |
| 383 | } | 383 | } |
| 384 | 384 | ||
| @@ -398,11 +398,11 @@ fn validateCursorType(comptime Table: type) void { | |||
| 398 | 398 | ||
| 399 | const info = @typeInfo(@TypeOf(Cursor.filter)).Fn; | 399 | const info = @typeInfo(@TypeOf(Cursor.filter)).Fn; |
| 400 | 400 | ||
| 401 | if (info.args.len != 4) @compileError(error_message); | 401 | if (info.params.len != 4) @compileError(error_message); |
| 402 | if (info.args[0].arg_type.? != *Cursor) @compileError(error_message); | 402 | if (info.params[0].type.? != *Cursor) @compileError(error_message); |
| 403 | if (info.args[1].arg_type.? != *VTabDiagnostics) @compileError(error_message); | 403 | if (info.params[1].type.? != *VTabDiagnostics) @compileError(error_message); |
| 404 | if (info.args[2].arg_type.? != IndexIdentifier) @compileError(error_message); | 404 | if (info.params[2].type.? != IndexIdentifier) @compileError(error_message); |
| 405 | if (info.args[3].arg_type.? != []FilterArg) @compileError(error_message); | 405 | if (info.params[3].type.? != []FilterArg) @compileError(error_message); |
| 406 | if (info.return_type.? != Cursor.FilterError!void) @compileError(error_message); | 406 | if (info.return_type.? != Cursor.FilterError!void) @compileError(error_message); |
| 407 | } | 407 | } |
| 408 | 408 | ||
| @@ -425,10 +425,10 @@ fn validateCursorType(comptime Table: type) void { | |||
| 425 | 425 | ||
| 426 | const info = @typeInfo(@TypeOf(Cursor.column)).Fn; | 426 | const info = @typeInfo(@TypeOf(Cursor.column)).Fn; |
| 427 | 427 | ||
| 428 | if (info.args.len != 3) @compileError(error_message); | 428 | if (info.params.len != 3) @compileError(error_message); |
| 429 | if (info.args[0].arg_type.? != *Cursor) @compileError(error_message); | 429 | if (info.params[0].type.? != *Cursor) @compileError(error_message); |
| 430 | if (info.args[1].arg_type.? != *VTabDiagnostics) @compileError(error_message); | 430 | if (info.params[1].type.? != *VTabDiagnostics) @compileError(error_message); |
| 431 | if (info.args[2].arg_type.? != i32) @compileError(error_message); | 431 | if (info.params[2].type.? != i32) @compileError(error_message); |
| 432 | if (info.return_type.? != Cursor.ColumnError!Cursor.Column) @compileError(error_message); | 432 | if (info.return_type.? != Cursor.ColumnError!Cursor.Column) @compileError(error_message); |
| 433 | } | 433 | } |
| 434 | 434 | ||
| @@ -448,9 +448,9 @@ fn validateCursorType(comptime Table: type) void { | |||
| 448 | 448 | ||
| 449 | const info = @typeInfo(@TypeOf(Cursor.rowId)).Fn; | 449 | const info = @typeInfo(@TypeOf(Cursor.rowId)).Fn; |
| 450 | 450 | ||
| 451 | if (info.args.len != 2) @compileError(error_message); | 451 | if (info.params.len != 2) @compileError(error_message); |
| 452 | if (info.args[0].arg_type.? != *Cursor) @compileError(error_message); | 452 | if (info.params[0].type.? != *Cursor) @compileError(error_message); |
| 453 | if (info.args[1].arg_type.? != *VTabDiagnostics) @compileError(error_message); | 453 | if (info.params[1].type.? != *VTabDiagnostics) @compileError(error_message); |
| 454 | if (info.return_type.? != Cursor.RowIDError!i64) @compileError(error_message); | 454 | if (info.return_type.? != Cursor.RowIDError!i64) @compileError(error_message); |
| 455 | } | 455 | } |
| 456 | } | 456 | } |
| @@ -473,11 +473,11 @@ fn validateTableType(comptime Table: type) void { | |||
| 473 | 473 | ||
| 474 | const info = @typeInfo(@TypeOf(Table.init)).Fn; | 474 | const info = @typeInfo(@TypeOf(Table.init)).Fn; |
| 475 | 475 | ||
| 476 | if (info.args.len != 3) @compileError(error_message); | 476 | if (info.params.len != 3) @compileError(error_message); |
| 477 | if (info.args[0].arg_type.? != mem.Allocator) @compileError(error_message); | 477 | if (info.params[0].type.? != mem.Allocator) @compileError(error_message); |
| 478 | if (info.args[1].arg_type.? != *VTabDiagnostics) @compileError(error_message); | 478 | if (info.params[1].type.? != *VTabDiagnostics) @compileError(error_message); |
| 479 | // TODO(vincent): maybe allow a signature without the args since a table can do withoout them | 479 | // TODO(vincent): maybe allow a signature without the params since a table can do withoout them |
| 480 | if (info.args[2].arg_type.? != []const ModuleArgument) @compileError(error_message); | 480 | if (info.params[2].type.? != []const ModuleArgument) @compileError(error_message); |
| 481 | if (info.return_type.? != Table.InitError!*Table) @compileError(error_message); | 481 | if (info.return_type.? != Table.InitError!*Table) @compileError(error_message); |
| 482 | } | 482 | } |
| 483 | 483 | ||
| @@ -493,9 +493,9 @@ fn validateTableType(comptime Table: type) void { | |||
| 493 | 493 | ||
| 494 | const info = @typeInfo(@TypeOf(Table.deinit)).Fn; | 494 | const info = @typeInfo(@TypeOf(Table.deinit)).Fn; |
| 495 | 495 | ||
| 496 | if (info.args.len != 2) @compileError(error_message); | 496 | if (info.params.len != 2) @compileError(error_message); |
| 497 | if (info.args[0].arg_type.? != *Table) @compileError(error_message); | 497 | if (info.params[0].type.? != *Table) @compileError(error_message); |
| 498 | if (info.args[1].arg_type.? != mem.Allocator) @compileError(error_message); | 498 | if (info.params[1].type.? != mem.Allocator) @compileError(error_message); |
| 499 | if (info.return_type.? != void) @compileError(error_message); | 499 | if (info.return_type.? != void) @compileError(error_message); |
| 500 | } | 500 | } |
| 501 | 501 | ||
| @@ -515,10 +515,10 @@ fn validateTableType(comptime Table: type) void { | |||
| 515 | 515 | ||
| 516 | const info = @typeInfo(@TypeOf(Table.buildBestIndex)).Fn; | 516 | const info = @typeInfo(@TypeOf(Table.buildBestIndex)).Fn; |
| 517 | 517 | ||
| 518 | if (info.args.len != 3) @compileError(error_message); | 518 | if (info.params.len != 3) @compileError(error_message); |
| 519 | if (info.args[0].arg_type.? != *Table) @compileError(error_message); | 519 | if (info.params[0].type.? != *Table) @compileError(error_message); |
| 520 | if (info.args[1].arg_type.? != *VTabDiagnostics) @compileError(error_message); | 520 | if (info.params[1].type.? != *VTabDiagnostics) @compileError(error_message); |
| 521 | if (info.args[2].arg_type.? != *BestIndexBuilder) @compileError(error_message); | 521 | if (info.params[2].type.? != *BestIndexBuilder) @compileError(error_message); |
| 522 | if (info.return_type.? != Table.BuildBestIndexError!void) @compileError(error_message); | 522 | if (info.return_type.? != Table.BuildBestIndexError!void) @compileError(error_message); |
| 523 | } | 523 | } |
| 524 | 524 | ||