diff options
author | Björn Gustavsson <[email protected]> | 2016-02-23 08:05:45 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2016-02-23 09:16:50 +0100 |
commit | b9f0b1259da6a26982855f490ba31a0031fca247 (patch) | |
tree | b75a9a5f87d42f2b5435b30fc71b56a32fd6affe /lib/compiler | |
parent | 6a7d8a49f0f33844a9b94fceb35079ac1b24e043 (diff) | |
download | otp-b9f0b1259da6a26982855f490ba31a0031fca247.tar.gz otp-b9f0b1259da6a26982855f490ba31a0031fca247.tar.bz2 otp-b9f0b1259da6a26982855f490ba31a0031fca247.zip |
v3_core: Include line number annotations in binary patterns
We will need them when we start to produce warnings for patterns
that can't match.
Diffstat (limited to 'lib/compiler')
-rw-r--r-- | lib/compiler/src/v3_core.erl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/compiler/src/v3_core.erl b/lib/compiler/src/v3_core.erl index 72649e5c9f..68c9f964d8 100644 --- a/lib/compiler/src/v3_core.erl +++ b/lib/compiler/src/v3_core.erl @@ -1653,10 +1653,12 @@ pat_alias_map_pairs_1([]) -> []. pat_bin(Ps, St) -> [pat_segment(P, St) || P <- Ps]. -pat_segment({bin_element,_,Val,Size,[Type,{unit,Unit}|Flags]}, St) -> +pat_segment({bin_element,L,Val,Size,[Type,{unit,Unit}|Flags]}, St) -> + Anno = lineno_anno(L, St), {Pval,[],St1} = pattern(Val,St), {Psize,[],_St2} = pattern(Size,St1), - #c_bitstr{val=Pval,size=Psize, + #c_bitstr{anno=Anno, + val=Pval,size=Psize, unit=#c_literal{val=Unit}, type=#c_literal{val=Type}, flags=#c_literal{val=Flags}}. |