diff options
author | Vladimir Azarov <avm@intermediate-node.net> | 2025-05-17 14:45:50 +0200 |
---|---|---|
committer | Vladimir Azarov <avm@intermediate-node.net> | 2025-05-17 14:45:50 +0200 |
commit | 5edd85474d6d8f3a0cc06cc0250ed3db8b26fcfa (patch) | |
tree | bd7ad914025858b4389b1801216ac7d41a0c1f45 /stream.sml | |
parent | 1f31e550385cfa64a36167a5f3f9ec780baaad86 (diff) |
Function-like macros
Diffstat (limited to 'stream.sml')
-rw-r--r-- | stream.sml | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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) %) |