Example #1
0
        public void TestArglistEscapeSpace()
        {
            Arglist args = new Arglist(@"open C:\\Program\ Files\ (x86)\\UwuCore\\setup.ini");

            Assert.AreEqual(@"open", args.Shift());
            Assert.AreEqual(@"C:\Program Files (x86)\UwuCore\setup.ini", args.Shift());
        }
Example #2
0
        public void TestArglistEscapeNL()
        {
            Arglist args = new Arglist("send 'ls -ltr\n'");

            Assert.AreEqual(@"send", args.Shift());
            Assert.AreEqual("ls -ltr\n", args.Shift());
        }
Example #3
0
        public void TestArglistParsingDQ()
        {
            Arglist args = new Arglist("\"Don't try to stop me!\" SIGTERM");

            Assert.AreEqual(@"Don't try to stop me!", args.Shift());
            Assert.AreEqual(@"SIGTERM", args.Shift());
        }
Example #4
0
        public void TestArglistParsing()
        {
            Arglist args = new Arglist(@"test C:\\Users\\Kevin\\Profile");

            Assert.AreEqual(@"test", args.Shift());
            Assert.AreEqual(@"C:\Users\Kevin\Profile", args.Shift());
        }
Example #5
0
        public void TestArglistEscapeUnicode()
        {
            Arglist args = new Arglist(@"alpha U+03b1 \u03b1");

            Assert.AreEqual(@"alpha", args.Shift());
            Assert.AreEqual(@"U+03b1", args.Shift());
            Assert.AreEqual("\u03b1", args.Shift());
        }
Example #6
0
        public void TestArglistParsingSQ()
        {
            Arglist args = new Arglist("'echo $DISPLAY >>/dev/null' || die");

            Assert.AreEqual(@"echo $DISPLAY >>/dev/null", args.Shift());
            Assert.AreEqual(@"||", args.Shift());
            Assert.AreEqual(@"die", args.Shift());
        }
Example #7
0
        static MetaType[] GetVarargsTypes(MethodSpec method, Arguments arguments)
        {
            AParametersCollection pd = method.Parameters;

            Argument a    = arguments[pd.Count - 1];
            Arglist  list = (Arglist)a.Expr;

            return(list.ArgumentTypes);
        }
 public virtual object Visit(Arglist argListExpression)
 {
     return(null);
 }
			public override object Visit (Arglist argListExpression)
			{
				var result = new UndocumentedExpression () { UndocumentedExpressionType = UndocumentedExpressionType.ArgList };
				result.AddChild (new CSharpTokenNode (Convert (argListExpression.Location), UndocumentedExpression.ArglistKeywordRole), UndocumentedExpression.ArglistKeywordRole);
				var location = LocationsBag.GetLocations (argListExpression);
				if (location != null)
					result.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.LPar), Roles.LPar);
				
				AddArguments (result, location, argListExpression.Arguments);
				
				if (location != null && location.Count > 1)
					result.AddChild (new CSharpTokenNode (Convert (location [1]), Roles.RPar), Roles.RPar);
				return result;
			}
Example #10
0
        public void TestArglistJoin()
        {
            Arglist args = new Arglist("one 't w o' \"ain't that you?\"");

            Assert.AreEqual("one \"t w o\" \"ain't that you?\"", args.Join());
        }
Example #11
0
        public void TestArglistQuotedInternal()
        {
            Arglist args = new Arglist("'my name'='Joe Bloggs'");

            Assert.AreEqual(@"my name=Joe Bloggs", args.Shift());
        }
Example #12
0
		public virtual object Visit (Arglist argListExpression)
		{
			return null;
		}