added checkLiteral() and implementation of constant()