Use a set instead of a vector because elements are unique (but mostly because it has slightly less-verbose API's)
Use this to make isReservedIdentifier equal to just implicitly converting the result of counting the occurences of a word in reservedIdentifiers to bool
.contains() would be more idiomatic, and then the function could be dropped entirely and checks done in the code like if (reservedIdentifiers.contains(str)) because that's basically as clear as calling if(isReservedIdentifier(str)) IMO
Close #11
set
instead of avector
because elements are unique (but mostly because it has slightly less-verbose API's)isReservedIdentifier
equal to just implicitly converting the result of counting the occurences of a word inreservedIdentifiers
tobool
.contains()
would be more idiomatic, and then the function could be dropped entirely and checks done in the code likeif (reservedIdentifiers.contains(str))
because that's basically as clear as callingif(isReservedIdentifier(str))
IMO=)