Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion external/fmt
Submodule fmt updated 56 files
+6 −0 .clang-format
+5 −3 .github/workflows/cifuzz.yml
+1 −1 .github/workflows/doc.yml
+8 −36 .github/workflows/lint.yml
+15 −13 .github/workflows/linux.yml
+6 −2 .github/workflows/macos.yml
+4 −4 .github/workflows/scorecard.yml
+4 −9 .github/workflows/windows.yml
+1 −0 .gitignore
+31 −15 CMakeLists.txt
+322 −0 ChangeLog.md
+1 −0 README.md
+54 −23 doc/api.md
+1 −1 doc/get-started.md
+2 −2 doc/index.md
+4 −5 doc/syntax.md
+20 −28 include/fmt/args.h
+1,775 −1,890 include/fmt/base.h
+376 −470 include/fmt/chrono.h
+20 −22 include/fmt/color.h
+54 −44 include/fmt/compile.h
+65 −44 include/fmt/format-inl.h
+1,104 −1,287 include/fmt/format.h
+43 −55 include/fmt/os.h
+43 −88 include/fmt/ostream.h
+107 −130 include/fmt/printf.h
+98 −130 include/fmt/ranges.h
+74 −47 include/fmt/std.h
+97 −46 include/fmt/xchar.h
+19 −1 src/fmt.cc
+4 −1 src/format.cc
+6 −11 src/os.cc
+35 −3 support/mkdocs
+311 −290 support/python/mkdocstrings_handlers/cxx/__init__.py
+31 −61 support/release.py
+4 −19 test/CMakeLists.txt
+14 −0 test/args-test.cc
+131 −144 test/base-test.cc
+40 −15 test/chrono-test.cc
+1 −27 test/compile-error-test/CMakeLists.txt
+51 −13 test/compile-test.cc
+4 −3 test/format-impl-test.cc
+148 −27 test/format-test.cc
+19 −11 test/gtest/gmock-gtest-all.cc
+24 −10 test/gtest/gmock/gmock.h
+4 −3 test/gtest/gtest/gtest.h
+24 −0 test/no-builtin-types-test.cc
+1 −1 test/os-test.cc
+23 −16 test/ranges-test.cc
+3 −3 test/scan-test.cc
+5 −5 test/scan.h
+29 −3 test/std-test.cc
+1 −1 test/test-assert.h
+1 −1 test/unicode-test.cc
+4 −5 test/util.cc
+23 −105 test/xchar-test.cc
2 changes: 1 addition & 1 deletion lib/include/pl/core/lexer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ namespace pl::core {
std::optional<u128> parseInteger(std::string_view literal);

Token makeToken(const Token& token, size_t length = 1);
static Token makeTokenAt(const Token& token, Location& location, size_t length = 1);
Token makeTokenAt(const Token& token, Location& location, size_t length = 1);
void addToken(const Token& token);
bool hasTheLineEnded(const char &ch) {
if(ch == '\n') {
Expand Down
5 changes: 3 additions & 2 deletions lib/include/pl/core/preprocessor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ namespace pl::core {
void addStatementHandler(const Token::Keyword &statementType, const api::StatementHandler &handler);
void removePragmaHandler(const std::string &pragmaType);
void removeDirectiveHandler(const Token::Directive &directiveType);

size_t getLongestLineLength() const { return m_longestLineLength; }
void setLongestLineLength(size_t length) { m_longestLineLength = length; }
void validateOutput();

[[nodiscard]] const std::vector<ExcludedLocation>& getExcludedLocations() const {
Expand Down Expand Up @@ -162,7 +163,7 @@ namespace pl::core {
std::vector<Token> m_result;
std::vector<Token> m_output;
std::vector<std::string> m_namespaces;

size_t m_longestLineLength = 0;
api::Source* m_source = nullptr;

bool m_onlyIncludeOnce = false;
Expand Down
2 changes: 2 additions & 0 deletions lib/source/pl/core/lexer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,11 +458,13 @@ namespace pl::core {
Token Lexer::makeToken(const Token &token, const size_t length) {
auto location = this->location();
location.length = length;
m_longestLineLength = std::max(m_longestLineLength, location.column + location.length);
return { token.type, token.value, location };
}

Token Lexer::makeTokenAt(const Token &token, Location& location, const size_t length) {
location.length = length;
m_longestLineLength = std::max(m_longestLineLength, location.column + location.length);
return { token.type, token.value, location };
}

Expand Down
2 changes: 1 addition & 1 deletion lib/source/pl/core/preprocessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ namespace pl::core {
this->error(item);
return { m_output, collectErrors() };
}

setLongestLineLength(lexer->getLongestLineLength());
m_token = m_result.begin();
m_initialized = true;
while (!eof())
Expand Down