Exemplo n.º 1
0
		public void TranslateListDefinition(List<string> output, ListDefinition list)
		{
			output.Add("[");
			for (int i = 0; i < list.Items.Length; ++i)
			{
				if (i > 0)
				{
					output.Add(", ");
				}

				this.TranslateExpression(output, list.Items[i]);
			}
			output.Add("]");
		}
Exemplo n.º 2
0
		private void CompileListDefinition(Parser parser, ByteBuffer buffer, ListDefinition listDef, bool outputUsed)
		{
			if (!outputUsed) throw new ParserException(listDef.FirstToken, "List allocation made without storing it. This is likely a mistake.");
			foreach (Expression item in listDef.Items)
			{
				this.CompileExpression(parser, buffer, item, true);
			}
			buffer.Add(listDef.FirstToken, OpCode.DEF_LIST, listDef.Items.Length);
		}