-
Notifications
You must be signed in to change notification settings - Fork 620
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
readtags: unescape input field (a.k.a {tagfile}) only if TAG_OUTPUT_MODE is u-ctags and TAG_OUTPUT_FILESEP is slash #3599
readtags: unescape input field (a.k.a {tagfile}) only if TAG_OUTPUT_MODE is u-ctags and TAG_OUTPUT_FILESEP is slash #3599
Conversation
Codecov ReportBase: 82.88% // Head: 82.87% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #3599 +/- ##
==========================================
- Coverage 82.88% 82.87% -0.01%
==========================================
Files 223 223
Lines 54028 54415 +387
==========================================
+ Hits 44779 45096 +317
- Misses 9249 9319 +70
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
The man pages we have to update: diff --git a/man/ctags-client-tools.7.rst.in b/man/ctags-client-tools.7.rst.in
index 0c086fa89..f0a75f807 100644
--- a/man/ctags-client-tools.7.rst.in
+++ b/man/ctags-client-tools.7.rst.in
@@ -297,6 +297,8 @@ for using notable ones.
find "input.c" from the file system. In that case,
``TAG_PROC_CWD`` gives the tool a hint; "input.c" may be at "/tmp".
+ <TODO:input>
+
``TAG_PROGRAM_NAME``
Indicates the name of program generating this tags file.
diff --git a/man/readtags.1.rst.in b/man/readtags.1.rst.in
index 5ea49350f..8a8cd87db 100644
--- a/man/readtags.1.rst.in
+++ b/man/readtags.1.rst.in
@@ -91,6 +91,7 @@ than the pattern field. By default, readtags translates them to make it
human-readable, but when utilizing readtags output in a script or a client
tool, ``-E`` option should be used. See ctags-client-tools(7) for more
discussion on this.
+<TODO:input>
Filtering, Sorting, and Formatting
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/man/tags.5.rst.in b/man/tags.5.rst.in
index 999f87469..b899d3e7c 100644
--- a/man/tags.5.rst.in
+++ b/man/tags.5.rst.in
@@ -294,7 +294,7 @@ A tagfield has a name, a colon, and a value: "name:value".
not handled in the above "value" rules.
EXCEPTION: Universal Ctags allows all these escape sequences in {tagname}
- also.
+ also. <TODO:input>
- The leading space (0x20) and ``!`` (0x21) in {tagname} are converted
to ``\x`` prefixed hexadecimal number (``\x20`` and ``\x21``) if the
@@ -448,6 +448,7 @@ command can be used::
(replace ^I with a real <Tab>).
+<TODO:input>
TAG FILE INFORMATION:
@@ -522,6 +523,8 @@ Exceptions
.. NOT REVIEWED YET (above item)
+<TODO:input>
+
.. _compat-output:
Compatible output and weakness |
5947466
to
ae28268
Compare
|
35fa3fa
to
3bd06ed
Compare
above two lines both are needed |
@leleliu008 I tried various things at #3608. However, the testing on MacOS is still failed. |
OK, I will |
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
…tory Signed-off-by: Masatake YAMATO <yamato@redhat.com>
4eee45ec6 Merge pull request universal-ctags#48 from masatake/unescaping-input-field-only-when-slash 15b9503ba Read the input field with unescaping if TAG_OUTPUT_MODE is "u-ctags" and TAG_OUTPUT_FILESEP is "slash" 93e0c73d4 Merge pull request universal-ctags#47 from masatake/unescaping-input-field 687f3d9ad Read the input field with unescaping if TAG_OUTPUT_MODE is "u-ctags" 3517d2e68 Use smaller data types for some members in tagFile 93bdb3226 Add a helper function for unescaping 3fb676fde Make macros for comparing field values reusable git-subtree-dir: libreadtags git-subtree-split: 4eee45ec6f4fedb506a9a14b33e97904ec1f09d8
e49b63f
to
18c218b
Compare
I could not reproduce this on Mingw/Msys running on my local PC. |
@@ -515,6 +521,14 @@ Exceptions | |||
exceptions. See {tagname} of Proposal section for more detail about the | |||
conversion. | |||
|
|||
#. {tagfile} in tags file generated by Universal Ctags may contain |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This item is newly added as suggested by @AmaiKinono.
02f1416
to
ec5ee24
Compare
docs/man/readtags.1.rst
Outdated
@@ -92,6 +92,13 @@ human-readable, but when utilizing readtags output in a script or a client | |||
tool, ``-E`` option should be used. See :ref:`ctags-client-tools(7) <ctags-client-tools(7)>` for more | |||
discussion on this. | |||
|
|||
About printing input fields ({tagfile} in :ref:`tags(5) <tags(5)>`) with ``-E`` option: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the updated description.
man/readtags.1.rst.in
Outdated
when ``TAG_OUTPUT_MODE`` pseudo tag has "u-ctags" and | ||
``TAG_OUTPUT_FILESEP`` has "slash" as values for their input fields. | ||
If this condition is not satisfied, readtags prints the fields with | ||
unescaping. About the pseudo tags, see ctags-client-tools(7). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I understand most of the things now, but this is still a bit confusing: If the condition is not satisfied, then according to tags(5), the input field won't contain any escape sequences, right? then we shouldn't need to "print with unescaping" as there are no escape sequences to unescape.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are correct. I will revise this.
Surprisingly, readtags built with this pull request doesn't behave as I wrote here.
I must update this pull request carefully.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, You are correct. After drawing the figure, I understand readtags print the input fields as-is when -E option is given. It doesn't depend on the pseudo tags.
However, the behavior of libreadtags depends on the pseudo tags.
5e5f9f3
to
91d65e4
Compare
@AmaiKinono updated again. 91d65e4 is taken from your review comment. So we are ready to merge this pull request. |
…ODE is u-ctags and TAG_OUTPUT_FILESEP is slash Close universal-ctags#3577. Close universal-ctags#3559 except documentation. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
…rmat Signed-off-by: Masatake YAMATO <yamato@redhat.com>
…o tags Signed-off-by: Masatake YAMATO <yamato@redhat.com>
…ctly Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
/ in pattern fields was converted to \/ in json format. This conversion comes from the format of tags(5). In the tags format, / in pattern fields is used as a separater of the field like: /int main(/ So a / in the middle of the field must be converted to \/. However, in the json format doesn't use such a separater. The conversion is not needed. NOTE: in a regular tag, the conversion is still needed even in the json format because / and ? are used as not only separaters but also indicators of searching direction like: /int main(/ ?int main(? Signed-off-by: Masatake YAMATO <yamato@redhat.com>
…put fields of psuedo tags Signed-off-by: Masatake YAMATO <yamato@redhat.com>
…ular tags Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
91d65e4
to
61bb712
Compare
… to input fields Co-authored-by: AmaiKinono <amaikinono@gmail.com> Signed-off-by: Masatake YAMATO <yamato@redhat.com>
61bb712
to
f72f908
Compare
Close #3577.
Close #3559
except documentation.