(Arne Babenhauserheide)
2017-10-08: warn about partial unindent stable v0.9.6 warn about partial unindent
diff --git a/NEWS b/NEWS --- a/NEWS +++ b/NEWS @@ -1,5 +1,9 @@ wisp (): +wisp 0.9.6: +- Add a warning with undefined indentation levels: they can + produce surprising behaviour when changing existing code. + wisp 0.9.5: - Fix bug with using not yet defined lower indentation levels. See tests/partial-indent.{w,scm} diff --git a/configure.ac b/configure.ac --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ dnl run `autoreconf -i` to generate a configure script. dnl Then run ./configure to generate a Makefile. dnl Finally run make to generate the project. -AC_INIT([wisp], [0.9.5], +AC_INIT([wisp], [0.9.6], [arne_bab@web.de]) # Add macros in m4/ to ensure that wisp builds without having Guile in the aclocal path AC_CONFIG_MACRO_DIR([m4]) diff --git a/docs/tutorial.org b/docs/tutorial.org new file mode 100644 --- /dev/null +++ b/docs/tutorial.org @@ -0,0 +1,1 @@ +- for devs from other languages: the only line terminator is the newline. ; starts a comment till the end of the line. diff --git a/wisp-scheme.w b/wisp-scheme.w --- a/wisp-scheme.w +++ b/wisp-scheme.w @@ -362,7 +362,6 @@ define : wisp-scheme-read-chunk-lines po . #f ; incomment . currentindent ; this also takes care of the hashbang and leading comments. - ; TODO: If used from Guile, activate curly infix via read-options. append currentsymbols : list : wisp-read port . emptylines @@ -531,12 +530,15 @@ define : wisp-scheme-indentation-to-pare let : : previous-indentation : car : cdr indentation-levels if : <= current-line-indentation previous-indentation values processed unprocessed - loop ;; not yet used level! TODO: maybe throw an error here. - . processed - . unprocessed - cons ; recursion via the indentation-levels - . current-line-indentation - cdr indentation-levels + begin ;; not yet used level! TODO: maybe throw an error here instead of a warning. + let : : linenumber : - (length lines) (length unprocessed) + format (current-error-port) ";;; WARNING:~A: used lower but undefined indentation level (line ~A of the current chunk: ~S). This makes refactoring much more error-prone, therefore it might become an error in a later version of Wisp.\n" linenumber linenumber (cdr current-line) + loop + . processed + . unprocessed + cons ; recursion via the indentation-levels + . current-line-indentation + cdr indentation-levels : = current-indentation current-line-indentation ; display "current-indent = next-line\n" let