I am trying to create a dog class on corona and it shows me an error
dog.lua
-- dog.lua -- -- Example "dog" class for Corona SDK tutorial. -- ------------------------------------------------- local dog = {} local dog\_mt = { \_\_index = dog } -- metatable ------------------------------------------------- -- PRIVATE FUNCTIONS ------------------------------------------------- local function getDogYears( realYears ) -- local; only visible in this module return realYears \* 7 end ------------------------------------------------- -- PUBLIC FUNCTIONS ------------------------------------------------- function dog.new( name, ageInYears ) -- constructor local newDog = { name = name or "Unnamed", age = ageInYears or 2 } return setmetatable( newDog, dog\_mt ) end ------------------------------------------------- function dog:rollOver() print(self.name.."rollOver") end ------------------------------------------------- function dog:sit() print( self.name .. " sits down in place." ) end ------------------------------------------------- function dog:bark() print( self.name .. " says \"woof!\"" ) end ------------------------------------------------- function dog:printAge() print( self.name .. " is " .. getDogYears( self.age ) .. " in dog years." ) end ------------------------------------------------- return dog
main.lua
local dog = require( "dog" ) local dog1 = dog.new( "Yai-Ya", 4 ) dog1.rollOver()
it says there is a problem on dog.lua line 36 what is the problem?