diff options
| author | Silas <silas@nocafe.net> | 2019-03-11 11:15:23 -0300 |
|---|---|---|
| committer | Silas <silas@nocafe.net> | 2019-03-11 11:15:23 -0300 |
| commit | 0eb675b33fdc309b5124b4164b5333ef4a64a1d8 (patch) | |
| tree | fa05e30a77855707db6c12a2bf72cb2cd2ecb430 | |
| parent | f8c9f23619ffa407251426d706a996965e6d1cc9 (diff) | |
| download | vis-0eb675b33fdc309b5124b4164b5333ef4a64a1d8.tar.gz vis-0eb675b33fdc309b5124b4164b5333ef4a64a1d8.tar.xz | |
Heredoc delimiter should end with a newline
Or else the following:
<<EOF
....
EOFXYZ
parsers incorrectly.
| -rw-r--r-- | lua/lexers/bash.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lua/lexers/bash.lua b/lua/lexers/bash.lua index 2fa72f2..207cb22 100644 --- a/lua/lexers/bash.lua +++ b/lua/lexers/bash.lua @@ -21,7 +21,7 @@ local heredoc = '<<' * P(function(input, index) local s, e, _, delimiter = input:find('%-?(["\']?)([%a_][%w_]*)%1[\n\r\f;]+', index) if s == index and delimiter then - local _, e = input:find('[\n\r\f]+'..delimiter, e) + local _, e = input:find('[\n\r\f]+'..delimiter..'\n', e) return e and e + 1 or #input + 1 end end) |
