From 5edd85474d6d8f3a0cc06cc0250ed3db8b26fcfa Mon Sep 17 00:00:00 2001 From: Vladimir Azarov Date: Sat, 17 May 2025 14:45:50 +0200 Subject: Function-like macros --- stream.sml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'stream.sml') diff --git a/stream.sml b/stream.sml index ff4a6ad..fd5932a 100644 --- a/stream.sml +++ b/stream.sml @@ -28,12 +28,13 @@ structure Stream :> STREAM = struct end z - fun pos2str (Pos (pos, line, col)) = + val Ppos = fn z => let - val % = Int.toString + fun p (out, Pos (fname, line, col)) = + Printf out `fname `":" I line `":" I col % in - pos ^ ":" ^ %line ^ ":" ^ %col - end + bind A1 p + end z fun getcharSure (S as { contents, off, ... }: t) = (String.sub (contents, off), updateStream S s#off (off + 1) %) -- cgit v1.2.3