mittens 0.3.4 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/LICENSE.txt +1 -1
- data/README.md +1 -1
- data/lib/mittens/version.rb +1 -1
- data/vendor/snowball/.github/workflows/ci.yml +43 -3
- data/vendor/snowball/.github/workflows/coverage.yml +8 -5
- data/vendor/snowball/GNUmakefile +46 -16
- data/vendor/snowball/NEWS +437 -13
- data/vendor/snowball/README.rst +4 -4
- data/vendor/snowball/algorithms/earlymodernenglish.sbl +301 -0
- data/vendor/snowball/algorithms/french.sbl +1 -1
- data/vendor/snowball/algorithms/ukrainian.sbl +1251 -0
- data/vendor/snowball/compiler/analyser.c +460 -156
- data/vendor/snowball/compiler/driver.c +41 -36
- data/vendor/snowball/compiler/generator.c +24 -1
- data/vendor/snowball/compiler/generator_ada.c +46 -45
- data/vendor/snowball/compiler/generator_c.c +1094 -187
- data/vendor/snowball/compiler/generator_csharp.c +34 -11
- data/vendor/snowball/compiler/generator_dart.c +39 -11
- data/vendor/snowball/compiler/generator_go.c +6 -6
- data/vendor/snowball/compiler/generator_java.c +29 -8
- data/vendor/snowball/compiler/generator_js.c +65 -38
- data/vendor/snowball/compiler/generator_pascal.c +69 -26
- data/vendor/snowball/compiler/generator_php.c +33 -12
- data/vendor/snowball/compiler/generator_python.c +23 -4
- data/vendor/snowball/compiler/generator_rust.c +37 -13
- data/vendor/snowball/compiler/generator_zig.c +6 -6
- data/vendor/snowball/compiler/header.h +85 -14
- data/vendor/snowball/compiler/space.c +67 -38
- data/vendor/snowball/compiler/tokeniser.c +28 -16
- data/vendor/snowball/csharp/Snowball/AssemblyInfo.cs +2 -2
- data/vendor/snowball/csharp/Snowball/Stemmer.cs +1 -4
- data/vendor/snowball/cxx/generate_algorithms.pl +5 -4
- data/vendor/snowball/cxx/{utilities.cxx → snowball_runtime.cxx} +1 -1
- data/vendor/snowball/cxx/stemmer.h +4 -0
- data/vendor/snowball/cxx/stemwords.cxx +36 -6
- data/vendor/snowball/dart/lib/src/snowball.dart +2 -2
- data/vendor/snowball/dart/pubspec.yaml +1 -1
- data/vendor/snowball/doc/libstemmer_c_README +3 -0
- data/vendor/snowball/doc/libstemmer_php_README +1 -1
- data/vendor/snowball/doc/libstemmer_python_README +8 -6
- data/vendor/snowball/examples/stemwords.c +4 -14
- data/vendor/snowball/go/env.go +16 -4
- data/vendor/snowball/include/libstemmer.h +0 -3
- data/vendor/snowball/java/org/tartarus/snowball/SnowballProgram.java +4 -4
- data/vendor/snowball/javascript/base-stemmer.js +27 -40
- data/vendor/snowball/javascript/stemwords.js +34 -10
- data/vendor/snowball/libstemmer/libstemmer_c.in +5 -5
- data/vendor/snowball/libstemmer/mkmodules.pl +5 -3
- data/vendor/snowball/libstemmer/modules.txt +4 -2
- data/vendor/snowball/pascal/SnowballProgram.pas +2 -2
- data/vendor/snowball/php/base-stemmer.php +2 -2
- data/vendor/snowball/python/setup.py +5 -1
- data/vendor/snowball/python/snowballstemmer/basestemmer.py +1 -2
- data/vendor/snowball/runtime/api.c +14 -3
- data/vendor/snowball/runtime/api.h +13 -9
- data/vendor/snowball/runtime/{utilities.c → snowball_runtime.c} +115 -181
- data/vendor/snowball/runtime/snowball_runtime.h +35 -24
- data/vendor/snowball/rust/src/snowball/snowball_env.rs +1 -1
- data/vendor/snowball/tests/compilertest +3 -3
- data/vendor/snowball/tests/runtime/among.sbl +96 -2
- data/vendor/snowball/tests/runtime/attachinsert.sbl +4 -0
- data/vendor/snowball/tests/runtime/debug.out +7 -0
- data/vendor/snowball/tests/runtime/debug.sbl +9 -0
- data/vendor/snowball/tests/runtime/integertests.sbl +22 -0
- data/vendor/snowball/tests/runtime/marklimit.sbl +30 -0
- data/vendor/snowball/tests/runtime/naming.sbl +20 -0
- data/vendor/snowball/tests/runtime/reverse.sbl +11 -0
- data/vendor/snowball/tests/stemtest.c +2 -5
- data/vendor/snowball/tests/syntax/aeslicefrom.sbl +7 -0
- data/vendor/snowball/tests/syntax/canon.sbl +14 -0
- data/vendor/snowball/tests/syntax/canon.syntax +36 -0
- data/vendor/snowball/tests/syntax/inline.syntax +4 -4
- data/vendor/snowball/tests/syntax/localvar.sbl +38 -0
- data/vendor/snowball/tests/syntax/localvar.stderr +3 -0
- data/vendor/snowball/tests/syntax/localvar.syntax +76 -0
- data/vendor/snowball/tests/syntax/unused.sbl +5 -1
- data/vendor/snowball/tests/syntax/unused.stderr +3 -1
- data/vendor/snowball/zig/env.zig +24 -4
- metadata +14 -4
|
@@ -37,14 +37,14 @@ for t ; do
|
|
|
37
37
|
if $SNOWBALL -syntax "$t" 2> tmp.stderr > tmp.syntax ; then
|
|
38
38
|
if [ -f "$b.stderr" ] ; then
|
|
39
39
|
if ! diff "$b.stderr" tmp.stderr ; then
|
|
40
|
-
|
|
40
|
+
f="stderr output not as expected"
|
|
41
41
|
fi
|
|
42
42
|
fi
|
|
43
43
|
if [ -z "$f" ] && [ -f "$b.syntax" ] ; then
|
|
44
44
|
if ! diff "$b.syntax" tmp.syntax ; then
|
|
45
|
-
|
|
45
|
+
f="syntax tree not as expected"
|
|
46
46
|
else
|
|
47
|
-
|
|
47
|
+
rm tmp.syntax
|
|
48
48
|
fi
|
|
49
49
|
fi
|
|
50
50
|
else
|
|
@@ -2,18 +2,112 @@
|
|
|
2
2
|
|
|
3
3
|
externals (stem)
|
|
4
4
|
|
|
5
|
-
routines (gate)
|
|
5
|
+
routines (gate bgate bgate2 not_atlimit)
|
|
6
6
|
|
|
7
7
|
stringescapes {}
|
|
8
8
|
|
|
9
9
|
define gate as 'q'
|
|
10
10
|
|
|
11
|
+
backwardmode (
|
|
12
|
+
define bgate as 'q'
|
|
13
|
+
define bgate2 as test hop 4
|
|
14
|
+
define not_atlimit as not atlimit
|
|
15
|
+
)
|
|
16
|
+
|
|
11
17
|
define stem as (
|
|
12
|
-
|
|
18
|
+
not (
|
|
13
19
|
among (
|
|
14
20
|
'x' ()
|
|
15
21
|
'' gate ()
|
|
16
22
|
)
|
|
17
23
|
='gated default among case did not fail as expected'
|
|
18
24
|
)
|
|
25
|
+
|
|
26
|
+
// Regression test for bug during development of new C among code.
|
|
27
|
+
not (
|
|
28
|
+
backwards among (
|
|
29
|
+
'a' bgate
|
|
30
|
+
'bc' bgate
|
|
31
|
+
)
|
|
32
|
+
='gated among did not fail as expected'
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
// Regression test for bug during development of new C among code.
|
|
36
|
+
test (
|
|
37
|
+
='jalovc'
|
|
38
|
+
backwards (
|
|
39
|
+
[substring] among (
|
|
40
|
+
// -c -> -k
|
|
41
|
+
'c'
|
|
42
|
+
(<- 'k')
|
|
43
|
+
'nc'
|
|
44
|
+
'avc'
|
|
45
|
+
'ovc'
|
|
46
|
+
()
|
|
47
|
+
'xnc'
|
|
48
|
+
(<- 'xnk')
|
|
49
|
+
)
|
|
50
|
+
)
|
|
51
|
+
('jalovc' atlimit) or fail='empty among action mishandled'
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
='hum'
|
|
55
|
+
// Regression test for bug during development of C new among code.
|
|
56
|
+
// Generated C code triggered "c0 set but not used" warning.
|
|
57
|
+
not backwards (
|
|
58
|
+
[substring] among (
|
|
59
|
+
'am'
|
|
60
|
+
(delete)
|
|
61
|
+
'em' bgate 'iem' bgate
|
|
62
|
+
(delete)
|
|
63
|
+
)
|
|
64
|
+
='gated among with top-level segment did not fail as expected'
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
// Regression test for bug during development of C new among code.
|
|
68
|
+
='aaronem'
|
|
69
|
+
backwards (
|
|
70
|
+
[substring] among (
|
|
71
|
+
'axxem' 'am'
|
|
72
|
+
'em' not_atlimit 'iem' not_atlimit
|
|
73
|
+
(delete)
|
|
74
|
+
)
|
|
75
|
+
) or fail='gated among did not match aaronem'
|
|
76
|
+
test ('aaron' atlimit) or fail='gated among did not stem aaronem'
|
|
77
|
+
|
|
78
|
+
// Regression test for bug during development of C new among code.
|
|
79
|
+
='aaronem'
|
|
80
|
+
backwards (
|
|
81
|
+
[substring] among (
|
|
82
|
+
'axxem' 'am'
|
|
83
|
+
'em' not_atlimit 'iem' not_atlimit
|
|
84
|
+
)
|
|
85
|
+
delete
|
|
86
|
+
) or fail='gated among did not match aaronem (2)'
|
|
87
|
+
test ('aaron' atlimit) or fail='gated among did not stem aaronem (2)'
|
|
88
|
+
|
|
89
|
+
// Regression test for bug during development of C new among code.
|
|
90
|
+
// This triggered malloc heap corruption during compilation.
|
|
91
|
+
='miami'
|
|
92
|
+
backwards (
|
|
93
|
+
[substring] among (
|
|
94
|
+
'i' bgate2
|
|
95
|
+
'ami' bgate2 'iami' bgate2
|
|
96
|
+
(delete)
|
|
97
|
+
)
|
|
98
|
+
) or fail='gated among did not match origami'
|
|
99
|
+
test ('miam' atlimit) or fail='among chained functions not handled'
|
|
100
|
+
|
|
101
|
+
// Regression test for bug in C new among code on big-endian platforms.
|
|
102
|
+
='youthfulness'
|
|
103
|
+
// Failed to match big-endian platforms.
|
|
104
|
+
backwards (
|
|
105
|
+
[substring] among (
|
|
106
|
+
'fulness' (<-'ful')
|
|
107
|
+
'ousness' (<-'ous')
|
|
108
|
+
)
|
|
109
|
+
) or fail='big-endian among regression test failed to match'
|
|
110
|
+
test ('youthful' atlimit) or fail='big-endian among regression test output wrong'
|
|
111
|
+
|
|
112
|
+
='ok'
|
|
19
113
|
)
|
|
@@ -11,6 +11,7 @@ define stem as (
|
|
|
11
11
|
next
|
|
12
12
|
)
|
|
13
13
|
$(cursor == 0) or fail='do failed to restore cursor after forwards attach'
|
|
14
|
+
test ('ab-cd' atlimit) or fail='attach failed to update correctly'
|
|
14
15
|
|
|
15
16
|
='abcd'
|
|
16
17
|
do (
|
|
@@ -20,6 +21,7 @@ define stem as (
|
|
|
20
21
|
next
|
|
21
22
|
)
|
|
22
23
|
$(cursor == 0) or fail='do failed to restore cursor after forwards insert'
|
|
24
|
+
test ('ab-cd' atlimit) or fail='insert failed to update correctly'
|
|
23
25
|
|
|
24
26
|
='abcd'
|
|
25
27
|
backwards (
|
|
@@ -31,6 +33,7 @@ define stem as (
|
|
|
31
33
|
)
|
|
32
34
|
$(cursor == size) or fail='do failed to restore cursor after backwards attach'
|
|
33
35
|
)
|
|
36
|
+
test ('ab-cd' atlimit) or fail='attach failed to update correctly'
|
|
34
37
|
|
|
35
38
|
='abcd'
|
|
36
39
|
backwards (
|
|
@@ -42,6 +45,7 @@ define stem as (
|
|
|
42
45
|
)
|
|
43
46
|
$(cursor == size) or fail='do failed to restore cursor after backwards insert'
|
|
44
47
|
)
|
|
48
|
+
test ('ab-cd' atlimit) or fail='insert failed to update correctly'
|
|
45
49
|
|
|
46
50
|
='ok'
|
|
47
51
|
)
|
|
@@ -2,9 +2,15 @@
|
|
|
2
2
|
externals (stem)
|
|
3
3
|
routines (var_local_bug var_local_bug_)
|
|
4
4
|
integers (x y var_local_bug_a var_local_bug_b)
|
|
5
|
+
routines (recursive_var_local_bug recursive_var_local_bug_)
|
|
6
|
+
integers (recursive_x)
|
|
7
|
+
booleans (reentered)
|
|
5
8
|
define stem as (
|
|
6
9
|
var_local_bug
|
|
7
10
|
|
|
11
|
+
unset reentered
|
|
12
|
+
test recursive_var_local_bug or fail='variable incorrectly localised into recursive routine'
|
|
13
|
+
|
|
8
14
|
$x = len
|
|
9
15
|
|
|
10
16
|
$x == 2 or fail='== failed (old style)'
|
|
@@ -58,3 +64,19 @@ define var_local_bug_ as (
|
|
|
58
64
|
)
|
|
59
65
|
$(7 == var_local_bug_b) or fail='var_local_bug_b was incorrectly localised'
|
|
60
66
|
)
|
|
67
|
+
|
|
68
|
+
define recursive_var_local_bug as (
|
|
69
|
+
$recursive_x = 0
|
|
70
|
+
reentered or (
|
|
71
|
+
set reentered
|
|
72
|
+
$recursive_x = 1
|
|
73
|
+
recursive_var_local_bug_
|
|
74
|
+
// `recursive_x` should get set back to 0 by the recursive call, but if it
|
|
75
|
+
// gets localised it will still have value 1.
|
|
76
|
+
$(recursive_x == 0)
|
|
77
|
+
)
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
define recursive_var_local_bug_ as (
|
|
81
|
+
recursive_var_local_bug
|
|
82
|
+
)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Test `setmark`/`tomark`/`atmark`/`tolimit`/`atlimit`.
|
|
2
|
+
|
|
3
|
+
externals (stem)
|
|
4
|
+
|
|
5
|
+
integers (x)
|
|
6
|
+
|
|
7
|
+
strings (s)
|
|
8
|
+
|
|
9
|
+
define stem as (
|
|
10
|
+
not atlimit or fail='atlimit true initially'
|
|
11
|
+
test (tolimit atlimit) or fail='not atlimit after tolimit'
|
|
12
|
+
test (tolimit atmark limit) or fail='not atmark limit after tolimit'
|
|
13
|
+
|
|
14
|
+
atmark 0 or fail='not at atmark 0 at start'
|
|
15
|
+
not atmark 1 or fail='atmark 1 at start'
|
|
16
|
+
|
|
17
|
+
setmark x
|
|
18
|
+
$(x == 0) or fail='setmark at start not 0'
|
|
19
|
+
atmark x or fail='not at atmark x after setmark x'
|
|
20
|
+
|
|
21
|
+
next
|
|
22
|
+
setmark x
|
|
23
|
+
$(x != 0) or fail='setmark after next still 0'
|
|
24
|
+
atmark x or fail='not at atmark x after setmark x (2)'
|
|
25
|
+
not atlimit or fail='atlimit true after next'
|
|
26
|
+
|
|
27
|
+
tolimit
|
|
28
|
+
setmark x
|
|
29
|
+
$(x == limit) or fail='setmark not limit after tolimit'
|
|
30
|
+
)
|
|
@@ -1,20 +1,40 @@
|
|
|
1
1
|
// Test target language naming problem cases.
|
|
2
2
|
// Test handling of names which only differ by case (for e.g. Pascal).
|
|
3
3
|
strings (notable NoTable NOTABLE)
|
|
4
|
+
|
|
4
5
|
// Test handling of name ending `_`.
|
|
5
6
|
// (Regression test for bug in Ada generator fixed in 3.1.0.)
|
|
6
7
|
integers (x_ x_e x_ee)
|
|
8
|
+
|
|
9
|
+
// Test names which would exceed the C90 guaranteed 31 significant initial
|
|
10
|
+
// characters for internal identifiers. The generator adds a 2 character
|
|
11
|
+
// prefix, so we need 30 here. We can't easily check that a short id is
|
|
12
|
+
// actually generated, but we can at least exercise this case to try to catch
|
|
13
|
+
// bugs.
|
|
14
|
+
integers (
|
|
15
|
+
abcdefghijklmnopqrstuvwxyz0123
|
|
16
|
+
abcdefghijklmnopqrstuvwxyz0124
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
// Test a name with a double underscore (reserved in C++):
|
|
20
|
+
strings (double__underscore)
|
|
21
|
+
|
|
7
22
|
externals (stem)
|
|
8
23
|
define stem as (
|
|
9
24
|
try (
|
|
10
25
|
[next] -> notable
|
|
11
26
|
next] -> NoTable
|
|
12
27
|
next] -> NOTABLE
|
|
28
|
+
(try next]) -> double__underscore
|
|
13
29
|
$x_ = lenof notable + lenof NoTable + lenof NOTABLE
|
|
30
|
+
$x_ += lenof double__underscore
|
|
14
31
|
$x_ee = 2
|
|
15
32
|
$x_e = len
|
|
16
33
|
$(x_ + x_ee < x_e)
|
|
17
34
|
delete
|
|
18
35
|
)
|
|
36
|
+
$abcdefghijklmnopqrstuvwxyz0123 = len
|
|
37
|
+
$abcdefghijklmnopqrstuvwxyz0124 = size
|
|
38
|
+
$(abcdefghijklmnopqrstuvwxyz0123 <= abcdefghijklmnopqrstuvwxyz0124)
|
|
19
39
|
[tolimit] <- 'ok'
|
|
20
40
|
)
|
|
@@ -50,15 +50,12 @@ static const struct testcase {
|
|
|
50
50
|
"a" EMOJI_FACE_THROWING_A_KISS "ing",
|
|
51
51
|
"a" EMOJI_FACE_THROWING_A_KISS "e" },
|
|
52
52
|
{ "en", 0, U_40079 "wing", 0 },
|
|
53
|
-
"a" EMOJI_FACE_THROWING_A_KISS "e" },
|
|
54
|
-
{ "en", 0, U_40079 "wing", 0 },
|
|
55
53
|
|
|
56
54
|
// The Persian stemmer removes ASCII space inside a word. It shouldn't
|
|
57
55
|
// appear there if our tokenisation recommendations are followed, and
|
|
58
56
|
// it seems more appropriate to test here rather than adding instances
|
|
59
57
|
// to persian/voc.txt.
|
|
60
|
-
{ "fa", 0, U_0622 U_062B " " U_0627 U_0631,
|
|
61
|
-
U_0622 U_062B U_0627 U_0631, 0 },
|
|
58
|
+
{ "fa", 0, U_0622 U_062B " " U_0627 U_0631, U_0622 U_062B U_0627 U_0631 },
|
|
62
59
|
|
|
63
60
|
// The Finnish stemmer used to damage numbers ending with two or more of
|
|
64
61
|
// the same digit. Regression test, applied to all stemmers.
|
|
@@ -100,7 +97,7 @@ run_testcase(const char * language, const struct testcase *test)
|
|
|
100
97
|
exit(1);
|
|
101
98
|
}
|
|
102
99
|
}
|
|
103
|
-
stemmed = sb_stemmer_stem(stemmer, (const unsigned char*)input, strlen(input));
|
|
100
|
+
stemmed = sb_stemmer_stem(stemmer, (const unsigned char*)input, (int)strlen(input));
|
|
104
101
|
if (stemmed == NULL) {
|
|
105
102
|
fprintf(stderr, "Out of memory");
|
|
106
103
|
exit(1);
|
|
@@ -51,6 +51,42 @@ define stem
|
|
|
51
51
|
(
|
|
52
52
|
<- ''
|
|
53
53
|
next
|
|
54
|
+
>=
|
|
55
|
+
# number 1
|
|
56
|
+
name x
|
|
57
|
+
>=
|
|
58
|
+
# number 1
|
|
59
|
+
name x
|
|
60
|
+
>=
|
|
61
|
+
# number 1
|
|
62
|
+
name x
|
|
63
|
+
>=
|
|
64
|
+
# number 1
|
|
65
|
+
name x
|
|
66
|
+
>=
|
|
67
|
+
# number 1
|
|
68
|
+
name x
|
|
69
|
+
>=
|
|
70
|
+
# number 1
|
|
71
|
+
name x
|
|
72
|
+
<=
|
|
73
|
+
# number 0
|
|
74
|
+
name y
|
|
75
|
+
<=
|
|
76
|
+
# number 0
|
|
77
|
+
name y
|
|
78
|
+
<=
|
|
79
|
+
# number 0
|
|
80
|
+
name y
|
|
81
|
+
<=
|
|
82
|
+
# number 0
|
|
83
|
+
name y
|
|
84
|
+
<=
|
|
85
|
+
# number 0
|
|
86
|
+
name y
|
|
87
|
+
<=
|
|
88
|
+
# number 0
|
|
89
|
+
name y
|
|
54
90
|
==
|
|
55
91
|
# name y
|
|
56
92
|
name x
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
externals (stem)
|
|
2
|
+
integers (s t u v x y)
|
|
3
|
+
integers (global_a global_b global_c)
|
|
4
|
+
|
|
5
|
+
define stem as (
|
|
6
|
+
do (
|
|
7
|
+
$x = len
|
|
8
|
+
next
|
|
9
|
+
$global_a = 0
|
|
10
|
+
$y = cursor
|
|
11
|
+
next
|
|
12
|
+
$(y > 0)
|
|
13
|
+
$global_b = 0
|
|
14
|
+
)
|
|
15
|
+
$(x > 0)
|
|
16
|
+
$global_a > 0
|
|
17
|
+
$global_b > 0
|
|
18
|
+
|
|
19
|
+
do (
|
|
20
|
+
$u = limit
|
|
21
|
+
test (next setmark v)
|
|
22
|
+
$global_c = 0
|
|
23
|
+
try ($u < v $u = v)
|
|
24
|
+
)
|
|
25
|
+
$(cursor >= u)
|
|
26
|
+
$global_c > 0
|
|
27
|
+
|
|
28
|
+
(
|
|
29
|
+
test (hop 3 setmark t)
|
|
30
|
+
$s = limit
|
|
31
|
+
do (
|
|
32
|
+
gopast 'a'
|
|
33
|
+
setmark s
|
|
34
|
+
try($s < t $s = t)
|
|
35
|
+
)
|
|
36
|
+
)
|
|
37
|
+
$(s > 3)
|
|
38
|
+
)
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
define stem
|
|
2
|
+
(
|
|
3
|
+
do
|
|
4
|
+
(
|
|
5
|
+
= x
|
|
6
|
+
# len
|
|
7
|
+
next
|
|
8
|
+
= global_a
|
|
9
|
+
# number 0
|
|
10
|
+
= y
|
|
11
|
+
# cursor
|
|
12
|
+
next
|
|
13
|
+
>=
|
|
14
|
+
# number 1
|
|
15
|
+
name y
|
|
16
|
+
= global_b
|
|
17
|
+
# number 0
|
|
18
|
+
>=
|
|
19
|
+
# number 1
|
|
20
|
+
name x
|
|
21
|
+
>=
|
|
22
|
+
# number 1
|
|
23
|
+
name global_a
|
|
24
|
+
>=
|
|
25
|
+
# number 1
|
|
26
|
+
name global_b
|
|
27
|
+
do
|
|
28
|
+
(
|
|
29
|
+
= u
|
|
30
|
+
# limit
|
|
31
|
+
test
|
|
32
|
+
(
|
|
33
|
+
next
|
|
34
|
+
= v
|
|
35
|
+
# cursor
|
|
36
|
+
= global_c
|
|
37
|
+
# number 0
|
|
38
|
+
try
|
|
39
|
+
(
|
|
40
|
+
<
|
|
41
|
+
# name v
|
|
42
|
+
name u
|
|
43
|
+
= u
|
|
44
|
+
# name v
|
|
45
|
+
>=
|
|
46
|
+
# name u
|
|
47
|
+
cursor
|
|
48
|
+
>=
|
|
49
|
+
# number 1
|
|
50
|
+
name global_c
|
|
51
|
+
(
|
|
52
|
+
test
|
|
53
|
+
(
|
|
54
|
+
hop
|
|
55
|
+
# number 3
|
|
56
|
+
= t
|
|
57
|
+
# cursor
|
|
58
|
+
= s
|
|
59
|
+
# limit
|
|
60
|
+
do
|
|
61
|
+
(
|
|
62
|
+
gopast
|
|
63
|
+
literal 'a'
|
|
64
|
+
= s
|
|
65
|
+
# cursor
|
|
66
|
+
try
|
|
67
|
+
(
|
|
68
|
+
<
|
|
69
|
+
# name t
|
|
70
|
+
name s
|
|
71
|
+
= s
|
|
72
|
+
# name t
|
|
73
|
+
>=
|
|
74
|
+
# number 4
|
|
75
|
+
name s
|
|
76
|
+
Function end
|
|
@@ -3,16 +3,20 @@ externals (stem)
|
|
|
3
3
|
integers (x unused_int)
|
|
4
4
|
booleans (b unused_bool)
|
|
5
5
|
strings (unused string)
|
|
6
|
-
routines (r undef_routine)
|
|
6
|
+
routines (r r2 r3 undef_routine)
|
|
7
7
|
groupings (g undef_grouping)
|
|
8
8
|
define g 'aeiou'
|
|
9
|
+
define r2 as not atlimit
|
|
10
|
+
define r3 as (atlimit or 'x')
|
|
9
11
|
define r as (
|
|
12
|
+
r3 r3
|
|
10
13
|
unset b
|
|
11
14
|
try (next set b)
|
|
12
15
|
$x = size
|
|
13
16
|
b
|
|
14
17
|
$(x > 2)
|
|
15
18
|
g
|
|
19
|
+
among ('should' 'not' 'leak' r2)
|
|
16
20
|
)
|
|
17
21
|
|
|
18
22
|
define stem as true
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
syntax/unused.sbl:7: warning: grouping 'undef_grouping' declared but not defined
|
|
2
2
|
syntax/unused.sbl:6: warning: routine 'undef_routine' declared but not defined
|
|
3
|
-
syntax/unused.sbl:
|
|
3
|
+
syntax/unused.sbl:10: warning: routine 'r3' not reachable from any externals
|
|
4
|
+
syntax/unused.sbl:9: warning: routine 'r2' not reachable from any externals
|
|
5
|
+
syntax/unused.sbl:11: warning: routine 'r' defined but not used
|
|
4
6
|
syntax/unused.sbl:5: warning: string 'string' declared but not used
|
|
5
7
|
syntax/unused.sbl:5: warning: string 'unused' declared but not used
|
|
6
8
|
syntax/unused.sbl:4: warning: boolean 'unused_bool' declared but not used
|
data/vendor/snowball/zig/env.zig
CHANGED
|
@@ -68,7 +68,7 @@ pub const Env = struct {
|
|
|
68
68
|
self.limit = s.len;
|
|
69
69
|
self.limit_backward = 0;
|
|
70
70
|
self.bra = 0;
|
|
71
|
-
self.ket =
|
|
71
|
+
self.ket = 0;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
pub fn getCurrent(self: *const Env) []const u8 {
|
|
@@ -457,9 +457,29 @@ pub const Env = struct {
|
|
|
457
457
|
self.ket = other.ket;
|
|
458
458
|
}
|
|
459
459
|
|
|
460
|
-
pub fn debug(self: *const Env,
|
|
461
|
-
|
|
462
|
-
std.
|
|
460
|
+
pub fn debug(self: *const Env, n: i32, line: i32) void {
|
|
461
|
+
var buf: [256]u8 = undefined;
|
|
462
|
+
var stdout = std.Io.File.stdout().writer(std.Options.debug_io, &buf);
|
|
463
|
+
const len = self.getCurrent().len;
|
|
464
|
+
stdout.interface.print("{:3} (line {:4}): [{}]'", .{ @as(u32, @intCast(n)), @as(u32, @intCast(line)), len }) catch {};
|
|
465
|
+
for (0..len + 1) |i_usize| {
|
|
466
|
+
const i = @as(i32, @intCast(i_usize));
|
|
467
|
+
if (self.limit_backward == i) stdout.interface.writeByte('{') catch {};
|
|
468
|
+
if (self.bra == i) stdout.interface.writeByte('[') catch {};
|
|
469
|
+
if (self.cursor == i) stdout.interface.writeByte('|') catch {};
|
|
470
|
+
if (self.ket == i) stdout.interface.writeByte(']') catch {};
|
|
471
|
+
if (self.limit == i) stdout.interface.writeByte('}') catch {};
|
|
472
|
+
if (i < len) {
|
|
473
|
+
const ch = self.current[i_usize];
|
|
474
|
+
if (ch == 0) {
|
|
475
|
+
stdout.interface.writeByte('#') catch {};
|
|
476
|
+
} else {
|
|
477
|
+
stdout.interface.writeByte(ch) catch {};
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
stdout.interface.writeAll("'\n") catch {};
|
|
482
|
+
stdout.interface.flush() catch {};
|
|
463
483
|
}
|
|
464
484
|
};
|
|
465
485
|
|