syntax: add better error message for unexpected inner attrs

Closes #2243
driver: use libnative