Parse JavaScript one character at a time to look for snippets in Templates