diff --git a/Jellyfin.Plugin.SmartPlaylist/Lisp/Compiler/TokenStream.cs b/Jellyfin.Plugin.SmartPlaylist/Lisp/Compiler/TokenStream.cs index d334f0d..0d0425f 100644 --- a/Jellyfin.Plugin.SmartPlaylist/Lisp/Compiler/TokenStream.cs +++ b/Jellyfin.Plugin.SmartPlaylist/Lisp/Compiler/TokenStream.cs @@ -78,7 +78,10 @@ namespace Jellyfin.Plugin.SmartPlaylist.Lisp.Compiler { } value += t; } - return null; + if (value.Equals("")) { + return null; + } + return new AtomToken(value); } } @@ -101,7 +104,7 @@ namespace Jellyfin.Plugin.SmartPlaylist.Lisp.Compiler { if (prev_avail == program.Available() && prev_avail == 0) { break; } else if (prev_avail == program.Available()) { - throw new ApplicationException("Program is invalid"); + throw new ApplicationException($"Program is invalid, still available: {program.Available()}"); } prev_avail = program.Available(); foreach (Type c in _classes) { diff --git a/Tests/Tests.cs b/Tests/Tests.cs index cd85678..3f358d1 100644 --- a/Tests/Tests.cs +++ b/Tests/Tests.cs @@ -148,6 +148,7 @@ namespace Tests (if (> 0 1) (car (quote (1 2 3))) (cdr (quote (2 3 4))))) """).ToString()); + Assert.Equal("a", e.eval("'a").ToString()); } [Fact]