Skip to content

Questions related to document layouts. #37

Answered by Omikhleia
no-vici asked this question in Q&A
Discussion options

You must be logged in to vote

Er. LPeg is hard and I am not always sure I got it right.
This being said, here, the "+" between the expressions being a "or" alternative, I want to parse:

  • division N r --> n = N, ratio = r (explicit values for both, i.e. the ws * number * ws * number case),
  • or division N --> n = N, ratio = nil (the one-number case ws * number; and this, later in the logic, means we will indeed use the page ratio (100%ph / 100%pw) in that case),
  • or division --> n = 9 (as a default), ratio = nil (i.e. the lpeg.Cc(9) case; and same as above regarding it).

Does it make sense?

Replies: 2 comments 13 replies

Comment options

You must be logged in to vote
13 replies
@no-vici
Comment options

@Omikhleia
Comment options

@no-vici
Comment options

@Omikhleia
Comment options

@no-vici
Comment options

Answer selected by no-vici
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants