diff --git a/Jellyfin.Plugin.SmartPlaylist/Lisp/Expression.cs b/Jellyfin.Plugin.SmartPlaylist/Lisp/Expression.cs index 3cc1584..3daf3b6 100644 --- a/Jellyfin.Plugin.SmartPlaylist/Lisp/Expression.cs +++ b/Jellyfin.Plugin.SmartPlaylist/Lisp/Expression.cs @@ -243,6 +243,13 @@ namespace Jellyfin.Plugin.SmartPlaylist.Lisp { return $"{Item1} . {Item2}"; } public override string? ToString() { + if (Item1 is Symbol SymbolItem1 + && SymbolItem1.Name() == "quote" + && Item2 is Cons ConsItem2 + && ConsItem2.Item2.Equals(Boolean.FALSE) + ) { + return $"'{ConsItem2.Item1}"; + } return $"({ToStringSimple()})"; } } diff --git a/Tests/Tests.cs b/Tests/Tests.cs index da690c0..cd85678 100644 --- a/Tests/Tests.cs +++ b/Tests/Tests.cs @@ -70,7 +70,7 @@ namespace Tests program = "(abc '(1 2 3))"; sts = StringTokenStream.generate(program); p = new Parser(sts); - Assert.Equal("(abc (quote (1 2 3)))", string.Format("{0}", p.parse())); + Assert.Equal(program, string.Format("{0}", p.parse())); program = "(abc \"'(1 2 3)\")"; sts = StringTokenStream.generate(program);