Ensure that amatch output is not binary data.
This commit is contained in:
parent
afcab5f907
commit
f137cc0c5c
|
|
@ -721,6 +721,7 @@ static void aerror(char *s)
|
||||||
{
|
{
|
||||||
LEXER lx = parse_lexer;
|
LEXER lx = parse_lexer;
|
||||||
printf("%s [%s]\n", s, lx->lexer_line + lx->lexer_pos);
|
printf("%s [%s]\n", s, lx->lexer_line + lx->lexer_pos);
|
||||||
|
fflush(stdout);
|
||||||
cleanup_parser();
|
cleanup_parser();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -735,12 +736,11 @@ char *get_temp_name(void)
|
||||||
|
|
||||||
static BOOL amatch(int t)
|
static BOOL amatch(int t)
|
||||||
{
|
{
|
||||||
LEXER lx = parse_lexer;
|
|
||||||
if (lookahead == t) {
|
if (lookahead == t) {
|
||||||
lookahead = lex_scan();
|
lookahead = lex_scan();
|
||||||
} else {
|
} else {
|
||||||
printf("expect = '%c' [%d] lookahead = '%c' [%d] lexer_buf %s\n",
|
printf("expect = %d lookahead = %d lexer_buf \"%s\"\n",
|
||||||
t, t, lookahead, lookahead, lx->lexer_buf);
|
t, lookahead, parse_lexer->lexer_buf);
|
||||||
aerror("amatch: syntax error");
|
aerror("amatch: syntax error");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3593,7 +3593,7 @@ BOOL u_check_instance(char *line)
|
||||||
}
|
}
|
||||||
if (ps_udevice_msgs >= 1) {
|
if (ps_udevice_msgs >= 1) {
|
||||||
if (current_subckt && subckt_msg_count == 0) {
|
if (current_subckt && subckt_msg_count == 0) {
|
||||||
printf("%s\n", current_subckt);
|
printf("\nWARNING in %s\n", current_subckt);
|
||||||
}
|
}
|
||||||
subckt_msg_count++;
|
subckt_msg_count++;
|
||||||
printf("WARNING ");
|
printf("WARNING ");
|
||||||
|
|
@ -3630,22 +3630,24 @@ BOOL u_process_instance(char *nline)
|
||||||
if (eq(itype, "logicexp")) {
|
if (eq(itype, "logicexp")) {
|
||||||
delete_instance_hdr(hdr);
|
delete_instance_hdr(hdr);
|
||||||
behav_ret = f_logicexp(nline);
|
behav_ret = f_logicexp(nline);
|
||||||
if (!behav_ret && current_subckt && ps_udevice_msgs >= 1) {
|
if (!behav_ret && current_subckt) {
|
||||||
printf("ERROR in %s\n", current_subckt);
|
printf("ERROR in %s\n", current_subckt);
|
||||||
}
|
}
|
||||||
if (!behav_ret && ps_udevice_exit) {
|
if (!behav_ret && ps_udevice_exit) {
|
||||||
fprintf(stderr, "ERROR bad syntax in logicexp\n");
|
fprintf(stderr, "ERROR bad syntax in logicexp\n");
|
||||||
|
fflush(stdout);
|
||||||
controlled_exit(EXIT_FAILURE);
|
controlled_exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
return behav_ret;
|
return behav_ret;
|
||||||
} else if (eq(itype, "pindly")) {
|
} else if (eq(itype, "pindly")) {
|
||||||
delete_instance_hdr(hdr);
|
delete_instance_hdr(hdr);
|
||||||
behav_ret = f_pindly(nline);
|
behav_ret = f_pindly(nline);
|
||||||
if (!behav_ret && current_subckt && ps_udevice_msgs >= 1) {
|
if (!behav_ret && current_subckt) {
|
||||||
printf("ERROR in %s\n", current_subckt);
|
printf("ERROR in %s\n", current_subckt);
|
||||||
}
|
}
|
||||||
if (!behav_ret && ps_udevice_exit) {
|
if (!behav_ret && ps_udevice_exit) {
|
||||||
fprintf(stderr, "ERROR bad syntax in pindly\n");
|
fprintf(stderr, "ERROR bad syntax in pindly\n");
|
||||||
|
fflush(stdout);
|
||||||
controlled_exit(EXIT_FAILURE);
|
controlled_exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
return behav_ret;
|
return behav_ret;
|
||||||
|
|
@ -3676,7 +3678,11 @@ BOOL u_process_instance(char *nline)
|
||||||
} else {
|
} else {
|
||||||
delete_instance_hdr(hdr);
|
delete_instance_hdr(hdr);
|
||||||
if (ps_udevice_exit) {
|
if (ps_udevice_exit) {
|
||||||
|
if (current_subckt) {
|
||||||
|
printf("ERROR in %s\n", current_subckt);
|
||||||
|
}
|
||||||
fprintf(stderr, "ERROR unknown U* device\n");
|
fprintf(stderr, "ERROR unknown U* device\n");
|
||||||
|
fflush(stdout);
|
||||||
controlled_exit(EXIT_FAILURE);
|
controlled_exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
@ -3687,7 +3693,11 @@ BOOL u_process_instance(char *nline)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
} else {
|
} else {
|
||||||
if (ps_udevice_exit) {
|
if (ps_udevice_exit) {
|
||||||
|
if (current_subckt) {
|
||||||
|
printf("ERROR in %s\n", current_subckt);
|
||||||
|
}
|
||||||
fprintf(stderr, "ERROR U* device syntax error\n");
|
fprintf(stderr, "ERROR U* device syntax error\n");
|
||||||
|
fflush(stdout);
|
||||||
controlled_exit(EXIT_FAILURE);
|
controlled_exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue