vis

a vi-like editor based on Plan 9's structural regular expressions

git clone https://9o.is/git/vis.git

commit 7eb7cacfe7e3915ee29f38e31b8653c73270997d
parent 1e384ccd813d469b9552f8dde2a8a1923b283d0f
Author: pystub <pystub@gmail.com>
Date:   Wed, 24 Jan 2018 23:26:48 +0200

PHP lexer: stop line comments right before ?>

This allows to end PHP code sections. Otherwise token is treated as part of the comment and parser continues to parse whatever is after.
Diffstat:
Mlua/lexers/php.lua | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lua/lexers/php.lua b/lua/lexers/php.lua @@ -11,7 +11,7 @@ local M = {_NAME = 'php'} local ws = token(l.WHITESPACE, l.space^1) -- Comments. -local line_comment = (P('//') + '#') * l.nonnewline^0 +local line_comment = (P('//') + '#') * (l.nonnewline - '?>')^0 local block_comment = '/*' * (l.any - '*/')^0 * P('*/')^-1 local comment = token(l.COMMENT, block_comment + line_comment)