Let error markers through parse_transform:do/5 #6

Merged
merged 1 commit into from Apr 24, 2012

2 participants

@nox

Error markers ({error, Term} tuples) in Forms are special-cased by do/5 and make it return a error tuple itself instead of just letting them through. I don't think it is good behaviour as the compiler and its friends already handle error markers correctly. Furthermore it makes parse_trans_codegen:parse_transform/2 fails when passing the error tuple to parse_trans:revert/1.

erlc output before:

src/henshin_module.erl:none: error in parse transform 'parse_trans_codegen': {function_clause,
                                                 [{lists,flatten,
                                                   [error],
                                                   [{file,"lists.erl"},
                                                    {line,550}]},
                                                  {parse_trans,revert,1,
                                                   [{file,
                                                     "src/parse_trans.erl"},
                                                    {line,515}]},
                                                  {compile,
                                                   '-foldl_transform/2-anonymous-2-',
                                                   2,
                                                   [{file,"compile.erl"},
                                                    {line,843}]},
                                                  {compile,foldl_transform,2,
                                                   [{file,"compile.erl"},
                                                    {line,845}]},
                                                  {compile,
                                                   '-internal_comp/4-anonymous-1-',
                                                   2,
                                                   [{file,"compile.erl"},
                                                    {line,269}]},
                                                  {compile,fold_comp,3,
                                                   [{file,"compile.erl"},
                                                    {line,287}]},
                                                  {compile,internal_comp,4,
                                                   [{file,"compile.erl"},
                                                    {line,271}]},
                                                  {compile,internal,3,
                                                   [{file,"compile.erl"},
                                                    {line,246}]}]}

erlc output after:

src/henshin_module.erl:189: syntax error before: '<-'
src/henshin_module.erl:59: Warning: variable 'TransformedRules' is unused
src/henshin_module.erl:60: Warning: variable 'HenshinMods' is unused
src/henshin_module.erl:60: Warning: variable 'OptsErrors' is unused
@nox nox Let error markers through parse_transform:do/5
Error markers ({error, Term} tuples) in Forms are special-cased by do/5
and make it return a error tuple itself instead of just letting them
through. I don't think it is good behaviour as the compiler and its
friends already handle error markers correctly. Furthermore it makes
parse_trans_codegen:parse_transform/2 fails when passing the error tuple
to parse_trans:revert/1.
11f137a
@uwiger uwiger merged commit 216531d into esl:master Apr 24, 2012
@uwiger

I agree. Thanks. Merged.

@nox

@uwiger Can you make a new tag with this commit?

@uwiger

Done - new tag is 2.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment