Skip to content
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

Can it support AutoHotKey? #2682

Open
iesv opened this issue Oct 28, 2020 · 6 comments
Open

Can it support AutoHotKey? #2682

iesv opened this issue Oct 28, 2020 · 6 comments

Comments

@iesv
Copy link

iesv commented Oct 28, 2020

Can it support AutoHotKey?

@masatake
Copy link
Member

Yes if someone writes a parser for it.
If you are interested in writing a parser, I can help you.
If you are not, you can queue the request for writing a parser to #1566.
The queue is so long. Therefore it is a kind of /dev/null.

@masatake
Copy link
Member

If you are interested in writing a parser, reopen this.

@iesv
Copy link
Author

iesv commented Oct 29, 2020 via email

@pidgeon777
Copy link

I would also be interested in an AutoHotkey parser. It is a language widely used to manipulate each aspect of Windows OS.

@masatake
Copy link
Member

I would also be interested in an AutoHotkey parser. It is a language widely used to manipulate each aspect of Windows OS.

So what?

What people (including I myself) would like to hear from you is "I will (try to)? implement a parser for the language. Tell me how to do it?"

In #2678, @pidgeon777, you quoted the code, VhdlKinds. It implies you know C. In the issue, you helped me with the design of VHDL parser. It implies you know the most important concept of ctags, "kind". The description of issue was clear enough.
You cannot say "My level is too low."

You may have good knowledges of hardware. Therefore you may know the word "speculative execution".
I write hear how to write the parser.

diff --git a/main/parsers_p.h b/main/parsers_p.h
index b463c238..57968c38 100644
--- a/main/parsers_p.h
+++ b/main/parsers_p.h
@@ -49,6 +49,7 @@
    AsmParser, \
    AspParser, \
    AutoconfParser, \
+   AutoHotKeyParser, \
    AutoItParser, \
    AutomakeParser, \
    AwkParser, \
diff --git a/makefiles/optlib2c_input.mak b/makefiles/optlib2c_input.mak
index 49275272..62073be3 100644
--- a/makefiles/optlib2c_input.mak
+++ b/makefiles/optlib2c_input.mak
@@ -1,6 +1,7 @@
 # -*- makefile -*-
 OPTLIB2C_INPUT = \
    optlib/RSpec.ctags          \
+   optlib/autohotkey.ctags         \
    optlib/cmake.ctags          \
    optlib/ctags-optlib.ctags       \
    optlib/elixir.ctags         \
diff --git a/optlib/autohotkey.ctags b/optlib/autohotkey.ctags
new file mode 100644
index 00000000..e3309db6
--- /dev/null
+++ b/optlib/autohotkey.ctags
@@ -0,0 +1,50 @@
+#
+# autohotkey.ctags --- multiline regex parser for AutoHotKey
+#
+# This software is derrived from ahktags (https://github.com/Perlence/ahktags).
+#
+# Copyright 2015 Sviatoslav Abakumov
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+#     Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+#
+#     Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in
+#     the documentation and/or other materials provided with the
+#     distribution.
+#
+#     Neither the name of the copyright holder nor the names of its
+#     contributors may be used to endorse or promote products derived
+#     from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# The language references are available at
+# https://www.autohotkey.com/docs/Language.htm
+#
+--langdef=AutoHotKey
+--map-AutoHotKey=+.ahk
+
+--kinddef-AutoHotKey=v,variable,variables
+--kinddef-AutoHotKey=l,label,labels
+--kinddef-AutoHotKey=f,function,functions
+--kinddef-AutoHotKey=h,hklabel,hot key lables
+
+--mline-regex-AutoHotKey=/^[ \t]*([a-zA-Z0-9_]+)[ \t\n\r\f\v]*:?=[ \t\n\r\f\v]*(;?.*)?$/\1/v/
+--mline-regex-AutoHotKey=/^[ \t]*([a-zA-Z0-9_]+):[ \t\n\r\f\v]*(;.*)?$/\1/l/
+--mline-regex-AutoHotKey=/^[ \t]*([^ \t\n\r\f\v:]+)::[ \t]*$/\1/h/
+--mline-regex-AutoHotKey=/^[ \t]*([a-zA-Z0-9_]+)\(.*\)[ \t\n\r\f\v]*\{[ \t\n\r\f\v]*(;?.*)$/\1/f/

If you want to capture "class", this code is not enough. But you can start from this code. If you are interested in finishing this work, let me know. I will tell more about tihs parser.

During I'm working on VHDL, you can work on AutoHotKey. How do you call this? pipeline? hyper threading?

@pidgeon777
Copy link

So what?
What people (including I myself) would like to hear from you is "I will (try to)? implement a parser for the language. Tell me how to do it?"

Well, sometimes when a user suggests a new feature to be implemented for improving a project, and this is the case of @iesvme , it is important to know if this kind of feature might be of general interest. By doing so, the developer of the project or those willing to contribute with their pulls may decide to prioritize one task or the other. This usually happens with medium to big-sized projects.

Thus, I just expressed my interest in this kind of parser, no more. This happens on almost every Github project, for what I've seen.

However, given that you cited me and the HDL case, I'll reaffirm my will to actively help with the HDL parser development through:

  • ideas
  • implementation suggestions
  • testing
  • bug reporting

This is what my current knowledge allows me to do. Better than nothing, hopefully.

However I'm also willing to give a try to this AHK parser one day, but unfortunately it won't happen anytime soon, thus hopefully someone will help with this, in the meanwhile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants