Permalink
Browse files

Why wasn't this using a record? Oof

  • Loading branch information...
1 parent fcf88bf commit e8b74b6b88a5b6c5af95aff41a842d99190e0eb7 Tony Arcieri committed Dec 25, 2010
Showing with 3 additions and 4 deletions.
  1. +3 −4 src/compiler/reia_bytecode.erl
View
7 src/compiler/reia_bytecode.erl
@@ -93,10 +93,9 @@ wrapped_module(Filename, Exprs) ->
unwrapped_module(Exprs) ->
case Exprs of
- [{module, Line, Name, Functions}] ->
- {ok, Functions2, Submodules} = reia_modules:replace(Functions, fun module_loader/1),
- Module = #module{line=Line, name=Name, exprs=Functions2},
- {Module, Submodules};
+ [#module{} = Module] ->
+ {ok, Functions2, Submodules} = reia_modules:replace(Module#module.exprs, fun module_loader/1),
+ {Module#module{exprs=Functions2}, Submodules};
_ ->
throw({error, "code without a toplevel wrapper should define exactly one module"})
end.

0 comments on commit e8b74b6

Please sign in to comment.