node_id (Analysis::Mappings::get ()->get_next_node_id ())
{}
- LiteralPattern (std::string val, Literal::LitType type, Location locus)
- : lit (Literal (std::move (val), type, PrimitiveCoreType::CORETYPE_STR)),
- locus (locus), node_id (Analysis::Mappings::get ()->get_next_node_id ())
+ LiteralPattern (std::string val, Literal::LitType type, Location locus,
+ PrimitiveCoreType type_hint)
+ : lit (Literal (std::move (val), type, type_hint)), locus (locus),
+ node_id (Analysis::Mappings::get ()->get_next_node_id ())
{}
Location get_locus () const override final { return locus; }
// literal pattern
return std::unique_ptr<AST::LiteralPattern> (
new AST::LiteralPattern (range_lower->get_str (), type,
- range_lower->get_locus ()));
+ range_lower->get_locus (),
+ range_lower->get_type_hint ()));
}
}
case TRUE_LITERAL:
lexer.skip_token ();
return std::unique_ptr<AST::LiteralPattern> (
- new AST::LiteralPattern ("true", AST::Literal::BOOL, t->get_locus ()));
+ new AST::LiteralPattern ("true", AST::Literal::BOOL, t->get_locus (),
+ t->get_type_hint ()));
case FALSE_LITERAL:
lexer.skip_token ();
return std::unique_ptr<AST::LiteralPattern> (
- new AST::LiteralPattern ("false", AST::Literal::BOOL, t->get_locus ()));
+ new AST::LiteralPattern ("false", AST::Literal::BOOL, t->get_locus (),
+ t->get_type_hint ()));
case CHAR_LITERAL:
case BYTE_CHAR_LITERAL:
case INT_LITERAL:
lexer.skip_token ();
return std::unique_ptr<AST::LiteralPattern> (
new AST::LiteralPattern (t->get_str (), AST::Literal::STRING,
- t->get_locus ()));
+ t->get_locus (), t->get_type_hint ()));
case BYTE_STRING_LITERAL:
lexer.skip_token ();
return std::unique_ptr<AST::LiteralPattern> (
new AST::LiteralPattern (t->get_str (), AST::Literal::BYTE_STRING,
- t->get_locus ()));
+ t->get_locus (), t->get_type_hint ()));
// raw string and raw byte string literals too if they are readded to
// lexer
case MINUS: