private PostMessage ProcessCommand(RTM.Message x) { AliasCommand.RecCount = 0; CurrentPostCount = 0; CurrentMessages = new PostMessage[10]; CallContext.LogicalSetData("Slack", this); x.text = HttpUtility.HtmlDecode(x.text); var i = x.text.IndexOf(':'); if (i == -1) { return(null); } var p = CommandParser.ParseCommand(x.text, false); if (p.Command.Name == "alias") { p = CommandParser.ParseCommand(x.text, false, false); AliasDefine.AddAlias(p.Argument, p.Text); return(null); } var bm = new PostMessage { Slack = this, Channel = x.channel }; CurrentMessage = bm; bm.Text = p.Command.Process(p.Text, p.Argument); if (string.IsNullOrEmpty(bm.Text)) { return(null); } return(bm); }
public override bool Transform(AliasDefine node) { if (node.Order == AliasDefine.OrderType.Column) { string tmpVal = node.Value; node.Value = CaseFormatUtils.Convert(_entity.ReservedWordCase, "AS"); node.Value += _entity.BeforeAliasDefineWhiteSpace; node.Value += tmpVal; } return(base.Transform(node)); }
static void Main(string[] args) { CommandRegister.Regist(new EchoCommand2()); CommandRegister.Regist(new Echo()); CommandRegister.Regist(new Filter("おちゃめ", ochame)); CommandRegister.Regist(new Filter("んちゃめ", nchame)); CommandRegister.Regist(new Filter("んもうだめ", nmoudame)); #if RAKUDALANG CommandRegister.Regist(new Rakuda()); #endif CommandRegister.Regist(new Pipe()); CommandRegister.Regist(new Repeat()); CommandRegister.Regist(new Plus()); CommandRegister.Regist(new Minus()); CommandRegister.Regist(new Mul()); CommandRegister.Regist(new Div()); CommandRegister.Regist(new Mod()); CommandRegister.Regist(new otyaCommand()); CommandRegister.Regist(new Gobi()); CommandRegister.Regist(new AliasDefine()); CommandRegister.Regist(new Replace()); CommandRegister.Regist(new Append()); #if GOOGLETRANSLATE CommandRegister.Regist(new GoogleTranslate()); #endif CommandRegister.Regist(new EqualCommand2()); CommandRegister.Regist(new Equal()); CommandRegister.Regist(new Kao()); CommandRegister.Regist(new CommandRandom()); CommandRegister.Regist(new Array()); CommandRegister.Regist(new Array2()); CommandRegister.Regist(new ArrayAccess()); CommandRegister.Regist(new CommandSubstr()); CommandRegister.Regist(new CommandChr()); CommandRegister.Regist(new CommandLen()); CommandRegister.Regist(new Json()); #if MECAB CommandRegister.Regist(new SuperMecab()); #endif CommandRegister.Regist(new ArrayItem()); CommandRegister.Regist(new StrLen()); CommandRegister.Regist(new ArrayLen()); CommandRegister.Regist(new If()); CommandRegister.Regist(new GetLocal()); CommandRegister.Regist(new SetLocal()); CommandRegister.Regist(new HasLocal()); CommandRegister.Regist(new RegexReplace()); CommandRegister.Regist(new WGet()); CommandRegister.Regist(new RegexIsMatch()); CommandRegister.Regist(new BASIC.BASIC()); //CommandRegister.Regist(new Browser()); CommandRegister.Regist(new OnReaction()); CommandRegister.Regist(new OnReactionRemoved()); CommandRegister.Regist(new OnPosted()); CommandRegister.Regist(new AddReaction()); CommandRegister.Regist(new SetIconEmoji()); CommandRegister.Regist(new Post()); CommandRegister.Regist(new SetPost()); CommandRegister.Regist(new GetPost()); CommandRegister.Regist(new Edit()); CommandRegister.Regist(new SetTimeout()); CommandRegister.Regist(new GetReactionCount()); AliasDefine.LoadAlias(); if (args.Length == 0) { Console.WriteLine("token"); return; } fuga(args[0]); //hoge(args[0]); Thread.Sleep(-1); }
public override bool Visit(AliasDefine node) { _currentLine = _tabTool.Pad(_currentLine, _LeftIndentSize.Peek()); AddResultSql(node.Value); return(base.Visit(node)); }
public virtual bool Visit(AliasDefine node) { return(true); }
public override bool Transform(AliasDefine node) { node.Value = CaseFormatUtils.Convert(_entity.AliasNameCase, node.Value); return(base.Transform(node)); }
public virtual bool Transform(AliasDefine node) { return(true); }