PLC-lang / rusty

Structured Text Parser and LLVM Frontend
GNU Lesser General Public License v3.0
183 stars 48 forks source link

With error numbers being strings it is easy to mistype #1126

Open ghaith opened 2 months ago

ghaith commented 2 months ago

Now that we converted error numbers to strings, it might be too easy to use invalid numbers. It is also not that easy to find if an existing number already fits your usecase. We should discuss strategies to make this less error-prone. One possiblity is to have the errors as constant strings and hope the user will use them instead of giving out strange strings. We should also validate if the user defines invalid strings in the json (another story). Or if the programmer uses an invalid error.