refactor: Simplify token type checking in parser
Created by: ecoulson
Summary
The checks in the parser to determine if a token was of a certain type used non-idiomatic Rust code. The checks and other similar statements were rewritten, taking advantage of the std lib and Rust's built-in features.