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
@@ -749,7 +749,7 @@ static VALUE
|
|
749
749
|
unindent(VALUE con, int start_col)
|
750
750
|
{
|
751
751
|
VALUE re;
|
752
|
-
|
752
|
+
/* Gherkin will crash gracefully if the string representation of start_col pushes the pattern past 32 characters */
|
753
753
|
char pat[32];
|
754
754
|
snprintf(pat, 32, "^[\t ]{0,%d}", start_col);
|
755
755
|
re = rb_reg_regcomp(rb_str_new2(pat));
|
@@ -1180,14 +1180,14 @@ _match:
|
|
1180
1180
|
buff = data;
|
1181
1181
|
}
|
1182
1182
|
|
1183
|
-
|
1183
|
+
/* Allocate as a ruby string so that it gets cleaned up by GC */
|
1184
1184
|
newstr_val = rb_str_new(buff, len);
|
1185
1185
|
newstr = RSTRING_PTR(newstr_val);
|
1186
1186
|
|
1187
1187
|
|
1188
1188
|
for (count = 0; count < len; count++) {
|
1189
1189
|
if(buff[count] == 10) {
|
1190
|
-
newstr[newstr_count] = '\0';
|
1190
|
+
newstr[newstr_count] = '\0'; /* terminate new string at first newline found */
|
1191
1191
|
break;
|
1192
1192
|
} else {
|
1193
1193
|
if (buff[count] == '%') {
|
@@ -1201,7 +1201,7 @@ _match:
|
|
1201
1201
|
}
|
1202
1202
|
|
1203
1203
|
line = lexer->line_number;
|
1204
|
-
lexer_init(lexer);
|
1204
|
+
lexer_init(lexer); /* Re-initialize so we can scan again with the same lexer */
|
1205
1205
|
raise_lexer_error(newstr, line);
|
1206
1206
|
} else {
|
1207
1207
|
rb_funcall(listener, rb_intern("eof"), 0);
|
@@ -1243,14 +1243,14 @@ _again:
|
|
1243
1243
|
buff = data;
|
1244
1244
|
}
|
1245
1245
|
|
1246
|
-
|
1246
|
+
/* Allocate as a ruby string so that it gets cleaned up by GC */
|
1247
1247
|
newstr_val = rb_str_new(buff, len);
|
1248
1248
|
newstr = RSTRING_PTR(newstr_val);
|
1249
1249
|
|
1250
1250
|
|
1251
1251
|
for (count = 0; count < len; count++) {
|
1252
1252
|
if(buff[count] == 10) {
|
1253
|
-
newstr[newstr_count] = '\0';
|
1253
|
+
newstr[newstr_count] = '\0'; /* terminate new string at first newline found */
|
1254
1254
|
break;
|
1255
1255
|
} else {
|
1256
1256
|
if (buff[count] == '%') {
|
@@ -1264,7 +1264,7 @@ _again:
|
|
1264
1264
|
}
|
1265
1265
|
|
1266
1266
|
line = lexer->line_number;
|
1267
|
-
lexer_init(lexer);
|
1267
|
+
lexer_init(lexer); /* Re-initialize so we can scan again with the same lexer */
|
1268
1268
|
raise_lexer_error(newstr, line);
|
1269
1269
|
} else {
|
1270
1270
|
rb_funcall(listener, rb_intern("eof"), 0);
|
@@ -1285,7 +1285,7 @@ _again:
|
|
1285
1285
|
assert(lexer->content_start <= len && "content starts after data end");
|
1286
1286
|
assert(lexer->mark < len && "mark is after data end");
|
1287
1287
|
|
1288
|
-
|
1288
|
+
/* Reset lexer by re-initializing the whole thing */
|
1289
1289
|
lexer_init(lexer);
|
1290
1290
|
|
1291
1291
|
if (cs == lexer_error) {
|
@@ -1176,7 +1176,7 @@ static VALUE
|
|
1176
1176
|
unindent(VALUE con, int start_col)
|
1177
1177
|
{
|
1178
1178
|
VALUE re;
|
1179
|
-
|
1179
|
+
/* Gherkin will crash gracefully if the string representation of start_col pushes the pattern past 32 characters */
|
1180
1180
|
char pat[32];
|
1181
1181
|
snprintf(pat, 32, "^[\t ]{0,%d}", start_col);
|
1182
1182
|
re = rb_reg_regcomp(rb_str_new2(pat));
|
@@ -1607,14 +1607,14 @@ _match:
|
|
1607
1607
|
buff = data;
|
1608
1608
|
}
|
1609
1609
|
|
1610
|
-
|
1610
|
+
/* Allocate as a ruby string so that it gets cleaned up by GC */
|
1611
1611
|
newstr_val = rb_str_new(buff, len);
|
1612
1612
|
newstr = RSTRING_PTR(newstr_val);
|
1613
1613
|
|
1614
1614
|
|
1615
1615
|
for (count = 0; count < len; count++) {
|
1616
1616
|
if(buff[count] == 10) {
|
1617
|
-
newstr[newstr_count] = '\0';
|
1617
|
+
newstr[newstr_count] = '\0'; /* terminate new string at first newline found */
|
1618
1618
|
break;
|
1619
1619
|
} else {
|
1620
1620
|
if (buff[count] == '%') {
|
@@ -1628,7 +1628,7 @@ _match:
|
|
1628
1628
|
}
|
1629
1629
|
|
1630
1630
|
line = lexer->line_number;
|
1631
|
-
lexer_init(lexer);
|
1631
|
+
lexer_init(lexer); /* Re-initialize so we can scan again with the same lexer */
|
1632
1632
|
raise_lexer_error(newstr, line);
|
1633
1633
|
} else {
|
1634
1634
|
rb_funcall(listener, rb_intern("eof"), 0);
|
@@ -1670,14 +1670,14 @@ _again:
|
|
1670
1670
|
buff = data;
|
1671
1671
|
}
|
1672
1672
|
|
1673
|
-
|
1673
|
+
/* Allocate as a ruby string so that it gets cleaned up by GC */
|
1674
1674
|
newstr_val = rb_str_new(buff, len);
|
1675
1675
|
newstr = RSTRING_PTR(newstr_val);
|
1676
1676
|
|
1677
1677
|
|
1678
1678
|
for (count = 0; count < len; count++) {
|
1679
1679
|
if(buff[count] == 10) {
|
1680
|
-
newstr[newstr_count] = '\0';
|
1680
|
+
newstr[newstr_count] = '\0'; /* terminate new string at first newline found */
|
1681
1681
|
break;
|
1682
1682
|
} else {
|
1683
1683
|
if (buff[count] == '%') {
|
@@ -1691,7 +1691,7 @@ _again:
|
|
1691
1691
|
}
|
1692
1692
|
|
1693
1693
|
line = lexer->line_number;
|
1694
|
-
lexer_init(lexer);
|
1694
|
+
lexer_init(lexer); /* Re-initialize so we can scan again with the same lexer */
|
1695
1695
|
raise_lexer_error(newstr, line);
|
1696
1696
|
} else {
|
1697
1697
|
rb_funcall(listener, rb_intern("eof"), 0);
|
@@ -1712,7 +1712,7 @@ _again:
|
|
1712
1712
|
assert(lexer->content_start <= len && "content starts after data end");
|
1713
1713
|
assert(lexer->mark < len && "mark is after data end");
|
1714
1714
|
|
1715
|
-
|
1715
|
+
/* Reset lexer by re-initializing the whole thing */
|
1716
1716
|
lexer_init(lexer);
|
1717
1717
|
|
1718
1718
|
if (cs == lexer_error) {
|
@@ -1149,7 +1149,7 @@ static VALUE
|
|
1149
1149
|
unindent(VALUE con, int start_col)
|
1150
1150
|
{
|
1151
1151
|
VALUE re;
|
1152
|
-
|
1152
|
+
/* Gherkin will crash gracefully if the string representation of start_col pushes the pattern past 32 characters */
|
1153
1153
|
char pat[32];
|
1154
1154
|
snprintf(pat, 32, "^[\t ]{0,%d}", start_col);
|
1155
1155
|
re = rb_reg_regcomp(rb_str_new2(pat));
|
@@ -1580,14 +1580,14 @@ _match:
|
|
1580
1580
|
buff = data;
|
1581
1581
|
}
|
1582
1582
|
|
1583
|
-
|
1583
|
+
/* Allocate as a ruby string so that it gets cleaned up by GC */
|
1584
1584
|
newstr_val = rb_str_new(buff, len);
|
1585
1585
|
newstr = RSTRING_PTR(newstr_val);
|
1586
1586
|
|
1587
1587
|
|
1588
1588
|
for (count = 0; count < len; count++) {
|
1589
1589
|
if(buff[count] == 10) {
|
1590
|
-
newstr[newstr_count] = '\0';
|
1590
|
+
newstr[newstr_count] = '\0'; /* terminate new string at first newline found */
|
1591
1591
|
break;
|
1592
1592
|
} else {
|
1593
1593
|
if (buff[count] == '%') {
|
@@ -1601,7 +1601,7 @@ _match:
|
|
1601
1601
|
}
|
1602
1602
|
|
1603
1603
|
line = lexer->line_number;
|
1604
|
-
lexer_init(lexer);
|
1604
|
+
lexer_init(lexer); /* Re-initialize so we can scan again with the same lexer */
|
1605
1605
|
raise_lexer_error(newstr, line);
|
1606
1606
|
} else {
|
1607
1607
|
rb_funcall(listener, rb_intern("eof"), 0);
|
@@ -1643,14 +1643,14 @@ _again:
|
|
1643
1643
|
buff = data;
|
1644
1644
|
}
|
1645
1645
|
|
1646
|
-
|
1646
|
+
/* Allocate as a ruby string so that it gets cleaned up by GC */
|
1647
1647
|
newstr_val = rb_str_new(buff, len);
|
1648
1648
|
newstr = RSTRING_PTR(newstr_val);
|
1649
1649
|
|
1650
1650
|
|
1651
1651
|
for (count = 0; count < len; count++) {
|
1652
1652
|
if(buff[count] == 10) {
|
1653
|
-
newstr[newstr_count] = '\0';
|
1653
|
+
newstr[newstr_count] = '\0'; /* terminate new string at first newline found */
|
1654
1654
|
break;
|
1655
1655
|
} else {
|
1656
1656
|
if (buff[count] == '%') {
|
@@ -1664,7 +1664,7 @@ _again:
|
|
1664
1664
|
}
|
1665
1665
|
|
1666
1666
|
line = lexer->line_number;
|
1667
|
-
lexer_init(lexer);
|
1667
|
+
lexer_init(lexer); /* Re-initialize so we can scan again with the same lexer */
|
1668
1668
|
raise_lexer_error(newstr, line);
|
1669
1669
|
} else {
|
1670
1670
|
rb_funcall(listener, rb_intern("eof"), 0);
|
@@ -1685,7 +1685,7 @@ _again:
|
|
1685
1685
|
assert(lexer->content_start <= len && "content starts after data end");
|
1686
1686
|
assert(lexer->mark < len && "mark is after data end");
|
1687
1687
|
|
1688
|
-
|
1688
|
+
/* Reset lexer by re-initializing the whole thing */
|
1689
1689
|
lexer_init(lexer);
|
1690
1690
|
|
1691
1691
|
if (cs == lexer_error) {
|
@@ -865,7 +865,7 @@ static VALUE
|
|
865
865
|
unindent(VALUE con, int start_col)
|
866
866
|
{
|
867
867
|
VALUE re;
|
868
|
-
|
868
|
+
/* Gherkin will crash gracefully if the string representation of start_col pushes the pattern past 32 characters */
|
869
869
|
char pat[32];
|
870
870
|
snprintf(pat, 32, "^[\t ]{0,%d}", start_col);
|
871
871
|
re = rb_reg_regcomp(rb_str_new2(pat));
|
@@ -1296,14 +1296,14 @@ _match:
|
|
1296
1296
|
buff = data;
|
1297
1297
|
}
|
1298
1298
|
|
1299
|
-
|
1299
|
+
/* Allocate as a ruby string so that it gets cleaned up by GC */
|
1300
1300
|
newstr_val = rb_str_new(buff, len);
|
1301
1301
|
newstr = RSTRING_PTR(newstr_val);
|
1302
1302
|
|
1303
1303
|
|
1304
1304
|
for (count = 0; count < len; count++) {
|
1305
1305
|
if(buff[count] == 10) {
|
1306
|
-
newstr[newstr_count] = '\0';
|
1306
|
+
newstr[newstr_count] = '\0'; /* terminate new string at first newline found */
|
1307
1307
|
break;
|
1308
1308
|
} else {
|
1309
1309
|
if (buff[count] == '%') {
|
@@ -1317,7 +1317,7 @@ _match:
|
|
1317
1317
|
}
|
1318
1318
|
|
1319
1319
|
line = lexer->line_number;
|
1320
|
-
lexer_init(lexer);
|
1320
|
+
lexer_init(lexer); /* Re-initialize so we can scan again with the same lexer */
|
1321
1321
|
raise_lexer_error(newstr, line);
|
1322
1322
|
} else {
|
1323
1323
|
rb_funcall(listener, rb_intern("eof"), 0);
|
@@ -1359,14 +1359,14 @@ _again:
|
|
1359
1359
|
buff = data;
|
1360
1360
|
}
|
1361
1361
|
|
1362
|
-
|
1362
|
+
/* Allocate as a ruby string so that it gets cleaned up by GC */
|
1363
1363
|
newstr_val = rb_str_new(buff, len);
|
1364
1364
|
newstr = RSTRING_PTR(newstr_val);
|
1365
1365
|
|
1366
1366
|
|
1367
1367
|
for (count = 0; count < len; count++) {
|
1368
1368
|
if(buff[count] == 10) {
|
1369
|
-
newstr[newstr_count] = '\0';
|
1369
|
+
newstr[newstr_count] = '\0'; /* terminate new string at first newline found */
|
1370
1370
|
break;
|
1371
1371
|
} else {
|
1372
1372
|
if (buff[count] == '%') {
|
@@ -1380,7 +1380,7 @@ _again:
|
|
1380
1380
|
}
|
1381
1381
|
|
1382
1382
|
line = lexer->line_number;
|
1383
|
-
lexer_init(lexer);
|
1383
|
+
lexer_init(lexer); /* Re-initialize so we can scan again with the same lexer */
|
1384
1384
|
raise_lexer_error(newstr, line);
|
1385
1385
|
} else {
|
1386
1386
|
rb_funcall(listener, rb_intern("eof"), 0);
|
@@ -1401,7 +1401,7 @@ _again:
|
|
1401
1401
|
assert(lexer->content_start <= len && "content starts after data end");
|
1402
1402
|
assert(lexer->mark < len && "mark is after data end");
|
1403
1403
|
|
1404
|
-
|
1404
|
+
/* Reset lexer by re-initializing the whole thing */
|
1405
1405
|
lexer_init(lexer);
|
1406
1406
|
|
1407
1407
|
if (cs == lexer_error) {
|
@@ -1509,7 +1509,7 @@ static VALUE
|
|
1509
1509
|
unindent(VALUE con, int start_col)
|
1510
1510
|
{
|
1511
1511
|
VALUE re;
|
1512
|
-
|
1512
|
+
/* Gherkin will crash gracefully if the string representation of start_col pushes the pattern past 32 characters */
|
1513
1513
|
char pat[32];
|
1514
1514
|
snprintf(pat, 32, "^[\t ]{0,%d}", start_col);
|
1515
1515
|
re = rb_reg_regcomp(rb_str_new2(pat));
|
@@ -1940,14 +1940,14 @@ _match:
|
|
1940
1940
|
buff = data;
|
1941
1941
|
}
|
1942
1942
|
|
1943
|
-
|
1943
|
+
/* Allocate as a ruby string so that it gets cleaned up by GC */
|
1944
1944
|
newstr_val = rb_str_new(buff, len);
|
1945
1945
|
newstr = RSTRING_PTR(newstr_val);
|
1946
1946
|
|
1947
1947
|
|
1948
1948
|
for (count = 0; count < len; count++) {
|
1949
1949
|
if(buff[count] == 10) {
|
1950
|
-
newstr[newstr_count] = '\0';
|
1950
|
+
newstr[newstr_count] = '\0'; /* terminate new string at first newline found */
|
1951
1951
|
break;
|
1952
1952
|
} else {
|
1953
1953
|
if (buff[count] == '%') {
|
@@ -1961,7 +1961,7 @@ _match:
|
|
1961
1961
|
}
|
1962
1962
|
|
1963
1963
|
line = lexer->line_number;
|
1964
|
-
lexer_init(lexer);
|
1964
|
+
lexer_init(lexer); /* Re-initialize so we can scan again with the same lexer */
|
1965
1965
|
raise_lexer_error(newstr, line);
|
1966
1966
|
} else {
|
1967
1967
|
rb_funcall(listener, rb_intern("eof"), 0);
|
@@ -2003,14 +2003,14 @@ _again:
|
|
2003
2003
|
buff = data;
|
2004
2004
|
}
|
2005
2005
|
|
2006
|
-
|
2006
|
+
/* Allocate as a ruby string so that it gets cleaned up by GC */
|
2007
2007
|
newstr_val = rb_str_new(buff, len);
|
2008
2008
|
newstr = RSTRING_PTR(newstr_val);
|
2009
2009
|
|
2010
2010
|
|
2011
2011
|
for (count = 0; count < len; count++) {
|
2012
2012
|
if(buff[count] == 10) {
|
2013
|
-
newstr[newstr_count] = '\0';
|
2013
|
+
newstr[newstr_count] = '\0'; /* terminate new string at first newline found */
|
2014
2014
|
break;
|
2015
2015
|
} else {
|
2016
2016
|
if (buff[count] == '%') {
|
@@ -2024,7 +2024,7 @@ _again:
|
|
2024
2024
|
}
|
2025
2025
|
|
2026
2026
|
line = lexer->line_number;
|
2027
|
-
lexer_init(lexer);
|
2027
|
+
lexer_init(lexer); /* Re-initialize so we can scan again with the same lexer */
|
2028
2028
|
raise_lexer_error(newstr, line);
|
2029
2029
|
} else {
|
2030
2030
|
rb_funcall(listener, rb_intern("eof"), 0);
|
@@ -2045,7 +2045,7 @@ _again:
|
|
2045
2045
|
assert(lexer->content_start <= len && "content starts after data end");
|
2046
2046
|
assert(lexer->mark < len && "mark is after data end");
|
2047
2047
|
|
2048
|
-
|
2048
|
+
/* Reset lexer by re-initializing the whole thing */
|
2049
2049
|
lexer_init(lexer);
|
2050
2050
|
|
2051
2051
|
if (cs == lexer_error) {
|
@@ -736,7 +736,7 @@ static VALUE
|
|
736
736
|
unindent(VALUE con, int start_col)
|
737
737
|
{
|
738
738
|
VALUE re;
|
739
|
-
|
739
|
+
/* Gherkin will crash gracefully if the string representation of start_col pushes the pattern past 32 characters */
|
740
740
|
char pat[32];
|
741
741
|
snprintf(pat, 32, "^[\t ]{0,%d}", start_col);
|
742
742
|
re = rb_reg_regcomp(rb_str_new2(pat));
|
@@ -1167,14 +1167,14 @@ _match:
|
|
1167
1167
|
buff = data;
|
1168
1168
|
}
|
1169
1169
|
|
1170
|
-
|
1170
|
+
/* Allocate as a ruby string so that it gets cleaned up by GC */
|
1171
1171
|
newstr_val = rb_str_new(buff, len);
|
1172
1172
|
newstr = RSTRING_PTR(newstr_val);
|
1173
1173
|
|
1174
1174
|
|
1175
1175
|
for (count = 0; count < len; count++) {
|
1176
1176
|
if(buff[count] == 10) {
|
1177
|
-
newstr[newstr_count] = '\0';
|
1177
|
+
newstr[newstr_count] = '\0'; /* terminate new string at first newline found */
|
1178
1178
|
break;
|
1179
1179
|
} else {
|
1180
1180
|
if (buff[count] == '%') {
|
@@ -1188,7 +1188,7 @@ _match:
|
|
1188
1188
|
}
|
1189
1189
|
|
1190
1190
|
line = lexer->line_number;
|
1191
|
-
lexer_init(lexer);
|
1191
|
+
lexer_init(lexer); /* Re-initialize so we can scan again with the same lexer */
|
1192
1192
|
raise_lexer_error(newstr, line);
|
1193
1193
|
} else {
|
1194
1194
|
rb_funcall(listener, rb_intern("eof"), 0);
|
@@ -1230,14 +1230,14 @@ _again:
|
|
1230
1230
|
buff = data;
|
1231
1231
|
}
|
1232
1232
|
|
1233
|
-
|
1233
|
+
/* Allocate as a ruby string so that it gets cleaned up by GC */
|
1234
1234
|
newstr_val = rb_str_new(buff, len);
|
1235
1235
|
newstr = RSTRING_PTR(newstr_val);
|
1236
1236
|
|
1237
1237
|
|
1238
1238
|
for (count = 0; count < len; count++) {
|
1239
1239
|
if(buff[count] == 10) {
|
1240
|
-
newstr[newstr_count] = '\0';
|
1240
|
+
newstr[newstr_count] = '\0'; /* terminate new string at first newline found */
|
1241
1241
|
break;
|
1242
1242
|
} else {
|
1243
1243
|
if (buff[count] == '%') {
|
@@ -1251,7 +1251,7 @@ _again:
|
|
1251
1251
|
}
|
1252
1252
|
|
1253
1253
|
line = lexer->line_number;
|
1254
|
-
lexer_init(lexer);
|
1254
|
+
lexer_init(lexer); /* Re-initialize so we can scan again with the same lexer */
|
1255
1255
|
raise_lexer_error(newstr, line);
|
1256
1256
|
} else {
|
1257
1257
|
rb_funcall(listener, rb_intern("eof"), 0);
|
@@ -1272,7 +1272,7 @@ _again:
|
|
1272
1272
|
assert(lexer->content_start <= len && "content starts after data end");
|
1273
1273
|
assert(lexer->mark < len && "mark is after data end");
|
1274
1274
|
|
1275
|
-
|
1275
|
+
/* Reset lexer by re-initializing the whole thing */
|
1276
1276
|
lexer_init(lexer);
|
1277
1277
|
|
1278
1278
|
if (cs == lexer_error) {
|
@@ -1550,7 +1550,7 @@ static VALUE
|
|
1550
1550
|
unindent(VALUE con, int start_col)
|
1551
1551
|
{
|
1552
1552
|
VALUE re;
|
1553
|
-
|
1553
|
+
/* Gherkin will crash gracefully if the string representation of start_col pushes the pattern past 32 characters */
|
1554
1554
|
char pat[32];
|
1555
1555
|
snprintf(pat, 32, "^[\t ]{0,%d}", start_col);
|
1556
1556
|
re = rb_reg_regcomp(rb_str_new2(pat));
|
@@ -1981,14 +1981,14 @@ _match:
|
|
1981
1981
|
buff = data;
|
1982
1982
|
}
|
1983
1983
|
|
1984
|
-
|
1984
|
+
/* Allocate as a ruby string so that it gets cleaned up by GC */
|
1985
1985
|
newstr_val = rb_str_new(buff, len);
|
1986
1986
|
newstr = RSTRING_PTR(newstr_val);
|
1987
1987
|
|
1988
1988
|
|
1989
1989
|
for (count = 0; count < len; count++) {
|
1990
1990
|
if(buff[count] == 10) {
|
1991
|
-
newstr[newstr_count] = '\0';
|
1991
|
+
newstr[newstr_count] = '\0'; /* terminate new string at first newline found */
|
1992
1992
|
break;
|
1993
1993
|
} else {
|
1994
1994
|
if (buff[count] == '%') {
|
@@ -2002,7 +2002,7 @@ _match:
|
|
2002
2002
|
}
|
2003
2003
|
|
2004
2004
|
line = lexer->line_number;
|
2005
|
-
lexer_init(lexer);
|
2005
|
+
lexer_init(lexer); /* Re-initialize so we can scan again with the same lexer */
|
2006
2006
|
raise_lexer_error(newstr, line);
|
2007
2007
|
} else {
|
2008
2008
|
rb_funcall(listener, rb_intern("eof"), 0);
|
@@ -2044,14 +2044,14 @@ _again:
|
|
2044
2044
|
buff = data;
|
2045
2045
|
}
|
2046
2046
|
|
2047
|
-
|
2047
|
+
/* Allocate as a ruby string so that it gets cleaned up by GC */
|
2048
2048
|
newstr_val = rb_str_new(buff, len);
|
2049
2049
|
newstr = RSTRING_PTR(newstr_val);
|
2050
2050
|
|
2051
2051
|
|
2052
2052
|
for (count = 0; count < len; count++) {
|
2053
2053
|
if(buff[count] == 10) {
|
2054
|
-
newstr[newstr_count] = '\0';
|
2054
|
+
newstr[newstr_count] = '\0'; /* terminate new string at first newline found */
|
2055
2055
|
break;
|
2056
2056
|
} else {
|
2057
2057
|
if (buff[count] == '%') {
|
@@ -2065,7 +2065,7 @@ _again:
|
|
2065
2065
|
}
|
2066
2066
|
|
2067
2067
|
line = lexer->line_number;
|
2068
|
-
lexer_init(lexer);
|
2068
|
+
lexer_init(lexer); /* Re-initialize so we can scan again with the same lexer */
|
2069
2069
|
raise_lexer_error(newstr, line);
|
2070
2070
|
} else {
|
2071
2071
|
rb_funcall(listener, rb_intern("eof"), 0);
|
@@ -2086,7 +2086,7 @@ _again:
|
|
2086
2086
|
assert(lexer->content_start <= len && "content starts after data end");
|
2087
2087
|
assert(lexer->mark < len && "mark is after data end");
|
2088
2088
|
|
2089
|
-
|
2089
|
+
/* Reset lexer by re-initializing the whole thing */
|
2090
2090
|
lexer_init(lexer);
|
2091
2091
|
|
2092
2092
|
if (cs == lexer_error) {
|