Sketch I loaded onto a Leonardo previously, won't compile now? help

I have a sketch I use to make a USB windows joystick. I've used it several times, even loaded it onto a board a few weeks ago. I wanted to make some changes to it and it won't compile. I get the following error. Any ideas? I have a big project I've been working for weeks on that is dependent on me getting this sketch onto another Leonardo:

Is it not loading the keypad.h library correctly?

here are the error messages:

Arduino: 1.8.11 (Windows 10), Board: "Arduino Leonardo"

UFC_Top_Axes:10:3: error: expected unqualified-id before '{' token

{0,1,2,3,4},

^

UFC_Top_Axes:10:14: error: expected unqualified-id before ',' token

{0,1,2,3,4},

^

UFC_Top_Axes:11:3: error: expected unqualified-id before '{' token

{5,6,7,8,9},

^

UFC_Top_Axes:11:14: error: expected unqualified-id before ',' token

{5,6,7,8,9},

^

UFC_Top_Axes:12:3: error: expected unqualified-id before '{' token

{10,11,12,13,14},

^

UFC_Top_Axes:12:19: error: expected unqualified-id before ',' token

{10,11,12,13,14},

^

UFC_Top_Axes:13:3: error: expected unqualified-id before '{' token

{15,16,17,18,19},

^

UFC_Top_Axes:13:19: error: expected unqualified-id before ',' token

{15,16,17,18,19},

^

UFC_Top_Axes:14:3: error: expected unqualified-id before '{' token

{20,21,22,23,24},

^

UFC_Top_Axes:14:19: error: expected unqualified-id before ',' token

{20,21,22,23,24},

^

UFC_Top_Axes:15:1: error: expected unqualified-id before '}' token

};

^

UFC_Top_Axes:15:1: error: expected declaration before '}' token

exit status 1
expected unqualified-id before '{' token

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Hey, you have made a common mistake in the code.

The struct rotariesdef should not be at that place. Remove the array and struct, and put this code -

struct rotariesdef{
//the array
}

You mistakenly put the struct rotariesdef below the array. Correct it.

And don't forget to paste the code in the code tags.

Arnav

(deleted)

(deleted)

spycatcher2k:
There are 3 major errors, firstly you have missing code after the #include<Keypad.h>, the comma after the last element of your array should not be there at all, and you are missing the closing } on your struct.

The trailing comma is not a major error, and will cause you no problem at all.
It's ugly, though.

(deleted)

I think it used to cause problems, but hasn't for a long time.
I guess it's helpful to ignore it if, for instance, you have a software-generated table definition.

const int table [] = {
#include "tabledef.csv"
};