ClickHouse/src/Functions/HTMLCharacterReference.sh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
1.0 KiB
Bash
Raw Normal View History

2023-08-31 04:27:00 +00:00
#!/usr/bin/env bash
echo '%language=C++
%define class-name HTMLCharacterHash
%define lookup-function-name Lookup
%readonly-tables
%includes
%compare-strncmp
%{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
#pragma GCC diagnostic ignored "-Wunused-macros"
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
#pragma GCC diagnostic ignored "-Wshorten-64-to-32"
2023-09-02 04:30:01 +00:00
// NOLINTBEGIN(google-runtime-int,hicpp-use-nullptr,modernize-use-nullptr)
2023-08-31 04:27:00 +00:00
%}
struct NameAndGlyph {
const char *name;
const char *glyph;
};
%%' > HTMLCharacterReference.gperf
# character reference as available at https://html.spec.whatwg.org/multipage/named-characters.html
curl -X GET https://html.spec.whatwg.org/entities.json | jq -r 'keys[] as $k | "\"\($k)\", \(.[$k] | .characters|tojson)"' | sed 's/^"&/"/' >> HTMLCharacterReference.gperf
echo '%%' >> HTMLCharacterReference.gperf
2023-09-02 04:30:01 +00:00
echo '// NOLINTEND(google-runtime-int,hicpp-use-nullptr,modernize-use-nullptr)' >> HTMLCharacterReference.gperf