Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libcaml-grew
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
4
Issues
4
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
grew
libcaml-grew
Commits
ab02cce7
Commit
ab02cce7
authored
May 25, 2017
by
Bruno Guillaume
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more explicit error
parent
28f369e4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
1 deletion
+14
-1
src/grew_ast.ml
src/grew_ast.ml
+11
-0
src/grew_ast.mli
src/grew_ast.mli
+2
-0
src/grew_fs.ml
src/grew_fs.ml
+1
-1
No files found.
src/grew_ast.ml
View file @
ab02cce7
...
...
@@ -89,12 +89,23 @@ module Ast = struct
|
Equal_param
of
string
(* $ident *)
|
Absent
let
feature_kind_to_string
=
function
|
Equality
fv_list
->
sprintf
" = %s"
(
String
.
concat
"|"
fv_list
)
|
Disequality
[]
->
""
|
Disequality
fv_list
->
sprintf
" <> %s"
(
String
.
concat
"|"
fv_list
)
|
Equal_param
param
->
sprintf
" = $%s"
param
|
Absent
->
" <> *"
type
u_feature
=
{
name
:
feature_name
;
kind
:
feature_kind
;
}
let
u_feature_to_string
uf
=
sprintf
"%s%s"
uf
.
name
(
feature_kind_to_string
uf
.
kind
)
type
feature
=
u_feature
*
Loc
.
t
let
default_fs
?
loc
lab
=
match
loc
with
|
None
->
[({
name
=
"label"
;
kind
=
Equality
[
lab
]}
,
Loc
.
empty
)]
...
...
src/grew_ast.mli
View file @
ab02cce7
...
...
@@ -61,6 +61,8 @@ module Ast : sig
name
:
feature_name
;
kind
:
feature_kind
;
}
val
u_feature_to_string
:
u_feature
->
string
type
feature
=
u_feature
*
Loc
.
t
val
default_fs
:
?
loc
:
Loc
.
t
->
string
->
feature
list
...
...
src/grew_fs.ml
View file @
ab02cce7
...
...
@@ -51,7 +51,7 @@ module G_feature = struct
let
build
?
domain
=
function
|
({
Ast
.
kind
=
Ast
.
Equality
[
atom
];
name
=
name
}
,
loc
)
->
(
name
,
Feature_value
.
build_value
~
loc
?
domain
name
atom
)
|
_
->
Error
.
build
"Illegal feature declaration in Graph (must be '=' and atomic)"
|
(
uf
,
loc
)
->
Error
.
build
~
loc
"in graph nodes, features must follow the shape
\"
name = value
\"
(error on feature:
\"
%s
\"
)"
(
Ast
.
u_feature_to_string
uf
)
let
to_string
(
feat_name
,
feat_val
)
=
sprintf
"%s=%s"
feat_name
(
string_of_value
feat_val
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment