engine-deprecated
engine-deprecated copied to clipboard
Include link to UAST Parse Examples & XPath Reference
I would be pretty happy if a UAST Parse Examples URL could be included on the cli output when running srcd parse --help. It would look something like:
Classify languages, parse files, and manage parsers
Usage:
srcd parse [command]
Examples:
https://docs.sourced.tech/engine/#babelfish-uast (examples)
Available Commands:
drivers Manage language drivers.
lang Identify the language of the given files.
uast Parse and return the filtered UAST of the given file(s)
Flags:
-h, --help help for parse
Global Flags:
--config string config file (default is $HOME/.srcd.yaml)
-v, --verbose if true, log all of the things
Use "srcd parse [command] --help" for more information about a command.
Moreover, I think it would be great to have some feedforward on XPath Syntax errors, like:
could not stream: rpc error: code = Unknown desc = could not apply query //uast:Identifier/Name: UastFilter() failed: Undefined namespace prefix
XPath Syntax Reference https://doc.bblf.sh/using-babelfish/uast-querying.html
I know we might be moving to css selectors, but let's cherish what we have now.