From cb7bcfad4ab0041aaf3fde3185e27ee46bb37788 Mon Sep 17 00:00:00 2001 From: JSDurand Date: Tue, 15 Nov 2022 12:01:28 +0800 Subject: Initial commit Basic GNU standard files are added, and we now stop worrying about monadic anamorphisms. The current focus is on testing the correctness of the algorithm, so I need convenient support for manipulating, interpreting, examining, and per chance animating nondeterministic automata. --- find-version.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 find-version.sh (limited to 'find-version.sh') diff --git a/find-version.sh b/find-version.sh new file mode 100755 index 0000000..4ac390e --- /dev/null +++ b/find-version.sh @@ -0,0 +1,20 @@ +#!/bin/sh +":"; exec emacs --quick --script "$0" -- "$@" # -*- mode: emacs-lisp; lexical-binding: t; -*- + +(with-temp-buffer + (insert-file-contents "Cargo.toml") + (goto-char (point-min)) + (cond + ((search-forward "version =" nil t) + (re-search-forward " *" (line-end-position) t) + (cond + ((= (char-after) 34)) + ((error "Invalid syntax at %d" (point)))) + (let ((end (line-end-position))) + (cond + ((= (char-before end) 34)) + ((error "Invalid syntax at %d" (1- end)))) + (princ + (buffer-substring-no-properties + (1+ (point)) (1- end))))) + ((print "Unknown")))) -- cgit v1.2.3-18-g5258