Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tarantool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
tarantool
Commits
2c71fd7f
Commit
2c71fd7f
authored
9 years ago
by
Konstantin Osipov
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'origin/gh-1133-multiline-lua-in-console' into 1.6
parents
92db0df7
b27871aa
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/lua/console.lua
+14
-1
14 additions, 1 deletion
src/lua/console.lua
with
14 additions
and
1 deletion
src/lua/console.lua
+
14
−
1
View file @
2c71fd7f
...
...
@@ -128,7 +128,20 @@ local function local_read(self)
return
nil
end
buf
=
buf
..
line
if
#
buf
>=
#
delim
and
buf
:
sub
(
#
buf
-
#
delim
+
1
)
==
delim
then
if
delim
==
""
then
-- stop once a complete Lua statement is entered
local
fn
,
err
=
loadstring
(
buf
)
if
fn
~=
nil
or
not
string.find
(
err
,
" near '<eof>'$"
)
then
-- valid Lua code or a syntax error not due to
-- an incomplete input
break
end
if
loadstring
(
'return '
..
buf
)
~=
nil
then
-- certain obscure inputs like '(42\n)' yield the
-- same error as incomplete statement
break
end
elseif
#
buf
>=
#
delim
and
buf
:
sub
(
#
buf
-
#
delim
+
1
)
==
delim
then
buf
=
buf
:
sub
(
0
,
#
buf
-
#
delim
)
break
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment