Implement the parser's expect() function

Also start implementing parser tests.
Didn't the lecture mention that the parser shouldn't try to construct an AST for a program after panic mode has first been initiated? If we're to implement this behavior (I'm not sure yet whether we gain anything by it), that bit of state needs to be put somewhere. (But not the return value, so feel free to ignore this)