gherkin 2.11.2 → 2.11.3
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.
- data/.travis.yml +1 -0
- data/History.md +9 -0
- data/README.md +2 -1
- data/ext/gherkin_lexer_ar/gherkin_lexer_ar.c +8 -8
- data/ext/gherkin_lexer_bg/gherkin_lexer_bg.c +8 -8
- data/ext/gherkin_lexer_bm/gherkin_lexer_bm.c +8 -8
- data/ext/gherkin_lexer_ca/gherkin_lexer_ca.c +8 -8
- data/ext/gherkin_lexer_cs/gherkin_lexer_cs.c +8 -8
- data/ext/gherkin_lexer_cy_gb/gherkin_lexer_cy_gb.c +8 -8
- data/ext/gherkin_lexer_da/gherkin_lexer_da.c +8 -8
- data/ext/gherkin_lexer_de/gherkin_lexer_de.c +8 -8
- data/ext/gherkin_lexer_en/gherkin_lexer_en.c +8 -8
- data/ext/gherkin_lexer_en_au/gherkin_lexer_en_au.c +915 -373
- data/ext/gherkin_lexer_en_lol/gherkin_lexer_en_lol.c +8 -8
- data/ext/gherkin_lexer_en_pirate/gherkin_lexer_en_pirate.c +8 -8
- data/ext/gherkin_lexer_en_scouse/gherkin_lexer_en_scouse.c +8 -8
- data/ext/gherkin_lexer_en_tx/gherkin_lexer_en_tx.c +8 -8
- data/ext/gherkin_lexer_eo/gherkin_lexer_eo.c +8 -8
- data/ext/gherkin_lexer_es/gherkin_lexer_es.c +8 -8
- data/ext/gherkin_lexer_et/gherkin_lexer_et.c +8 -8
- data/ext/gherkin_lexer_fi/gherkin_lexer_fi.c +8 -8
- data/ext/gherkin_lexer_fr/gherkin_lexer_fr.c +8 -8
- data/ext/gherkin_lexer_he/gherkin_lexer_he.c +8 -8
- data/ext/gherkin_lexer_hr/gherkin_lexer_hr.c +8 -8
- data/ext/gherkin_lexer_hu/gherkin_lexer_hu.c +8 -8
- data/ext/gherkin_lexer_id/gherkin_lexer_id.c +8 -8
- data/ext/gherkin_lexer_is/gherkin_lexer_is.c +8 -8
- data/ext/gherkin_lexer_it/gherkin_lexer_it.c +8 -8
- data/ext/gherkin_lexer_ja/gherkin_lexer_ja.c +8 -8
- data/ext/gherkin_lexer_ko/gherkin_lexer_ko.c +8 -8
- data/ext/gherkin_lexer_lt/gherkin_lexer_lt.c +8 -8
- data/ext/gherkin_lexer_lu/gherkin_lexer_lu.c +8 -8
- data/ext/gherkin_lexer_lv/gherkin_lexer_lv.c +8 -8
- data/ext/gherkin_lexer_nl/gherkin_lexer_nl.c +8 -8
- data/ext/gherkin_lexer_no/gherkin_lexer_no.c +8 -8
- data/ext/gherkin_lexer_pl/gherkin_lexer_pl.c +8 -8
- data/ext/gherkin_lexer_pt/gherkin_lexer_pt.c +8 -8
- data/ext/gherkin_lexer_ro/gherkin_lexer_ro.c +8 -8
- data/ext/gherkin_lexer_ru/gherkin_lexer_ru.c +8 -8
- data/ext/gherkin_lexer_sk/gherkin_lexer_sk.c +8 -8
- data/ext/gherkin_lexer_sr_cyrl/gherkin_lexer_sr_cyrl.c +8 -8
- data/ext/gherkin_lexer_sr_latn/gherkin_lexer_sr_latn.c +8 -8
- data/ext/gherkin_lexer_sv/gherkin_lexer_sv.c +8 -8
- data/ext/gherkin_lexer_tr/gherkin_lexer_tr.c +8 -8
- data/ext/gherkin_lexer_uk/gherkin_lexer_uk.c +8 -8
- data/ext/gherkin_lexer_uz/gherkin_lexer_uz.c +8 -8
- data/ext/gherkin_lexer_vi/gherkin_lexer_vi.c +8 -8
- data/ext/gherkin_lexer_zh_cn/gherkin_lexer_zh_cn.c +8 -8
- data/ext/gherkin_lexer_zh_tw/gherkin_lexer_zh_tw.c +8 -8
- data/gherkin.gemspec +4 -4
- data/lib/gherkin/i18n.json +10 -10
- data/lib/gherkin/i18n.rb +1 -1
- data/ragel/lexer.c.rl.erb +5 -5
- data/tasks/apidoc.rake +32 -0
- data/tasks/ikvm.rake +1 -1
- data/tasks/ragel_task.rb +1 -0
- data/tasks/release.rake +1 -19
- metadata +10 -10
- data/tasks/yard.rake +0 -7
@@ -615,7 +615,7 @@ static VALUE
|
|
615
615
|
unindent(VALUE con, int start_col)
|
616
616
|
{
|
617
617
|
VALUE re;
|
618
|
-
|
618
|
+
/* Gherkin will crash gracefully if the string representation of start_col pushes the pattern past 32 characters */
|
619
619
|
char pat[32];
|
620
620
|
snprintf(pat, 32, "^[\t ]{0,%d}", start_col);
|
621
621
|
re = rb_reg_regcomp(rb_str_new2(pat));
|
@@ -1046,14 +1046,14 @@ _match:
|
|
1046
1046
|
buff = data;
|
1047
1047
|
}
|
1048
1048
|
|
1049
|
-
|
1049
|
+
/* Allocate as a ruby string so that it gets cleaned up by GC */
|
1050
1050
|
newstr_val = rb_str_new(buff, len);
|
1051
1051
|
newstr = RSTRING_PTR(newstr_val);
|
1052
1052
|
|
1053
1053
|
|
1054
1054
|
for (count = 0; count < len; count++) {
|
1055
1055
|
if(buff[count] == 10) {
|
1056
|
-
newstr[newstr_count] = '\0';
|
1056
|
+
newstr[newstr_count] = '\0'; /* terminate new string at first newline found */
|
1057
1057
|
break;
|
1058
1058
|
} else {
|
1059
1059
|
if (buff[count] == '%') {
|
@@ -1067,7 +1067,7 @@ _match:
|
|
1067
1067
|
}
|
1068
1068
|
|
1069
1069
|
line = lexer->line_number;
|
1070
|
-
lexer_init(lexer);
|
1070
|
+
lexer_init(lexer); /* Re-initialize so we can scan again with the same lexer */
|
1071
1071
|
raise_lexer_error(newstr, line);
|
1072
1072
|
} else {
|
1073
1073
|
rb_funcall(listener, rb_intern("eof"), 0);
|
@@ -1109,14 +1109,14 @@ _again:
|
|
1109
1109
|
buff = data;
|
1110
1110
|
}
|
1111
1111
|
|
1112
|
-
|
1112
|
+
/* Allocate as a ruby string so that it gets cleaned up by GC */
|
1113
1113
|
newstr_val = rb_str_new(buff, len);
|
1114
1114
|
newstr = RSTRING_PTR(newstr_val);
|
1115
1115
|
|
1116
1116
|
|
1117
1117
|
for (count = 0; count < len; count++) {
|
1118
1118
|
if(buff[count] == 10) {
|
1119
|
-
newstr[newstr_count] = '\0';
|
1119
|
+
newstr[newstr_count] = '\0'; /* terminate new string at first newline found */
|
1120
1120
|
break;
|
1121
1121
|
} else {
|
1122
1122
|
if (buff[count] == '%') {
|
@@ -1130,7 +1130,7 @@ _again:
|
|
1130
1130
|
}
|
1131
1131
|
|
1132
1132
|
line = lexer->line_number;
|
1133
|
-
lexer_init(lexer);
|
1133
|
+
lexer_init(lexer); /* Re-initialize so we can scan again with the same lexer */
|
1134
1134
|
raise_lexer_error(newstr, line);
|
1135
1135
|
} else {
|
1136
1136
|
rb_funcall(listener, rb_intern("eof"), 0);
|
@@ -1151,7 +1151,7 @@ _again:
|
|
1151
1151
|
assert(lexer->content_start <= len && "content starts after data end");
|
1152
1152
|
assert(lexer->mark < len && "mark is after data end");
|
1153
1153
|
|
1154
|
-
|
1154
|
+
/* Reset lexer by re-initializing the whole thing */
|
1155
1155
|
lexer_init(lexer);
|
1156
1156
|
|
1157
1157
|
if (cs == lexer_error) {
|
@@ -909,7 +909,7 @@ static VALUE
|
|
909
909
|
unindent(VALUE con, int start_col)
|
910
910
|
{
|
911
911
|
VALUE re;
|
912
|
-
|
912
|
+
/* Gherkin will crash gracefully if the string representation of start_col pushes the pattern past 32 characters */
|
913
913
|
char pat[32];
|
914
914
|
snprintf(pat, 32, "^[\t ]{0,%d}", start_col);
|
915
915
|
re = rb_reg_regcomp(rb_str_new2(pat));
|
@@ -1340,14 +1340,14 @@ _match:
|
|
1340
1340
|
buff = data;
|
1341
1341
|
}
|
1342
1342
|
|
1343
|
-
|
1343
|
+
/* Allocate as a ruby string so that it gets cleaned up by GC */
|
1344
1344
|
newstr_val = rb_str_new(buff, len);
|
1345
1345
|
newstr = RSTRING_PTR(newstr_val);
|
1346
1346
|
|
1347
1347
|
|
1348
1348
|
for (count = 0; count < len; count++) {
|
1349
1349
|
if(buff[count] == 10) {
|
1350
|
-
newstr[newstr_count] = '\0';
|
1350
|
+
newstr[newstr_count] = '\0'; /* terminate new string at first newline found */
|
1351
1351
|
break;
|
1352
1352
|
} else {
|
1353
1353
|
if (buff[count] == '%') {
|
@@ -1361,7 +1361,7 @@ _match:
|
|
1361
1361
|
}
|
1362
1362
|
|
1363
1363
|
line = lexer->line_number;
|
1364
|
-
lexer_init(lexer);
|
1364
|
+
lexer_init(lexer); /* Re-initialize so we can scan again with the same lexer */
|
1365
1365
|
raise_lexer_error(newstr, line);
|
1366
1366
|
} else {
|
1367
1367
|
rb_funcall(listener, rb_intern("eof"), 0);
|
@@ -1403,14 +1403,14 @@ _again:
|
|
1403
1403
|
buff = data;
|
1404
1404
|
}
|
1405
1405
|
|
1406
|
-
|
1406
|
+
/* Allocate as a ruby string so that it gets cleaned up by GC */
|
1407
1407
|
newstr_val = rb_str_new(buff, len);
|
1408
1408
|
newstr = RSTRING_PTR(newstr_val);
|
1409
1409
|
|
1410
1410
|
|
1411
1411
|
for (count = 0; count < len; count++) {
|
1412
1412
|
if(buff[count] == 10) {
|
1413
|
-
newstr[newstr_count] = '\0';
|
1413
|
+
newstr[newstr_count] = '\0'; /* terminate new string at first newline found */
|
1414
1414
|
break;
|
1415
1415
|
} else {
|
1416
1416
|
if (buff[count] == '%') {
|
@@ -1424,7 +1424,7 @@ _again:
|
|
1424
1424
|
}
|
1425
1425
|
|
1426
1426
|
line = lexer->line_number;
|
1427
|
-
lexer_init(lexer);
|
1427
|
+
lexer_init(lexer); /* Re-initialize so we can scan again with the same lexer */
|
1428
1428
|
raise_lexer_error(newstr, line);
|
1429
1429
|
} else {
|
1430
1430
|
rb_funcall(listener, rb_intern("eof"), 0);
|
@@ -1445,7 +1445,7 @@ _again:
|
|
1445
1445
|
assert(lexer->content_start <= len && "content starts after data end");
|
1446
1446
|
assert(lexer->mark < len && "mark is after data end");
|
1447
1447
|
|
1448
|
-
|
1448
|
+
/* Reset lexer by re-initializing the whole thing */
|
1449
1449
|
lexer_init(lexer);
|
1450
1450
|
|
1451
1451
|
if (cs == lexer_error) {
|
@@ -1072,7 +1072,7 @@ static VALUE
|
|
1072
1072
|
unindent(VALUE con, int start_col)
|
1073
1073
|
{
|
1074
1074
|
VALUE re;
|
1075
|
-
|
1075
|
+
/* Gherkin will crash gracefully if the string representation of start_col pushes the pattern past 32 characters */
|
1076
1076
|
char pat[32];
|
1077
1077
|
snprintf(pat, 32, "^[\t ]{0,%d}", start_col);
|
1078
1078
|
re = rb_reg_regcomp(rb_str_new2(pat));
|
@@ -1503,14 +1503,14 @@ _match:
|
|
1503
1503
|
buff = data;
|
1504
1504
|
}
|
1505
1505
|
|
1506
|
-
|
1506
|
+
/* Allocate as a ruby string so that it gets cleaned up by GC */
|
1507
1507
|
newstr_val = rb_str_new(buff, len);
|
1508
1508
|
newstr = RSTRING_PTR(newstr_val);
|
1509
1509
|
|
1510
1510
|
|
1511
1511
|
for (count = 0; count < len; count++) {
|
1512
1512
|
if(buff[count] == 10) {
|
1513
|
-
newstr[newstr_count] = '\0';
|
1513
|
+
newstr[newstr_count] = '\0'; /* terminate new string at first newline found */
|
1514
1514
|
break;
|
1515
1515
|
} else {
|
1516
1516
|
if (buff[count] == '%') {
|
@@ -1524,7 +1524,7 @@ _match:
|
|
1524
1524
|
}
|
1525
1525
|
|
1526
1526
|
line = lexer->line_number;
|
1527
|
-
lexer_init(lexer);
|
1527
|
+
lexer_init(lexer); /* Re-initialize so we can scan again with the same lexer */
|
1528
1528
|
raise_lexer_error(newstr, line);
|
1529
1529
|
} else {
|
1530
1530
|
rb_funcall(listener, rb_intern("eof"), 0);
|
@@ -1566,14 +1566,14 @@ _again:
|
|
1566
1566
|
buff = data;
|
1567
1567
|
}
|
1568
1568
|
|
1569
|
-
|
1569
|
+
/* Allocate as a ruby string so that it gets cleaned up by GC */
|
1570
1570
|
newstr_val = rb_str_new(buff, len);
|
1571
1571
|
newstr = RSTRING_PTR(newstr_val);
|
1572
1572
|
|
1573
1573
|
|
1574
1574
|
for (count = 0; count < len; count++) {
|
1575
1575
|
if(buff[count] == 10) {
|
1576
|
-
newstr[newstr_count] = '\0';
|
1576
|
+
newstr[newstr_count] = '\0'; /* terminate new string at first newline found */
|
1577
1577
|
break;
|
1578
1578
|
} else {
|
1579
1579
|
if (buff[count] == '%') {
|
@@ -1587,7 +1587,7 @@ _again:
|
|
1587
1587
|
}
|
1588
1588
|
|
1589
1589
|
line = lexer->line_number;
|
1590
|
-
lexer_init(lexer);
|
1590
|
+
lexer_init(lexer); /* Re-initialize so we can scan again with the same lexer */
|
1591
1591
|
raise_lexer_error(newstr, line);
|
1592
1592
|
} else {
|
1593
1593
|
rb_funcall(listener, rb_intern("eof"), 0);
|
@@ -1608,7 +1608,7 @@ _again:
|
|
1608
1608
|
assert(lexer->content_start <= len && "content starts after data end");
|
1609
1609
|
assert(lexer->mark < len && "mark is after data end");
|
1610
1610
|
|
1611
|
-
|
1611
|
+
/* Reset lexer by re-initializing the whole thing */
|
1612
1612
|
lexer_init(lexer);
|
1613
1613
|
|
1614
1614
|
if (cs == lexer_error) {
|
@@ -703,7 +703,7 @@ static VALUE
|
|
703
703
|
unindent(VALUE con, int start_col)
|
704
704
|
{
|
705
705
|
VALUE re;
|
706
|
-
|
706
|
+
/* Gherkin will crash gracefully if the string representation of start_col pushes the pattern past 32 characters */
|
707
707
|
char pat[32];
|
708
708
|
snprintf(pat, 32, "^[\t ]{0,%d}", start_col);
|
709
709
|
re = rb_reg_regcomp(rb_str_new2(pat));
|
@@ -1134,14 +1134,14 @@ _match:
|
|
1134
1134
|
buff = data;
|
1135
1135
|
}
|
1136
1136
|
|
1137
|
-
|
1137
|
+
/* Allocate as a ruby string so that it gets cleaned up by GC */
|
1138
1138
|
newstr_val = rb_str_new(buff, len);
|
1139
1139
|
newstr = RSTRING_PTR(newstr_val);
|
1140
1140
|
|
1141
1141
|
|
1142
1142
|
for (count = 0; count < len; count++) {
|
1143
1143
|
if(buff[count] == 10) {
|
1144
|
-
newstr[newstr_count] = '\0';
|
1144
|
+
newstr[newstr_count] = '\0'; /* terminate new string at first newline found */
|
1145
1145
|
break;
|
1146
1146
|
} else {
|
1147
1147
|
if (buff[count] == '%') {
|
@@ -1155,7 +1155,7 @@ _match:
|
|
1155
1155
|
}
|
1156
1156
|
|
1157
1157
|
line = lexer->line_number;
|
1158
|
-
lexer_init(lexer);
|
1158
|
+
lexer_init(lexer); /* Re-initialize so we can scan again with the same lexer */
|
1159
1159
|
raise_lexer_error(newstr, line);
|
1160
1160
|
} else {
|
1161
1161
|
rb_funcall(listener, rb_intern("eof"), 0);
|
@@ -1197,14 +1197,14 @@ _again:
|
|
1197
1197
|
buff = data;
|
1198
1198
|
}
|
1199
1199
|
|
1200
|
-
|
1200
|
+
/* Allocate as a ruby string so that it gets cleaned up by GC */
|
1201
1201
|
newstr_val = rb_str_new(buff, len);
|
1202
1202
|
newstr = RSTRING_PTR(newstr_val);
|
1203
1203
|
|
1204
1204
|
|
1205
1205
|
for (count = 0; count < len; count++) {
|
1206
1206
|
if(buff[count] == 10) {
|
1207
|
-
newstr[newstr_count] = '\0';
|
1207
|
+
newstr[newstr_count] = '\0'; /* terminate new string at first newline found */
|
1208
1208
|
break;
|
1209
1209
|
} else {
|
1210
1210
|
if (buff[count] == '%') {
|
@@ -1218,7 +1218,7 @@ _again:
|
|
1218
1218
|
}
|
1219
1219
|
|
1220
1220
|
line = lexer->line_number;
|
1221
|
-
lexer_init(lexer);
|
1221
|
+
lexer_init(lexer); /* Re-initialize so we can scan again with the same lexer */
|
1222
1222
|
raise_lexer_error(newstr, line);
|
1223
1223
|
} else {
|
1224
1224
|
rb_funcall(listener, rb_intern("eof"), 0);
|
@@ -1239,7 +1239,7 @@ _again:
|
|
1239
1239
|
assert(lexer->content_start <= len && "content starts after data end");
|
1240
1240
|
assert(lexer->mark < len && "mark is after data end");
|
1241
1241
|
|
1242
|
-
|
1242
|
+
/* Reset lexer by re-initializing the whole thing */
|
1243
1243
|
lexer_init(lexer);
|
1244
1244
|
|
1245
1245
|
if (cs == lexer_error) {
|
@@ -679,7 +679,7 @@ static VALUE
|
|
679
679
|
unindent(VALUE con, int start_col)
|
680
680
|
{
|
681
681
|
VALUE re;
|
682
|
-
|
682
|
+
/* Gherkin will crash gracefully if the string representation of start_col pushes the pattern past 32 characters */
|
683
683
|
char pat[32];
|
684
684
|
snprintf(pat, 32, "^[\t ]{0,%d}", start_col);
|
685
685
|
re = rb_reg_regcomp(rb_str_new2(pat));
|
@@ -1110,14 +1110,14 @@ _match:
|
|
1110
1110
|
buff = data;
|
1111
1111
|
}
|
1112
1112
|
|
1113
|
-
|
1113
|
+
/* Allocate as a ruby string so that it gets cleaned up by GC */
|
1114
1114
|
newstr_val = rb_str_new(buff, len);
|
1115
1115
|
newstr = RSTRING_PTR(newstr_val);
|
1116
1116
|
|
1117
1117
|
|
1118
1118
|
for (count = 0; count < len; count++) {
|
1119
1119
|
if(buff[count] == 10) {
|
1120
|
-
newstr[newstr_count] = '\0';
|
1120
|
+
newstr[newstr_count] = '\0'; /* terminate new string at first newline found */
|
1121
1121
|
break;
|
1122
1122
|
} else {
|
1123
1123
|
if (buff[count] == '%') {
|
@@ -1131,7 +1131,7 @@ _match:
|
|
1131
1131
|
}
|
1132
1132
|
|
1133
1133
|
line = lexer->line_number;
|
1134
|
-
lexer_init(lexer);
|
1134
|
+
lexer_init(lexer); /* Re-initialize so we can scan again with the same lexer */
|
1135
1135
|
raise_lexer_error(newstr, line);
|
1136
1136
|
} else {
|
1137
1137
|
rb_funcall(listener, rb_intern("eof"), 0);
|
@@ -1173,14 +1173,14 @@ _again:
|
|
1173
1173
|
buff = data;
|
1174
1174
|
}
|
1175
1175
|
|
1176
|
-
|
1176
|
+
/* Allocate as a ruby string so that it gets cleaned up by GC */
|
1177
1177
|
newstr_val = rb_str_new(buff, len);
|
1178
1178
|
newstr = RSTRING_PTR(newstr_val);
|
1179
1179
|
|
1180
1180
|
|
1181
1181
|
for (count = 0; count < len; count++) {
|
1182
1182
|
if(buff[count] == 10) {
|
1183
|
-
newstr[newstr_count] = '\0';
|
1183
|
+
newstr[newstr_count] = '\0'; /* terminate new string at first newline found */
|
1184
1184
|
break;
|
1185
1185
|
} else {
|
1186
1186
|
if (buff[count] == '%') {
|
@@ -1194,7 +1194,7 @@ _again:
|
|
1194
1194
|
}
|
1195
1195
|
|
1196
1196
|
line = lexer->line_number;
|
1197
|
-
lexer_init(lexer);
|
1197
|
+
lexer_init(lexer); /* Re-initialize so we can scan again with the same lexer */
|
1198
1198
|
raise_lexer_error(newstr, line);
|
1199
1199
|
} else {
|
1200
1200
|
rb_funcall(listener, rb_intern("eof"), 0);
|
@@ -1215,7 +1215,7 @@ _again:
|
|
1215
1215
|
assert(lexer->content_start <= len && "content starts after data end");
|
1216
1216
|
assert(lexer->mark < len && "mark is after data end");
|
1217
1217
|
|
1218
|
-
|
1218
|
+
/* Reset lexer by re-initializing the whole thing */
|
1219
1219
|
lexer_init(lexer);
|
1220
1220
|
|
1221
1221
|
if (cs == lexer_error) {
|
@@ -837,7 +837,7 @@ static VALUE
|
|
837
837
|
unindent(VALUE con, int start_col)
|
838
838
|
{
|
839
839
|
VALUE re;
|
840
|
-
|
840
|
+
/* Gherkin will crash gracefully if the string representation of start_col pushes the pattern past 32 characters */
|
841
841
|
char pat[32];
|
842
842
|
snprintf(pat, 32, "^[\t ]{0,%d}", start_col);
|
843
843
|
re = rb_reg_regcomp(rb_str_new2(pat));
|
@@ -1268,14 +1268,14 @@ _match:
|
|
1268
1268
|
buff = data;
|
1269
1269
|
}
|
1270
1270
|
|
1271
|
-
|
1271
|
+
/* Allocate as a ruby string so that it gets cleaned up by GC */
|
1272
1272
|
newstr_val = rb_str_new(buff, len);
|
1273
1273
|
newstr = RSTRING_PTR(newstr_val);
|
1274
1274
|
|
1275
1275
|
|
1276
1276
|
for (count = 0; count < len; count++) {
|
1277
1277
|
if(buff[count] == 10) {
|
1278
|
-
newstr[newstr_count] = '\0';
|
1278
|
+
newstr[newstr_count] = '\0'; /* terminate new string at first newline found */
|
1279
1279
|
break;
|
1280
1280
|
} else {
|
1281
1281
|
if (buff[count] == '%') {
|
@@ -1289,7 +1289,7 @@ _match:
|
|
1289
1289
|
}
|
1290
1290
|
|
1291
1291
|
line = lexer->line_number;
|
1292
|
-
lexer_init(lexer);
|
1292
|
+
lexer_init(lexer); /* Re-initialize so we can scan again with the same lexer */
|
1293
1293
|
raise_lexer_error(newstr, line);
|
1294
1294
|
} else {
|
1295
1295
|
rb_funcall(listener, rb_intern("eof"), 0);
|
@@ -1331,14 +1331,14 @@ _again:
|
|
1331
1331
|
buff = data;
|
1332
1332
|
}
|
1333
1333
|
|
1334
|
-
|
1334
|
+
/* Allocate as a ruby string so that it gets cleaned up by GC */
|
1335
1335
|
newstr_val = rb_str_new(buff, len);
|
1336
1336
|
newstr = RSTRING_PTR(newstr_val);
|
1337
1337
|
|
1338
1338
|
|
1339
1339
|
for (count = 0; count < len; count++) {
|
1340
1340
|
if(buff[count] == 10) {
|
1341
|
-
newstr[newstr_count] = '\0';
|
1341
|
+
newstr[newstr_count] = '\0'; /* terminate new string at first newline found */
|
1342
1342
|
break;
|
1343
1343
|
} else {
|
1344
1344
|
if (buff[count] == '%') {
|
@@ -1352,7 +1352,7 @@ _again:
|
|
1352
1352
|
}
|
1353
1353
|
|
1354
1354
|
line = lexer->line_number;
|
1355
|
-
lexer_init(lexer);
|
1355
|
+
lexer_init(lexer); /* Re-initialize so we can scan again with the same lexer */
|
1356
1356
|
raise_lexer_error(newstr, line);
|
1357
1357
|
} else {
|
1358
1358
|
rb_funcall(listener, rb_intern("eof"), 0);
|
@@ -1373,7 +1373,7 @@ _again:
|
|
1373
1373
|
assert(lexer->content_start <= len && "content starts after data end");
|
1374
1374
|
assert(lexer->mark < len && "mark is after data end");
|
1375
1375
|
|
1376
|
-
|
1376
|
+
/* Reset lexer by re-initializing the whole thing */
|
1377
1377
|
lexer_init(lexer);
|
1378
1378
|
|
1379
1379
|
if (cs == lexer_error) {
|
@@ -674,7 +674,7 @@ static VALUE
|
|
674
674
|
unindent(VALUE con, int start_col)
|
675
675
|
{
|
676
676
|
VALUE re;
|
677
|
-
|
677
|
+
/* Gherkin will crash gracefully if the string representation of start_col pushes the pattern past 32 characters */
|
678
678
|
char pat[32];
|
679
679
|
snprintf(pat, 32, "^[\t ]{0,%d}", start_col);
|
680
680
|
re = rb_reg_regcomp(rb_str_new2(pat));
|
@@ -1105,14 +1105,14 @@ _match:
|
|
1105
1105
|
buff = data;
|
1106
1106
|
}
|
1107
1107
|
|
1108
|
-
|
1108
|
+
/* Allocate as a ruby string so that it gets cleaned up by GC */
|
1109
1109
|
newstr_val = rb_str_new(buff, len);
|
1110
1110
|
newstr = RSTRING_PTR(newstr_val);
|
1111
1111
|
|
1112
1112
|
|
1113
1113
|
for (count = 0; count < len; count++) {
|
1114
1114
|
if(buff[count] == 10) {
|
1115
|
-
newstr[newstr_count] = '\0';
|
1115
|
+
newstr[newstr_count] = '\0'; /* terminate new string at first newline found */
|
1116
1116
|
break;
|
1117
1117
|
} else {
|
1118
1118
|
if (buff[count] == '%') {
|
@@ -1126,7 +1126,7 @@ _match:
|
|
1126
1126
|
}
|
1127
1127
|
|
1128
1128
|
line = lexer->line_number;
|
1129
|
-
lexer_init(lexer);
|
1129
|
+
lexer_init(lexer); /* Re-initialize so we can scan again with the same lexer */
|
1130
1130
|
raise_lexer_error(newstr, line);
|
1131
1131
|
} else {
|
1132
1132
|
rb_funcall(listener, rb_intern("eof"), 0);
|
@@ -1168,14 +1168,14 @@ _again:
|
|
1168
1168
|
buff = data;
|
1169
1169
|
}
|
1170
1170
|
|
1171
|
-
|
1171
|
+
/* Allocate as a ruby string so that it gets cleaned up by GC */
|
1172
1172
|
newstr_val = rb_str_new(buff, len);
|
1173
1173
|
newstr = RSTRING_PTR(newstr_val);
|
1174
1174
|
|
1175
1175
|
|
1176
1176
|
for (count = 0; count < len; count++) {
|
1177
1177
|
if(buff[count] == 10) {
|
1178
|
-
newstr[newstr_count] = '\0';
|
1178
|
+
newstr[newstr_count] = '\0'; /* terminate new string at first newline found */
|
1179
1179
|
break;
|
1180
1180
|
} else {
|
1181
1181
|
if (buff[count] == '%') {
|
@@ -1189,7 +1189,7 @@ _again:
|
|
1189
1189
|
}
|
1190
1190
|
|
1191
1191
|
line = lexer->line_number;
|
1192
|
-
lexer_init(lexer);
|
1192
|
+
lexer_init(lexer); /* Re-initialize so we can scan again with the same lexer */
|
1193
1193
|
raise_lexer_error(newstr, line);
|
1194
1194
|
} else {
|
1195
1195
|
rb_funcall(listener, rb_intern("eof"), 0);
|
@@ -1210,7 +1210,7 @@ _again:
|
|
1210
1210
|
assert(lexer->content_start <= len && "content starts after data end");
|
1211
1211
|
assert(lexer->mark < len && "mark is after data end");
|
1212
1212
|
|
1213
|
-
|
1213
|
+
/* Reset lexer by re-initializing the whole thing */
|
1214
1214
|
lexer_init(lexer);
|
1215
1215
|
|
1216
1216
|
if (cs == lexer_error) {
|