1
1
mirror of https://github.com/kanaka/mal.git synced 2024-11-10 02:45:44 +03:00

vimscript: Fix exception on literal empty list

Issue #190
This commit is contained in:
Dov Murik 2016-03-27 22:12:19 -04:00
parent 181a55ad00
commit 8f27005f97
8 changed files with 24 additions and 0 deletions

View File

@ -43,6 +43,9 @@ function EVAL(ast, env)
if !ListQ(a:ast)
return EvalAst(a:ast, a:env)
end
if EmptyQ(a:ast)
return a:ast
endif
let first_symbol = ObjValue(ObjValue(a:ast)[0])
if first_symbol == "def!"

View File

@ -44,6 +44,9 @@ function EVAL(ast, env)
if !ListQ(a:ast)
return EvalAst(a:ast, a:env)
end
if EmptyQ(a:ast)
return a:ast
endif
let first = ListFirst(a:ast)
let first_symbol = SymbolQ(first) ? ObjValue(first) : ""

View File

@ -48,6 +48,9 @@ function EVAL(ast, env)
if !ListQ(ast)
return EvalAst(ast, env)
end
if EmptyQ(ast)
return ast
endif
let first = ListFirst(ast)
let first_symbol = SymbolQ(first) ? ObjValue(first) : ""

View File

@ -48,6 +48,9 @@ function EVAL(ast, env)
if !ListQ(ast)
return EvalAst(ast, env)
end
if EmptyQ(ast)
return ast
endif
let first = ListFirst(ast)
let first_symbol = SymbolQ(first) ? ObjValue(first) : ""

View File

@ -66,6 +66,9 @@ function EVAL(ast, env)
if !ListQ(ast)
return EvalAst(ast, env)
end
if EmptyQ(ast)
return ast
endif
let first = ListFirst(ast)
let first_symbol = SymbolQ(first) ? ObjValue(first) : ""

View File

@ -96,6 +96,9 @@ function EVAL(ast, env)
if !ListQ(ast)
return EvalAst(ast, env)
end
if EmptyQ(ast)
return ast
endif
let first = ListFirst(ast)
let first_symbol = SymbolQ(first) ? ObjValue(first) : ""

View File

@ -110,6 +110,9 @@ function EVAL(ast, env)
if !ListQ(ast)
return EvalAst(ast, env)
end
if EmptyQ(ast)
return ast
endif
let first = ListFirst(ast)
let first_symbol = SymbolQ(first) ? ObjValue(first) : ""

View File

@ -110,6 +110,9 @@ function EVAL(ast, env)
if !ListQ(ast)
return EvalAst(ast, env)
end
if EmptyQ(ast)
return ast
endif
let first = ListFirst(ast)
let first_symbol = SymbolQ(first) ? ObjValue(first) : ""