Skip to content

Commit

Permalink
Issue yuin#150: clear PNewLine flag
Browse files Browse the repository at this point in the history
  • Loading branch information
yuin committed Dec 18, 2017
1 parent b641d31 commit 3d9c819
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions _glua-tests/issues.lua
Original file line number Diff line number Diff line change
Expand Up @@ -165,3 +165,12 @@ assert(s:match("([^-]+)-world") == "hello")
local t = {}
local ok, msg = pcall(function() t.notfound() end)
assert(not ok and string.find(msg, "attempt to call a non-function object", 1, true))

-- issue 150
local util = {
fn = function() end
}
local b
local x = util.fn(
1,
(b or {}).x)
2 changes: 2 additions & 0 deletions parse/lexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,8 @@ redo:

if ch == '(' && lexer.PrevTokenType == ')' {
lexer.PNewLine = newline
} else {
lexer.PNewLine = false
}

var _buf bytes.Buffer
Expand Down

0 comments on commit 3d9c819

Please sign in to comment.