Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
8b3d513d
Commit
8b3d513d
authored
2 years ago
by
Loïc Correnson
Committed by
David Bühler
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[server] registering type markers
parent
eb435af6
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ivette/src/frama-c/richtext.tsx
+6
-2
6 additions, 2 deletions
ivette/src/frama-c/richtext.tsx
src/plugins/server/kernel_ast.ml
+6
-1
6 additions, 1 deletion
src/plugins/server/kernel_ast.ml
src/plugins/server/kernel_ast.mli
+1
-0
1 addition, 0 deletions
src/plugins/server/kernel_ast.mli
with
13 additions
and
3 deletions
ivette/src/frama-c/richtext.tsx
+
6
−
2
View file @
8b3d513d
...
...
@@ -83,7 +83,7 @@ interface MarkerProps {
function
Marker
(
props
:
MarkerProps
):
JSX
.
Element
{
const
{
marker
,
onMarker
,
children
}
=
props
;
const
onClick
=
():
void
=>
{
if
(
onMarker
)
onMarker
(
marker
);};
const
onClick
=
():
void
=>
{
if
(
onMarker
)
onMarker
(
marker
);
};
return
(
<
span
className
=
"kernel-text-marker"
...
...
@@ -109,7 +109,11 @@ export function Text(props: TextProps): JSX.Element {
const
array
=
marker
?
text
.
slice
(
1
)
:
text
;
const
contents
=
React
.
Children
.
toArray
(
array
.
map
(
makeContents
));
if
(
marker
)
{
return
<
Marker
marker
=
{
tag
}
onMarker
=
{
props
.
onMarker
}
>
{
contents
}
</
Marker
>;
return
(
<
Marker
marker
=
{
tag
}
onMarker
=
{
props
.
onMarker
}
>
{
contents
}
</
Marker
>
);
}
return
<>
{
contents
}
</>;
}
if
(
typeof
text
===
'
string
'
)
{
...
...
This diff is collapsed.
Click to expand it.
src/plugins/server/kernel_ast.ml
+
6
−
1
View file @
8b3d513d
...
...
@@ -336,6 +336,7 @@ struct
let
jterm
=
jmarker
"term"
let
jglobal
=
jmarker
"global"
let
jproperty
=
jmarker
"property"
let
jtyp
=
jmarker
"type"
let
jtype
=
Data
.
declare
~
package
~
name
:
"marker"
~
descr
:
(
Md
.
plain
"Localizable AST markers"
)
...
...
@@ -427,6 +428,7 @@ end
module
KfMarker
=
struct
type
record
let
record
:
record
Record
.
signature
=
Record
.
signature
()
let
fct
=
Record
.
field
record
~
name
:
"fct"
~
descr
:
(
Md
.
plain
"Function"
)
(
module
Kf
)
let
marker
=
Record
.
field
record
~
name
:
"marker"
...
...
@@ -435,6 +437,7 @@ module KfMarker = struct
let
data
=
Record
.
publish
~
package
~
name
:
"location"
~
descr
:
(
Md
.
plain
"Location: function and marker"
)
record
module
R
:
Record
.
S
with
type
r
=
record
=
(
val
data
)
type
t
=
kernel_function
*
Printer_tag
.
localizable
let
jtype
=
R
.
jtype
...
...
@@ -647,7 +650,9 @@ struct
let
update
()
=
Request
.
emit
signal
let
register
~
id
~
label
~
descr
?
(
title
=
descr
)
?
(
enable
=
fun
_
->
true
)
pretty
=
let
register
~
id
~
label
~
descr
?
(
title
=
descr
)
?
(
enable
=
fun
_
->
true
)
pretty
=
let
rank
=
incr
rankId
;
!
rankId
in
let
info
=
{
id
;
rank
;
label
;
descr
;
title
;
enable
;
pretty
}
in
if
Hashtbl
.
mem
registry
id
then
...
...
This diff is collapsed.
Click to expand it.
src/plugins/server/kernel_ast.mli
+
1
−
0
View file @
8b3d513d
...
...
@@ -46,6 +46,7 @@ sig
val
jterm
:
jtype
val
jglobal
:
jtype
val
jproperty
:
jtype
val
jtyp
:
jtype
val
create
:
t
->
string
(** Memoized unique identifier. *)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment