Support extracting syntax from filename

Closes #1.