Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Tmain/list-fields-with-prefix.d/stdout-expected.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ x UCTAGSxpath no NONE s-- no -- xpath for
- UCTAGSmacrodef no CPreProcessor s-- no -- macro definition
- UCTAGSmacrodef no CUDA s-- no -- macro definition
- UCTAGSproperties no CUDA s-- no -- properties (static, inline, mutable,...)
- UCTAGSmoduleName yes Elm s-- no -- actual name of renamed module
- UCTAGSannotations yes GDScript s-- no -- annotations on functions and variables
- UCTAGShowImported no Go s-- no -- how the package is imported ("inline" for `.' or "init" for `_')
- UCTAGSpackage yes Go s-- no -- the real package specified by the package name
Expand Down
1 change: 1 addition & 0 deletions Tmain/list-fields.d/stdout-expected.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ z kind no NONE s-- no r- [tags output] prepend "kind:" to k/ (or K/) field outpu
- macrodef no CPreProcessor s-- no -- macro definition
- macrodef no CUDA s-- no -- macro definition
- properties no CUDA s-- no -- properties (static, inline, mutable,...)
- moduleName yes Elm s-- no -- actual name of renamed module
- annotations yes GDScript s-- no -- annotations on functions and variables
- howImported no Go s-- no -- how the package is imported ("inline" for `.' or "init" for `_')
- package yes Go s-- no -- the real package specified by the package name
Expand Down
10 changes: 8 additions & 2 deletions Tmain/list-roles.d/stdout-expected.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ DTD e/element attOwner on attributes owner
DTD p/parameterEntity condition on conditions
DTD p/parameterEntity elementName on element names
DTD p/parameterEntity partOfAttDef on part of attribute definition
Elm m/module imported on imported module
Elm c/constructor imported on item imported
Elm f/function imported on item imported
Elm m/module imported on item imported
Elm t/type imported on item imported
Flex I/import import on imports
GDScript c/class extended on used as a base class for extending
GemSpec g/gem develDep on specifying development dependency
Expand Down Expand Up @@ -145,7 +148,10 @@ DTD e/element attOwner on attributes owner
DTD p/parameterEntity condition on conditions
DTD p/parameterEntity elementName on element names
DTD p/parameterEntity partOfAttDef on part of attribute definition
Elm m/module imported on imported module
Elm c/constructor imported on item imported
Elm f/function imported on item imported
Elm m/module imported on item imported
Elm t/type imported on item imported
Flex I/import import on imports
GDScript c/class extended on used as a base class for extending
GemSpec g/gem develDep on specifying development dependency
Expand Down
2 changes: 2 additions & 0 deletions Units/parser-elm.r/elm-aliases.d/args.ctags
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--sort=no
--fields=+r
3 changes: 3 additions & 0 deletions Units/parser-elm.r/elm-aliases.d/expected.tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
MyAlias1 input.elm /^type alias MyAlias1 = String$/;" a roles:def
MyAlias2 input.elm /^type alias MyAlias2 =$/;" a roles:def
MyAlias3 input.elm /^ MyAlias3$/;" a roles:def
11 changes: 11 additions & 0 deletions Units/parser-elm.r/elm-aliases.d/input.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
type alias MyAlias1 = String

type alias MyAlias2 =
String

type
alias
MyAlias3
=
{ x:Float, y:Float }

3 changes: 3 additions & 0 deletions Units/parser-elm.r/elm-bad-lines.d/args.ctags
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
--sort=no
--extras=+r
--fields=+rS
8 changes: 8 additions & 0 deletions Units/parser-elm.r/elm-bad-lines.d/expected.tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Input input.elm /^import Input exposing (..)$/;" m roles:imported
input1a input-1.elm /^input1a = 1$/;" f roles:def
input1b input-1.elm /^input1b = 2$/;" f signature:Int roles:def
input2b input-2.elm /^input2b = 1$/;" f roles:def
input2c input-2.elm /^input2c = 3$/;" f roles:def
module2d input-2.elm /^module2d = 4$/;" f roles:def
input3b input-3.elm /^input3b = 1$/;" f roles:def
input3d input-3.elm /^input3d = 1$/;" f roles:def
8 changes: 8 additions & 0 deletions Units/parser-elm.r/elm-bad-lines.d/input-1.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
type alias Input1a *= ConsA

input1a = 1

type alias Input1b *= ConsB

input1b : Int
input1b = 2
9 changes: 9 additions & 0 deletions Units/parser-elm.r/elm-bad-lines.d/input-2.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
type Input2a = Cons2A1 | Cons2A2 *

input2b = 1

module = 2

input2c = 3

module2d = 4
13 changes: 13 additions & 0 deletions Units/parser-elm.r/elm-bad-lines.d/input-3.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
-- Should be able to ignore a function where only part of the body
-- parses successfully

input3a i3_1 i3_2 =
(]? x &&

input3b = 1

input3c i3_1 i3_2 =
(]? x &&

input3d = 1

3 changes: 3 additions & 0 deletions Units/parser-elm.r/elm-bad-lines.d/input.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Input exposinx?*

import Input exposing (..)
3 changes: 3 additions & 0 deletions Units/parser-elm.r/elm-case-statements.d/args.ctags
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
--sort=no
--extras=+r
--fields=+rS
6 changes: 6 additions & 0 deletions Units/parser-elm.r/elm-case-statements.d/expected.tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
funcA input.elm /^funcA a1 a2 =$/;" f roles:def
funcB input.elm /^funcB b1 =$/;" f roles:def
funcC input.elm /^funcC c1 c2 =$/;" f roles:def
c2 input.elm /^ c2 = 2$/;" f function:funcC roles:def
c3 input.elm /^ c3 = 3$/;" f function:funcC roles:def
funcD input.elm /^funcD str =$/;" f roles:def
43 changes: 43 additions & 0 deletions Units/parser-elm.r/elm-case-statements.d/input.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
-- A function with a case statement

-- The code below won't compile, but it is
-- syntactically correct

funcA a1 a2 =
case (complex ex pression + 12) of
"Literal" ->
a + b
'l' ->
Cons a b
Cons a b ->
a +
b
_ ->
False

-- Check we can still read a simple function

funcB b1 =
True

-- Can we catch functions defined inside case statements?

funcC c1 c2 =
case (complex ex pression + 12) of
"Literal" ->
let
c2 = 2
c3 = 3
in
c2 + c3
_ -> False

-- This previously exposed a bug...

funcD str =
case str of
Just c1 ->
c1 / 255
_ ->
0

3 changes: 3 additions & 0 deletions Units/parser-elm.r/elm-comments.d/args.ctags
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
--sort=no
--extras=+r
--fields=+r
2 changes: 2 additions & 0 deletions Units/parser-elm.r/elm-comments.d/expected.tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
f input.elm /^f = 6 {- another comment -}$/;" f roles:def
h input.elm /^h = 9$/;" f roles:def
31 changes: 31 additions & 0 deletions Units/parser-elm.r/elm-comments.d/input.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
-- a = 1

{- b = 2 -}

{-
c = 3
-}

{-* d = 4 -}

{-*
e = 5
-}

{- some comment -}
f = 6 {- another comment -}

-- This should be ignored

-- This next line is not top level
{- so should continue the above -} + 1

-- A top level statement

h = 9

{-
comment
{- nested comment -}
i = 9
-}
3 changes: 3 additions & 0 deletions Units/parser-elm.r/elm-complex-types.d/args.ctags
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
--sort=no
--extras=+r
--fields=+r
20 changes: 20 additions & 0 deletions Units/parser-elm.r/elm-complex-types.d/expected.tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
A input.elm /^type A = ACons { x : Float, y : Float }$/;" t roles:def
ACons input.elm /^type A = ACons { x : Float, y : Float }$/;" c type:A roles:def
B input.elm /^type B$/;" t roles:def
B3Cons input.elm /^ | B3Cons$/;" c type:B roles:def
B2Cons input.elm /^ | B2Cons String Integer$/;" c type:B roles:def
B1Cons input.elm /^ = B1Cons$/;" c type:B roles:def
C input.elm /^type C=CCons{x:Float,y:Float}$/;" t roles:def
CCons input.elm /^type C=CCons{x:Float,y:Float}$/;" c type:C roles:def
D input.elm /^type D = DCons (String, Float, {x:String, y:Float})$/;" t roles:def
DCons input.elm /^type D = DCons (String, Float, {x:String, y:Float})$/;" c type:D roles:def
E input.elm /^type E$/;" t roles:def
E2Cons input.elm /^ | E2Cons ()$/;" c type:E roles:def
E1Cons input.elm /^ = E1Cons {}$/;" c type:E roles:def
F input.elm /^type F$/;" t roles:def
F3Cons input.elm /^ | F3Cons$/;" c type:F roles:def
F2Cons input.elm /^ | F2Cons (Float -> String -> (String -> {x:Float, y:Float}))$/;" c type:F roles:def
F1Cons input.elm /^ = F1Cons (String -> Int)$/;" c type:F roles:def
G input.elm /^type G a$/;" t roles:def
G2Cons input.elm /^ | G2Cons { a | name : String}$/;" c type:G roles:def
G1Cons input.elm /^ = G1Cons a Int$/;" c type:G roles:def
40 changes: 40 additions & 0 deletions Units/parser-elm.r/elm-complex-types.d/input.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
-- A type with a record spec

type A = ACons { x : Float, y : Float }

-- A type with more complex spec

type B
= B1Cons
{ x : Float
, y : Float
}
| B2Cons String Integer
| B3Cons

-- With a lack of spacing

type C=CCons{x:Float,y:Float}

-- Tuples

type D = DCons (String, Float, {x:String, y:Float})

-- Empty records and tuples

type E
= E1Cons {}
| E2Cons ()

-- With functions as type specifications

type F
= F1Cons (String -> Int)
| F2Cons (Float -> String -> (String -> {x:Float, y:Float}))
| F3Cons

-- With vertical bars within the type

type G a
= G1Cons a Int
| G2Cons { a | name : String}
3 changes: 3 additions & 0 deletions Units/parser-elm.r/elm-constructor-signatures.d/args.ctags
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
--sort=no
--extras=+r
--fields=+rS
4 changes: 4 additions & 0 deletions Units/parser-elm.r/elm-constructor-signatures.d/expected.tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
B input.elm /^type B$/;" t roles:def
B3Cons input.elm /^ | B3Cons$/;" c type:B signature: roles:def
B2Cons input.elm /^ | B2Cons String Integer$/;" c type:B signature:String Integer roles:def
B1Cons input.elm /^ = B1Cons$/;" c type:B signature:{ x : Float , y : Float } roles:def
7 changes: 7 additions & 0 deletions Units/parser-elm.r/elm-constructor-signatures.d/input.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type B
= B1Cons
{ x : Float
, y : Float
}
| B2Cons String Integer
| B3Cons
3 changes: 3 additions & 0 deletions Units/parser-elm.r/elm-expressions.d/args.ctags
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
--sort=no
--extras=+r
--fields=+rS
13 changes: 13 additions & 0 deletions Units/parser-elm.r/elm-expressions.d/expected.tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
funcA input.elm /^funcA =$/;" f roles:def
funcB input.elm /^funcB = (\\b1 b2 b3 -> 42)$/;" f roles:def
funcC input.elm /^funcC =$/;" f roles:def
funcD input.elm /^funcD =$/;" f roles:def
funcE input.elm /^funcE e1 e2 =$/;" f roles:def
funcF input.elm /^funcF = []$/;" f roles:def
funcG input.elm /^funcG =$/;" f roles:def
funcH input.elm /^funcH h =$/;" f roles:def
funcI input.elm /^funcI i1 i2 =$/;" f roles:def
funcJ1 input.elm /^funcJ1 =$/;" f roles:def
funcJ2 input.elm /^funcJ2 =$/;" f roles:def
funcJ3 input.elm /^funcJ3 =$/;" f roles:def
funcJ4 input.elm /^funcJ4 =$/;" f roles:def
60 changes: 60 additions & 0 deletions Units/parser-elm.r/elm-expressions.d/input.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
-- Expressions with parentheses

funcA =
(23 + 34)

-- Anonymous functions

funcB = (\b1 b2 b3 -> 42)

-- Allow us to call constructors as functions

funcC =
Cons a b

-- Allow us to functions and constructors using their module names

funcD =
(List.Deep.Cons a b) + (Main.add a b)

-- Basic lists

funcE e1 e2 =
e1 :: [e2, e1 + e2]

-- Empty lists

funcF = []

-- Tuples, including an empty tuple

funcG =
(12, 0x034, ('a')) ++ ()

-- Record names as function calls

funcH h =
(3) + (.age h.family.person)

-- Binary operators as function calls

funcI i1 i2 =
(++) (i1 // i2) 99

-- Records

funcJ1 =
{x = 2 , y = 3 , z = 4}

funcJ2 =
{ point | x = point.x + 1 , y = Cons a b }

funcJ3 =
{}

-- Record with spaces

funcJ4 =
{ model
| width = width
}
3 changes: 3 additions & 0 deletions Units/parser-elm.r/elm-functions.d/args.ctags
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
--sort=no
--extras=+r
--fields=+rS
5 changes: 5 additions & 0 deletions Units/parser-elm.r/elm-functions.d/expected.tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
funcA input.elm /^funcA a1 a2 = a1 + a2$/;" f roles:def
funcB input.elm /^funcB b =$/;" f roles:def
funcC input.elm /^funcC = 2 + 1$/;" f roles:def
funcD input.elm /^funcD d1$/;" f roles:def
funcE input.elm /^funcE=2$/;" f roles:def
22 changes: 22 additions & 0 deletions Units/parser-elm.r/elm-functions.d/input.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
-- Simple function with some parameters.

funcA a1 a2 = a1 + a2

-- Function over multiple lines

funcB b =
b + 1

-- Function with no parameter

funcC = 2 + 1

-- Function with whitespace - ideally this will be stripped in the signature

funcD d1
d2 = d1 + d2

-- Function with no whitespace after the name

funcE=2

Loading