Skip to content

Commit

Permalink
add polyfill for boolean type
Browse files Browse the repository at this point in the history
  • Loading branch information
PgBiel committed Nov 17, 2023
1 parent 5a72674 commit 8fd57c9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/common.typ
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
// (0.2.0-0.7.0: they're strings; 0.8.0+: they're proper types)
#let _array_type = type(())
#let _dict_type = type((a: 5))
#let _bool_type = type(true)
#let _str_type = type("")
#let _color_type = type(red)
#let _stroke_type = type(red + 5pt)
Expand Down
4 changes: 2 additions & 2 deletions src/option-parsing.typ
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@

repeat-header = default-if-auto(default-if-none(repeat-header, false), false)

if type(repeat-header) not in ("boolean", _int_type, _array_type) {
if type(repeat-header) not in (_bool_type, _int_type, _array_type) {
panic("Tablex error: 'repeat-header' must be a boolean (true - always repeat the header, false - never), an integer (amount of pages for which to repeat the header), or an array of integers (relative pages in which the header should repeat).")
} else if type(repeat-header) == _array_type and repeat-header.any(i => type(i) != _int_type) {
panic("Tablex error: 'repeat-header' cannot be an array of anything other than integers!")
Expand All @@ -258,7 +258,7 @@
) = {
header-hlines-have-priority = default-if-auto(default-if-none(header-hlines-have-priority, true), true)

if type(header-hlines-have-priority) != "boolean" {
if type(header-hlines-have-priority) != _bool_type {
panic("Tablex error: 'header-hlines-have-priority' option must be a boolean.")
}

Expand Down

0 comments on commit 8fd57c9

Please sign in to comment.