Skip to content
Draft
14 changes: 7 additions & 7 deletions bin/ci_browser_foundation.grease
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ build_idric() {
git -C /tmp/Idric checkout --detach -q FETCH_HEAD
test "$(git -C /tmp/Idric rev-parse HEAD)" = "$idric_ref"

idric_build_root=/tmp/Idric
if [ -f /tmp/Idric/_/Makefile ]; then
idric_build_root=/tmp/Idric/_
fi

SCHEME=chezscheme make -C "$idric_build_root" bootstrap PREFIX="$idric_prefix"
SCHEME=chezscheme make -C "$idric_build_root" install PREFIX="$idric_prefix"
# Current Edric owns its bootstrap/build machinery below _/. Use the stable
# top-level entrypoint rather than depending on the old root Makefile layout.
PREFIX="$idric_prefix" sh /tmp/Idric/edric bootstrap
make -C /tmp/Idric/_ install \
PREFIX="$idric_prefix" \
SCHEME=/tmp/Idric/_/.tools/bin/scheme
test -x "$idric_prefix/bin/idris2"
}

verify_pdf_harvester() {
Expand Down
41 changes: 22 additions & 19 deletions src/CanonicalInformationSmoke.idric
Original file line number Diff line number Diff line change
@@ -1,35 +1,38 @@
module CanonicalInformationSmoke

import IB.Information.Model
import IB.Prepaint.Model
import IB.Strand
import IB.Prepaint
import IB.Prepaint.Version1

%default total

fixture_strand : Maybe Strand
fixture_strand = do
source_reference <- nonempty_text "fixture:strand-1"
requested <- requested_address "https://example.test/requested"
resolved <- resolved_address "https://example.test/resolved"
image <- fetched_image "asset:figure-1"
let source = Source source_reference HtmlRepresentation CompleteRepresentation
source_reference ← nonempty_text "fixture:strand-1"
requested ← requested_address "https://example.test/requested"
resolved ← resolved_address "https://example.test/resolved"
image ← image_reference "asset:figure-1"
next_link ← link_reference "/next"
search_form ← form_reference "/search"
figure_link ← link_reference "/figure/1"
let source = Source source_reference HtmlSource CompleteSource
pure
(MakeStrand
source
requested
resolved
(Just "Example")
[ InformationHeading Heading2 "Section"
, InformationText "Visible paragraph"
, InformationLink "Next" (LinkReference "/next")
, InformationTableRow (TableCells "first" ["second"])
, InformationForm "Search" (FormReference "/search")
, InformationImage image "diagram" "Figure 1" (Just (LinkReference "/figure/1"))
[ Heading Heading2 "Section"
, Text "Visible paragraph"
, Link "Next" next_link
, TableRow (table_row "first" ["second"])
, Form "Search" search_form
, Image image "diagram" "Figure 1" (Just figure_link)
])

empty_image_refused : Bool
empty_image_refused =
case fetched_image "" of
case image_reference "" of
Nothing ⇒ True
Just _ ⇒ False

Expand All @@ -41,8 +44,8 @@ seventh_heading_refused =

nonincreasing_revision_refused : Strand → Bool
nonincreasing_revision_refused strand =
let first = revision_from_strand (Revision 1) PartialRevision strand in
let second = revision_from_strand (Revision 1) CompleteRevision strand in
let first = prepaint_from_strand first_revision PartialRevision strand in
let second = prepaint_from_strand first_revision CompleteRevision strand in
case serialize_version1 [first, second] of
Nothing ⇒ True
Just _ ⇒ False
Expand All @@ -55,12 +58,12 @@ version1_result (Just version1_text) =

strand_report : Strand → String
strand_report strand =
let partial = revision_from_strand (Revision 0) PartialRevision strand in
let complete = revision_from_strand (Revision 1) CompleteRevision strand in
let partial = prepaint_from_strand first_revision PartialRevision strand in
let complete = prepaint_from_strand (next_revision first_revision) CompleteRevision strand in
unlines
[ "canonical-information=constructed"
, "canonical-blocks=" ++ show (length strand.blocks)
, "canonical-row-cells=" ++ show (length (table_row_cells (TableCells "first" ["second"])))
, "canonical-row-cells=" ++ show (length (table_row_cells (table_row "first" ["second"])))
, "empty-image-refused=" ++ show empty_image_refused
, "seventh-heading-refused=" ++ show seventh_heading_refused
, "revision-zero=" ++ show (revision_sequence_value partial.sequence)
Expand Down
137 changes: 0 additions & 137 deletions src/IB/Information/Model.idric

This file was deleted.

51 changes: 51 additions & 0 deletions src/IB/Prepaint.idric
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
module IB.Prepaint

import IB.Strand

%default total

-- Revision numbers are generated here rather than exposed as an unrestricted
-- machine count. Zero is the first valid revision and next_revision is the
-- only public way to advance it.
export
data RevisionSequence = Revision Integer

export
first_revision : RevisionSequence
first_revision = Revision 0

export
next_revision : RevisionSequence → RevisionSequence
next_revision (Revision value) = Revision (value + 1)

export
revision_sequence_value : RevisionSequence → Integer
revision_sequence_value (Revision value) = value

public export
data RevisionState
= PartialRevision
| CompleteRevision

public export
record PrepaintRevision where
constructor Prepaint
sequence : RevisionSequence
state : RevisionState
source : SourceRepresentation
requested : RequestedAddress
resolved : ResolvedAddress
title : Maybe String
blocks : List InformationBlock

export
prepaint_from_strand : RevisionSequence → RevisionState → Strand → PrepaintRevision
prepaint_from_strand sequence state strand =
Prepaint
sequence
state
strand.source
strand.requested
strand.resolved
strand.title
strand.blocks
40 changes: 0 additions & 40 deletions src/IB/Prepaint/Model.idric

This file was deleted.

Loading
Loading