77using Mages . Core ;
88using Flow . Launcher . Plugin . Calculator . ViewModels ;
99using Flow . Launcher . Plugin . Calculator . Views ;
10- using System . IO ;
11- using System . Net . Quic ;
10+
1211
1312namespace Flow . Launcher . Plugin . Calculator
1413{
@@ -23,7 +22,6 @@ public class Main : IPlugin, IPluginI18n, ISettingProvider
2322 @"factorial|sign|isprime|isinfty|" +
2423 @"==|~=|&&|\|\||(?:\<|\>)=?|" +
2524 @"[ei]|[0-9]|[\+\%\-\*\/\^\., ""]|[\(\)\|\!\[\]]" +
26-
2725 @")+$" , RegexOptions . Compiled ) ;
2826 private static readonly Regex RegBrackets = new Regex ( @"[\(\)\[\]]" , RegexOptions . Compiled ) ;
2927 private static Engine MagesEngine ;
@@ -47,9 +45,7 @@ public void Init(PluginInitContext context)
4745 {
4846 { "e" , Math . E } , // e is not contained in the default mages engine
4947 }
50- }
51- ) ;
52- ;
48+ } ) ;
5349 Func < double , double > rad2deg = ( rad ) => rad * ( 180.0 / Math . PI ) ;
5450 MagesEngine . SetFunction ( "rad2deg" , rad2deg ) ;
5551 MagesEngine . SetFunction ( "deg2rad" , ( double x ) => x * ( Math . PI / 180.0 ) ) ;
@@ -76,7 +72,7 @@ public List<Result> Query(Query query)
7672 expression = query . Search ;
7773 break ;
7874 }
79- // Replace all spaces in the expression
75+
8076 var result = MagesEngine . Interpret ( expression ) ;
8177
8278 if ( result ? . ToString ( ) == "NaN" )
0 commit comments