Merge pull request #6651 from mermaid-js/6584-piechart-zero-negative-values

6584: prevent pie chart crash on zero or negative values
This commit is contained in:
Knut Sveidqvist
2025-08-08 09:52:16 +00:00
committed by GitHub
9 changed files with 128 additions and 29 deletions

View File

@@ -12,5 +12,9 @@ entry Pie:
;
PieSection:
label=STRING ":" value=NUMBER EOL
label=STRING ":" value=NUMBER_PIE EOL
;
terminal FLOAT_PIE returns number: /-?[0-9]+\.[0-9]+(?!\.)/;
terminal INT_PIE returns number: /-?(0|[1-9][0-9]*)(?!\.)/;
terminal NUMBER_PIE returns number: FLOAT_PIE | INT_PIE;