module Rucc::Parser::Return

Private Instance Methods

read_return_stmt() click to toggle source
# File lib/rucc/parser/return.rb, line 6
def read_return_stmt
  retval = read_expr_opt
  expect!(';')
  if !retval.nil?
    return Node.ast_return(Node.ast_conv(@current_func_type.rettype, retval))
  end
  Node.ast_return(nil)
end