Skip to content

Commit 94e964e

Browse files
authored
Elm: Rewritten using PackCC PEG parser (#3312)
* Elm: Rewritten using PackCC PEG parser. * Tmain: Update tests for new Elm parser * refactor: Remove Elm source generated by build system * Elm: Fix parser error causing assertion failure. Error reported is ``` ctags: main/numarray.c:178: intArrayRemoveLast: Assertion `current->count > 0' failed. ``` caused by unbalanced SET_SCOPE/POP_KIND. Thanks to Masaktake Yamato for [finding the cause](#3312 (review)). * Elm,cosmetic: Add links in comments language reference. * Style: Update generated win32 VS2013 files Following an earlier comment, committed files generated by `make -BC win32`. Earlier comment is: #3312 (comment) * Elm,refactor: Use helper function for brevity. * Elm: signature field becomes typeref:description field. * Elm: Typerefs for constructors correctly include arrows. * Elm: Function parameters appear as ctags signature. * Elm: Misc fixes, including description -> typename. - (Format) typeref:description: -> typeref:typename: - (Refactor) Use isspace() for clarity. - (Man page) Man page passes `make man-test`. - (Comments) Remove incorrect task in comments. - (Comments) Add thanks in comments.
1 parent 1c7ca58 commit 94e964e

File tree

96 files changed

+2194
-168
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+2194
-168
lines changed

Tmain/list-fields-with-prefix.d/stdout-expected.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ x UCTAGSxpath no NONE s-- no -- xpath for
1919
- UCTAGSmacrodef no CPreProcessor s-- no -- macro definition
2020
- UCTAGSmacrodef no CUDA s-- no -- macro definition
2121
- UCTAGSproperties no CUDA s-- no -- properties (static, inline, mutable,...)
22+
- UCTAGSmoduleName yes Elm s-- no -- actual name of renamed module
2223
- UCTAGSannotations yes GDScript s-- no -- annotations on functions and variables
2324
- UCTAGShowImported no Go s-- no -- how the package is imported ("inline" for `.' or "init" for `_')
2425
- UCTAGSpackage yes Go s-- no -- the real package specified by the package name

Tmain/list-fields.d/stdout-expected.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ z kind no NONE s-- no r- [tags output] prepend "kind:" to k/ (or K/) field outpu
3737
- macrodef no CPreProcessor s-- no -- macro definition
3838
- macrodef no CUDA s-- no -- macro definition
3939
- properties no CUDA s-- no -- properties (static, inline, mutable,...)
40+
- moduleName yes Elm s-- no -- actual name of renamed module
4041
- annotations yes GDScript s-- no -- annotations on functions and variables
4142
- howImported no Go s-- no -- how the package is imported ("inline" for `.' or "init" for `_')
4243
- package yes Go s-- no -- the real package specified by the package name

Tmain/list-roles.d/stdout-expected.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ DTD e/element attOwner on attributes owner
4040
DTD p/parameterEntity condition on conditions
4141
DTD p/parameterEntity elementName on element names
4242
DTD p/parameterEntity partOfAttDef on part of attribute definition
43-
Elm m/module imported on imported module
43+
Elm c/constructor imported on item imported
44+
Elm f/function imported on item imported
45+
Elm m/module imported on item imported
46+
Elm t/type imported on item imported
4447
Flex I/import import on imports
4548
GDScript c/class extended on used as a base class for extending
4649
GemSpec g/gem develDep on specifying development dependency
@@ -145,7 +148,10 @@ DTD e/element attOwner on attributes owner
145148
DTD p/parameterEntity condition on conditions
146149
DTD p/parameterEntity elementName on element names
147150
DTD p/parameterEntity partOfAttDef on part of attribute definition
148-
Elm m/module imported on imported module
151+
Elm c/constructor imported on item imported
152+
Elm f/function imported on item imported
153+
Elm m/module imported on item imported
154+
Elm t/type imported on item imported
149155
Flex I/import import on imports
150156
GDScript c/class extended on used as a base class for extending
151157
GemSpec g/gem develDep on specifying development dependency
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
--sort=no
2+
--fields=+r
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
MyAlias1 input.elm /^type alias MyAlias1 = String$/;" a roles:def
2+
MyAlias2 input.elm /^type alias MyAlias2 =$/;" a roles:def
3+
MyAlias3 input.elm /^ MyAlias3$/;" a roles:def
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
type alias MyAlias1 = String
2+
3+
type alias MyAlias2 =
4+
String
5+
6+
type
7+
alias
8+
MyAlias3
9+
=
10+
{ x:Float, y:Float }
11+
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
--sort=no
2-
--fields=+r
32
--extras=+r
3+
--fields=+r
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Input input.elm /^import Input exposing (..)$/;" m roles:imported
2+
input1a input-1.elm /^input1a = 1$/;" f roles:def
3+
input1b input-1.elm /^input1b = 2$/;" f typeref:typename:Int roles:def
4+
input2b input-2.elm /^input2b = 1$/;" f roles:def
5+
input2c input-2.elm /^input2c = 3$/;" f roles:def
6+
module2d input-2.elm /^module2d = 4$/;" f roles:def
7+
input3b input-3.elm /^input3b = 1$/;" f roles:def
8+
input3d input-3.elm /^input3d = 1$/;" f roles:def
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
type alias Input1a *= ConsA
2+
3+
input1a = 1
4+
5+
type alias Input1b *= ConsB
6+
7+
input1b : Int
8+
input1b = 2
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
type Input2a = Cons2A1 | Cons2A2 *
2+
3+
input2b = 1
4+
5+
module = 2
6+
7+
input2c = 3
8+
9+
module2d = 4

0 commit comments

Comments
 (0)