xaizek / zograscope (License: AGPLv3 only) (since 2018-12-07)
Mainly a syntax-aware diff that also provides a number of additional tools.
Commit df7cf95a1a5c1f416004139660efa6fa7de11a0f

Allow escaping of (/) in Makefile functions
Author: xaizek
Author date (UTC): 2022-11-29 19:09
Committer name: xaizek
Committer date (UTC): 2022-11-29 19:09
Parent(s): 29290ec532fa6e1272e5cd3be45664e381a09acd
Signing key: 99DC5E4DB05F6BE2
Tree: 9899cdb239025f0b4384125610b8bcbb32eda04d
File Lines added Lines deleted
src/make/make-lexer.flex 6 0
tests/make/make-parser.cpp 5 0
File src/make/make-lexer.flex changed (mode: 100644) (index bf02ee3..ef630bd)
... ... NL \n|\r|\r\n
267 267 return token(CHARS, yylval, yyextra, NeedFakeWS); return token(CHARS, yylval, yyextra, NeedFakeWS);
268 268 } }
269 269 $. return token(VAR, yylval, yyextra); $. return token(VAR, yylval, yyextra);
270 \\\(|\\\) {
271 if (shouldInsertFakeWS(yylval, yyextra)) {
272 return FAKE_TOKEN(WS);
273 }
274 return token(CHARS, yylval, yyextra, NeedFakeWS);
275 }
270 276 "(" { "(" {
271 277 if (shouldInsertFakeWS(yylval, yyextra)) { if (shouldInsertFakeWS(yylval, yyextra)) {
272 278 return FAKE_TOKEN(WS); return FAKE_TOKEN(WS);
File tests/make/make-parser.cpp changed (mode: 100644) (index 9fe7b1f..e2614a8)
... ... TEST_CASE("Functions are parsed in a Makefile", "[make][parser]")
219 219 CHECK(makeIsParsed(R"_(${shell "$(CC)"})_")); CHECK(makeIsParsed(R"_(${shell "$(CC)"})_"));
220 220 CHECK(makeIsParsed(R"($(error "str"))")); CHECK(makeIsParsed(R"($(error "str"))"));
221 221 } }
222 SECTION("Parenthesis can be escaped in a call") {
223 CHECK(makeIsParsed(R"_($(shell \( echo hi ))_"));
224 CHECK(makeIsParsed(R"_($(shell echo hi \) ))_"));
225 CHECK(makeIsParsed(R"_($(shell \( echo hi \) ))_"));
226 }
222 227 } }
223 228
224 229 TEST_CASE("Targets are parsed in a Makefile", "[make][parser]") TEST_CASE("Targets are parsed in a Makefile", "[make][parser]")
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/zograscope

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/zograscope

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master