import can have free whitespace around imported names

This commit is contained in:
leaf corcoran 2013-06-06 17:29:12 -07:00
parent 6867817df4
commit 71dad43c03
3 changed files with 43 additions and 2 deletions

View File

@ -409,9 +409,9 @@ local build_grammar = wrap_env(function()
Local = key"local" * ((op"*" + op"^") / mark"declare_glob" + Ct(NameList) / mark"declare_with_shadows"), Local = key"local" * ((op"*" + op"^") / mark"declare_glob" + Ct(NameList) / mark"declare_with_shadows"),
Import = key"import" * Ct(ImportNameList) * key"from" * Exp / mark"import", Import = key"import" * Ct(ImportNameList) * SpaceBreak^0 * key"from" * Exp / mark"import",
ImportName = (sym"\\" * Ct(Cc"colon_stub" * Name) + Name), ImportName = (sym"\\" * Ct(Cc"colon_stub" * Name) + Name),
ImportNameList = ImportName * (sym"," * ImportName)^0, ImportNameList = SpaceBreak^0 * ImportName * ((SpaceBreak^1 + sym"," * SpaceBreak^0) * ImportName)^0,
NameList = Name * (sym"," * Name)^0, NameList = Name * (sym"," * Name)^0,

View File

@ -20,3 +20,29 @@ import something from a table
if indent if indent
import okay, \well from tables[100] import okay, \well from tables[100]
do
import a, b, c from z
do
import a,
b, c from z
do
import a
b
c from z
do
import
a
b
c from z
do
import
a
b
c
from z

View File

@ -43,3 +43,18 @@ if indent then
end)() end)()
end end
end end
do
a, b, c = z.a, z.b, z.c
end
do
a, b, c = z.a, z.b, z.c
end
do
a, b, c = z.a, z.b, z.c
end
do
a, b, c = z.a, z.b, z.c
end
do
a, b, c = z.a, z.b, z.c
end