From 517b9ad2af99c0e0529fcadf08d4fe0de895abc1 Mon Sep 17 00:00:00 2001 From: RaiKoHoff Date: Fri, 11 Sep 2020 16:34:51 +0200 Subject: [PATCH] + fix: TinyExpr: inline evaluation on active option only + fix: TinyExpr: allow rh equal and questionmark + fix: TinyExpr: newline after evaluation by '=' --- src/Config/Config.cpp | 2 +- src/Styles.c | 6 +++--- tinyexpr/tinyexpr.c | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Config/Config.cpp b/src/Config/Config.cpp index 26a147c43..2a76b0fca 100644 --- a/src/Config/Config.cpp +++ b/src/Config/Config.cpp @@ -1259,7 +1259,7 @@ void LoadSettings() Defaults2.LineCommentPostfixStrg[0] = L'\0'; IniSectionGetString(IniSecSettings2, L"LineCommentPostfixStrg", Defaults2.LineCommentPostfixStrg, Settings2.LineCommentPostfixStrg, COUNTOF(Settings2.LineCommentPostfixStrg)); - StrTrimW(Settings2.LineCommentPostfixStrg, L"\"'"); + StrTrim(Settings2.LineCommentPostfixStrg, L"\"'"); Defaults2.DateTimeFormat[0] = L'\0'; // empty to get IniSectionGetString(IniSecSettings2, L"DateTimeFormat", Defaults2.DateTimeFormat, Settings2.DateTimeFormat, COUNTOF(Settings2.DateTimeFormat)); diff --git a/src/Styles.c b/src/Styles.c index 0cd172839..a51941138 100644 --- a/src/Styles.c +++ b/src/Styles.c @@ -1394,7 +1394,7 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew) SendMessage(hwnd,SCI_SETADDITIONALCARETFORE,rgb,0); - StrTrimW(wchSpecificStyle, L" ;"); + StrTrim(wchSpecificStyle, L" ;"); StringCchCopy(pCurrentStandard->Styles[STY_CARET].szValue, COUNTOF(pCurrentStandard->Styles[STY_CARET].szValue),wchSpecificStyle); @@ -3420,7 +3420,7 @@ bool Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle, LPCWSTR sLexerNam if (lf.lfWeight == iFontWeight) { WCHAR check[64] = { L'\0' }; Style_AppendWeightStr(check, COUNTOF(check), lf.lfWeight); - StrTrimW(check, L" ;"); + StrTrim(check, L" ;"); if (Style_StrGetAttribute(lpszStyle, check)) { Style_AppendWeightStr(szNewStyle, COUNTOF(szNewStyle), lf.lfWeight); } @@ -3434,7 +3434,7 @@ bool Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle, LPCWSTR sLexerNam if (lf.lfWidth == 0) { WCHAR check[64] = { L'\0' }; Style_AppendStretchStr(check, COUNTOF(check), /*lf.lfWidth*/ iFontStretch); - StrTrimW(check, L" ;"); + StrTrim(check, L" ;"); if (Style_StrGetAttribute(lpszStyle, check)) { Style_AppendStretchStr(szNewStyle, COUNTOF(szNewStyle), /*lf.lfWidth*/ iFontStretch); } diff --git a/tinyexpr/tinyexpr.c b/tinyexpr/tinyexpr.c index 1b9a68bf9..dd8898661 100644 --- a/tinyexpr/tinyexpr.c +++ b/tinyexpr/tinyexpr.c @@ -415,8 +415,10 @@ void next_token(state *s) { case '+': s->type = TOK_INFIX; s->function = get_function_pointer_2d(add); break; case '-': s->type = TOK_INFIX; s->function = get_function_pointer_2d(sub); break; case '*': s->type = TOK_INFIX; s->function = get_function_pointer_2d(mul); break; + //~case '×': s->type = TOK_INFIX; s->function = get_function_pointer_2d(mul); break; case '/': s->type = TOK_INFIX; s->function = get_function_pointer_2d(divide); break; case ':': s->type = TOK_INFIX; s->function = get_function_pointer_2d(divide); break; + //~case '÷': s->type = TOK_INFIX; s->function = get_function_pointer_2d(divide); break; case '^': s->type = TOK_INFIX; s->function = get_function_pointer_2d(pow); break; case '%': if (s->next++[0] == '%') {