Hi
I am trying the following code, which should return a list of html tags.
My thinking is to:
check for '</' to find an end tag, which I ignore since there should also be a start tag, just recurse upon the rest following the '>'
check for '<' to find a start tag, which I add to the list, then
recurse upon the rest following the '>'
and (currently) ignore everything else.
When run the code just prints and empty list, rather than [html].
#returns lists of tags
test_html(input) =>
('</':etag:'>':rest) : test_html(rest)
('<':tag:'>':rest) : [tag] + test_html(rest)
* : []
main ->
print(test_html(content))
where content: '<html>123</html>'
Even using '<html>' or '</html>' as content yields the same result: []
Any ideas? It would appear to execute the wildcard case, rather than matching the previous rule.
But I would expect the patterns to be check in the order (top to bottom) they appear in the code.
Thanks for any help!
Steve