1
0
kpmy 9 жил өмнө
parent
commit
006692d303
1 өөрчлөгдсөн 6 нэмэгдсэн , 1 устгасан
  1. 6 1
      sc.go

+ 6 - 1
sc.go

@@ -51,6 +51,7 @@ type Opts struct {
 	Skip func(r rune) bool
 
 	NoStrings bool
+	NoNum     bool
 }
 
 type Scanner interface {
@@ -378,7 +379,11 @@ func (s *sc) get() (sym Symbol) {
 			sym.Code, _ = s.opts.SpaceMap[sym.Value]
 			s.next()
 		case unicode.IsDigit(s.ch):
-			sym = s.num()
+			if !s.opts.NoNum {
+				sym = s.num()
+			} else {
+				justRune()
+			}
 		default:
 			justRune()
 		}