def boolean(p): boolean = p[0] if boolean.gettokentype() == "true": return ast.Boolean(True) elif boolean.gettokentype() == "false": return ast.Boolean(False) else: assert False, "Something went wrong"
def parse_bool(self): return ast.Boolean(self.cur_tok, self.cur_tok.type == token.TRUE)
def parseBoolean(self): b = ast.Boolean() b.Token = self.curToken b.Value = self.curTokenIs(token.TRUE) return b
def p_boolean_literal(self, p): """boolean_literal : TRUE | FALSE """ p[0] = ast.Boolean(p[1])
def p_boolean(self, p): """ boolean : TRUE | FALSE """ p[0] = ast.Boolean(p[1])
def p_expression_boolean_constant(self, parse): ''' expression : BOOLEAN ''' parse[0] = AST.Boolean(content=parse[1])
def expression_boolean(s): val = True if s[0].getstr() == "True" else False return ast.Boolean(val)
def parseBoolean(self): return ast.Boolean(self.currToken, self.curTokenIs(tkn.TRUE))
def not_boolean(p): return ast.Boolean(not p[1].value)
def val_boolean(s): return ast.Boolean(s[0].getstr())
def _parse_boolean(self) -> Optional[ast.Boolean]: if self._current_token is None: return None return ast.Boolean(self._current_token, self._current_token_is(TokenType.TRUE))
def parseBoolean(self): return ast.Boolean(Token = self.curToken, Value= self.curTokenIs(tokens.TRUE))