camieac / atom-doxit

An Atom package for Doxygen commenting.
http://camieac.github.io/atom-doxit/
MIT License
0 stars 1 forks source link

Parsing of function signatures to insert function parameters #1

Open camieac opened 8 years ago

camieac commented 8 years ago

I have stumbled across PEG.js, a very nice looking parser in Javascript. It provides an example grammar for Javascript parsing, so we will probably start with support for Javascript files.

I idea is to gradually add support for more languages. The initial implementation should take this into account, so that we don't need to re-design the thing when adding additional language parsing support.

This issue covers the initial implementation of a Javascript Parser, fully integrated into the package. When a function comment is inserted, the parameters of the function signature below the cursor is parsed, and the parameters are inserted as part of the comment.

camieac commented 4 years ago

peg (not pegjs) C parser: https://github.com/pointlander/peg/blob/master/grammars/c/c.peg

camieac commented 4 years ago

Javascript grammar for pegjs: https://github.com/pegjs/pegjs/blob/master/examples/javascript.pegjs