[parsing] Allow digits in mfm fn node function names
This commit is contained in:
parent
3f28a586a5
commit
c969265e61
2 changed files with 6 additions and 2 deletions
|
@ -276,7 +276,7 @@ module private MfmParser =
|
||||||
|>> fun e -> MfmEmojiCodeNode(e) :> MfmNode
|
|>> fun e -> MfmEmojiCodeNode(e) :> MfmNode
|
||||||
|
|
||||||
let fnNode =
|
let fnNode =
|
||||||
skipString "$[" >>. many1Chars asciiLower
|
skipString "$[" >>. many1Chars (asciiLower <|> digit)
|
||||||
.>>. opt (skipChar '.' >>. sepBy1 fnArg (skipChar ','))
|
.>>. opt (skipChar '.' >>. sepBy1 fnArg (skipChar ','))
|
||||||
.>> skipChar ' '
|
.>> skipChar ' '
|
||||||
.>>. many1Till inlineNode (skipChar ']')
|
.>>. many1Till inlineNode (skipChar ']')
|
||||||
|
|
|
@ -349,7 +349,7 @@ public class MfmTests
|
||||||
public void TestFn()
|
public void TestFn()
|
||||||
{
|
{
|
||||||
const string input =
|
const string input =
|
||||||
"test $[] $[test] $[test ] $[test test] $[test.a test] $[test.a=b test] $[test.a=b,c=e test] $[test.a,c=e test] $[test.a=b,c test]";
|
"test $[] $[test] $[test ] $[test test] $[test123 test] $[test.a test] $[test.a=b test] $[test.a=b,c=e test] $[test.a,c=e test] $[test.a=b,c test]";
|
||||||
|
|
||||||
var some = FSharpOption<IDictionary<string, FSharpOption<string>>>.Some;
|
var some = FSharpOption<IDictionary<string, FSharpOption<string>>>.Some;
|
||||||
var none = FSharpOption<IDictionary<string, FSharpOption<string>>>.None;
|
var none = FSharpOption<IDictionary<string, FSharpOption<string>>>.None;
|
||||||
|
@ -363,6 +363,10 @@ public class MfmTests
|
||||||
none,
|
none,
|
||||||
test),
|
test),
|
||||||
new MfmTextNode(" "),
|
new MfmTextNode(" "),
|
||||||
|
new MfmFnNode("test123",
|
||||||
|
none,
|
||||||
|
test),
|
||||||
|
new MfmTextNode(" "),
|
||||||
new MfmFnNode("test",
|
new MfmFnNode("test",
|
||||||
some(new Dictionary<string, FSharpOption<string>>{ {"a", FSharpOption<string>.None} }),
|
some(new Dictionary<string, FSharpOption<string>>{ {"a", FSharpOption<string>.None} }),
|
||||||
test),
|
test),
|
||||||
|
|
Loading…
Add table
Reference in a new issue