-
-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add python support #121
Add python support #121
Conversation
6d0ed00
to
235b150
Compare
public function __construct(private array $keywords = [ | ||
'and', 'as', 'assert', 'async', 'await', 'break', 'class', 'continue', | ||
'def', 'del', 'elif', 'else', 'except', 'finally', 'for', 'from', 'global', | ||
'if', 'import', 'in', 'is', 'lambda', 'nonlocal', 'not', 'or', 'pass', | ||
'raise', 'return', 'try', 'while', 'with', 'yield', | ||
]) | ||
{ | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I chose to add the keywords as an array directly within the class constructor for simplicity. For me this offers more efficiency and clarity, especially considering that the list of keywords is unlikely to change frequently.
public function __construct(private array $builtinFunctions = [ | ||
'__import__', 'abs', 'aiter', 'all', 'any', 'anext', 'ascii', 'bin', 'bool', | ||
'breakpoint', 'bytearray', 'bytes', 'callable', 'chr', 'classmethod', 'compile', | ||
'complex', 'delattr', 'dict', 'dir', 'divmod', 'enumerate', 'eval', 'exec', | ||
'filter', 'float', 'format', 'frozenset', 'getattr', 'globals', 'hasattr', | ||
'hash', 'help', 'hex', 'id', 'input', 'int', 'isinstance', 'issubclass', 'iter', | ||
'len', 'list', 'locals', 'map', 'max', 'memoryview', 'min', 'next', 'object', | ||
'oct', 'open', 'ord', 'pow', 'print', 'property', 'range', 'repr', 'reversed', | ||
'round', 'set', 'setattr', 'slice', 'sorted', 'staticmethod', 'str', 'sum', | ||
'super', 'tuple', 'type', 'vars', 'zip', | ||
]) | ||
{ | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same goes for the built-in functions, adding all of this individually inside the PythonLanguage just gave me anxiety 😂
14bd226
to
9f53a1e
Compare
9f53a1e
to
116da0e
Compare
Pull Request Test Coverage Report for Build 9206970052Details
💛 - Coveralls |
Ok @brendt, I will flag this as ready for review. I think it covers well most of the basic stuff to be considered usable. I'll defiantly continue into more edge cases and additional patterns but for now I'll leave that for a later update. |
Cool!
I agree, this can be finetuned later :) Are you on discord, by any chance? We have a server for Tempest related stuff, it would be nice if I could ping you there — I don't expect you to put in any work you don't want to, but I lack Python knowledge, so it'd be nice to bounce ideas off of someone if we need to further work on this: https://discord.gg/pPhpTGUMPQ Also, shall I wait until #123 gets merged and you can update this PR accordingly? |
FYI #123 has been merged :) |
b8b2947
to
b9f1393
Compare
b9f1393
to
dbde1c2
Compare
@brendt Added NUMBER and BOOLEAN support. This can be merged now. I'll continue to improve on it when I find time but for now, it should cover enough to be usable. |
@brendt As the title suggests this PR adds Python language support :)
📋 TODO: