Browse Source

Format: Allow user-defined types in Parser

master
Riyyi 2 years ago
parent
commit
a83615083d
  1. 2
      src/ruc/format/formatter.h
  2. 2
      src/ruc/format/parser.cpp
  3. 1
      src/ruc/format/parser.h
  4. 2
      test/unit/testutilformat.cpp

2
src/ruc/format/formatter.h

@ -314,8 +314,6 @@ struct Formatter<Specifier> : Formatter<std::nullptr_t> {
} // namespace ruc::format } // namespace ruc::format
using ruc::format::Formatter;
#if 0 #if 0
TODO: TODO:

2
src/ruc/format/parser.cpp

@ -411,6 +411,8 @@ constexpr void Parser::checkSpecifierType(const Specifier& specifier, ParameterT
case ParameterType::Container: case ParameterType::Container:
checkSpecifierContainerType(specifier); checkSpecifierContainerType(specifier);
break; break;
case ParameterType::UserDefined:
break;
default: default:
VERIFY_NOT_REACHED(); VERIFY_NOT_REACHED();
} }

1
src/ruc/format/parser.h

@ -32,6 +32,7 @@ public:
String, String,
Pointer, Pointer,
Container, Container,
UserDefined,
}; };
Parser(std::string_view format, size_t parameterCount); Parser(std::string_view format, size_t parameterCount);

2
test/unit/testutilformat.cpp

@ -513,5 +513,5 @@ TEST_CASE(FormatContainers)
} }
// Local Variables: // Local Variables:
// lsp-in-cpp-project-cache: nil // lsp-in-cpp-project-cache: (nil)
// End: // End:

Loading…
Cancel
Save