diff --git a/fea-rs/src/parse/grammar/gpos.rs b/fea-rs/src/parse/grammar/gpos.rs index 5f4b49645..f0c4bb2e4 100644 --- a/fea-rs/src/parse/grammar/gpos.rs +++ b/fea-rs/src/parse/grammar/gpos.rs @@ -60,7 +60,10 @@ pub(crate) fn gpos_rule(parser: &mut Parser, recovery: TokenSet) { // now either a single or pair (type A) if metrics::eat_value_record(parser, recovery) { if glyph::eat_glyph_or_glyph_class(parser, recovery) { - metrics::expect_value_record(parser, recovery); + // second value record is expected per the spec, but + // skipping it is supported in afdko & feaLib: + // https://github.com/adobe-type-tools/afdko/issues/1757 + metrics::eat_value_record(parser, recovery); parser.expect_semi(); return AstKind::GposType2; } diff --git a/fea-rs/test-data/compile-tests/mini-latin/good/pair_pos_funny_syntax.fea b/fea-rs/test-data/compile-tests/mini-latin/good/pair_pos_funny_syntax.fea new file mode 100644 index 000000000..a8dded9dc --- /dev/null +++ b/fea-rs/test-data/compile-tests/mini-latin/good/pair_pos_funny_syntax.fea @@ -0,0 +1,8 @@ +feature derp { + # this is not documented syntax but is treated equivalently to + # 'pos a b 30' and is handled by both feaLib and afdko + # ( see https://github.com/adobe-type-tools/afdko/issues/1757 ) + pos a 30 b; + # so basically the same as, + pos a c 30; +} derp; diff --git a/fea-rs/test-data/compile-tests/mini-latin/good/pair_pos_funny_syntax.ttx b/fea-rs/test-data/compile-tests/mini-latin/good/pair_pos_funny_syntax.ttx new file mode 100644 index 000000000..4aff19088 --- /dev/null +++ b/fea-rs/test-data/compile-tests/mini-latin/good/pair_pos_funny_syntax.ttx @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +