diff --git a/main.go b/main.go index 75895d9..2806a81 100644 --- a/main.go +++ b/main.go @@ -17,6 +17,7 @@ func usage() { func main() { flag.Usage = usage isDebug := flag.Bool("debug", false, "use debug mode") + noLine := flag.Bool("noline", false, "skip line number hint in generated code") version := flag.Bool("version", false, "show gorazor version info") quick := flag.Bool("q", false, "enable quick mode; skip template render optimzation") namespacePrefix := flag.String("prefix", "", "tpl namespace prefix") @@ -31,12 +32,9 @@ func main() { options := razorcore.Option{} - if *isDebug { - options["Debug"] = *isDebug - } - if *nameNotChange { - options["NameNotChange"] = *nameNotChange - } + options.IsDebug = *isDebug + options.NameNotChange = *nameNotChange + options.NoLineNumber = *noLine if len(flag.Args()) != 2 { flag.Usage() diff --git a/pkg/razorcore/ast.go b/pkg/razorcore/ast.go new file mode 100644 index 0000000..10309ab --- /dev/null +++ b/pkg/razorcore/ast.go @@ -0,0 +1,140 @@ +package razorcore + +import "fmt" + +// Ast stores the abstract syntax tree +type Ast struct { + Parent *Ast + Children []interface{} + Mode int + TagName string +} + +// ModeStr return string representation of ast mode +func (ast *Ast) ModeStr() string { + switch ast.Mode { + case PRG: + return "PROGRAM" + case MKP: + return "MARKUP" + case BLK: + return "BLOCK" + case EXP: + return "EXP" + default: + return "UNDEF" + } +} + +func (ast *Ast) check() { + if len(ast.Children) >= 100000 { + panic("Maximum number of elements exceeded.") + } +} + +func (ast *Ast) addChild(child interface{}) { + ast.Children = append(ast.Children, child) + ast.check() + if _a, ok := child.(*Ast); ok { + _a.Parent = ast + } +} + +func (ast *Ast) addChildren(children []Token) { + for _, c := range children { + ast.addChild(c) + } +} + +func (ast *Ast) addAst(_ast *Ast) { + c := _ast + for { + if len(c.Children) != 1 { + break + } + first := c.Children[0] + if _, ok := first.(*Ast); !ok { + break + } + c = first.(*Ast) + } + if c.Mode != PRG { + ast.addChild(c) + } else { + for _, x := range c.Children { + ast.addChild(x) + } + } +} + +func (ast *Ast) popChild() { + l := len(ast.Children) + if l == 0 { + return + } + ast.Children = ast.Children[:l-1] +} + +func (ast *Ast) beget(mode int, tag string) *Ast { + child := &Ast{nil, []interface{}{}, mode, tag} + ast.addChild(child) + return child +} + +func (ast *Ast) closest(mode int, tag string) *Ast { + p := ast + for { + if p.TagName != tag && p.Parent != nil { + p = p.Parent + } else { + break + } + } + return p +} + +func (ast *Ast) hasNonExp() bool { + if ast.Mode != EXP { + return true + } + + for _, c := range ast.Children { + if v, ok := c.(*Ast); ok { + if v.hasNonExp() { + return true + } + } + return false + } + + return false +} + +func (ast *Ast) debug(depth int, max int) { + if depth >= max { + return + } + for i := 0; i < depth; i++ { + fmt.Printf("%c", '-') + } + fmt.Printf("TagName: %s Mode: %s Children: %d [[ \n", ast.TagName, ast.ModeStr(), len(ast.Children)) + for _, a := range ast.Children { + if _, ok := a.(*Ast); ok { + b := (*Ast)(a.(*Ast)) + b.debug(depth+1, max) + } else { + if depth+1 < max { + aa := (Token)(a.(Token)) + for i := 0; i < depth+1; i++ { + fmt.Printf("%c", '-') + } + aa.P() + } + } + } + for i := 0; i < depth; i++ { + fmt.Printf("%c", '-') + } + + fmt.Println("]]") +} diff --git a/pkg/razorcore/gogen.go b/pkg/razorcore/compiler.go similarity index 92% rename from pkg/razorcore/gogen.go rename to pkg/razorcore/compiler.go index 76e1f51..907c21a 100644 --- a/pkg/razorcore/gogen.go +++ b/pkg/razorcore/compiler.go @@ -9,6 +9,7 @@ import ( "path" "path/filepath" "runtime" + "strconv" "strings" ) @@ -54,6 +55,7 @@ func getValStr(e interface{}) string { type Part struct { ptype int value string + line int } // Compiler generate go code for gorazor template @@ -101,8 +103,8 @@ func (cp *Compiler) isLayoutSectionPart(p Part) (is bool, val string) { } val = p.value[21 : len(p.value)-3] - for _, p := range cp.paramNames { - if val == p { + for _, name := range cp.paramNames { + if val == name { return true, val } } @@ -130,6 +132,13 @@ func (cp *Compiler) isLayoutSectionTest(p Part) (is bool, val string) { return } +func (cp *Compiler) getLineHint(line int) string { + if cp.options.NoLineNumber { + return "" + } + return "// Line: " + strconv.Itoa(line) + "\n" +} + func (cp *Compiler) genPart() { res := "" @@ -141,6 +150,10 @@ func (cp *Compiler) genPart() { } if p.value != "" { p.value = fmt.Sprintf("%#v", p.value) + if p.line > 0 { + res += cp.getLineHint(p.line) + } + res += "_buffer.WriteString(" + p.value + ")\n" } } else if p.ptype == CBLK { @@ -150,6 +163,7 @@ func (cp *Compiler) genPart() { res += p.value + "\n" } } else if ok, val := cp.isLayoutSectionPart(p); ok { + res += cp.getLineHint(p.line) res += val + "(_buffer)\n" } else { res += p.value @@ -161,7 +175,7 @@ func (cp *Compiler) genPart() { func makeCompiler(ast *Ast, options Option, input string) *Compiler { dir := filepath.Base(filepath.Dir(input)) file := strings.Replace(filepath.Base(input), gzExtension, "", 1) - if options["NameNotChange"] == nil { + if !options.NameNotChange { file = Capitalize(file) } cp := &Compiler{ @@ -184,12 +198,12 @@ func makeCompiler(ast *Ast, options Option, input string) *Compiler { return cp } -func (cp *Compiler) visitBLK(child interface{}, ast *Ast) { - cp.addPart(Part{CBLK, getValStr(child)}) +func (cp *Compiler) visitBLK(child Token) { + cp.addPart(Part{CBLK, getValStr(child), child.Line}) } -func (cp *Compiler) visitMKP(child interface{}, ast *Ast) { - cp.addPart(Part{CMKP, getValStr(child)}) +func (cp *Compiler) visitMKP(child Token) { + cp.addPart(Part{CMKP, getValStr(child), child.Line}) } func (cp *Compiler) settleLayout(layoutFunc string) { @@ -325,7 +339,13 @@ func (cp *Compiler) visitExp(child interface{}, parent *Ast, idx int, isHomo boo end += ")" } + lineHint := "" + lineNumber := 0 if ppNotExp && idx == 0 { + if token, ok := child.(Token); ok { + lineNumber = token.Line + lineHint = cp.getLineHint(token.Line) + } start = "_buffer.WriteString(" + start } if ppNotExp && idx == ppChildCnt-1 { @@ -333,9 +353,13 @@ func (cp *Compiler) visitExp(child interface{}, parent *Ast, idx int, isHomo boo } if val == "raw" { - cp.addPart(Part{CSTAT, start + end}) + cp.addPart(Part{CSTAT, lineHint + start + end, lineNumber}) } else { - cp.addPart(Part{CSTAT, start + val + end}) + p := Part{CSTAT, start + val + end, lineNumber} + if ok, _ := cp.isLayoutSectionPart(p); !ok { + p.value = lineHint + p.value + } + cp.addPart(p) } } @@ -358,8 +382,8 @@ func (cp *Compiler) visitAstBlk(ast *Ast) { if remove && (idx == 0 || idx == len(ast.Children)-1) { continue } - if _, ok := c.(Token); ok { - cp.visitBLK(c, ast) + if token, ok := c.(Token); ok { + cp.visitBLK(token) } else { cp.visitAst(c.(*Ast)) } @@ -372,8 +396,8 @@ func (cp *Compiler) visitAst(ast *Ast) { case MKP: cp.firstBLK = 1 for _, c := range ast.Children { - if _, ok := c.(Token); ok { - cp.visitMKP(c, ast) + if token, ok := c.(Token); ok { + cp.visitMKP(token) } else { cp.visitAst(c.(*Ast)) } @@ -594,7 +618,7 @@ func run(path string, Options Option) (*Compiler, error) { } //DEBUG - if Options["Debug"] != nil { + if Options.IsDebug { fmt.Println("------------------- TOKEN START -----------------") for _, elem := range res { elem.P() @@ -610,7 +634,7 @@ func run(path string, Options Option) (*Compiler, error) { } //DEBUG - if Options["Debug"] != nil { + if Options.IsDebug { fmt.Println("--------------------- AST START -----------------") parser.ast.debug(0, 20) fmt.Println("--------------------- AST END -----------------") diff --git a/pkg/razorcore/gorazor_test.go b/pkg/razorcore/gorazor_test.go index 1a80032..bfb6441 100644 --- a/pkg/razorcore/gorazor_test.go +++ b/pkg/razorcore/gorazor_test.go @@ -78,7 +78,7 @@ func TestDebug(t *testing.T) { casedir, _ := filepath.Abs(filepath.Dir("./cases/")) outdir, _ := filepath.Abs(filepath.Dir("./" + testdata + "/")) option := Option{} - option["Debug"] = true + option.IsDebug = true GenFile(casedir+"/var.gohtml", outdir+"/_var.gohtml", option) } diff --git a/pkg/razorcore/lexer.go b/pkg/razorcore/lexer.go index e64d300..28199d5 100644 --- a/pkg/razorcore/lexer.go +++ b/pkg/razorcore/lexer.go @@ -56,10 +56,11 @@ var typeStr = [...]string{ "TEXT_TAG_OPEN", "COMMENT_TAG_OPEN", "COMMENT_TAG_CLOSE", "WHITESPACE"} // Option have following options: -// Debug bool -// Watch bool -// NameNotChange bool -type Option map[string]interface{} +type Option struct { + IsDebug bool + NoLineNumber bool + NameNotChange bool +} // TokenMatch store matched token type TokenMatch struct { @@ -194,9 +195,8 @@ func tryPeekNext(text string) (match string, tokVal int, ok bool) { func (lexer *Lexer) Scan() ([]Token, error) { toks := []Token{} text := strings.Replace(lexer.Text, "\r\n", "\n", -1) - text = strings.Replace(text, "\r", "\n", -1) text += "\n" - cur, line, pos := 0, 0, 0 + cur, line, pos := 0, 1, 0 for cur < len(text) { val, left := text[cur], text[cur:] var tok Token diff --git a/pkg/razorcore/parser.go b/pkg/razorcore/parser.go index f850a03..a6cb2f2 100644 --- a/pkg/razorcore/parser.go +++ b/pkg/razorcore/parser.go @@ -27,143 +27,6 @@ var PAIRS = map[int]int{ tkAtColon: tkNewline, } -// Ast stores the abstract syntax tree -type Ast struct { - Parent *Ast - Children []interface{} - Mode int - TagName string -} - -// ModeStr return string representation of ast mode -func (ast *Ast) ModeStr() string { - switch ast.Mode { - case PRG: - return "PROGRAM" - case MKP: - return "MARKUP" - case BLK: - return "BLOCK" - case EXP: - return "EXP" - default: - return "UNDEF" - } -} - -func (ast *Ast) check() { - if len(ast.Children) >= 100000 { - panic("Maximum number of elements exceeded.") - } -} - -func (ast *Ast) addChild(child interface{}) { - ast.Children = append(ast.Children, child) - ast.check() - if _a, ok := child.(*Ast); ok { - _a.Parent = ast - } -} - -func (ast *Ast) addChildren(children []Token) { - for _, c := range children { - ast.addChild(c) - } -} - -func (ast *Ast) addAst(_ast *Ast) { - c := _ast - for { - if len(c.Children) != 1 { - break - } - first := c.Children[0] - if _, ok := first.(*Ast); !ok { - break - } - c = first.(*Ast) - } - if c.Mode != PRG { - ast.addChild(c) - } else { - for _, x := range c.Children { - ast.addChild(x) - } - } -} - -func (ast *Ast) popChild() { - l := len(ast.Children) - if l == 0 { - return - } - ast.Children = ast.Children[:l-1] -} - -func (ast *Ast) beget(mode int, tag string) *Ast { - child := &Ast{nil, []interface{}{}, mode, tag} - ast.addChild(child) - return child -} - -func (ast *Ast) closest(mode int, tag string) *Ast { - p := ast - for { - if p.TagName != tag && p.Parent != nil { - p = p.Parent - } else { - break - } - } - return p -} - -func (ast *Ast) hasNonExp() bool { - if ast.Mode != EXP { - return true - } - - for _, c := range ast.Children { - if v, ok := c.(*Ast); ok { - if v.hasNonExp() { - return true - } - } - return false - } - - return false -} - -func (ast *Ast) debug(depth int, max int) { - if depth >= max { - return - } - for i := 0; i < depth; i++ { - fmt.Printf("%c", '-') - } - fmt.Printf("TagName: %s Mode: %s Children: %d [[ \n", ast.TagName, ast.ModeStr(), len(ast.Children)) - for _, a := range ast.Children { - if _, ok := a.(*Ast); ok { - b := (*Ast)(a.(*Ast)) - b.debug(depth+1, max) - } else { - if depth+1 < max { - aa := (Token)(a.(Token)) - for i := 0; i < depth+1; i++ { - fmt.Printf("%c", '-') - } - aa.P() - } - } - } - for i := 0; i < depth; i++ { - fmt.Printf("%c", '-') - } - - fmt.Println("]]") -} - // Parser parse the gorazor file type Parser struct { ast *Ast diff --git a/pkg/razorcore/testdata/add.go b/pkg/razorcore/testdata/add.go index d0e221f..a504e86 100644 --- a/pkg/razorcore/testdata/add.go +++ b/pkg/razorcore/testdata/add.go @@ -1,4 +1,4 @@ -// This file is generated by gorazor 1.2.1 +// This file is generated by gorazor 1.2.2 // DON'T modified manually // Should edit source file and re-generate: cases/add.gohtml @@ -22,26 +22,35 @@ func Add(content string, err string) string { func RenderAdd(_buffer io.StringWriter, content string, err string) { _body := func(_buffer io.StringWriter) { + // Line: 8 _buffer.WriteString("\n\n\n\n\n\n

日程登记

\n\n
\n\t
\n\t
\n\t\t

") + // Line: 23 _buffer.WriteString(gorazor.HTMLEscape(err)) + // Line: 23 _buffer.WriteString("

\n\t
\n\n\t
\n\t内容:\n\t\n\t
\n\n\t
\n\t开始时间:\n\t\n\t
\n\n\t
\n\t结束时间:\n\t\n\t
\n\n\t
\n\t日程指派:\n\t\n\t
\n\n\t
\n\t\n\t
\n\t
\n
") } _title := func(_buffer io.StringWriter) { + // Line: 57 _buffer.WriteString("管理后台 - 添加日程") } _js := func(_buffer io.StringWriter) { + // Line: 61 _buffer.WriteString("") + // Line: 62 _buffer.WriteString("") + // Line: 63 _buffer.WriteString("") } diff --git a/pkg/razorcore/testdata/argsbug.go b/pkg/razorcore/testdata/argsbug.go index f9379fc..41ea948 100644 --- a/pkg/razorcore/testdata/argsbug.go +++ b/pkg/razorcore/testdata/argsbug.go @@ -1,4 +1,4 @@ -// This file is generated by gorazor 1.2.1 +// This file is generated by gorazor 1.2.2 // DON'T modified manually // Should edit source file and re-generate: cases/argsbug.gohtml @@ -25,8 +25,11 @@ func RenderArgsbug(_buffer io.StringWriter, totalMessage int, u *User) { messages := []string{} + // Line: 13 _buffer.WriteString("\n\n

") + // Line: 15 _buffer.WriteString(gorazor.HTMLEscape(gorazor.Itoa(args(messages...)))) + // Line: 15 _buffer.WriteString("

") } diff --git a/pkg/razorcore/testdata/badtag.go b/pkg/razorcore/testdata/badtag.go index 7c00f0d..e30158b 100644 --- a/pkg/razorcore/testdata/badtag.go +++ b/pkg/razorcore/testdata/badtag.go @@ -1,4 +1,4 @@ -// This file is generated by gorazor 1.2.1 +// This file is generated by gorazor 1.2.2 // DON'T modified manually // Should edit source file and re-generate: cases/badtag.gohtml @@ -21,25 +21,42 @@ func Badtag(w *gorazor.Widget) string { func RenderBadtag(_buffer io.StringWriter, w *gorazor.Widget) { if w.ErrorMsg != "" { + // Line: 6 _buffer.WriteString("
\n\t
") + // Line: 7 _buffer.WriteString(gorazor.HTMLEscape(w.ErrorMsg)) + // Line: 7 _buffer.WriteString("
") } else { + // Line: 9 _buffer.WriteString("
") } + // Line: 10 _buffer.WriteString("\n\n\t\n\t\n
") } diff --git a/pkg/razorcore/testdata/base.go b/pkg/razorcore/testdata/base.go index e344203..6cef7f6 100644 --- a/pkg/razorcore/testdata/base.go +++ b/pkg/razorcore/testdata/base.go @@ -1,4 +1,4 @@ -// This file is generated by gorazor 1.2.1 +// This file is generated by gorazor 1.2.2 // DON'T modified manually // Should edit source file and re-generate: cases/base.gohtml @@ -20,12 +20,19 @@ func Base(body string, title string) string { // RenderBase render cases/base.gohtml func RenderBase(_buffer io.StringWriter, body string, title string) { + // Line: 7 _buffer.WriteString("\n\n\n\n\t\n \n \n\t\n\t\n \n \n\t") + // Line: 21 _buffer.WriteString(gorazor.HTMLEscape(title)) + // Line: 21 _buffer.WriteString("\n\n\n
\n
\n
\n \n 广东省政法委信息化平台\n
\n
\n \n
\n \n
\n
\n
\n
\n\n
\n
\n
\n\t\t\t") + // Line: 51 _buffer.WriteString((helper.Menu())) + // Line: 51 _buffer.WriteString("\n
\n
\n ") + // Line: 54 _buffer.WriteString(gorazor.HTMLEscape(body)) + // Line: 54 _buffer.WriteString("\n
\n
\n
\n\t\n\t\n \n") } diff --git a/pkg/razorcore/testdata/base_layout.go b/pkg/razorcore/testdata/base_layout.go index 66d65a2..017e28f 100644 --- a/pkg/razorcore/testdata/base_layout.go +++ b/pkg/razorcore/testdata/base_layout.go @@ -1,4 +1,4 @@ -// This file is generated by gorazor 1.2.1 +// This file is generated by gorazor 1.2.2 // DON'T modified manually // Should edit source file and re-generate: cases/base_layout.gohtml @@ -28,10 +28,15 @@ func Base_layout(body string, title string) string { // RenderBase_layout render cases/base_layout.gohtml func RenderBase_layout(_buffer io.StringWriter, body func(_buffer io.StringWriter), title func(_buffer io.StringWriter)) { + // Line: 5 _buffer.WriteString("\n\n \n ") + // Line: 8 _buffer.WriteString(gorazor.HTMLEscape(title)) + // Line: 8 _buffer.WriteString("\n \n ") + // Line: 10 _buffer.WriteString(gorazor.HTMLEscape(body)) + // Line: 10 _buffer.WriteString("\n") } diff --git a/pkg/razorcore/testdata/blk.go b/pkg/razorcore/testdata/blk.go index 4dd8bff..8f8dbb0 100644 --- a/pkg/razorcore/testdata/blk.go +++ b/pkg/razorcore/testdata/blk.go @@ -1,4 +1,4 @@ -// This file is generated by gorazor 1.2.1 +// This file is generated by gorazor 1.2.2 // DON'T modified manually // Should edit source file and re-generate: cases/blk.gohtml diff --git a/pkg/razorcore/testdata/brace_bug.go b/pkg/razorcore/testdata/brace_bug.go index 82a4566..673d87d 100644 --- a/pkg/razorcore/testdata/brace_bug.go +++ b/pkg/razorcore/testdata/brace_bug.go @@ -1,4 +1,4 @@ -// This file is generated by gorazor 1.2.1 +// This file is generated by gorazor 1.2.2 // DON'T modified manually // Should edit source file and re-generate: cases/brace_bug.gohtml @@ -22,9 +22,11 @@ func RenderBrace_bug(_buffer io.StringWriter) { isActive := func(name string) { if active == name { + // Line: 7 _buffer.WriteString("
  • \n ") } else { + // Line: 9 _buffer.WriteString("
  • \n ") } } diff --git a/pkg/razorcore/testdata/bug.go b/pkg/razorcore/testdata/bug.go index dde8bb7..63b34ee 100644 --- a/pkg/razorcore/testdata/bug.go +++ b/pkg/razorcore/testdata/bug.go @@ -1,4 +1,4 @@ -// This file is generated by gorazor 1.2.1 +// This file is generated by gorazor 1.2.2 // DON'T modified manually // Should edit source file and re-generate: cases/bug.gohtml @@ -18,6 +18,7 @@ func Bug() string { // RenderBug render cases/bug.gohtml func RenderBug(_buffer io.StringWriter) { + // Line: 1 _buffer.WriteString("\n \n Title\n \n\n \n Body\n \n") } diff --git a/pkg/razorcore/testdata/bug34.go b/pkg/razorcore/testdata/bug34.go index 4042e0c..5674568 100644 --- a/pkg/razorcore/testdata/bug34.go +++ b/pkg/razorcore/testdata/bug34.go @@ -1,4 +1,4 @@ -// This file is generated by gorazor 1.2.1 +// This file is generated by gorazor 1.2.2 // DON'T modified manually // Should edit source file and re-generate: cases/bug34.gohtml @@ -18,6 +18,7 @@ func Bug34() string { // RenderBug34 render cases/bug34.gohtml func RenderBug34(_buffer io.StringWriter) { + // Line: 1 _buffer.WriteString("value=\\\"\\\"/>\\n") } diff --git a/pkg/razorcore/testdata/bug42.go b/pkg/razorcore/testdata/bug42.go index 5d0ba99..30d8704 100644 --- a/pkg/razorcore/testdata/bug42.go +++ b/pkg/razorcore/testdata/bug42.go @@ -1,4 +1,4 @@ -// This file is generated by gorazor 1.2.1 +// This file is generated by gorazor 1.2.2 // DON'T modified manually // Should edit source file and re-generate: cases/bug42.gohtml @@ -20,8 +20,11 @@ func Bug42() string { // RenderBug42 render cases/bug42.gohtml func RenderBug42(_buffer io.StringWriter) { + // Line: 5 _buffer.WriteString("\n
    \n ") + // Line: 7 _buffer.WriteString(gorazor.HTMLEscape((Tpl.TplBread([]string{"选择邮寄方式"})))) + // Line: 7 _buffer.WriteString("\n
    ") } diff --git a/pkg/razorcore/testdata/bug8.go b/pkg/razorcore/testdata/bug8.go index 0a20750..e44ed1f 100644 --- a/pkg/razorcore/testdata/bug8.go +++ b/pkg/razorcore/testdata/bug8.go @@ -1,4 +1,4 @@ -// This file is generated by gorazor 1.2.1 +// This file is generated by gorazor 1.2.2 // DON'T modified manually // Should edit source file and re-generate: cases/bug8.gohtml @@ -19,8 +19,11 @@ func Bug8(l *Locale) string { // RenderBug8 render cases/bug8.gohtml func RenderBug8(_buffer io.StringWriter, l *Locale) { + // Line: 3 _buffer.WriteString("\n") + // Line: 4 _buffer.WriteString(gorazor.HTMLEscape(l.T("for"))) + // Line: 4 _buffer.WriteString("") } diff --git a/pkg/razorcore/testdata/bug9.go b/pkg/razorcore/testdata/bug9.go index b60141c..708122b 100644 --- a/pkg/razorcore/testdata/bug9.go +++ b/pkg/razorcore/testdata/bug9.go @@ -1,4 +1,4 @@ -// This file is generated by gorazor 1.2.1 +// This file is generated by gorazor 1.2.2 // DON'T modified manually // Should edit source file and re-generate: cases/bug9.gohtml @@ -19,8 +19,11 @@ func Bug9(l *Locale) string { // RenderBug9 render cases/bug9.gohtml func RenderBug9(_buffer io.StringWriter, l *Locale) { + // Line: 3 _buffer.WriteString("\n") + // Line: 4 _buffer.WriteString(gorazor.HTMLEscape(l.T(`for`))) + // Line: 4 _buffer.WriteString("") } diff --git a/pkg/razorcore/testdata/codeblock.go b/pkg/razorcore/testdata/codeblock.go index 901f6e2..4f9595c 100644 --- a/pkg/razorcore/testdata/codeblock.go +++ b/pkg/razorcore/testdata/codeblock.go @@ -1,4 +1,4 @@ -// This file is generated by gorazor 1.2.1 +// This file is generated by gorazor 1.2.2 // DON'T modified manually // Should edit source file and re-generate: cases/codeblock.gohtml diff --git a/pkg/razorcore/testdata/comment.go b/pkg/razorcore/testdata/comment.go index 9aea4a1..e5b39bb 100644 --- a/pkg/razorcore/testdata/comment.go +++ b/pkg/razorcore/testdata/comment.go @@ -1,4 +1,4 @@ -// This file is generated by gorazor 1.2.1 +// This file is generated by gorazor 1.2.2 // DON'T modified manually // Should edit source file and re-generate: cases/comment.gohtml @@ -18,6 +18,7 @@ func Comment() string { // RenderComment render cases/comment.gohtml func RenderComment(_buffer io.StringWriter) { + // Line: 2 _buffer.WriteString("\n\n\n\n

    hello

    ") hello diff --git a/pkg/razorcore/testdata/double_quote.go b/pkg/razorcore/testdata/double_quote.go index a18ce19..ecc4df3 100644 --- a/pkg/razorcore/testdata/double_quote.go +++ b/pkg/razorcore/testdata/double_quote.go @@ -1,4 +1,4 @@ -// This file is generated by gorazor 1.2.1 +// This file is generated by gorazor 1.2.2 // DON'T modified manually // Should edit source file and re-generate: cases/double_quote.gohtml @@ -18,6 +18,7 @@ func Double_quote() string { // RenderDouble_quote render cases/double_quote.gohtml func RenderDouble_quote(_buffer io.StringWriter) { + // Line: 1 _buffer.WriteString("") } diff --git a/pkg/razorcore/testdata/edit.go b/pkg/razorcore/testdata/edit.go index d297309..3e1eebb 100644 --- a/pkg/razorcore/testdata/edit.go +++ b/pkg/razorcore/testdata/edit.go @@ -1,4 +1,4 @@ -// This file is generated by gorazor 1.2.1 +// This file is generated by gorazor 1.2.2 // DON'T modified manually // Should edit source file and re-generate: cases/edit.gohtml @@ -23,16 +23,22 @@ func Edit(u *models.User) string { func RenderEdit(_buffer io.StringWriter, u *models.User) { _body := func(_buffer io.StringWriter) { + // Line: 8 _buffer.WriteString("\n
    \n
    \n
    \n \n \n
    \n
    \n \n \n
    \n \n 返回\n
    \n
    ") } _title := func(_buffer io.StringWriter) { + // Line: 26 _buffer.WriteString("用户管理") } diff --git a/pkg/razorcore/testdata/edit_layout_declare.go b/pkg/razorcore/testdata/edit_layout_declare.go index 551e2e5..e45274b 100644 --- a/pkg/razorcore/testdata/edit_layout_declare.go +++ b/pkg/razorcore/testdata/edit_layout_declare.go @@ -1,4 +1,4 @@ -// This file is generated by gorazor 1.2.1 +// This file is generated by gorazor 1.2.2 // DON'T modified manually // Should edit source file and re-generate: cases/edit_layout_declare.gohtml @@ -23,16 +23,22 @@ func Edit_layout_declare(u *models.User) string { func RenderEdit_layout_declare(_buffer io.StringWriter, u *models.User) { _body := func(_buffer io.StringWriter) { + // Line: 8 _buffer.WriteString("\n
    \n
    \n
    \n \n \n
    \n
    \n \n \n
    \n \n 返回\n
    \n
    ") } _title := func(_buffer io.StringWriter) { + // Line: 26 _buffer.WriteString("用户管理") } diff --git a/pkg/razorcore/testdata/email.go b/pkg/razorcore/testdata/email.go index 9842cd1..e5d2cc6 100644 --- a/pkg/razorcore/testdata/email.go +++ b/pkg/razorcore/testdata/email.go @@ -1,4 +1,4 @@ -// This file is generated by gorazor 1.2.1 +// This file is generated by gorazor 1.2.2 // DON'T modified manually // Should edit source file and re-generate: cases/email.gohtml @@ -19,8 +19,11 @@ func Email() string { // RenderEmail render cases/email.gohtml func RenderEmail(_buffer io.StringWriter) { + // Line: 1 _buffer.WriteString("rememberingsteve@apple.com ") + // Line: 1 _buffer.WriteString(gorazor.HTMLEscape(username)) + // Line: 1 _buffer.WriteString("") } diff --git a/pkg/razorcore/testdata/end.go b/pkg/razorcore/testdata/end.go index 6e6e155..fb336a4 100644 --- a/pkg/razorcore/testdata/end.go +++ b/pkg/razorcore/testdata/end.go @@ -1,4 +1,4 @@ -// This file is generated by gorazor 1.2.1 +// This file is generated by gorazor 1.2.2 // DON'T modified manually // Should edit source file and re-generate: cases/end.gohtml @@ -24,29 +24,42 @@ func End(totalMessage int, u *User) string { func RenderEnd(_buffer io.StringWriter, totalMessage int, u *User) { _body := func(_buffer io.StringWriter) { + // Line: 13 _buffer.WriteString((helper.Header())) + // Line: 14 _buffer.WriteString((helper.Msg(u))) for i := 0; i < 2; i++ { if totalMessage > 0 { if totalMessage == 1 { + // Line: 19 _buffer.WriteString("

    ") + // Line: 19 _buffer.WriteString(gorazor.HTMLEscape(u.Name)) + // Line: 19 _buffer.WriteString(" has 1 message

    ") } else { + // Line: 21 _buffer.WriteString("

    ") + // Line: 21 _buffer.WriteString(gorazor.HTMLEscape(u.Name)) + // Line: 21 _buffer.WriteString(" has ") + // Line: 21 _buffer.WriteString(gorazor.HTMLEscape(gorazor.Itoa(totalMessage))) + // Line: 21 _buffer.WriteString(" messages

    ") } } else { + // Line: 24 _buffer.WriteString("

    ") + // Line: 24 _buffer.WriteString(gorazor.HTMLEscape(u.Name)) + // Line: 24 _buffer.WriteString(" has no messages

    ") } @@ -56,23 +69,34 @@ func RenderEnd(_buffer io.StringWriter, totalMessage int, u *User) { if totalMessage > 0 { if totalMessage == 1 { + // Line: 33 _buffer.WriteString("

    ") + // Line: 33 _buffer.WriteString(gorazor.HTMLEscape(u.Name)) + // Line: 33 _buffer.WriteString(" has 1 message

    ") } else { + // Line: 35 _buffer.WriteString("

    ") + // Line: 35 _buffer.WriteString(gorazor.HTMLEscape(u.Name)) + // Line: 35 _buffer.WriteString(" has ") + // Line: 35 _buffer.WriteString(gorazor.HTMLEscape(gorazor.Itoa(totalMessage))) + // Line: 35 _buffer.WriteString(" messages

    ") } } else { + // Line: 38 _buffer.WriteString("

    ") + // Line: 38 _buffer.WriteString(gorazor.HTMLEscape(u.Name)) + // Line: 38 _buffer.WriteString(" has no messages

    ") } @@ -81,32 +105,45 @@ func RenderEnd(_buffer io.StringWriter, totalMessage int, u *User) { switch totalMessage { case 1: + // Line: 46 _buffer.WriteString("

    ") + // Line: 46 _buffer.WriteString(gorazor.HTMLEscape(u.Name)) + // Line: 46 _buffer.WriteString(" has 1 message

    ") case 2: + // Line: 48 _buffer.WriteString("

    ") + // Line: 48 _buffer.WriteString(gorazor.HTMLEscape(u.Name)) + // Line: 48 _buffer.WriteString(" has 2 messages

    ") default: + // Line: 50 _buffer.WriteString("

    ") + // Line: 50 _buffer.WriteString(gorazor.HTMLEscape(u.Name)) + // Line: 50 _buffer.WriteString(" has no messages

    ") } + // Line: 54 _buffer.WriteString((helper.Footer())) } _title := func(_buffer io.StringWriter) { + // Line: 57 _buffer.WriteString("") + // Line: 57 _buffer.WriteString(gorazor.HTMLEscape(u.Name)) + // Line: 57 _buffer.WriteString("'s homepage") } diff --git a/pkg/razorcore/testdata/escapebug.go b/pkg/razorcore/testdata/escapebug.go index 9b2c6fa..582a74b 100644 --- a/pkg/razorcore/testdata/escapebug.go +++ b/pkg/razorcore/testdata/escapebug.go @@ -1,4 +1,4 @@ -// This file is generated by gorazor 1.2.1 +// This file is generated by gorazor 1.2.2 // DON'T modified manually // Should edit source file and re-generate: cases/escapebug.gohtml @@ -18,6 +18,7 @@ func Escapebug() string { // RenderEscapebug render cases/escapebug.gohtml func RenderEscapebug(_buffer io.StringWriter) { + // Line: 1 _buffer.WriteString("") } diff --git a/pkg/razorcore/testdata/footer.go b/pkg/razorcore/testdata/footer.go index 9a87750..f633496 100644 --- a/pkg/razorcore/testdata/footer.go +++ b/pkg/razorcore/testdata/footer.go @@ -1,4 +1,4 @@ -// This file is generated by gorazor 1.2.1 +// This file is generated by gorazor 1.2.2 // DON'T modified manually // Should edit source file and re-generate: cases/footer.gohtml @@ -18,6 +18,7 @@ func Footer() string { // RenderFooter render cases/footer.gohtml func RenderFooter(_buffer io.StringWriter) { + // Line: 1 _buffer.WriteString("
    copyright 2014
    ") } diff --git a/pkg/razorcore/testdata/forward.go b/pkg/razorcore/testdata/forward.go index 31df587..4d83929 100644 --- a/pkg/razorcore/testdata/forward.go +++ b/pkg/razorcore/testdata/forward.go @@ -1,4 +1,4 @@ -// This file is generated by gorazor 1.2.1 +// This file is generated by gorazor 1.2.2 // DON'T modified manually // Should edit source file and re-generate: cases/forward.gohtml diff --git a/pkg/razorcore/testdata/header.go b/pkg/razorcore/testdata/header.go index 9290fad..d81217f 100644 --- a/pkg/razorcore/testdata/header.go +++ b/pkg/razorcore/testdata/header.go @@ -1,4 +1,4 @@ -// This file is generated by gorazor 1.2.1 +// This file is generated by gorazor 1.2.2 // DON'T modified manually // Should edit source file and re-generate: cases/header.gohtml @@ -18,6 +18,7 @@ func Header() string { // RenderHeader render cases/header.gohtml func RenderHeader(_buffer io.StringWriter) { + // Line: 1 _buffer.WriteString("
    Page Header
    ") } diff --git a/pkg/razorcore/testdata/home.go b/pkg/razorcore/testdata/home.go index d6d13a8..b4b197d 100644 --- a/pkg/razorcore/testdata/home.go +++ b/pkg/razorcore/testdata/home.go @@ -1,4 +1,4 @@ -// This file is generated by gorazor 1.2.1 +// This file is generated by gorazor 1.2.2 // DON'T modified manually // Should edit source file and re-generate: cases/home.gohtml @@ -24,29 +24,42 @@ func Home(totalMessage int, u *User) string { func RenderHome(_buffer io.StringWriter, totalMessage int, u *User) { _body := func(_buffer io.StringWriter) { + // Line: 13 _buffer.WriteString((helper.Header())) + // Line: 14 _buffer.WriteString((helper.Msg(u))) for i := 0; i < 2; i++ { if totalMessage > 0 { if totalMessage == 1 { + // Line: 19 _buffer.WriteString("

    ") + // Line: 19 _buffer.WriteString(gorazor.HTMLEscape(u.Name)) + // Line: 19 _buffer.WriteString(" has 1 message

    ") } else { + // Line: 21 _buffer.WriteString("

    ") + // Line: 21 _buffer.WriteString(gorazor.HTMLEscape(u.Name)) + // Line: 21 _buffer.WriteString(" has ") + // Line: 21 _buffer.WriteString(gorazor.HTMLEscape(gorazor.Itoa(totalMessage))) + // Line: 21 _buffer.WriteString(" messages

    ") } } else { + // Line: 24 _buffer.WriteString("

    ") + // Line: 24 _buffer.WriteString(gorazor.HTMLEscape(u.Name)) + // Line: 24 _buffer.WriteString(" has no messages

    ") } @@ -56,23 +69,34 @@ func RenderHome(_buffer io.StringWriter, totalMessage int, u *User) { if totalMessage > 0 { if totalMessage == 1 { + // Line: 33 _buffer.WriteString("

    ") + // Line: 33 _buffer.WriteString(gorazor.HTMLEscape(u.Name)) + // Line: 33 _buffer.WriteString(" has 1 message

    ") } else { + // Line: 35 _buffer.WriteString("

    ") + // Line: 35 _buffer.WriteString(gorazor.HTMLEscape(u.Name)) + // Line: 35 _buffer.WriteString(" has ") + // Line: 35 _buffer.WriteString(gorazor.HTMLEscape(gorazor.Itoa(totalMessage))) + // Line: 35 _buffer.WriteString(" messages

    ") } } else { + // Line: 38 _buffer.WriteString("

    ") + // Line: 38 _buffer.WriteString(gorazor.HTMLEscape(u.Name)) + // Line: 38 _buffer.WriteString(" has no messages

    ") } @@ -81,32 +105,45 @@ func RenderHome(_buffer io.StringWriter, totalMessage int, u *User) { switch totalMessage { case 1: + // Line: 46 _buffer.WriteString("

    ") + // Line: 46 _buffer.WriteString(gorazor.HTMLEscape(u.Name)) + // Line: 46 _buffer.WriteString(" has 1 message

    ") case 2: + // Line: 48 _buffer.WriteString("

    ") + // Line: 48 _buffer.WriteString(gorazor.HTMLEscape(u.Name)) + // Line: 48 _buffer.WriteString(" has 2 messages

    ") default: + // Line: 50 _buffer.WriteString("

    ") + // Line: 50 _buffer.WriteString(gorazor.HTMLEscape(u.Name)) + // Line: 50 _buffer.WriteString(" has no messages

    ") } + // Line: 54 _buffer.WriteString((helper.Footer())) } _title := func(_buffer io.StringWriter) { + // Line: 57 _buffer.WriteString("") + // Line: 57 _buffer.WriteString(gorazor.HTMLEscape(u.Name)) + // Line: 57 _buffer.WriteString("'s homepage") } diff --git a/pkg/razorcore/testdata/import.go b/pkg/razorcore/testdata/import.go index d19a922..db464c0 100644 --- a/pkg/razorcore/testdata/import.go +++ b/pkg/razorcore/testdata/import.go @@ -1,4 +1,4 @@ -// This file is generated by gorazor 1.2.1 +// This file is generated by gorazor 1.2.2 // DON'T modified manually // Should edit source file and re-generate: cases/import.gohtml @@ -23,6 +23,7 @@ func Import() string { // RenderImport render cases/import.gohtml func RenderImport(_buffer io.StringWriter) { + // Line: 11 _buffer.WriteString("\n\n\n

    hello

    ") } diff --git a/pkg/razorcore/testdata/index.go b/pkg/razorcore/testdata/index.go index 7d89e95..9add1aa 100644 --- a/pkg/razorcore/testdata/index.go +++ b/pkg/razorcore/testdata/index.go @@ -1,4 +1,4 @@ -// This file is generated by gorazor 1.2.1 +// This file is generated by gorazor 1.2.2 // DON'T modified manually // Should edit source file and re-generate: cases/index.gohtml @@ -23,20 +23,31 @@ func Index(users []*models.User, total int, limit int, offset int) string { func RenderIndex(_buffer io.StringWriter, users []*models.User, total int, limit int, offset int) { _body := func(_buffer io.StringWriter) { + // Line: 12 _buffer.WriteString("\n\n

    用户总数:") + // Line: 14 _buffer.WriteString(gorazor.HTMLEscape(gorazor.Itoa(total))) + // Line: 14 _buffer.WriteString("

    \n
    \n\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t") for _, u := range users { + // Line: 26 _buffer.WriteString("\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t") } + // Line: 31 _buffer.WriteString("\n\t\t\n\t
    名字电邮编辑
    ") + // Line: 27 _buffer.WriteString(gorazor.HTMLEscape(u.Name)) + // Line: 27 _buffer.WriteString("") + // Line: 28 _buffer.WriteString(gorazor.HTMLEscape(u.Email)) + // Line: 28 _buffer.WriteString("编辑
    \n
    ") } @@ -47,6 +58,7 @@ func RenderIndex(_buffer io.StringWriter, users []*models.User, total int, limit _title := func(_buffer io.StringWriter) { + // Line: 41 _buffer.WriteString("用户管理") } diff --git a/pkg/razorcore/testdata/inline_var.go b/pkg/razorcore/testdata/inline_var.go index 9720145..1408e91 100644 --- a/pkg/razorcore/testdata/inline_var.go +++ b/pkg/razorcore/testdata/inline_var.go @@ -1,4 +1,4 @@ -// This file is generated by gorazor 1.2.1 +// This file is generated by gorazor 1.2.2 // DON'T modified manually // Should edit source file and re-generate: cases/inline_var.gohtml @@ -20,8 +20,11 @@ func Inline_var() string { // RenderInline_var render cases/inline_var.gohtml func RenderInline_var(_buffer io.StringWriter) { + // Line: 5 _buffer.WriteString("\n\n") + // Line: 8 _buffer.WriteString(gorazor.HTMLEscape(Hello("Felix Sun", "h1", 30, &models.Author{"Van", 20}, 10))) + // Line: 8 _buffer.WriteString("\n") } diff --git a/pkg/razorcore/testdata/keyword.go b/pkg/razorcore/testdata/keyword.go index 65c083a..91b613f 100644 --- a/pkg/razorcore/testdata/keyword.go +++ b/pkg/razorcore/testdata/keyword.go @@ -1,4 +1,4 @@ -// This file is generated by gorazor 1.2.1 +// This file is generated by gorazor 1.2.2 // DON'T modified manually // Should edit source file and re-generate: cases/keyword.gohtml @@ -19,8 +19,11 @@ func Keyword() string { // RenderKeyword render cases/keyword.gohtml func RenderKeyword(_buffer io.StringWriter) { + // Line: 1 _buffer.WriteString("BLK(rememberingsteve@apple.com ") + // Line: 1 _buffer.WriteString(gorazor.HTMLEscape(username)) + // Line: 1 _buffer.WriteString(")BLK") } diff --git a/pkg/razorcore/testdata/layout.go b/pkg/razorcore/testdata/layout.go index bc7dfb2..c5681bf 100644 --- a/pkg/razorcore/testdata/layout.go +++ b/pkg/razorcore/testdata/layout.go @@ -1,4 +1,4 @@ -// This file is generated by gorazor 1.2.1 +// This file is generated by gorazor 1.2.2 // DON'T modified manually // Should edit source file and re-generate: cases/layout.gohtml @@ -19,12 +19,19 @@ func Layout(body string, title string, side string) string { // RenderLayout render cases/layout.gohtml func RenderLayout(_buffer io.StringWriter, body string, title string, side string) { + // Line: 5 _buffer.WriteString("\n\n\n\n") + // Line: 10 _buffer.WriteString(gorazor.HTMLEscape(title)) + // Line: 10 _buffer.WriteString("\n\n\n
    ") + // Line: 13 _buffer.WriteString(gorazor.HTMLEscape(body)) + // Line: 13 _buffer.WriteString("
    \n
    ") + // Line: 14 _buffer.WriteString(gorazor.HTMLEscape(side)) + // Line: 14 _buffer.WriteString("
    \n\n") } diff --git a/pkg/razorcore/testdata/layout/args.go b/pkg/razorcore/testdata/layout/args.go index b544e68..acfb926 100644 --- a/pkg/razorcore/testdata/layout/args.go +++ b/pkg/razorcore/testdata/layout/args.go @@ -1,4 +1,4 @@ -// This file is generated by gorazor 1.2.1 +// This file is generated by gorazor 1.2.2 // DON'T modified manually // Should edit source file and re-generate: cases/layout/args.gohtml diff --git a/pkg/razorcore/testdata/layout/base.go b/pkg/razorcore/testdata/layout/base.go index e6a8b8d..d6521f8 100644 --- a/pkg/razorcore/testdata/layout/base.go +++ b/pkg/razorcore/testdata/layout/base.go @@ -1,4 +1,4 @@ -// This file is generated by gorazor 1.2.1 +// This file is generated by gorazor 1.2.2 // DON'T modified manually // Should edit source file and re-generate: cases/layout/base.gohtml @@ -36,29 +36,46 @@ func RenderBase(_buffer io.StringWriter, body func(_buffer io.StringWriter), tit companyName := "深圳思品科技有限公司" + // Line: 11 _buffer.WriteString("\n\n\n\n\t\n \n \n\t\n\t\n \n \n\t") + // Line: 25 title(_buffer) + // Line: 25 _buffer.WriteString("\n\n\n
    \n
    \n \n
    \n \n
    \n \n
    \n
    \n
    \n
    \n\n
    \n
    \n
    \n\t\t\t") + // Line: 55 _buffer.WriteString((helper.Menu())) + // Line: 55 _buffer.WriteString("\n
    \n
    \n ") + // Line: 58 body(_buffer) + // Line: 58 _buffer.WriteString("\n
    \n
    \n
    \n ") if js == nil { + // Line: 63 _buffer.WriteString("") + // Line: 64 _buffer.WriteString("
    @Copyright 2019
    ") } else { + // Line: 66 _buffer.WriteString("
    ") + // Line: 66 js(_buffer) + // Line: 66 _buffer.WriteString("
    ") } + // Line: 67 _buffer.WriteString("\n\t\n\t") + // Line: 69 js(_buffer) + // Line: 69 _buffer.WriteString("\n \n") } diff --git a/pkg/razorcore/testdata/login.go b/pkg/razorcore/testdata/login.go index 11571da..2911843 100644 --- a/pkg/razorcore/testdata/login.go +++ b/pkg/razorcore/testdata/login.go @@ -1,4 +1,4 @@ -// This file is generated by gorazor 1.2.1 +// This file is generated by gorazor 1.2.2 // DON'T modified manually // Should edit source file and re-generate: cases/login.gohtml @@ -19,14 +19,19 @@ func Login(msg string) string { // RenderLogin render cases/login.gohtml func RenderLogin(_buffer io.StringWriter, msg string) { + // Line: 3 _buffer.WriteString("\n\n\n\n\n \n \n 登陆后台\n \n\n\n\n
    \n
    \n \n ") if msg != "" { + // Line: 60 _buffer.WriteString("
    ") + // Line: 60 _buffer.WriteString(gorazor.HTMLEscape(msg)) + // Line: 60 _buffer.WriteString("
    ") } + // Line: 61 _buffer.WriteString("\n\n \n \n \n \n
    \n
    \n \n \n\n") } diff --git a/pkg/razorcore/testdata/menu.go b/pkg/razorcore/testdata/menu.go index e79f2d1..878fdb1 100644 --- a/pkg/razorcore/testdata/menu.go +++ b/pkg/razorcore/testdata/menu.go @@ -1,4 +1,4 @@ -// This file is generated by gorazor 1.2.1 +// This file is generated by gorazor 1.2.2 // DON'T modified manually // Should edit source file and re-generate: cases/menu.gohtml @@ -18,6 +18,7 @@ func Menu() string { // RenderMenu render cases/menu.gohtml func RenderMenu(_buffer io.StringWriter) { + // Line: 1 _buffer.WriteString("\n") } diff --git a/pkg/razorcore/testdata/menu_layout.go b/pkg/razorcore/testdata/menu_layout.go index 8a67796..0db98aa 100644 --- a/pkg/razorcore/testdata/menu_layout.go +++ b/pkg/razorcore/testdata/menu_layout.go @@ -1,4 +1,4 @@ -// This file is generated by gorazor 1.2.1 +// This file is generated by gorazor 1.2.2 // DON'T modified manually // Should edit source file and re-generate: cases/menu_layout.gohtml @@ -36,16 +36,22 @@ func Menu_layout(body string, title string, menu string) string { func RenderMenu_layout(_buffer io.StringWriter, body func(_buffer io.StringWriter), title func(_buffer io.StringWriter), menu func(_buffer io.StringWriter)) { _body := func(_buffer io.StringWriter) { + // Line: 13 _buffer.WriteString("\n\n
    \n
    ") + // Line: 16 _buffer.WriteString(gorazor.HTMLEscape(menu)) + // Line: 16 _buffer.WriteString("
    \n
    ") + // Line: 17 _buffer.WriteString(gorazor.HTMLEscape(body)) + // Line: 17 _buffer.WriteString("
    \n
    ") } _title := func(_buffer io.StringWriter) { + // Line: 21 _buffer.WriteString(gorazor.HTMLEscape(title)) } diff --git a/pkg/razorcore/testdata/msg.go b/pkg/razorcore/testdata/msg.go index ff62b41..69c16db 100644 --- a/pkg/razorcore/testdata/msg.go +++ b/pkg/razorcore/testdata/msg.go @@ -1,4 +1,4 @@ -// This file is generated by gorazor 1.2.1 +// This file is generated by gorazor 1.2.2 // DON'T modified manually // Should edit source file and re-generate: cases/msg.gohtml @@ -30,10 +30,15 @@ func RenderMsg(_buffer io.StringWriter, u *User) { username = getName(u) + "(" + u.Email + ")" } + // Line: 18 _buffer.WriteString("\n
    \n

    Hello ") + // Line: 20 _buffer.WriteString(gorazor.HTMLEscape(username)) + // Line: 20 _buffer.WriteString("

    \n\n
    ") + // Line: 22 _buffer.WriteString((u.Intro)) + // Line: 22 _buffer.WriteString("
    \n
    ") } diff --git a/pkg/razorcore/testdata/quote.go b/pkg/razorcore/testdata/quote.go index 6f44b22..8d7fca1 100644 --- a/pkg/razorcore/testdata/quote.go +++ b/pkg/razorcore/testdata/quote.go @@ -1,4 +1,4 @@ -// This file is generated by gorazor 1.2.1 +// This file is generated by gorazor 1.2.2 // DON'T modified manually // Should edit source file and re-generate: cases/quote.gohtml @@ -18,6 +18,7 @@ func Quote() string { // RenderQuote render cases/quote.gohtml func RenderQuote(_buffer io.StringWriter) { + // Line: 1 _buffer.WriteString("'text'") } diff --git a/pkg/razorcore/testdata/scope.go b/pkg/razorcore/testdata/scope.go index 42f5ea1..27e86e8 100644 --- a/pkg/razorcore/testdata/scope.go +++ b/pkg/razorcore/testdata/scope.go @@ -1,4 +1,4 @@ -// This file is generated by gorazor 1.2.1 +// This file is generated by gorazor 1.2.2 // DON'T modified manually // Should edit source file and re-generate: cases/scope.gohtml @@ -28,71 +28,106 @@ func RenderScope(_buffer io.StringWriter, obj *models.Widget) { if dmType == "simple" { obj.StringList = data.([]string) + // Line: 15 _buffer.WriteString("
    ") + // Line: 15 _buffer.WriteString((SelectPk(obj))) + // Line: 15 _buffer.WriteString("
    ") } else { node := data.(*dm.DMTree) + // Line: 18 _buffer.WriteString("
    \n \n
    \n \n ") if obj.ErrorMsg != "" { + // Line: 43 _buffer.WriteString("") + // Line: 43 _buffer.WriteString(gorazor.HTMLEscape(obj.ErrorMsg)) + // Line: 43 _buffer.WriteString("") } + // Line: 44 _buffer.WriteString("\n
    \n
    ") } diff --git a/pkg/razorcore/testdata/scopebug.go b/pkg/razorcore/testdata/scopebug.go index 9d512e3..0c3e9e0 100644 --- a/pkg/razorcore/testdata/scopebug.go +++ b/pkg/razorcore/testdata/scopebug.go @@ -1,4 +1,4 @@ -// This file is generated by gorazor 1.2.1 +// This file is generated by gorazor 1.2.2 // DON'T modified manually // Should edit source file and re-generate: cases/scopebug.gohtml @@ -28,9 +28,11 @@ func RenderScopebug(_buffer io.StringWriter, obj *models.Widget) { for _, v := range values { if v, ok := v.(type); ok { + // Line: 16 _buffer.WriteString("\n\t\t\t\t\t") for _, v := range values { } + // Line: 18 _buffer.WriteString("\n\t\t\t\t") } else { diff --git a/pkg/razorcore/testdata/section_comment_bug.go b/pkg/razorcore/testdata/section_comment_bug.go index 1603b81..006126e 100644 --- a/pkg/razorcore/testdata/section_comment_bug.go +++ b/pkg/razorcore/testdata/section_comment_bug.go @@ -1,4 +1,4 @@ -// This file is generated by gorazor 1.2.1 +// This file is generated by gorazor 1.2.2 // DON'T modified manually // Should edit source file and re-generate: cases/section_comment_bug.gohtml @@ -21,12 +21,14 @@ func Section_comment_bug() string { func RenderSection_comment_bug(_buffer io.StringWriter) { _body := func(_buffer io.StringWriter) { + // Line: 7 _buffer.WriteString("\n\n\n \n") } _side := func(_buffer io.StringWriter) { + // Line: 14 _buffer.WriteString("\n plain text") } diff --git a/pkg/razorcore/testdata/sectionbug.go b/pkg/razorcore/testdata/sectionbug.go index 5ba4d2a..47d6f4e 100644 --- a/pkg/razorcore/testdata/sectionbug.go +++ b/pkg/razorcore/testdata/sectionbug.go @@ -1,4 +1,4 @@ -// This file is generated by gorazor 1.2.1 +// This file is generated by gorazor 1.2.2 // DON'T modified manually // Should edit source file and re-generate: cases/sectionbug.gohtml @@ -29,8 +29,11 @@ func RenderSectionbug(_buffer io.StringWriter) { _js := func(_buffer io.StringWriter) { for _, jsFile := range ctx.GetJS() { + // Line: 12 _buffer.WriteString("") } diff --git a/pkg/razorcore/testdata/slashbug.go b/pkg/razorcore/testdata/slashbug.go index 6a5f26c..c2be251 100644 --- a/pkg/razorcore/testdata/slashbug.go +++ b/pkg/razorcore/testdata/slashbug.go @@ -1,4 +1,4 @@ -// This file is generated by gorazor 1.2.1 +// This file is generated by gorazor 1.2.2 // DON'T modified manually // Should edit source file and re-generate: cases/slashbug.gohtml diff --git a/pkg/razorcore/testdata/textarea.go b/pkg/razorcore/testdata/textarea.go index e6c7506..0cdd1df 100644 --- a/pkg/razorcore/testdata/textarea.go +++ b/pkg/razorcore/testdata/textarea.go @@ -1,4 +1,4 @@ -// This file is generated by gorazor 1.2.1 +// This file is generated by gorazor 1.2.2 // DON'T modified manually // Should edit source file and re-generate: cases/textarea.gohtml @@ -19,10 +19,15 @@ func Textarea(count int) string { // RenderTextarea render cases/textarea.gohtml func RenderTextarea(_buffer io.StringWriter, count int) { + // Line: 3 _buffer.WriteString("\n\n\n