In a language I worked on ( github.com/skiplang/skip ), at the moment where we throw a syntax error, we can look at the previous few tokens and generate much better error message.
In the case of the above, if last is ], previous is number and before is 0, then put a nice error message where octal notation is not allowed.
This is not “pure” from a language theory sense but in practice if you add a handful of common ones, it makes for a much better experience.