Exemple #1
0
        public void DoubleHashWillEmitSingleHash()
        {
            var sqlText = "\\#";
            var result  = SqlTextUtil.Parse(sqlText);

            Assert.Equal("#", result);
        }
Exemple #2
0
        public override Result VisitPlainText([NotNull] PlainTextContext context)
        {
            var sqlText    = SqlTextUtil.Parse(context.GetToken(SQLText, 0).GetText());
            var csharpText = SqlTextUtil.ToCSharpString(sqlText);

            _writer.WriteIndentLine($"sb.Append({csharpText});");
            return(Result.Ok());
        }
Exemple #3
0
        public override Result VisitPlainText([NotNull] PlainTextContext context)
        {
            var text = SqlTextUtil.Parse(context.GetToken(SQLText, 0).GetText());

            _il.Emit(OpCodes.Ldloc_0);                                             // sb
            _il.Emit(OpCodes.Ldstr, text);                                         // sb str
            _il.Emit(OpCodes.Call, _appendCall);                                   // [empty]
            return(Result.Ok());
        }