-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Removing test.mo * Adding class definition tags * Adding variable definitions tags * Updating readme
- Loading branch information
1 parent
93def7a
commit 2972fa1
Showing
9 changed files
with
315 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,168 @@ | ||
;;;;; Tagging for code navigation | ||
|
||
;;; Class definitions | ||
|
||
(class_definition | ||
(class_type | ||
class: (CLASS) | ||
) | ||
(class_specifier | ||
identifier: (identifier) @name | ||
comment: (string_comment | ||
(STRING) @doc | ||
( | ||
(PLUS) | ||
(STRING) @doc | ||
)* | ||
)* | ||
) | ||
(#strip! @doc "^\\\"|\\\"$") | ||
) @definition.class | ||
|
||
(class_definition | ||
(class_type | ||
optimization: (OPTIMIZATION) | ||
) | ||
(class_specifier | ||
identifier: (identifier) @name | ||
comment: (string_comment | ||
(STRING) @doc | ||
( | ||
(PLUS) | ||
(STRING) @doc | ||
)* | ||
)* | ||
) | ||
(#strip! @doc "^\\\"|\\\"$") | ||
) @definition.optimization | ||
|
||
(class_definition | ||
(class_type | ||
model: (MODEL) | ||
) | ||
(class_specifier | ||
identifier: (identifier) @name | ||
comment: (string_comment | ||
(STRING) @doc | ||
( | ||
(PLUS) | ||
(STRING) @doc | ||
)* | ||
)* | ||
) | ||
(#strip! @doc "^\\\"|\\\"$") | ||
) @definition.model | ||
|
||
(class_definition | ||
(class_type | ||
record: (RECORD) | ||
) | ||
(class_specifier | ||
identifier: (identifier) @name | ||
comment: (string_comment | ||
(STRING) @doc | ||
( | ||
(PLUS) | ||
(STRING) @doc | ||
)* | ||
)* | ||
) | ||
(#strip! @doc "^\\\"|\\\"$") | ||
) @definition.record | ||
|
||
(class_definition | ||
(class_type | ||
connector: (CONNECTOR) | ||
) | ||
(class_specifier | ||
identifier: (identifier) @name | ||
comment: (string_comment | ||
(STRING) @doc | ||
( | ||
(PLUS) | ||
(STRING) @doc | ||
)* | ||
)* | ||
) | ||
(#strip! @doc "^\\\"|\\\"$") | ||
) @definition.connector | ||
|
||
(class_definition | ||
(class_type | ||
type: (TYPE) | ||
) | ||
(class_specifier | ||
identifier: (identifier) @name | ||
comment: (string_comment | ||
(STRING) @doc | ||
( | ||
(PLUS) | ||
(STRING) @doc | ||
)* | ||
)* | ||
) | ||
(#strip! @doc "^\\\"|\\\"$") | ||
) @definition.type | ||
|
||
(class_definition | ||
(class_type | ||
package: (PACKAGE) | ||
) | ||
(class_specifier | ||
identifier: (identifier) @name | ||
comment: (string_comment | ||
(STRING) @doc | ||
( | ||
(PLUS) | ||
(STRING) @doc | ||
)* | ||
)* | ||
) | ||
(#strip! @doc "^\\\"|\\\"$") | ||
) @definition.package | ||
|
||
(class_definition | ||
(class_type | ||
function: (FUNCTION) | ||
) | ||
(class_specifier | ||
identifier: (identifier) @name | ||
comment: (string_comment | ||
(STRING) @doc | ||
( | ||
(PLUS) | ||
(STRING) @doc | ||
)* | ||
)* | ||
) | ||
(#strip! @doc "^\\\"|\\\"$") | ||
) @definition.function | ||
|
||
(class_definition | ||
(class_type | ||
uniontype: (UNIONTYPE) | ||
) | ||
(class_specifier | ||
identifier: (identifier) @name | ||
comment: (string_comment | ||
(STRING) @doc | ||
( | ||
(PLUS) | ||
(STRING) @doc | ||
)* | ||
)* | ||
) | ||
(#strip! @doc "^\\\"|\\\"$") | ||
) @definition.uniontype | ||
|
||
;;; Variable definitions | ||
|
||
(component_declaration | ||
declaration: (declaration | ||
[ | ||
identifier: (IDENT) @name | ||
(OPERATOR) @name | ||
] | ||
) | ||
comment: (comment)* @doc | ||
) @definition.variable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package A "Package" | ||
function foo | ||
end foo; | ||
|
||
function bar | ||
algorithm | ||
foo(); // In scope | ||
end bar; | ||
end A; | ||
|
||
package B | ||
function bar1 | ||
Real x; | ||
algorithm | ||
x := foo(); // Not in scope | ||
x := A.foo(); // In scope | ||
end bar1; | ||
|
||
function bar2 | ||
Real y; | ||
algorithm | ||
show(x); // Not in scope | ||
show(y); // In scope | ||
end bar2; | ||
end B; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
class C1 "Documentation" | ||
// ^ definition.class | ||
end C1; | ||
|
||
class C2 | ||
// ^ definition.class | ||
"Documentation" | ||
end C2; | ||
|
||
optimization Opt "This has" + "a lot of documentation" | ||
// ^ definition.optimization | ||
end Opt; | ||
|
||
model MyModel | ||
// ^ definition.model | ||
end MyModel; | ||
|
||
record R | ||
// ^ definition.record | ||
end R; | ||
|
||
connector C | ||
// ^ definition.connector | ||
end C; | ||
|
||
type T | ||
// ^ definition.type | ||
end T; | ||
|
||
package PackageA | ||
// ^ definition.package | ||
end PackageA; | ||
|
||
function foo | ||
// ^ definition.function | ||
end foo; | ||
|
||
uniontype T2 | ||
// ^ definition.uniontype | ||
end T2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
function foo "Some | ||
longish documentation." | ||
input T1 x; | ||
// ^ definition.variable | ||
algorithm | ||
() := match x | ||
local | ||
Real y1; | ||
// ^ definition.variable | ||
list<T2> y2; | ||
// ^ definition.variable | ||
list<T> y3; | ||
// ^ definition.variable | ||
list<T<T, list<T>>> y4; | ||
// ^ definition.variable | ||
case T1.R(_) | ||
algorithm | ||
doStuff(y1, y2); | ||
then (); | ||
|
||
else | ||
then fail(); | ||
end match; | ||
end foo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
function foo | ||
input Absyn.Operator operator; | ||
// ^ definition.variable | ||
input Real i1 "This is some input"; | ||
// ^ definition.variable | ||
output Real o1 "This is some output"; | ||
// ^ definition.variable | ||
protected | ||
Real x1 "Some protected variable"; | ||
// ^ definition.variable | ||
Integer x2; | ||
// ^ definition.variable | ||
Boolean x3; | ||
// ^ definition.variable | ||
String x4; | ||
// ^ definition.variable | ||
MyType x5; | ||
// ^ definition.variable | ||
public | ||
List<Real> x6 "Some public variable"; | ||
// ^ definition.variable | ||
List<MyType> x7; | ||
// ^ definition.variable | ||
Option<Real> x8; | ||
// ^ definition.variable | ||
Option<MyType> x9; | ||
// ^ definition.variable | ||
Tuple<T1, T2, T3> x10; | ||
// ^ definition.variable | ||
end foo; |