-
Notifications
You must be signed in to change notification settings - Fork 204
Expand file tree
/
Copy pathNEWS
More file actions
3670 lines (2514 loc) · 133 KB
/
Copy pathNEWS
File metadata and controls
3670 lines (2514 loc) · 133 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
up to: 6ddd7dd0a18b88bb0df2a4ac64f1b2fc9f856f40
Snowball 3.2.0 (UNRELEASED)
===========================
Compiler changes
----------------
* Bug fixes:
- Fix detection of read errors for piped input which were effectively being
ignored. Bug introduced in 3.1.0.
- The coverage counts for among functions were one too low.
- Drop use of `restrict` in compiler source as it seems it isn't supported by
MSVC 2019 and earlier.
* Compiler command-line options:
- Change how -coverage reports among functions
If the string matched we used to always report a string match, and
additionally either "func-f" or "func-t" depending what the function
signalled.
Now we only report one thing - if the string matches but the function
signals f we report "func-f"; if the string matches and the function
signals t we reprot a string match.
This gives a report that seems clearer, and requires logging and
collating less data.
* Diagnostics:
- Report an "info" diagnostic when we don't localise a variable into a
recursive routine.
- Fix spurious extra output of variable name on a line by itself after
an "info" diagnostic saying we couldn't localise it.
- Routine "not reachable" warnings are now reported at the definition which
seems a better location than the declaration.
* Optimisations:
- Grow large sumbol strings exponentially, like we already do for byte
strings.
- Eliminate some unnecessary copying when growing strings during compilation.
* Code quality:
- Fix compiler memory leak when an unreachable routine contains an `among`.
* Other changes:
Generic code generation changes
-------------------------------
* Bug fixes:
* Optimisations:
- Improve variable localisation machinery, and fix some obscure cases
it was getting wrong. All variables which are only used in one function
after inlining in the shipped stemmers are now successfully localised.
- Extend inlining to all calls to routines which consists of a single
non-compound Snowball command. The target language code generated for
such commands should be comparable in size to the target language code
to call a routine, and inlining may enable other optimisations (variable
localisation and folding `not` into integer tests, for example).
- Inline any non-recursive routine which is only used once (where that use is
not as an among function). When there's only one use this should if
anything reduce the code size, and for target languages which don't
inline themselves it eliminates the overhead of a call. It may also enable
more variables to be localised.
- Normalise comparison with an integer literal so we merge equivalent among
actions such as this example from arabic.sbl:
[substring] among (
// [...]
'{a}{n}' '{w}{n}' '{y}{n}' ($(len > 5) delete) // present
'{t}{m}{a}' ($(len >= 6) delete)
)
* Code quality:
- The Snowball manual says:
For any string, the slice ends should be assumed to be unset until
they are set with the two commands `[` and `]`.
For many target languages, we actually initialise the slice ends
(either because the target language requires doing so, or because the
author of that generator thought it cleaner to do so, or perhaps just
followed an existing target language generator which did this).
In these situations, what the slice is set to does not matter since the
Snowball language doesn't define values, so we now simply set both the
slice start and end to 0 which is slightly simpler than the previous
setting of the slice end to the length of the string.
* Documentation:
* Other changes:
Ada
---
* Bug fixes:
- Generate valid Ada code for a Snowball routine/variable name which contains
`__`.
* Optimisations:
* Code quality:
- Use consistent case for `Debug()` helper function name.
* Documentation:
* Other changes:
C
-
* Bug fixes:
* Optimisations:
- We now statically check if errors from a command are possible, and if not
avoid generating extra code to propagate errors.
- Reduce the work done when creating a stemmer. We now memset() the whole
allocation to zero which also takes care of initialising non-localised
integer and boolean variables to 0. If there's only one string variable
we now skip pre-initialising it to NULL before we try to allocate it (this
preallocation is done to facilitate cleaning up if we fail after partially
allocating, but with only one string variable this can't happen). We could
skip this entirely if we know the implementation uses all-zero-bits in
memory representation for NULL pointers, which all modern platforms seem to
but the C standard doesn't guarantee. However none of the current stemmers
use more than one string variable, so we now always avoid the overhead in
practice.
- If an algorithm doesn't use strings then its close_env() only needs to call
`SN_delete_env()`. Both take the same parameters and return void, so we
now `#define` the close_env function to `SN_delete_env` in the header which
reduces code size and eliminates a small runtime overhead for closing a
stemmer. 35 of the 38 stemmers we currently ship benefit from this.
- Use a more sensible initial string size.
We were allocating only enough space for a single character. That
won't be enough for words being stemmed. It might be enough for
some string variables, but we actually allocate an extra character to
allow in-place zero termination as well as space for two ints to store
the size and capacity, so the minimum total allocation is actually
10 bytes when sizeof(symbol)==1 anyway.
- Use putc() in debug() helper to write single characters.
* Code quality:
- Limit generated internal C identifier lengths. C90 only guarantees 31
significant initial characters in an internal identifier. C99 raised this
to 63, and modern implementations are likely to have a high limit or not
impose one, but it is easy to instead generate a short identifier using a
number when the Snowball name is long.
- The code now compile cleanly with MSVC with warning level `-W3` (which is
apparently the default warning level when using the IDE).
* Documentation:
* Other changes:
C++
---
* Bug fixes:
- Generate valid C++ code for a Snowball routine/variable name which contains
`__`.
* Optimisations:
* Code quality:
- Fix location of comment which should be at the start of the generated C++
stemmer source but was actually after all the generated header includes.
* Documentation:
- Remove -c from C++ stemwords help. We don't support specifying the
character set in the C++ version.
* Other changes:
- Support generating wide-character stemmers which take and return
std::wstring and work in wchar_t. To use:
make SNOWBALL_WIDE=1 clean
make SNOWBALL_WIDE=1 cxx
make SNOWBALL_WIDE=1 check_cxx
See #267
C/C++
-----
* Bug fixes:
* Optimisations:
- Snowball `among` is now implemented as a state-machine. This gives a
better theoretical performance (the new implementation is O(1) in the
number of cases instead of O(log(n)), and is also faster for the current
stemmers in benchmarks.
The generated among tables are smaller than those for the existing
implementation.
The generated among tables are now just arrays of unsigned short,
so require no dynamic load-time relocations if Snowball-generated C/C++
code is included in a shared library.
Among gating functions are now called by generated code, which
means the C/C++ compiler can inline them and optimise better.
The Snowball generated code for non-widechars now needs to know the
endianness of the platform it is being built on. The runtime code
includes checks that should automatically detect this for GCC, clang and
MSVC. If the code can't determine the endianness it will #error at
C/C++ compile-time. In this case, if your platform has the POSIX
endian.h header then you can define HAVE_ENDIAN_H. Otherwise you'll
need to define either SNOWBALL_BIGENDIAN or SNOWBALL_LITTLEENDIAN.
- We now merge Snowball string literals which are identical or which are the
prefix of another literal. Partly addresses #262
* Code quality:
* Documentation:
* Other changes:
- Flush stdout after each debug() call. The debug command (`?`) is not a
performance sensitive, and it can be confusing if its output is delayed by
buffering.
C#
--
* Bug fixes:
* Optimisations:
* Code quality:
* Documentation:
* Other changes:
- Support Snowball debug command (`?`).
Dart
----
* Bug fixes:
* Optimisations:
* Code quality:
* Documentation:
* Other changes:
- Support Snowball debug command (`?`).
Go
--
* Bug fixes:
* Optimisations:
* Code quality:
* Documentation:
* Other changes:
- Properly implement Snowball debug command (`?`).
Java
----
* Bug fixes:
* Optimisations:
* Code quality:
* Documentation:
* Other changes:
- Support Snowball debug command (`?`).
Javascript
----------
* Bug fixes:
* Optimisations:
* Code quality:
- Improve JSDoc TypeScript annotations.
JS: Fix typescript annotations in generated code
We need to pass `--check-js` to `deno check` to actually check .js
files, which we now do (so we'll spot regressions).
Closes #300, reported by alex-kinokon.
stemwords.js: Improve typescript annotations
Fix incorrect/missing annotations and adjust code so that type checking
passes.
Partially based on changes from alex-kinokon in #300.
- Replace most @ts-expect-error annotations with JSDoc cast annotations. A
cast is better as it is more targetted, and also more self-documenting.
* Documentation:
* Other changes:
- Support Snowball debug command (`?`).
Pascal
------
* Bug fixes:
* Optimisations:
* Code quality:
* Documentation:
* Other changes:
- Support Snowball debug command (`?`).
PHP
---
* Bug fixes:
* Optimisations:
* Code quality:
- Emit minimum length Unicode escapes.
* Documentation:
* Other changes:
- Support Snowball debug command (`?`).
Python
------
* Bug fixes:
* Optimisations:
* Code quality:
* Documentation:
- libstemmer_python_README: Fix typo.
* Other changes:
- Include classifier for pt_BR since we document that our Portuguese stemmer
"aims to work with both European Portuguese and Brazilian Portuguese".
- Support Snowball debug command (`?`).
Rust
----
* Bug fixes:
* Optimisations:
* Code quality:
- Emit minimum length Unicode escapes.
* Documentation:
* Other changes:
- Support Snowball debug command (`?`).
Zig
---
* Bug fixes:
* Optimisations:
* Code quality:
* Documentation:
* Other changes:
- Properly implement Snowball debug command (`?`).
New Code Generators
-------------------
Snowball Language Changes
-------------------------
* Handle `<-` in an arithmetic expression more gracefully. In this context,
the symbol `<-` isn't meaningful, so we now interpret it as `<` followed by
`-`. Examples such as `$x<-1` now parse the same way as `$x < -1` instead
of giving a syntax error.
New stemming algorithms
-----------------------
* Add stemmer for Early Modern English
This is a variant of the English stemmer which was previously only
described on the website, but seems sufficiently useful to include in
the distribution.
A few additional rules have been added:
+ Remove th'-, t'-
+ Replace o'vr- with over-
+ Replace -e'er with -ever
+ Remove -edst (suggested by E. Timothy Uy in 2012!)
+ Remove -'d, -'dly, -'dst, -'st, -'t
+ Replace -'n, -'nd with -en
+ Replace -'r, -'rous with -er
+ Replace -'ri with -eri
+ Replace -'li with -ili
+ Replace -lie with -ly
earlymodernenglish: Normalise æ and œ and long-s
These ligatures appear in texts from this era significantly more than
in modern English. `œ` is not in iso-8859-1 so drop that.
Fixes #261
earlymodernenglish: Handle more prefixes/suffixes
Behavioural changes to existing algorithms
------------------------------------------
* Arabic:
* Armenian:
* Basque:
* Catalan:
* Czech:
* Danish:
* Dutch:
* English:
* Early Modern English:
* Esperanto:
* Estonian:
* Finnish:
* French:
- Remove z'- which is a colloquial, nonstandard elision (for "vous"), and
also a prefix used to represent a nonstandard liaison within a plural noun
phrase, or eye dialect for a standard liaison.
https://en.wiktionary.org/wiki/z%27#French
* German:
* Greek:
* Hindi:
* Hungarian:
* Indonesian:
* Irish:
* Italian:
* Lithuanian:
* Nepali:
* Norwegian:
* Persian:
* Polish:
* Romanian:
* Russian:
* Serbian:
* Sesotho:
* Spanish:
* Swedish:
* Tamil:
* Turkish:
* Yiddish:
Optimisations to existing algorithms
------------------------------------
* Arabic:
* Armenian:
* Basque:
* Catalan:
* Czech:
* Danish:
* Dutch:
* English:
* Early Modern English:
* Esperanto:
* Estonian:
* Finnish:
* French:
* German:
* Greek:
* Hindi:
* Hungarian:
* Indonesian:
* Irish:
* Italian:
* Lithuanian:
* Nepali:
* Norwegian:
* Persian:
* Polish:
* Romanian:
* Russian:
* Serbian:
* Sesotho:
* Spanish:
* Swedish:
* Tamil:
* Turkish:
* Yiddish:
Code clarity improvements to existing algorithms
------------------------------------------------
* Arabic:
* Armenian:
* Basque:
* Catalan:
* Czech:
* Danish:
* Dutch:
* English:
* Early Modern English:
* Esperanto:
* Estonian:
* Finnish:
* French:
* German:
* Greek:
* Hindi:
* Hungarian:
* Indonesian:
* Irish:
* Italian:
* Lithuanian:
* Nepali:
* Norwegian:
* Persian:
* Polish:
* Romanian:
* Russian:
* Serbian:
* Sesotho:
* Spanish:
* Swedish:
* Tamil:
* Turkish:
* Yiddish:
Build system
------------
* `make clean_runtime_tests` now first runs `make clean` for smoother switching
to runtime test mode.
* The build system now supports MSVC better. If CC matches `*cl` then it uses
Microsoft's non-standard `-Fo:` and `-Fe:` instead of `-o`, which avoids lots
of deprecation warnings. Extensions `.o` and `.a` are still used (which
triggers warnings from MSVC). The command `ar` is used to create a static
library so you'll also need the mingw toolchain installed for that.
* C++: Add missing dependency for runtime code.
* C/C++: Rename utilities.{c,cxx} to snowball_runtime.{c,cxx} to matches the
header snowball_runtime.h which contains the prototypes for the external
functions here.
* modules.txt: Fix alphabetical ordering of entries.
libstemmer
----------
* Fix incorrect ISO 639-2/B code "pers" for Persian. This should be "per"
(these codes are all 3 letters long).
* Reduce load time relocations in libstemmer by using a suitably sized char[]
array in struct stemmer_encoding instead of const char*.
* Eliminate sentinel NULL entry at end of encodings array. We know the length
of the encodings list at compile time, so use that to limit iteration.
Testsuite
---------
* Expand runtime test coverage. Partly addresses #301.
* Add runtime test coverage for `?` (debug command).
* Fix compilation errors in stemtest.c Introduced by v3.1.0.
Currently stemtest doesn't get built or run by default, which is how this
slipped in.
Fixes #295, reported by Duncan Bellamy.
We stopped compiling or running stemtest in v3.1.0.
We can't actually run stemtest when runtime tests are enabled (it fails
with "language `en' not available for stemming") but I meant to
conditionalise it rather than just stop running it at all.
Now `stemtest` is run on `make check` unless the tree has been switched
to run runtime tests. We now handle `compilertest` in the same way,
since that is redundant to run when running runtime tests.
Addresses the underlying reason why #295 wasn't detected right away,
as a recurrence of #295 would now fail CI.
Documentation
-------------
* NEWS: Removed unused subheading in old entry.
Snowball 3.1.1 (2026-06-03)
===========================
Compiler changes
----------------
* Bug fixes:
+ Fix a segmentation fault after reporting an error for a string command
not followed by a string variable name or string literal. Bug introduced
in 3.1.0. Patch from Jerry James (#287).
* Compiler command-line options:
+ Emit an error for `-o -`/`-output -`. Output to stdout is not supported
because we need to generate multiple files for some target languages.
We were interpreting `-` as a base filename to append extensions to, so
we'd create `-.c` and `-.h` for C, but creating filenames that start with
`-` seems unhelpful.
Generic code generation changes
-------------------------------
* Bug fixes:
+ Variable localisation was failing to check the expression on the RHS of an
integer test for uses of a variable, so could incorrectly localise an
integer variable whose value should have persisted between calls to a
function. This bug won't realistically manifest in real world Snowball
code.
* Optimisations:
+ Inline some routines which are only used once. This is done for routines
consisting of a single non-compound command (or cases such as `not
<boolean>` and `goto <grouping>` which we internally synthesise a
non-compound command for). Localisation of variables happens after
inlining, so variables can now be localised in more cases.
+ `test next` and `not next` are both now simplified to a comparison between
`cursor` and `limit` (like `not atlimit` and `atlimit`). We already
normalise `hop 1` to `next`, so `test hop 1` and `not hop 1` are also
simplified in this way.
+ Simplify `not` applied to an integer test by removing the `not` and
flipping the sense of the test (e.g. `not $(x > y)` becomes `$(x <= y)`)
which results in simpler generated code. More usefully in real world code,
this also results in simpler generated code for `not atlimit` (since
`atlimit` is converted `$(cursor >= limit)` or `$(cursor <= limit)`
(depending on the current direction).
+ Canonicalise `delete` to `<-''`. 3.1.0 added a canonicalisation of `<-''`
to `delete`, but if we instead make `<-''` the canonical representation
then the generators can easily handle an empty string here specially (and
if they don't then the results are still correct), we don't have to handle
the delete token after tokenisation, and the optimisation of among when
all actions are `<-` plus a literal string can also fire when some actions
are `delete`. (This case occurs in the stemmers for arabic, czech,
estonian, hungarian, irish, italian, polish, porter and tamil.)
C++
---
* Code quality:
+ C++ runtime support is now fully hooked up and can be tested using
`make check_cxx`.
+ Don't use `extern "C"` for functions which can throw because MSVC seems to
treat such functions as if they were marked `noexcept`.
Javascript
----------
* Code quality:
+ Fix formatting of code generated by `among` of `<-` optimisation where we
were emitting a literal `+` rather than increasing the margin size. The
`+` was actually harmless in practice, but the rest of the file would be
misindented.
Python
------
* Other changes:
+ Skip classifier for Sesotho which isn't yet in the official list of
trove classifiers. Patch from Dmitry Shachnev (#289).
+ Add classifier to indicate support for Python 3.14.
Build system
------------
* The `generate` target added in 3.1.0 now overrides `FPC` and `MCS` to do
nothing, to avoid compiling Pascal and C# code.
* Provide a way to run tests under valgrind:
make RUN_STEMWORDS='valgrind ./stemwords' check
Testsuite
---------
* compilertest: Require syntax tests have stderr output - we are testing errors
here, so we should really be checking the errors we get are the ones we
expect. We expect the compiler to fail, so testing stderr means we will
catch unrelated failures. This provides a regression test for #287.
Documentation
-------------
* NEWS: Fix formatting/wording of a few existing entries.
* README: List C++ as target language.
Snowball 3.1.0 (2026-05-22)
===========================
Compiler changes
----------------
* Bug fixes:
+ Fix segmentation fault if -syntax is used on a program with no code.
+ Fix segmentation fault on some assignment syntax errors.
+ Fix bug introduced in v3.0.0 with conversion of `among` starter. If there
were any commands after the among in the same command list then the among
itself would get lost. Not triggered by any current algorithms.
+ Clear name field when removing dead assignments. This is visible in the
syntax tree shown when command line option -syntax is used, but probably
doesn't affect anything otherwise.
* Compiler command-line options:
+ Using `-` for the Snowball source file is now interpreted as stdin.
+ Improve comments generated by `-comments` to show more details of the
corresponding Snowball code (e.g. variable names, arithmetic expressions,
and literal strings).
+ Add `-coverage` option which enables a code coverage feature. So far this
tracks which among strings and functions are exercised, and which grouping
characters are exercised. !
+ Support `-eprefix` for all target languages. This is easy to do and
provides a way to deal with externals which collide with keywords in the
target language. Our build system now uses `-eprefix _` for Python to make
the `stem` external non-public (it is called by BaseStemmer method
`stemWord()`) and we no longer hard-code prefixing Python externals with
`_`.
+ Describe more options in `--help` output.
+ Sort target language options in `--help` output.
+ The `-o` option is now optional. If not specified we now write output(s)
to the same filename as the first source, but with a different extension
(e.g. path/to/english.sbl -> path/to/english.c and path/to/english.h).
+ The `-o` option can now optionally include an extension so you can now
write `-c++ -o path/to/foo.cxx` instead of `-c++ -o path/to/foo`, which can
be more convenient (e.g. in `make` rules) and also provides an easy way to
specify an alternative extension (for example, `.cxx`, `.cc` and `.cpp` are
all extensions commonly used for C++ source code).
+ Reject `-vprefix` option for target languages which don't support it (it is
currently only implemented for C/C++).
* Diagnostics:
+ Clean up and improve error reporting.
+ Improve line numbers reported for some errors and warnings by using the
line number of an appropriate token rather than the current line number
of the tokeniser (which is often the line after the command being warned
about).
+ Improve recovery after various errors, trying to resynchronise based on
what's more likely, and eliminating some additional irrelevant errors
(including reporting the exact same error twice in some situations).
+ Emit warnings for uses of legacy Snowball language features.
+ The Snowball manual describes `integers (x)` as a declaration of `x` so we
now warn:
integer 'x' declared but not used
rather than:
integer 'x' defined but not used
+ 3.0.0 added a warning if the body of a `repeat` or `atleast` loop always
signals `t` (meaning it will loop forever which is very undesirable for a
stemming algorithm) or always signals `f` (meaning it will never loop,
which seems unlikely to be what was intended). This warning was added to
the C generator, but has been moved to generic code so it is now issued
regardless of the current target language.
+ Improve the wording of the warning if the body of a `repeat` or `atleast`
loop always signals 't' to explicitly say this means the loop is infinite.
+ Improve warning message for unreachable code after `not`.
+ `$x = x + 1` cleared the initialised status of x (rather than just not
setting it) which could lead to bogus warnings that `x` is never
initialised.
+ The compiler no longer exits immediately after reporting a division by zero
error in the Snowball code.
+ We now report a division by zero error for `$x /= 0` (this was meant to be
already implemented but wasn't working due to a code typo).
+ More consistent wording of "is a no-op" warnings.
+ Warn that `insert ''` and `attach ''` are no-ops (and don't generate code
for them).
+ Warn if a string used to define a grouping repeats characters. There's no
reason to do this, so it seems likely to be a typo.
+ Avoid sometimes reporting "-1 blocks unfreed".
* Optimisations:
+ Speed up processing larger Snowball programs by growing large string
buffers exponentially to avoid a huge number of reallocations. For
example, this reduced the time to compile serbian.sbl to C by about 80%!
+ Optimise reading of input file when it is seekable (which it is in typical
usage). Non-seekable input files are still supported.
+ Optimise writing integers when generating code. 72% of integers we write
are 0 to 9 and these are now written as a character. Other values are now
handled without a temporary buffer, avoiding a copy. This reduced the time
to compile serbian.sbl to C by about 8%, for example.
+ Optimise comparing among actions to find and merge equivalent actions.
The comparison function used for this was carefully returning a full order,
but actually we only need to know if the actions are equivalent or not
which can be tested more efficiently. For example, this reduced the time
to compile serbian.sbl to C by about 2%.
+ We now precompute the possible signals from each command which means this
is now done exactly once per command, whereas previously we could end up
doing it many times for some commands in some cases. The only functional
change should we no longer make a pessimistic assumption if the function
call depth reaches 100. This is cleaner but is unlikely to make a
difference for any real-world Snowball programs.
+ Handle possible_signals for string-$ which just passes on signals from its
subcommand. This doesn't affect code generation for any algorithms we
currently ship.
+ We now only generate function bodies to a temporary buffer for target
languages where we need to. This makes the code a bit clearer and reduces
the amount of copying of data so will make the Snowball compiler a little
faster. This change produces identical output for all current algorithms.