Validate parent object for accessibility and layout

This commit is contained in:
James Westman 2021-11-12 17:10:30 -06:00
parent 2224f0958c
commit e759569c3f
No known key found for this signature in database
GPG key ID: CE2DBA0ADB654EA6
8 changed files with 40 additions and 4 deletions

View file

@ -514,12 +514,16 @@ class UseLiteral(ParseNode):
class Keyword(ParseNode):
""" Matches the given identifier. """
def __init__(self, kw):
def __init__(self, kw, set_token=False):
self.kw = kw
self.set_token = True
def _parse(self, ctx: ParseContext):
token = ctx.next_token()
if token.type != TokenType.IDENT:
return False
if self.set_token:
ctx.set_group_val(self.kw, True, token)
return str(token) == self.kw