Parse JavaScript-like expressions for use in templates