github.com/skycoinproject/nex@v0.0.0-20191231010827-3bb2d0c49bc5/test/wc.nex (about) 1 /[^\n]*\n/ < {} 2 /[^ \t\r\n]*/ < {} 3 /./ { nChars++ } 4 > { nWords++ } 5 /./ { nChars++ } 6 > { nLines++ } 7 // 8 package main 9 import ("fmt";"os") 10 func main() { 11 var nLines, nWords, nChars int 12 NN_FUN(NewLexer(os.Stdin)) 13 fmt.Printf("%d %d %d\n", nLines, nWords, nChars) 14 }