Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comment Error in parser.lua #222

Open
FoolBit opened this issue Dec 10, 2021 · 1 comment
Open

Comment Error in parser.lua #222

FoolBit opened this issue Dec 10, 2021 · 1 comment

Comments

@FoolBit
Copy link

FoolBit commented Dec 10, 2021

In parser.lua, line 443-444,, may be skip end instead of function?

-- Parses argument list and the statements.
local function parse_function(state, function_range)
   local paren_range = copy_range(state)
   check_and_skip_token(state, "(")
   local args = {}

   -- Are there arguments?
   if state.token ~= ")" then
      repeat
         if state.token == "name" then
            args[#args + 1] = parse_id(state)
         elseif state.token == "..." then
            args[#args + 1] = simple_expressions["..."](state)
            break
         else
            parse_error(state, "expected argument")
         end
      until not test_and_skip_token(state, ",")
   end

   check_and_skip_closing_token(state, paren_range, "(")
   local body = parse_block(state, function_range, "function")
   local end_range = copy_range(state)
   -- Skip "function".                       line 443
   skip_token(state)                      --line 444
   return new_inner_node(function_range, end_range, "Function", {args, body, end_range = end_range})
end
@tst2005
Copy link

tst2005 commented Dec 10, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants