Skip to content

Commit

Permalink
Give annotations to record field names that appear in updates.
Browse files Browse the repository at this point in the history
Field names in selections were already annotated.

Closes #191
  • Loading branch information
mn200 committed Aug 29, 2014
1 parent 4f16bf9 commit ff0ad49
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/TeX/theory_tests/expected-output
Expand Up @@ -15,3 +15,11 @@
\HOLTokenBar{} \HOLConst{Tyrep} \HOLTyOp{string} \HOLTyOp{term}

\HOLinline{\HOLFreeVar{x}.\HOLFieldName{fld1}}

\HOLinline{\HOLFreeVar{x} with \HOLFieldName{fld1} := \HOLConst{T}}

\HOLinline{\HOLFreeVar{x} with \HOLTokenLeftrec{}\HOLFieldName{fld1} := \HOLConst{T}; \HOLFieldName{fld2} := \HOLConst{K} \HOLNumLit{3}\HOLTokenRightrec{}}

\HOLinline{\HOLFreeVar{x} with \HOLFieldName{fld1} updated_by (\HOLConst{\HOLTokenNeg{}})}

\HOLinline{\HOLFreeVar{x} with \HOLFieldName{fld2} updated_by \HOLFreeVar{g}}
8 changes: 8 additions & 0 deletions src/TeX/theory_tests/input
@@ -1,3 +1,11 @@
\HOLthm{mdt.datatype_term}

\HOLtm{x.fld1}

\HOLtm{x with fld1 := T}

\HOLtm{x with <| fld1 := T; fld2 := K 3 |>}

\HOLtm{x with fld1 updated_by $~}

\HOLtm{x with <| fld2 updated_by g |>}
3 changes: 2 additions & 1 deletion src/parse/term_pp.sml
Expand Up @@ -1035,7 +1035,8 @@ fun pp_term (G : grammar) TyG backend = let
else valOf recfupd_info
in
block INCONSISTENT 2
(add_string fld >>
(add_ann_string
(fld, PPBackEnd.Literal PPBackEnd.FldName) >>
add_string " " >>
add_string updtok >>
add_break(1,0) >>
Expand Down

0 comments on commit ff0ad49

Please sign in to comment.