Skip to content

Commit

Permalink
fix(time): allow dash instead of space for qualified grain
Browse files Browse the repository at this point in the history
  • Loading branch information
ClaudiuCeia committed Jul 21, 2022
1 parent f70d6ad commit eeae3b4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
5 changes: 3 additions & 2 deletions src/Time.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,12 +353,13 @@ export const Time = createLanguage<TimeEntityLanguage>({
__(
seq(
Quantity.NonFractional,
__(any(str("st"), str("nd"), str("rd"), str("th"))),
any(str("st"), str("nd"), str("rd"), str("th")),
either(str("-"), space()),
s.Grain,
optional(s.Era)
)
),
([quantity, qualifier, grain, maybeEra], b, a) =>
([quantity, qualifier, ,grain, maybeEra], b, a) =>
time(
{
when: `${quantity.value.amount}${qualifier} ${grain} ${
Expand Down
17 changes: 4 additions & 13 deletions tests/Institution.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,23 +88,14 @@ Deno.test("Fordwich Town Hall", () => {
if (res.success) {
assertEquals(res.value, [
{
end: 2,
kind: "quantity",
start: 0,
text: "16",
value: {
amount: 16,
},
},
{
end: 12,
end: 13,
kind: "time",
start: 5,
text: "century",
start: 0,
text: "16th-century ",
value: {
era: "CE",
grain: "century",
when: "century",
when: "16th century ",
},
},
{
Expand Down

0 comments on commit eeae3b4

Please sign in to comment.