Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions fluent-syntax/test/fixtures_reference/any_char.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# ↓ BEL, U+0007
control0 = abcdef

# ↓ DEL, U+007F
delete = abcdef

# ↓ BPM, U+0082
control1 = abc‚def
68 changes: 68 additions & 0 deletions fluent-syntax/test/fixtures_reference/any_char.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"type": "Resource",
"body": [
{
"type": "Message",
"id": {
"type": "Identifier",
"name": "control0"
},
"value": {
"type": "Pattern",
"elements": [
{
"type": "TextElement",
"value": "abc\u0007def"
}
]
},
"attributes": [],
"comment": {
"type": "Comment",
"content": " ↓ BEL, U+0007"
}
},
{
"type": "Message",
"id": {
"type": "Identifier",
"name": "delete"
},
"value": {
"type": "Pattern",
"elements": [
{
"type": "TextElement",
"value": "abcdef"
}
]
},
"attributes": [],
"comment": {
"type": "Comment",
"content": " ↓ DEL, U+007F"
}
},
{
"type": "Message",
"id": {
"type": "Identifier",
"name": "control1"
},
"value": {
"type": "Pattern",
"elements": [
{
"type": "TextElement",
"value": "abc‚def"
}
]
},
"attributes": [],
"comment": {
"type": "Comment",
"content": " ↓ BPM, U+0082"
}
}
]
}
4 changes: 2 additions & 2 deletions fluent-syntax/test/fixtures_reference/astral.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
{
"type": "Junk",
"annotations": [],
"content": "err-😂 = Value\n"
"content": "err-😂 = Value\n\n"
},
{
"type": "Comment",
Expand All @@ -163,7 +163,7 @@
{
"type": "Junk",
"annotations": [],
"content": "err-invalid-expression = { 😂 }\n"
"content": "err-invalid-expression = { 😂 }\n\n"
},
{
"type": "Comment",
Expand Down
20 changes: 15 additions & 5 deletions fluent-syntax/test/fixtures_reference/call_expressions.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
{
"type": "Junk",
"annotations": [],
"content": "mixed-case-callee = {Function()}\n"
"content": "mixed-case-callee = {Function()}\n\n"
},
{
"type": "Comment",
Expand All @@ -88,7 +88,7 @@
{
"type": "Junk",
"annotations": [],
"content": "variable-callee = {$variable()}\n"
"content": "variable-callee = {$variable()}\n\n"
},
{
"type": "GroupComment",
Expand Down Expand Up @@ -323,7 +323,7 @@
{
"type": "Junk",
"annotations": [],
"content": "shuffled-args = {FUN(1, x: 1, \"a\", y: \"Y\", msg)}\n"
"content": "shuffled-args = {FUN(1, x: 1, \"a\", y: \"Y\", msg)}\n\n"
},
{
"type": "Comment",
Expand All @@ -332,7 +332,7 @@
{
"type": "Junk",
"annotations": [],
"content": "duplicate-named-args = {FUN(x: 1, x: \"X\")}\n"
"content": "duplicate-named-args = {FUN(x: 1, x: \"X\")}\n\n\n"
},
{
"type": "GroupComment",
Expand Down Expand Up @@ -1063,7 +1063,17 @@
{
"type": "Junk",
"annotations": [],
"content": "one-argument = {FUN(1,,)}\nmissing-arg = {FUN(,)}\nmissing-sparse-arg = {FUN( , )}\n"
"content": "one-argument = {FUN(1,,)}\n"
},
{
"type": "Junk",
"annotations": [],
"content": "missing-arg = {FUN(,)}\n"
},
{
"type": "Junk",
"annotations": [],
"content": "missing-sparse-arg = {FUN( , )}\n\n\n"
},
{
"type": "GroupComment",
Expand Down
2 changes: 1 addition & 1 deletion fluent-syntax/test/fixtures_reference/crlf.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
{
"type": "Junk",
"annotations": [],
"content": "err03 = { \"str\r\n"
"content": "err03 = { \"str\r\n\r\n"
},
{
"type": "Comment",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@
{
"type": "Junk",
"annotations": [],
"content": "unknown-escape = {\"\\x\"}\n"
"content": "unknown-escape = {\"\\x\"}\n\n"
},
{
"type": "GroupComment",
Expand Down
19 changes: 18 additions & 1 deletion fluent-syntax/test/fixtures_reference/junk.ftl
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
## Two adjacent Junks.
err01 = {1x}
err02 = {2x}

# A single Junk.
err03 = {1x
2

# A single Junk.
ą=Invalid identifier
ć=Another one

key01 = {
# The COMMENT ends this junk.
err04 = {
# COMMENT

# The COMMENT ends this junk.
# The closing brace is a separate Junk.
err04 = {
# COMMENT
}
57 changes: 55 additions & 2 deletions fluent-syntax/test/fixtures_reference/junk.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,68 @@
{
"type": "Resource",
"body": [
{
"type": "GroupComment",
"content": "Two adjacent Junks."
},
{
"type": "Junk",
"annotations": [],
"content": "err01 = {1x}\n"
},
{
"type": "Junk",
"annotations": [],
"content": "err02 = {2x}\n\n"
},
{
"type": "Comment",
"content": "A single Junk."
},
{
"type": "Junk",
"annotations": [],
"content": "err03 = {1x\n2\n\n"
},
{
"type": "Comment",
"content": "A single Junk."
},
{
"type": "Junk",
"annotations": [],
"content": "ą=Invalid identifier\nć=Another one\n"
"content": "ą=Invalid identifier\nć=Another one\n\n"
},
{
"type": "Comment",
"content": "The COMMENT ends this junk."
},
{
"type": "Junk",
"annotations": [],
"content": "err04 = {\n"
},
{
"type": "Comment",
"content": "COMMENT"
},
{
"type": "Comment",
"content": "The COMMENT ends this junk.\nThe closing brace is a separate Junk."
},
{
"type": "Junk",
"annotations": [],
"content": "err04 = {\n"
},
{
"type": "Comment",
"content": "COMMENT"
},
{
"type": "Junk",
"annotations": [],
"content": "key01 = {\n"
"content": "}\n"
}
]
}
12 changes: 6 additions & 6 deletions fluent-syntax/test/fixtures_reference/leading_dots.json
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
{
"type": "Junk",
"annotations": [],
"content": " .Continued\n"
"content": " .Continued\n\n"
},
{
"type": "Comment",
Expand All @@ -182,7 +182,7 @@
{
"type": "Junk",
"annotations": [],
"content": "key08 =\n .Value\n"
"content": "key08 =\n .Value\n\n"
},
{
"type": "Comment",
Expand All @@ -191,7 +191,7 @@
{
"type": "Junk",
"annotations": [],
"content": "key09 =\n .Value\n Continued\n"
"content": "key09 =\n .Value\n Continued\n\n"
},
{
"type": "Message",
Expand Down Expand Up @@ -410,7 +410,7 @@
{
"type": "Junk",
"annotations": [],
"content": "key16 =\n { 1 ->\n *[one]\n .Value\n }\n"
"content": "key16 =\n { 1 ->\n *[one]\n .Value\n }\n\n"
},
{
"type": "Comment",
Expand All @@ -419,7 +419,7 @@
{
"type": "Junk",
"annotations": [],
"content": "key17 =\n { 1 ->\n *[one] Value\n .Continued\n }\n"
"content": "key17 =\n { 1 ->\n *[one] Value\n .Continued\n }\n\n"
},
{
"type": "Comment",
Expand All @@ -428,7 +428,7 @@
{
"type": "Junk",
"annotations": [],
"content": "key18 =\n.Value\n"
"content": "key18 =\n.Value\n\n"
},
{
"type": "Message",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,12 @@
{
"type": "Junk",
"annotations": [],
"content": "variant-expression = {msg[case]}\nattribute-expression = {-term.attr}\n"
"content": "variant-expression = {msg[case]}\n"
},
{
"type": "Junk",
"annotations": [],
"content": "attribute-expression = {-term.attr}\n"
}
]
}
2 changes: 1 addition & 1 deletion fluent-syntax/test/fixtures_reference/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@
{
"type": "Junk",
"annotations": [],
"content": "key07 =\n"
"content": "key07 =\n\n"
},
{
"type": "Comment",
Expand Down
4 changes: 2 additions & 2 deletions fluent-syntax/test/fixtures_reference/mixed_entries.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
{
"type": "Junk",
"annotations": [],
"content": "ą=Invalid identifier\nć=Another one\n"
"content": "ą=Invalid identifier\nć=Another one\n\n"
},
{
"type": "Message",
Expand Down Expand Up @@ -91,7 +91,7 @@
{
"type": "Junk",
"annotations": [],
"content": " .attr = Dangling attribute\n"
"content": " .attr = Dangling attribute\n\n"
},
{
"type": "Message",
Expand Down
6 changes: 3 additions & 3 deletions fluent-syntax/test/fixtures_reference/placeables.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
{
"type": "Junk",
"annotations": [],
"content": "unmatched-open1 = { 1\n"
"content": "unmatched-open1 = { 1\n\n"
},
{
"type": "Comment",
Expand All @@ -89,7 +89,7 @@
{
"type": "Junk",
"annotations": [],
"content": "unmatched-open2 = {{ 1 }\n"
"content": "unmatched-open2 = {{ 1 }\n\n"
},
{
"type": "Comment",
Expand All @@ -98,7 +98,7 @@
{
"type": "Junk",
"annotations": [],
"content": "unmatched-close1 = 1 }\n"
"content": "unmatched-close1 = 1 }\n\n"
},
{
"type": "Comment",
Expand Down
Loading