-
Notifications
You must be signed in to change notification settings - Fork 646
Basic: extract namespaces (partially derived from #3276) #3284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basic: extract namespaces (partially derived from #3276) #3284
Conversation
Signed-off-by: Masatake YAMATO <[email protected]>
Signed-off-by: Masatake YAMATO <[email protected]>
Signed-off-by: Masatake YAMATO <[email protected]>
Signed-off-by: Masatake YAMATO <[email protected]>
This change is based on the pull request universal-ctags#3276 submitted by Glog78.
This change is based on the pull request universal-ctags#3276 submitted by @Glog78.
Signed-off-by: Masatake YAMATO <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #3284 +/- ##
==========================================
+ Coverage 85.21% 85.47% +0.25%
==========================================
Files 210 210
Lines 49689 50669 +980
==========================================
+ Hits 42343 43308 +965
- Misses 7346 7361 +15
Continue to review full report at Codecov.
|
Signed-off-by: Masatake YAMATO <[email protected]>
Signed-off-by: Masatake YAMATO <[email protected]>
Signed-off-by: Masatake YAMATO <[email protected]>
Signed-off-by: Masatake YAMATO <[email protected]>
Signed-off-by: Masatake YAMATO <[email protected]>
03416c4 to
8001720
Compare
|
@masatake i have put you a little input.bas for testing https://termbin.com/x9wo also declare sub or declare functions is a forward declaration so it's very hard to handle. But i would rather prefer the same identifier twice than never. |
Thank you. I needed such an input file for testing. For https://termbin.com/x9wo, there are two ways to extract declarations: (1) using reference tags C paresr uses (2). However, it will be better to convert it to (1). About the Basic parser, we don't have to think about compatibility. So we can choose (1). How about following tags output for https://termbin.com/x9wo: ? |
|
can we strip down the description tags ... so leading spaces/tabs are removed / multiple spaces , tabs are shortened down to 1 space? Does this even make sense ? Also i will check if i can make an example for qbasic |
What is your concern?
Thank you! |
|
Hier is the promised small example ... the syntax between freebasic and qbasic (qb64) differs quiet alot in a way ' https://wiki.qb64.org/wiki/Variable_Types << this is important Also the cleaning of the description could make sure that editors who use this field for additional informations when autocomplete don't print all this "wasted data". But i would agree that most likely every editor will reduce it anyway. |
|
It is not wasted data. To use the tags file for the "jumping to definition" feature, the area that you called "description", is referred to by editors as search patterns. Can I merge this pull request? Did you write https://termbin.com/x9wo ? |
|
you can merge this one. Awesome work and thanks alot. |
Are you really talking about https://termbin.com/x9wo? ' Taken from https://termbin.com/x9woIf you took this example somewhere, I would like to know it URL, and I would like to update the comment. |
|
BTW, you can use |
|
I assumed https://termbin.com/x9wo is an example of freebasic code. Am I wrong? << oh yes ... this is freebasic code i wrote to play around (testing c library use from freebasic) qb64 examples -> https://termbin.com/uxl7 |
I see. Thank you. I would like to merge up to the code for namespace. |
fd45032 to
8001720
Compare
In this example, "initscr" is a name of function written in C. Am I correct? |
|
I found more examples in https://github.com/freebasic/fbc/tree/master/examples . #inclib "gtk-3"
...
declare sub gtk_init(byval argc as long ptr, byval argv as zstring ptr ptr ptr)
...
declare function gtk_check_version_ alias "gtk_check_version"(byval required_major as guint, byval required_minor as guint, byval required_micro as guint) as const gchar ptr
In this line, expected tags are:
As far as I can remember correctly, cython has similar concepts. So kinds, roles, and fields design can be shared between the two parsers. |
|
You assumed right about the Init and and also gtk_check_version . example: declare sub dosomething sub dosomething A part of the documentation can be found here -> https://documentation.help/FreeBASIC/KeyPgDeclare.html |
This should be If "Lib" is specified in a "Declare" line, we can put the name of the library to |
YES! I'm thinking about it. I recognized we cannot distinguish the two. Maybe this is the reason why we are taking a lot of time for design. The final version of my design looks good to me. The next step is implementation. |
One is a reference tag and another is a definition tag. |
|
After thinking more, reserving a slot for storing Lib in |
|
It seems that I misunderstand the meaning of "alias". It seems that this is a valid code. Declaration with an alias may define a new name or declare something. There is no good way to distinguish the two. |
|
I must change the policy. Let's do the same as C parser: introducing "declaration" kind and extracting declarations as definition tags. |
This pull request is inspired by and derived from #3276 submitted by @Glog78 partially.
This pull request doesn't deal with declarations.
The pull request for dealing declarations comes after merging this pull request.