Skip to content

Commit

Permalink
Project updates
Browse files Browse the repository at this point in the history
  • Loading branch information
raphasampaio committed Aug 14, 2024
1 parent 453b11a commit 0a259d9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/build.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
macro collection(expression)
@capture(expression, @kwdef mutable struct name_ <: AbstractCollection fields__ end) ||
error("Expected @kwdef mutable struct T <: AbstractCollection fields... end, got $expression")
error("Expected @collection @kwdef mutable struct name <: AbstractCollection fields... end, got $expression")

name_snakecase = convert(PascalCase, SnakeCase, string(name))

Expand All @@ -25,6 +25,13 @@ macro collection(expression)
return inputs.$(Symbol(name_snakecase)).$field_name[i]
end
end)

# temporary
push!(getters, quote
function $(Symbol(name_snakecase, :_, field_name))(inputs::AbstractInputs, i::Integer)
return inputs.collections.$(Symbol(name_snakecase)).$field_name[i]
end
end)
end

return esc(
Expand Down

0 comments on commit 0a259d9

Please sign in to comment.