Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package highlight for openSUSE:Factory checked in at 2023-07-24 18:11:59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/highlight (Old) and /work/SRC/openSUSE:Factory/.highlight.new.1467 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "highlight" Mon Jul 24 18:11:59 2023 rev:42 rq:1099149 version:4.7 Changes: -------- --- /work/SRC/openSUSE:Factory/highlight/highlight.changes 2023-05-25 23:52:23.063557327 +0200 +++ /work/SRC/openSUSE:Factory/.highlight.new.1467/highlight.changes 2023-07-24 18:12:12.269295437 +0200 @@ -1,0 +2,7 @@ +Mon Jul 17 22:41:06 UTC 2023 - antoine.belv...@opensuse.org + +- Update to version 4.7: + * Updated astyle lib to version 3.4.1. + * CLI: Fixed member variable initialization. + +------------------------------------------------------------------- Old: ---- highlight-v4.6.tar.bz2 New: ---- highlight-v4.7.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ highlight.spec ++++++ --- /var/tmp/diff_new_pack.PmW0th/_old 2023-07-24 18:12:13.481302569 +0200 +++ /var/tmp/diff_new_pack.PmW0th/_new 2023-07-24 18:12:13.485302593 +0200 @@ -18,7 +18,7 @@ %bcond_without gui Name: highlight -Version: 4.6 +Version: 4.7 Release: 0 Summary: Universal Source Code to Formatted Text Converter License: GPL-3.0-or-later ++++++ highlight-v4.6.tar.bz2 -> highlight-v4.7.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/highlight-v4.6/.gitlab-ci.yml new/highlight-v4.7/.gitlab-ci.yml --- old/highlight-v4.6/.gitlab-ci.yml 2023-05-19 13:27:59.000000000 +0200 +++ new/highlight-v4.7/.gitlab-ci.yml 2023-07-17 20:53:18.000000000 +0200 @@ -11,7 +11,7 @@ # ====================== # Install Node.js: - apt-get install -y curl - - curl -sL https://deb.nodesource.com/setup_17.x | bash + - curl -sL https://deb.nodesource.com/setup_20.x | bash - apt-get install -y nodejs - node -v - npm -v @@ -25,11 +25,6 @@ # Verify that our compiled app works properly with a custom "test" script - bash ./src/ci_test.sh - # Save the compiled output from the above for downloading via GitLab and in Gitlab 8.6 to use in future build steps - #artifacts: - # paths: - # - ansifilter - validate: script: # Validate committed files against EditorConfig settings via EClint using diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/highlight-v4.6/AUTHORS new/highlight-v4.7/AUTHORS --- old/highlight-v4.6/AUTHORS 2023-05-19 13:27:59.000000000 +0200 +++ new/highlight-v4.7/AUTHORS 2023-07-17 20:53:18.000000000 +0200 @@ -89,4 +89,4 @@ Andrew Fuller (xterm256 font attributes) Troy Sankey (JS regex) OÄuz Ersen (manpage formatting) -https://gitlab.com/MitchC (service mode) +Mitch Capper (service mode) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/highlight-v4.6/ChangeLog.adoc new/highlight-v4.7/ChangeLog.adoc --- old/highlight-v4.6/ChangeLog.adoc 2023-05-19 13:27:59.000000000 +0200 +++ new/highlight-v4.7/ChangeLog.adoc 2023-07-17 20:53:18.000000000 +0200 @@ -6,6 +6,13 @@ :toc: left :toclevels: 1 +== highlight 4.7 + +17.07.2023 + + - updated astyle lib to version 3.4.1 + - CLI: fixed member variable initialization (https://gitlab.com/saalen/highlight/-/merge_requests/143) + == highlight 4.6 11.05.2023 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/highlight-v4.6/makefile new/highlight-v4.7/makefile --- old/highlight-v4.6/makefile 2023-05-19 13:27:59.000000000 +0200 +++ new/highlight-v4.7/makefile 2023-07-17 20:53:18.000000000 +0200 @@ -180,9 +180,9 @@ ${RMDIR} ${DESTDIR}${examples_dir} rm -rf ${DESTDIR}${man_dir}man1/highlight.1.gz rm -rf ${DESTDIR}${man_dir}man5/filetypes.conf.5.gz - rm -rf ${DESTDIR}${bash_comp_dir}highlight.bash + rm -rf ${DESTDIR}${bash_comp_dir}highlight rm -rf ${DESTDIR}${fish_comp_dir}highlight.fish - + rm -rf ${DESTDIR}${zsh_comp_dir}_highlight rm -rf ${DESTDIR}${bin_dir}highlight rm -rf ${DESTDIR}${bin_dir}highlight-gui rm -rf ${DESTDIR}${desktop_apps}highlight.desktop diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/highlight-v4.6/src/core/astyle/ASBeautifier.cpp new/highlight-v4.7/src/core/astyle/ASBeautifier.cpp --- old/highlight-v4.6/src/core/astyle/ASBeautifier.cpp 2023-05-19 13:27:59.000000000 +0200 +++ new/highlight-v4.7/src/core/astyle/ASBeautifier.cpp 2023-07-17 20:53:18.000000000 +0200 @@ -60,6 +60,7 @@ setSwitchIndent(false); setCaseIndent(false); setSqueezeWhitespace(false); + setLambdaIndentation(false); setBlockIndent(false); setBraceIndent(false); setBraceIndentVtk(false); @@ -207,6 +208,7 @@ switchIndent = other.switchIndent; caseIndent = other.caseIndent; squeezeWhitespace = other.squeezeWhitespace; + attemptLambdaIndentation = other.attemptLambdaIndentation; namespaceIndent = other.namespaceIndent; braceIndent = other.braceIndent; braceIndentVtk = other.braceIndentVtk; @@ -236,7 +238,7 @@ shouldAlignMethodColon = other.shouldAlignMethodColon; shouldIndentPreprocDefine = other.shouldIndentPreprocDefine; shouldIndentPreprocConditional = other.shouldIndentPreprocConditional; - lambdaIndicator = other.lambdaIndicator; + lambdaIndicator = other.lambdaIndicator; indentCount = other.indentCount; spaceIndentCount = other.spaceIndentCount; @@ -1121,6 +1123,18 @@ } /** + * set the state of the lambda indentation option. If true, + * the parser tries to recognize lambda code. Indentation + * is bad if the lambda code is more complex (if/switch etc) + * + * @param state state of option. + */ +void ASBeautifier::setLambdaIndentation(bool state) +{ + attemptLambdaIndentation = state; +} + +/** * get the file type. */ int ASBeautifier::getFileType() const @@ -2611,8 +2625,9 @@ // bypass whitespace here if (isWhiteSpace(ch)) { - if (squeezeWhitespace && !isInComment && !isInQuote && isWhiteSpace(line[i+1]) && !isWhiteSpace(line[i-1])) { - size_t wsSpanEnd = line.find_first_not_of(" \t", i+1); + if (squeezeWhitespace && !isInComment && !isInQuote && isWhiteSpace(line[i + 1]) && !isWhiteSpace(line[i - 1])) + { + size_t wsSpanEnd = line.find_first_not_of(" \t", i + 1); std::pair<size_t, size_t> wsSpan(i, wsSpanEnd - i - 1); squeezeWSStack.emplace_back(wsSpan); } @@ -2846,7 +2861,8 @@ { headerStack->pop_back(); isInClassHeader = false; - if ( !findKeyword(line, i, AS_STRUCT) ) // if not on this line #526 + + if (line.find("struct ", 0) > i) // if not on this line #526, GH #12 indentCount -= classInitializerIndents; if (indentCount < 0) indentCount = 0; @@ -2870,7 +2886,13 @@ } // #121 - if (!isLegalNameChar(prevNonSpaceCh) && prevNonSpaceCh != ']' && prevNonSpaceCh != ')' && line.find(AS_AUTO, 0 ) == std::string::npos) { + if (attemptLambdaIndentation // GH #7 + && !isLegalNameChar(prevNonSpaceCh) + && prevNonSpaceCh != ']' + && prevNonSpaceCh != ')' + && prevNonSpaceCh != '*' // GH #11 + && line.find(AS_AUTO, 0 ) == std::string::npos) + { lambdaIndicator = true; } } @@ -2945,7 +2967,7 @@ || isSharpDelegate || isInExternC || isInAsmBlock - //|| (getNextWord(line, i) == AS_NEW // #487 + //|| getNextWord(line, i) == AS_NEW // #487 || (isInDefine && (prevNonSpaceCh == '(' || isLegalNameChar(prevNonSpaceCh)))); @@ -2976,7 +2998,8 @@ } // #121 fix indent of lambda bodies - if (isCStyle() && lambdaIndicator ) { + if (isCStyle() && lambdaIndicator ) + { isBlockOpener = false; } @@ -3265,6 +3288,13 @@ if (isObjCStyle() && findKeyword(line, i, AS_NS_HANDLER)) foundPreCommandMacro = true; + //https://sourceforge.net/p/astyle/bugs/353/ + // new is ending the line? + if (isJavaStyle() && findKeyword(line, i, AS_NEW) && line.length() - 3 == i) + { + headerStack->emplace_back(&AS_FIXED); // needs to be something which will not match - need to define a token which will never match + } + //https://sourceforge.net/p/astyle/bugs/550/ //enum can be function return value if (parenDepth == 0 && findKeyword(line, i, AS_ENUM) && line.find_first_of(AS_OPEN_PAREN, i) == std::string::npos) @@ -3808,7 +3838,8 @@ && prevNonSpaceCh != ']' // an array && statementEndsWithComma(line, i)) { - if (!haveAssignmentThisLine) // only one assignment indent per line + // only one assignment indent per line + GH #10 + if (!haveAssignmentThisLine && line.find(AS_SCOPE_RESOLUTION) == std::string::npos) { // register indent at previous word haveAssignmentThisLine = true; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/highlight-v4.6/src/core/astyle/ASFormatter.cpp new/highlight-v4.7/src/core/astyle/ASFormatter.cpp --- old/highlight-v4.6/src/core/astyle/ASFormatter.cpp 2023-05-19 13:27:59.000000000 +0200 +++ new/highlight-v4.7/src/core/astyle/ASFormatter.cpp 2023-07-17 20:53:18.000000000 +0200 @@ -1507,7 +1507,7 @@ } } if (currentChar != ';' - || foundStructHeader // #518 + || foundStructHeader // #518 || (needHeaderOpeningBrace && parenStack->back() == 0)) currentHeader = nullptr; @@ -2922,7 +2922,8 @@ else if (isWhiteSpace(currentLine[charNum]) && !(charNum + 1 < (int) currentLine.length())) { lineIsEmpty = true; - if (!isImmediatelyPostEmptyLine ) { + if (!isImmediatelyPostEmptyLine ) + { squeezeEmptyLineCount = 0; } } @@ -3436,14 +3437,15 @@ if (isCharImmediatelyPostTemplate) return false; - //TODO FIXME // https://sourceforge.net/p/astyle/bugs/537/ - if ( previousNonWSChar == ',' && parenthesesCount <= 0) { + // https://sourceforge.net/p/astyle/bugs/552/ + if ( previousNonWSChar == ',' && parenthesesCount <= 0 && currentChar != '&') + { return false; } if (previousNonWSChar == '=' - //|| previousNonWSChar == ',' // #537 + || (previousNonWSChar == ',' && currentChar == '&') // #537, #552 || previousNonWSChar == '.' || previousNonWSChar == '{' || previousNonWSChar == '>' @@ -3976,8 +3978,8 @@ * @return the next non-whitespace substd::string. */ std::string ASFormatter::peekNextText(const std::string& firstLine, - bool endOnEmptyLine /*false*/, - const std::shared_ptr<ASPeekStream>& streamArg /*nullptr*/) const + bool endOnEmptyLine /*false*/, + const std::shared_ptr<ASPeekStream>& streamArg /*nullptr*/) const { assert(sourceIterator->getPeekStart() == 0 || streamArg != nullptr); // Borland may need != 0 bool isFirstLine = true; @@ -4681,7 +4683,7 @@ int spacesOutsideToDelete = 0; int spacesInsideToDelete = 0; - if (currentChar ==openDelim) + if (currentChar == openDelim) { spacesOutsideToDelete = formattedLine.length() - 1; spacesInsideToDelete = 0; @@ -6226,7 +6228,8 @@ int _braceCount = 0; - if (checkInterpolation && currentChar=='{') { + if (checkInterpolation && currentChar == '{') + { ++_braceCount; } @@ -6254,7 +6257,7 @@ checkInterpolation = false; } } - else if (isSharpStyle()) + else if (isSharpStyle() && !checkInterpolation ) { if ((int) currentLine.length() > charNum + 1 && currentLine[charNum + 1] == '"') // check consecutive quotes @@ -6286,11 +6289,12 @@ { currentChar = currentLine[++charNum]; - if (checkInterpolation) { - if (currentChar=='{') + if (checkInterpolation) + { + if (currentChar == '{') ++_braceCount; - if (currentChar=='}') + if (currentChar == '}') --_braceCount; } appendCurrentChar(); @@ -6298,8 +6302,9 @@ } if (charNum + 1 >= (int) currentLine.length() && currentChar != '\\' - && !isInVerbatimQuote) { - isInQuote = false; // missing closing quote + && !isInVerbatimQuote) + { + isInQuote = false; // missing closing quote } } @@ -6325,7 +6330,8 @@ verbatimDelimiter = currentLine.substr(charNum + 1, parenPos - charNum - 1); } } - else if (isSharpStyle() && (previousChar == '@' || previousChar == '$' )) { + else if (isSharpStyle() && (previousChar == '@' || previousChar == '$' )) + { isInVerbatimQuote = true; checkInterpolation = true; } @@ -6809,6 +6815,14 @@ i = line.length(); continue; } + + // https://sourceforge.net/p/astyle/bugs/504/ + if (line[line.length()-1] == ':') + { + i = line.length(); + foundSplitPoint = true; + continue; + } // not in quote or comment if (!foundSplitPoint) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/highlight-v4.6/src/core/astyle/ASResource.cpp new/highlight-v4.7/src/core/astyle/ASResource.cpp --- old/highlight-v4.6/src/core/astyle/ASResource.cpp 2023-05-19 13:27:59.000000000 +0200 +++ new/highlight-v4.7/src/core/astyle/ASResource.cpp 2023-07-17 20:53:18.000000000 +0200 @@ -8,7 +8,6 @@ //----------------------------------------------------------------------------- #include "astyle/astyle.h" - #include <algorithm> //----------------------------------------------------------------------------- @@ -628,7 +627,7 @@ // check if a specific line position contains a header. const std::string* ASBase::findHeader(const std::string& line, int i, - const std::vector<const std::string*>* possibleHeaders) const + const std::vector<const std::string*>* possibleHeaders) const { assert(isCharPotentialHeader(line, i)); // check the word @@ -679,7 +678,8 @@ if (line.compare(i, keywordLength, keyword) != 0) return false; // check that this is not part of a longer word - if (wordEnd == line.length()) { + if (wordEnd == line.length()) + { //std::cerr << "findKeyword t1 \n"; return true; } @@ -697,7 +697,7 @@ // check if a specific line position contains an operator. const std::string* ASBase::findOperator(const std::string& line, int i, - const std::vector<const std::string*>* possibleOperators) const + const std::vector<const std::string*>* possibleOperators) const { assert(isCharPotentialOperator(line[i])); // find the operator in the vector diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/highlight-v4.6/src/core/codegenerator.cpp new/highlight-v4.7/src/core/codegenerator.cpp --- old/highlight-v4.6/src/core/codegenerator.cpp 2023-05-19 13:27:59.000000000 +0200 +++ new/highlight-v4.7/src/core/codegenerator.cpp 2023-07-17 20:53:18.000000000 +0200 @@ -152,6 +152,7 @@ lineNumberWidth ( 5 ), startLineCnt( 1 ), startLineCntCurFile( 1 ), + extraEOFChar( 255 ), maxLineCnt ( UINT_MAX ), inputFilesCnt (0), processedFilesCnt (0), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/highlight-v4.6/src/include/astyle/astyle.h new/highlight-v4.7/src/include/astyle/astyle.h --- old/highlight-v4.6/src/include/astyle/astyle.h 2023-05-19 13:27:59.000000000 +0200 +++ new/highlight-v4.7/src/include/astyle/astyle.h 2023-07-17 20:53:18.000000000 +0200 @@ -313,10 +313,10 @@ protected: // functions definitions are at the end of ASResource.cpp const std::string* findHeader(const std::string& line, int i, - const std::vector<const std::string*>* possibleHeaders) const; + const std::vector<const std::string*>* possibleHeaders) const; bool findKeyword(const std::string& line, int i, const std::string& keyword) const; const std::string* findOperator(const std::string& line, int i, - const std::vector<const std::string*>* possibleOperators) const; + const std::vector<const std::string*>* possibleOperators) const; std::string getCurrentWord(const std::string& line, size_t index) const; bool isDigit(char ch) const; bool isLegalNameChar(char ch) const; @@ -353,8 +353,8 @@ void setAfterParenIndent(bool state); void setJavaStyle(); void setJSStyle(); - void setObjCStyle(); - void setSharpStyle(); + void setObjCStyle(); + void setSharpStyle(); void setLabelIndent(bool state); void setMaxContinuationIndentLength(int max); @@ -371,6 +371,7 @@ void setPreprocDefineIndent(bool state); void setPreprocConditionalIndent(bool state); void setSqueezeWhitespace(bool state); + void setLambdaIndentation(bool state); int getBeautifierFileType() const; int getFileType() const; int getIndentLength() const; @@ -556,6 +557,7 @@ bool shouldIndentPreprocConditional; bool lambdaIndicator; bool squeezeWhitespace; + bool attemptLambdaIndentation; int indentCount; int spaceIndentCount; int spaceIndentObjCMethodAlignment; @@ -853,8 +855,8 @@ const std::string* getFollowingOperator() const; std::string getPreviousWord(const std::string& line, int currPos) const; std::string peekNextText(const std::string& firstLine, - bool endOnEmptyLine = false, - const std::shared_ptr<ASPeekStream>& streamArg = nullptr) const; + bool endOnEmptyLine = false, + const std::shared_ptr<ASPeekStream>& streamArg = nullptr) const; private: // variables int formatterFileType; @@ -991,7 +993,7 @@ bool isFormattingModeOff; bool isInEnum; bool isInStruct; - bool isInContinuedPreProc; + bool isInContinuedPreProc; bool isInExecSQL; bool isInAsm; bool isInAsmOneLine; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/highlight-v4.6/src/include/version.h new/highlight-v4.7/src/include/version.h --- old/highlight-v4.6/src/include/version.h 2023-05-19 13:27:59.000000000 +0200 +++ new/highlight-v4.7/src/include/version.h 2023-07-17 20:53:18.000000000 +0200 @@ -31,7 +31,7 @@ #include <string> #define HIGHLIGHT_MAJOR "4" -#define HIGHLIGHT_MINOR "6" +#define HIGHLIGHT_MINOR "7" #define HIGHLIGHT_VERSION HIGHLIGHT_MAJOR "." HIGHLIGHT_MINOR