Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
You cannot "import typing" in Python 3.10 when testing.
Error below:
Traceback (most recent call last):
File "/workspace/default/tests.py", line 2, in
File "/workspace/default/solution.py", line 2, in
File "/workspace/default/preloaded.py", line 11, in
File "", line 1027, in _find_and_load
File "", line 1002, in _find_and_load_unlocked
File "", line 945, in _find_spec
File "/workspace/default/.venv/lib/python3.10/site-packages/_distutils_hack/init.py", line 88, in find_spec
TypeError: str.format() argument after ** must be a mapping, not int
As far as I can tell, programs with an infinite number of variables can exist:
var
) is unlimited (based on the grammar).var
instruction is unlimited (based on the grammar).VarName
length is unlimited, based on the grammar).I'd say, you should support an unlimited number because of this.
Theoretically, it should even be possible to compile and run such program, because:
Is there a limited, unlimited, or undefined number of vars allowed to be defined?
Description:
and then two blocks of examples returning ASTs.
Return an AST.
This comment is hidden because it contains spoiler information about the solution
Looks like I submitted this accidentally without refactoring (hence allot of debug code). I'll fork it soon. (Edit: forked.)
There's no whitespace in register or label names.
The tests don't seem to call msg twice - my code inserts newlines when it sees repeat calls.
This comment is hidden because it contains spoiler information about the solution
That violates the rule, hence not allowed.
The first line provided is: f=_=>
Does this violate the only-one-char-per-line rule or is it an exception?
On the Python version, I am very confused about what the return type of parseRegExpr should be. Are we returning ASTs? Are we matching a regex? Are we transpiling from one regex flavor to another as noted by the testcase of shouldBe("a|b", "(a|b)")? The kata details is missing a section about the statement returned, and only mentions that invalid regexes return "".
I'm looking at the basic tests and I think it converts the returned value into a string, then compares it to the second "shouldBe" argument. Should there be a __str__ implementation in the AST nodes that converts an Any() as a "." for example?
My current implementation is returning the AST.
Did anyone get it?
This just made my day. Might try something like this sometime!
This is generally known as a recursive descent parser and I'd say it's a good way to do things
Thanks, it's accually the only solution I can figure out when before checked the solusions. LOL
Loading more items...