From 96bc7205e271afc830d5fa53b52f0eb16446c45b Mon Sep 17 00:00:00 2001 From: marihachi <marihachi0620@gmail.com> Date: Thu, 15 Apr 2021 00:03:09 +0900 Subject: [PATCH] fix bug of #42 --- src/parser.pegjs | 2 +- test/parser.ts | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/parser.pegjs b/src/parser.pegjs index eef222c..555ec65 100644 --- a/src/parser.pegjs +++ b/src/parser.pegjs @@ -371,7 +371,7 @@ fnArgs } fnArg - = k:$([a-z0-9_]i)+ "=" v:$([a-z0-9_]i)+ + = k:$([a-z0-9_]i)+ "=" v:$([a-z0-9_.]i)+ { return { k, v }; } diff --git a/test/parser.ts b/test/parser.ts index c889ec5..fc29f1a 100644 --- a/test/parser.ts +++ b/test/parser.ts @@ -474,6 +474,16 @@ describe('parser', () => { ]; assert.deepStrictEqual(mfm.parse(input), output); }); + + it('with a string argument', () => { + const input = '[spin.speed=1.1s a]'; + const output = [ + FN('spin', { speed: '1.1s' }, [ + TEXT('a') + ]) + ]; + assert.deepStrictEqual(mfm.parse(input), output); + }); }); it('composite', () => { -- GitLab