File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -1696,14 +1696,33 @@ class parser {
1696
1696
token:: AT {
1697
1697
self . bump( ) ;
1698
1698
let sub = self . parse_pat( ) ;
1699
- pat = pat_box( sub) ;
1700
1699
hi = sub. span. hi;
1700
+ // HACK: parse @"..." as a literal of a vstore @str
1701
+ pat = alt sub. node {
1702
+ pat_lit( e@@{ node: expr_lit( @{ node: lit_str( _) , span: _} ) , _} ) {
1703
+ let vst = @{ id: self . get_id( ) , callee_id: self . get_id( ) ,
1704
+ node: expr_vstore( e, vstore_box) ,
1705
+ span: mk_sp( lo, hi) } ;
1706
+ pat_lit( vst)
1707
+ }
1708
+ _ { pat_box( sub) }
1709
+ } ;
1701
1710
}
1702
1711
token:: TILDE {
1703
1712
self . bump( ) ;
1704
1713
let sub = self . parse_pat( ) ;
1705
- pat = pat_uniq( sub) ;
1706
1714
hi = sub. span. hi;
1715
+ // HACK: parse ~"..." as a literal of a vstore ~str
1716
+ pat = alt sub. node {
1717
+ pat_lit( e@@{ node: expr_lit( @{ node: lit_str( _) , span: _} ) , _} ) {
1718
+ let vst = @{ id: self . get_id( ) , callee_id: self . get_id( ) ,
1719
+ node: expr_vstore( e, vstore_uniq) ,
1720
+ span: mk_sp( lo, hi) } ;
1721
+ pat_lit( vst)
1722
+ }
1723
+ _ { pat_uniq( sub) }
1724
+ } ;
1725
+
1707
1726
}
1708
1727
token:: LBRACE {
1709
1728
self . bump( ) ;
You can’t perform that action at this time.
0 commit comments