| @@ -1,15 +1,15 @@ | | | @@ -1,15 +1,15 @@ |
1 | %{ | | 1 | %{ |
2 | /* $NetBSD: testlang_parse.y,v 1.19 2020/10/24 14:45:06 roy Exp $ */ | | 2 | /* $NetBSD: testlang_parse.y,v 1.20 2021/02/07 12:08:42 rillig Exp $ */ |
3 | | | 3 | |
4 | /*- | | 4 | /*- |
5 | * Copyright 2009 Brett Lymn <blymn@NetBSD.org> | | 5 | * Copyright 2009 Brett Lymn <blymn@NetBSD.org> |
6 | * | | 6 | * |
7 | * All rights reserved. | | 7 | * All rights reserved. |
8 | * | | 8 | * |
9 | * This code has been donated to The NetBSD Foundation by the Author. | | 9 | * This code has been donated to The NetBSD Foundation by the Author. |
10 | * | | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | | 11 | * Redistribution and use in source and binary forms, with or without |
12 | * modification, are permitted provided that the following conditions | | 12 | * modification, are permitted provided that the following conditions |
13 | * are met: | | 13 | * are met: |
14 | * 1. Redistributions of source code must retain the above copyright | | 14 | * 1. Redistributions of source code must retain the above copyright |
15 | * notice, this list of conditions and the following disclaimer. | | 15 | * notice, this list of conditions and the following disclaimer. |
| @@ -287,27 +287,27 @@ check : CHECK var returns eol { | | | @@ -287,27 +287,27 @@ check : CHECK var returns eol { |
287 | command.returns[1].data_value = &vptr->cchar; | | 287 | command.returns[1].data_value = &vptr->cchar; |
288 | } | | 288 | } |
289 | | | 289 | |
290 | if (verbose) { | | 290 | if (verbose) { |
291 | fprintf(stderr, "Checking contents of variable %s for %s\n", | | 291 | fprintf(stderr, "Checking contents of variable %s for %s\n", |
292 | vars[command.returns[0].data_index].name, | | 292 | vars[command.returns[0].data_index].name, |
293 | enum_names[command.returns[1].data_type]); | | 293 | enum_names[command.returns[1].data_type]); |
294 | } | | 294 | } |
295 | | | 295 | |
296 | /* | | 296 | /* |
297 | * Check if var and return have same data types | | 297 | * Check if var and return have same data types |
298 | */ | | 298 | */ |
299 | if (((command.returns[1].data_type == data_byte) && | | 299 | if (((command.returns[1].data_type == data_byte) && |
300 | - (vars[command.returns[0].data_index].type != data_byte))) | | 300 | (vars[command.returns[0].data_index].type != data_byte))) |
301 | err(1, "Var type %s (%d) does not match return type %s (%d)", | | 301 | err(1, "Var type %s (%d) does not match return type %s (%d)", |
302 | enum_names[ | | 302 | enum_names[ |
303 | vars[command.returns[0].data_index].type], | | 303 | vars[command.returns[0].data_index].type], |
304 | vars[command.returns[0].data_index].type, | | 304 | vars[command.returns[0].data_index].type, |
305 | enum_names[command.returns[1].data_type], | | 305 | enum_names[command.returns[1].data_type], |
306 | command.returns[1].data_type); | | 306 | command.returns[1].data_type); |
307 | | | 307 | |
308 | switch (command.returns[1].data_type) { | | 308 | switch (command.returns[1].data_type) { |
309 | case data_err: | | 309 | case data_err: |
310 | case data_ok: | | 310 | case data_ok: |
311 | validate_type(vars[command.returns[0].data_index].type, | | 311 | validate_type(vars[command.returns[0].data_index].type, |
312 | &command.returns[1], 0); | | 312 | &command.returns[1], 0); |
313 | break; | | 313 | break; |