Skip to content

Commit

Permalink
Fix bug where +#a did not work in ixml grammar.
Browse files Browse the repository at this point in the history
  • Loading branch information
weetmuts committed Feb 4, 2025
1 parent 41391ab commit 62bea88
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/c/parts/ixml.c
Original file line number Diff line number Diff line change
Expand Up @@ -966,10 +966,12 @@ void parse_ixml_insertion(XMQParseState *state)
}
else if (is_ixml_encoded_start(state))
{
allocate_yaep_tmp_terminals(state);
parse_ixml_encoded(state, true);
UTF8Char c;
encode_utf8(state->ixml_encoded, &c);
add_insertion_rule(state, c.bytes);
free_yaep_tmp_terminals(state);
}
else
{
Expand Down
15 changes: 15 additions & 0 deletions tests/backforth_041_newlines.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
INPUT
root {
alfa = 'a

a'
}
FIRST
{"_":"root","alfa":"a\n\na"}
SECOND
root{alfa=('a'

'a')}
END
ARGS_FIRST
CMDS_FIRST to-json
ARGS_SECOND
CMDS_SECOND to-xmq --compact
11 changes: 11 additions & 0 deletions tests/ixml_parse_055_insert_encoded.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
START
alfa: A, +#a, +#a, A.
-A: 'a'.
INPUT
aa
OUTPUT
alfa = 'a

a'
END
ARGS=

0 comments on commit 62bea88

Please sign in to comment.