Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tammo Jan Dijkema
dt_ctrl
Commits
7f43a10d
Commit
7f43a10d
authored
Jun 04, 2013
by
Jeroen Vreeken
Browse files
When parsing a control file failes on non syntax errors we should stop parsing
the file.
parent
e0cadc03
Changes
2
Hide whitespace changes
Inline
Side-by-side
controller/controller/controller_block.c
View file @
7f43a10d
...
...
@@ -56,7 +56,7 @@ int controller_block_create(char *type, char *name, va_list ap)
handle
=
dlopen
(
NULL
,
RTLD_NOW
);
if
(
!
handle
)
{
log_send
(
LOG_T_ERROR
,
"
Error getting
handle from dlopen(): %s"
,
dlerror
());
"
Could not get
handle from dlopen(): %s"
,
dlerror
());
return
-
1
;
}
...
...
@@ -67,12 +67,12 @@ int controller_block_create(char *type, char *name, va_list ap)
if
(
create_func
)
{
if
(
!
create_func
(
name
,
ap
))
{
log_send
(
LOG_T_ERROR
,
"
Error:
%s() failed"
,
symbol
);
log_send
(
LOG_T_ERROR
,
"%s() failed"
,
symbol
);
ret
=
-
1
;
}
}
else
{
log_send
(
LOG_T_ERROR
,
"
Error
find
ing
function %s for block %s"
,
symbol
,
type
);
"
Could not
find function %s for block %s"
,
symbol
,
type
);
ret
=
-
1
;
}
...
...
controller/controller/controller_load_parser.y
View file @
7f43a10d
...
...
@@ -124,8 +124,10 @@ block : BRACEOPENSYM
STRINGSYM varlist
BRACECLOSESYM
{
if(controller_load_block_create($2, $4, scanner))
if(controller_load_block_create($2, $4, scanner))
{
yyerror(scanner, "Error creating block");
YYERROR;
}
free($2);
free($4);
controller_load_var_clear(scanner);
...
...
@@ -144,8 +146,10 @@ param : BRACEOPENSYM
varlist
BRACECLOSESYM
{
if (controller_load_block_param_set($2, $4, scanner))
if (controller_load_block_param_set($2, $4, scanner))
{
yyerror(scanner, "Error setting parameter");
YYERROR;
}
controller_load_var_clear(scanner);
}
;
...
...
@@ -249,8 +253,10 @@ link : BRACEOPENSYM
BOOLSYM
BRACECLOSESYM
{
if (controller_block_connect($2, $4, $6, $8, $10))
if (controller_block_connect($2, $4, $6, $8, $10))
{
yyerror(scanner, "Error connecting blocks");
YYERROR;
}
free($2);
free($4);
free($6);
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment