summaryrefslogtreecommitdiff
path: root/Rakefile
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-05-18 11:48:21 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-05-18 15:45:22 +0900
commite2ad91fc2094d3cc2f76adc6c55d420cd06f34d8 (patch)
tree3812b2c7a2377c54c059102c2bcc7329dc2af4be /Rakefile
parent127f0e286c284812c9cbfe0fe5849d949735f5ef (diff)
downloadjson-e2ad91fc2094d3cc2f76adc6c55d420cd06f34d8.tar.gz
parser: fix warnings against code generated by ragel
* type-limits when plain-char is unsigned * unused-const-variable for NFA constants
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile3
1 files changed, 2 insertions, 1 deletions
diff --git a/Rakefile b/Rakefile
index 813a6d9..8de6ded 100644
--- a/Rakefile
+++ b/Rakefile
@@ -282,7 +282,8 @@ else
end
src = File.read("parser.c").gsub(/[ \t]+$/, '')
src.gsub!(/^static const int (JSON_.*=.*);$/, 'enum {\1};')
- src.gsub!(/0 <= \(\*p\) && \(\*p\) <= 31/, "0 <= (signed char)(*p) && (*p) <= 31")
+ src.gsub!(/^(static const char) (_JSON(?:_\w+)?_nfa_\w+)(?=\[\] =)/, '\1 MAYBE_UNUSED(\2)')
+ src.gsub!(/0 <= ([\( ]+\*[\( ]*p\)+) && \1 <= 31/, "0 <= (signed char)(*(p)) && (*(p)) <= 31")
src[0, 0] = "/* This file is automatically generated from parser.rl by using ragel */"
File.open("parser.c", "w") {|f| f.print src}
end