Share your repls and programming experiences

← Back to all posts
really dumb way of parsing a function
personmandude

This is a thing i made that can parse the contents of a file to find any functions within it. I could take it a step further and make it run code that detects exactly what the function does, but im too lazy, so I just made this for now. Pretty much, it can detect any function and then output the function name and then run it. I know that i could do this with a decorator but im dumb so idc. anyways yeah if you want to you can fork it and add more functions to test it out but yeah its kinda useless

oh and did i forget to mention that the way it works is it finds any line of code that starts with 'd' so if there is an indent on a function or if there is an unindented del() thing or something else, it will break this

Edit: so i fixed the indents and it also can handle errors that are raised from functions that need arguments

Voters
OlauPla
NFadhlurrahman
CodingElf66
personmandude
Comments
hotnewtop
CodeStudent1337

Nice! Though it most probably won't be used in real programs...

MrVoo

Not bad, but maybe detect if it starts with "def " instead of "d"

CodingElf66

I like it, it's good!