diff options
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | parser.y | 4 | ||||
-rw-r--r-- | txr.1 | 4 |
3 files changed, 13 insertions, 5 deletions
@@ -1,5 +1,15 @@ 2011-10-13 Kaz Kylheku <kaz@kylheku.com> + * parser.y (elem): Amending previous change. A single space + should only denote multiple spaces, not mixtures of spaces and + tabs. WE have to be careful with tabs because they can be + semantically different from spaces (e.g. file with tab delimited + fields which can be blank, empty or have leading or trailing spaces.) + + * txr.1: Updated. + +2011-10-13 Kaz Kylheku <kaz@kylheku.com> + * Makefile (%.ok: %.txr): Use unified diff for showing differences between expected and actual test output. @@ -226,9 +226,7 @@ elems : elem { $$ = cons($1, nil); } elem : TEXT { $$ = string_own($1); } | SPACE { if ($1[0] == ' ' && $1[1] == 0) { val spaces = list(oneplus_s, - list(set_s, chr(' '), - chr('\t'), nao), - nao); + chr(' '), nao); $$ = cons(regex_compile(spaces), spaces); free($1); } else @@ -320,8 +320,8 @@ an undivided mixture of tabs and spaces is a whitespace token. Whitespace tokens match a precisely identical piece of whitespace in the input, with one exception: a whitespace token consisting of precisely one space has a -special meaning. It is equivalent to the regular expression @/[ \t]+/: match -one or more tabs or spaces. +special meaning. It is equivalent to the regular expression @/[ ]+/: match +an extent of one or more spaces (but not tabs!) Thus, the query line "a b" (one space) matches texts like "a b", "a b", et cetera (arbitrary number of tabs and spaces between a and b). However "a b" |