All Downloads are FREE. Search and download functionalities are using the official Maven repository.

js.prompto.argument.CodeArgument.js Maven / Gradle / Ivy

var CodeType = require("../type/CodeType").CodeType;
var Argument = require("./Argument").Argument;

function CodeArgument(id) {
	Argument.call(this, id);
	return this;
}

CodeArgument.prototype = Object.create(Argument.prototype);
CodeArgument.prototype.constructor = CodeArgument;


CodeArgument.prototype.getProto = function() {
	return CodeType.instance.name;
};


CodeArgument.prototype.register = function(context) {
	var actual = context.getRegisteredValue(this.name);
	if(actual!=null) {
		throw new SyntaxError("Duplicate argument: \"" + this.name + "\"");
	}
	context.registerValue(this);
};

CodeArgument.prototype.check = function(context) {
	// ok
};

CodeArgument.prototype.getType = function(context) {
	return CodeType.instance;
};

CodeArgument.prototype.toDialect = function(writer) {
    writer.append(CodeType.instance.name);
    writer.append(" ");
    writer.append(this.name);
};


exports.CodeArgument = CodeArgument;




© 2015 - 2025 Weber Informatics LLC | Privacy Policy