Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] vis: backport upstream fix for bash lexer
@ 2022-10-05 14:20 dkwo
  2022-10-12 14:50 ` dkwo
  2022-10-12 15:19 ` [PR PATCH] [Merged]: " leahneukirchen
  0 siblings, 2 replies; 3+ messages in thread
From: dkwo @ 2022-10-05 14:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 427 bytes --]

There is a new pull request by dkwo against master on the void-packages repository

https://github.com/dkwo/void-packages vis
https://github.com/void-linux/void-packages/pull/39740

vis: backport upstream fix for bash lexer
- I tested the changes in this PR: **YES**
- I built this PR locally for my native architecture, (x86_64-musl)

A patch file from https://github.com/void-linux/void-packages/pull/39740.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-vis-39740.patch --]
[-- Type: text/x-diff, Size: 2964 bytes --]

From 5fb3b815f7c0bfdca107115f8c0e14dce1c8d972 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 5 Oct 2022 09:45:42 -0400
Subject: [PATCH] vis: backport upstream fix for bash lexer

---
 ...-bug-in-bash-lexer-for-last-here-doc.patch | 45 +++++++++++++++++++
 srcpkgs/vis/template                          |  2 +-
 2 files changed, 46 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/vis/patches/0001-lexers-fix-bug-in-bash-lexer-for-last-here-doc.patch

diff --git a/srcpkgs/vis/patches/0001-lexers-fix-bug-in-bash-lexer-for-last-here-doc.patch b/srcpkgs/vis/patches/0001-lexers-fix-bug-in-bash-lexer-for-last-here-doc.patch
new file mode 100644
index 000000000000..826809840a48
--- /dev/null
+++ b/srcpkgs/vis/patches/0001-lexers-fix-bug-in-bash-lexer-for-last-here-doc.patch
@@ -0,0 +1,45 @@
+From e57851806592f5ea4ee48303b97a5f59731370c5 Mon Sep 17 00:00:00 2001
+From: Silas <silas_git@nocafe.net>
+Date: Tue, 8 Dec 2020 17:37:43 -0300
+Subject: [PATCH] lexers: fix bug in bash lexer for last here-doc
+
+f4f0f5b allowed "<<-EOF" heredocs to be parsed correctly, but it
+introduced a bug that made the lexer fail when the beginning of a
+here-doc was the last string in a file (optionally followed only
+by blanks).
+
+In order to fix this, move everything regarding "delimiter" within
+the block that is executed only if "delimiter" is not nil.
+---
+ lua/lexers/bash.lua | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/lua/lexers/bash.lua b/lua/lexers/bash.lua
+index 4dc4cf6..7927b4a 100644
+--- a/lua/lexers/bash.lua
++++ b/lua/lexers/bash.lua
+@@ -20,15 +20,15 @@ local ex_str = l.delimited_range('`')
+ local heredoc = '<<' * P(function(input, index)
+   local s, e, minus, _, delimiter =
+     input:find('(-?)(["\']?)([%a_][%w_]*)%2[\n\r\f;]+', index)
+-  -- If the starting delimiter of a here-doc begins with "-", then
+-  -- spaces are allowed to come before the closing delimiter.
+-  local close_pattern
+-  if minus == '-' then
+-    close_pattern = '[\n\r\f%s]+'..delimiter..'\n'
+-  else
+-    close_pattern = '[\n\r\f]+'..delimiter..'\n'
+-  end
+   if s == index and delimiter then
++    -- If the starting delimiter of a here-doc begins with "-", then
++    -- spaces are allowed to come before the closing delimiter.
++    local close_pattern
++    if minus == '-' then
++      close_pattern = '[\n\r\f%s]+'..delimiter..'\n'
++    else
++      close_pattern = '[\n\r\f]+'..delimiter..'\n'
++    end
+     local _, e = input:find(close_pattern, e)
+     return e and e + 1 or #input + 1
+   end
+
diff --git a/srcpkgs/vis/template b/srcpkgs/vis/template
index e33ff9591487..02072dc6c515 100644
--- a/srcpkgs/vis/template
+++ b/srcpkgs/vis/template
@@ -1,7 +1,7 @@
 # Template file for 'vis'
 pkgname=vis
 version=0.7
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="pkg-config"
 makedepends="acl-devel libtermkey-devel lua53-devel ncurses-devel"

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: vis: backport upstream fix for bash lexer
  2022-10-05 14:20 [PR PATCH] vis: backport upstream fix for bash lexer dkwo
@ 2022-10-12 14:50 ` dkwo
  2022-10-12 15:19 ` [PR PATCH] [Merged]: " leahneukirchen
  1 sibling, 0 replies; 3+ messages in thread
From: dkwo @ 2022-10-12 14:50 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 166 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/39740#issuecomment-1276308911

Comment:
@diogoleal @leahneukirchen 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PR PATCH] [Merged]: vis: backport upstream fix for bash lexer
  2022-10-05 14:20 [PR PATCH] vis: backport upstream fix for bash lexer dkwo
  2022-10-12 14:50 ` dkwo
@ 2022-10-12 15:19 ` leahneukirchen
  1 sibling, 0 replies; 3+ messages in thread
From: leahneukirchen @ 2022-10-12 15:19 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 286 bytes --]

There's a merged pull request on the void-packages repository

vis: backport upstream fix for bash lexer
https://github.com/void-linux/void-packages/pull/39740

Description:
- I tested the changes in this PR: **YES**
- I built this PR locally for my native architecture, (x86_64-musl)

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-12 15:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-05 14:20 [PR PATCH] vis: backport upstream fix for bash lexer dkwo
2022-10-12 14:50 ` dkwo
2022-10-12 15:19 ` [PR PATCH] [Merged]: " leahneukirchen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).