mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Use "using" instead of "gtk" and "import"
- Having one keyword for both is less syntax to remember - I might use "include" as a keyword in the future, which would make "import" confusing, so use "using" instead
This commit is contained in:
parent
78a9481631
commit
b3c28ce3d4
5 changed files with 27 additions and 13 deletions
|
@ -408,6 +408,21 @@ class UseNumber(ParseNode):
|
|||
return True
|
||||
|
||||
|
||||
class UseNumberText(ParseNode):
|
||||
""" ParseNode that matches a number, but sets its *original text* it in a
|
||||
key=value pair on the containing match group. """
|
||||
def __init__(self, key):
|
||||
self.key = key
|
||||
|
||||
def _parse(self, ctx: ParseContext):
|
||||
token = ctx.next_token()
|
||||
if token.type != TokenType.NUMBER:
|
||||
return False
|
||||
|
||||
ctx.set_group_val(self.key, str(token), token)
|
||||
return True
|
||||
|
||||
|
||||
class UseQuoted(ParseNode):
|
||||
""" ParseNode that matches a quoted string and sets it in a key=value pair
|
||||
on the containing match group. """
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue