mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Validate parent object for accessibility and layout
This commit is contained in:
parent
2224f0958c
commit
e759569c3f
8 changed files with 40 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue