Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cslib/Foundations/Syntax/HasWellFormed.lean
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ class HasWellFormed (α : Type u) where
wf (x : α) : Prop

/-- Notation for well-formedness. -/
notation x:max "✓" => HasWellFormed.wf x
macro x:term:max noWs "✓" : term => `(HasWellFormed.wf $x)

end Cslib
1 change: 1 addition & 0 deletions CslibTests.lean
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import CslibTests.FreeMonad
import CslibTests.GrindLint
import CslibTests.HML
import CslibTests.HasFresh
import CslibTests.HasWellFormed
import CslibTests.ImportWithMathlib
import CslibTests.LTS
import CslibTests.LambdaCalculus
Expand Down
26 changes: 26 additions & 0 deletions CslibTests/HasWellFormed.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/-
Copyright (c) 2026 Sean D. Stoneburner. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Sean D. Stoneburner
-/
import Cslib.Algorithms.Lean.TimeM
import Cslib.Foundations.Syntax.HasWellFormed

open Cslib.Algorithms.Lean

/-!
# Syntax Collision Test
This file tests that the `✓` prefix macro from `TimeM` does not collide with
the `✓` postfix notation from `HasWellFormed` across line breaks.
-/

def testParserCollision (n : Nat) : TimeM Nat Nat := do
let m := n
✓ return m

-- Ensure the postfix notation still functions correctly when attached without whitespace
variable {α : Type*} [Cslib.HasWellFormed α] (x : α)

/-- info: Cslib.HasWellFormed.wf x : Prop -/
#guard_msgs in
#check x✓
Loading