The linked code is actually just for the variables in psql (the commandline tool). For the code parsing input to the SQL-level bool datatype, it's
https://github.com/postgres/postgres/blob/master/src/backend...
which uses
https://github.com/postgres/postgres/blob/master/src/backend...