aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tools/bison/src/location.c
diff options
context:
space:
mode:
authorthegeorg <thegeorg@yandex-team.com>2024-06-29 21:48:22 +0300
committerthegeorg <thegeorg@yandex-team.com>2024-06-29 21:59:59 +0300
commitb21e05a2e32e36ae9cc9826acf98084ca4b52d7d (patch)
tree20d654fb0156f50e150944fc8108a3cada8ca6ec /contrib/tools/bison/src/location.c
parent0cf48e974f5542c3e65398c01b9b6baf8aa6c260 (diff)
downloadydb-b21e05a2e32e36ae9cc9826acf98084ca4b52d7d.tar.gz
Update contrib/tools/bison to 3.3.2
6215035f251de2d87363064fb4f07a2b14a3b4c8
Diffstat (limited to 'contrib/tools/bison/src/location.c')
-rw-r--r--contrib/tools/bison/src/location.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/contrib/tools/bison/src/location.c b/contrib/tools/bison/src/location.c
index e75e67e331..6876890c02 100644
--- a/contrib/tools/bison/src/location.c
+++ b/contrib/tools/bison/src/location.c
@@ -1,6 +1,7 @@
/* Locations for Bison
- Copyright (C) 2002, 2005-2015, 2018 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005-2015, 2018-2019 Free Software Foundation,
+ Inc.
This file is part of Bison, the GNU Compiler Compiler.
@@ -208,13 +209,20 @@ location_caret (location loc, FILE *out)
/* Print the carets (at least one), with the same indent as above.*/
fprintf (out, " %*s", loc.start.column - 1, "");
for (i = loc.start.column; i == loc.start.column || i < len; ++i)
- putc ('^', out);
+ putc (i == loc.start.column ? '^' : '~', out);
}
putc ('\n', out);
}
}
}
+bool
+location_empty (location loc)
+{
+ return !loc.start.file && !loc.start.line && !loc.start.column
+ && !loc.end.file && !loc.end.line && !loc.end.column;
+}
+
void
boundary_set_from_string (boundary *bound, char *loc_str)
{