From c3b8293c1ce682f34abfb8d88687922288f016ed Mon Sep 17 00:00:00 2001 From: mpeterv Date: Sun, 17 Apr 2016 12:45:31 +0300 Subject: Fix line filtering for simple single line expressions --- tests/linescanner.lua | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/linescanner.lua b/tests/linescanner.lua index 3c62f8c..6287850 100644 --- a/tests/linescanner.lua +++ b/tests/linescanner.lua @@ -244,11 +244,11 @@ local function f() end + local x - local x, y - local x = - -1 + +1 ? local x, y = - 2, 3 + local x, y = 2, + -3 + +3 ? ]] test [[ @@ -274,6 +274,39 @@ local t = { + } ? ]=] +-- Single expressions in tables and calls. +test [=[ +local x = { + + 1, ? + 2 ? +} ? +local y = { + + 3, ? + id ? +} ? +local z = { + + "" ? +} ? +local a = f( + + true ? +) ? +local b = { + + id[1] ? +} ? +local c = { + + id.abcd ? +} ? +local d = { + + id.k1.k2 + +} ? +local e = { + + {} ? +} ? +local f = { + + {foo} + +} ? +]=] + -- Hanging table endings. test [[ local v = f({ + -- cgit v1.2.1