@@ -30,24 +30,42 @@ class LiteralPattern : public Pattern
3030 Literal lit;
3131 location_t locus;
3232 NodeId node_id;
33+ bool has_minus;
3334
3435public:
3536 std::string as_string () const override ;
3637
3738 // Constructor for a literal pattern
3839 LiteralPattern (Literal lit, location_t locus)
3940 : lit (std::move (lit)), locus (locus),
40- node_id (Analysis::Mappings::get ().get_next_node_id ())
41+ node_id (Analysis::Mappings::get ().get_next_node_id ()),
42+ has_minus (false )
43+ {}
44+
45+ LiteralPattern (Literal lit, location_t locus, bool has_minus)
46+ : lit (std::move (lit)), locus (locus),
47+ node_id (Analysis::Mappings::get ().get_next_node_id ()),
48+ has_minus (has_minus)
4149 {}
4250
4351 LiteralPattern (std::string val, Literal::LitType type, location_t locus,
4452 PrimitiveCoreType type_hint)
4553 : lit (Literal (std::move (val), type, type_hint)), locus (locus),
46- node_id (Analysis::Mappings::get ().get_next_node_id ())
54+ node_id (Analysis::Mappings::get ().get_next_node_id ()),
55+ has_minus (false )
56+ {}
57+
58+ LiteralPattern (std::string val, Literal::LitType type, location_t locus,
59+ PrimitiveCoreType type_hint, bool has_minus)
60+ : lit (Literal (std::move (val), type, type_hint)), locus (locus),
61+ node_id (Analysis::Mappings::get ().get_next_node_id ()),
62+ has_minus (has_minus)
4763 {}
4864
4965 location_t get_locus () const override final { return locus; }
5066
67+ bool get_has_minus () const { return has_minus; }
68+
5169 void accept_vis (ASTVisitor &vis) override ;
5270
5371 NodeId get_node_id () const override { return node_id; }
0 commit comments