Created
July 4, 2020 15:40
-
-
Save Allwin12/4a23c28b0d5d374cbff3d25f684f060f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import js2xml | |
jscode = """function factorial(n) { | |
if (n === 0) { | |
return 1; | |
} | |
return n * factorial(n - 1); | |
}""" | |
parsed = js2xml.parse(jscode) | |
print(parsed.xpath("//funcdecl/@name")) | |
# ['factorial'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment