machine.go 54 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828
  1. //line machine.go.rl:1
  2. package protocol
  3. import (
  4. "errors"
  5. "io"
  6. )
  7. var (
  8. ErrNameParse = errors.New("expected measurement name")
  9. ErrFieldParse = errors.New("expected field")
  10. ErrTagParse = errors.New("expected tag")
  11. ErrTimestampParse = errors.New("expected timestamp")
  12. ErrParse = errors.New("parse error")
  13. EOF = errors.New("EOF")
  14. )
  15. //line machine.go.rl:310
  16. //line machine.go:25
  17. const LineProtocol_start int = 47
  18. const LineProtocol_first_final int = 47
  19. const LineProtocol_error int = 0
  20. const LineProtocol_en_main int = 47
  21. const LineProtocol_en_discard_line int = 35
  22. const LineProtocol_en_align int = 86
  23. const LineProtocol_en_series int = 38
  24. //line machine.go.rl:313
  25. type Handler interface {
  26. SetMeasurement(name []byte) error
  27. AddTag(key []byte, value []byte) error
  28. AddInt(key []byte, value []byte) error
  29. AddUint(key []byte, value []byte) error
  30. AddFloat(key []byte, value []byte) error
  31. AddString(key []byte, value []byte) error
  32. AddBool(key []byte, value []byte) error
  33. SetTimestamp(tm []byte) error
  34. }
  35. type machine struct {
  36. data []byte
  37. cs int
  38. p, pe, eof int
  39. pb int
  40. lineno int
  41. sol int
  42. handler Handler
  43. initState int
  44. key []byte
  45. beginMetric bool
  46. finishMetric bool
  47. }
  48. func NewMachine(handler Handler) *machine {
  49. m := &machine{
  50. handler: handler,
  51. initState: LineProtocol_en_align,
  52. }
  53. //line machine.go.rl:346
  54. //line machine.go.rl:347
  55. //line machine.go.rl:348
  56. //line machine.go.rl:349
  57. //line machine.go.rl:350
  58. //line machine.go.rl:351
  59. //line machine.go:82
  60. {
  61. (m.cs) = LineProtocol_start
  62. }
  63. //line machine.go.rl:352
  64. return m
  65. }
  66. func NewSeriesMachine(handler Handler) *machine {
  67. m := &machine{
  68. handler: handler,
  69. initState: LineProtocol_en_series,
  70. }
  71. //line machine.go.rl:363
  72. //line machine.go.rl:364
  73. //line machine.go.rl:365
  74. //line machine.go.rl:366
  75. //line machine.go.rl:367
  76. //line machine.go:109
  77. {
  78. (m.cs) = LineProtocol_start
  79. }
  80. //line machine.go.rl:368
  81. return m
  82. }
  83. func (m *machine) SetData(data []byte) {
  84. m.data = data
  85. m.p = 0
  86. m.pb = 0
  87. m.lineno = 1
  88. m.sol = 0
  89. m.pe = len(data)
  90. m.eof = len(data)
  91. m.key = nil
  92. m.beginMetric = false
  93. m.finishMetric = false
  94. //line machine.go:132
  95. {
  96. (m.cs) = LineProtocol_start
  97. }
  98. //line machine.go.rl:385
  99. m.cs = m.initState
  100. }
  101. // Next parses the next metric line and returns nil if it was successfully
  102. // processed. If the line contains a syntax error an error is returned,
  103. // otherwise if the end of file is reached before finding a metric line then
  104. // EOF is returned.
  105. func (m *machine) Next() error {
  106. if m.p == m.pe && m.pe == m.eof {
  107. return EOF
  108. }
  109. m.key = nil
  110. m.beginMetric = false
  111. m.finishMetric = false
  112. return m.exec()
  113. }
  114. func (m *machine) exec() error {
  115. var err error
  116. //line machine.go:160
  117. {
  118. if (m.p) == (m.pe) {
  119. goto _test_eof
  120. }
  121. goto _resume
  122. _again:
  123. switch m.cs {
  124. case 47:
  125. goto st47
  126. case 1:
  127. goto st1
  128. case 2:
  129. goto st2
  130. case 3:
  131. goto st3
  132. case 0:
  133. goto st0
  134. case 4:
  135. goto st4
  136. case 5:
  137. goto st5
  138. case 6:
  139. goto st6
  140. case 7:
  141. goto st7
  142. case 48:
  143. goto st48
  144. case 49:
  145. goto st49
  146. case 50:
  147. goto st50
  148. case 8:
  149. goto st8
  150. case 9:
  151. goto st9
  152. case 10:
  153. goto st10
  154. case 11:
  155. goto st11
  156. case 51:
  157. goto st51
  158. case 52:
  159. goto st52
  160. case 53:
  161. goto st53
  162. case 54:
  163. goto st54
  164. case 55:
  165. goto st55
  166. case 56:
  167. goto st56
  168. case 57:
  169. goto st57
  170. case 58:
  171. goto st58
  172. case 59:
  173. goto st59
  174. case 60:
  175. goto st60
  176. case 61:
  177. goto st61
  178. case 62:
  179. goto st62
  180. case 63:
  181. goto st63
  182. case 64:
  183. goto st64
  184. case 65:
  185. goto st65
  186. case 66:
  187. goto st66
  188. case 67:
  189. goto st67
  190. case 68:
  191. goto st68
  192. case 69:
  193. goto st69
  194. case 70:
  195. goto st70
  196. case 12:
  197. goto st12
  198. case 13:
  199. goto st13
  200. case 14:
  201. goto st14
  202. case 15:
  203. goto st15
  204. case 16:
  205. goto st16
  206. case 71:
  207. goto st71
  208. case 17:
  209. goto st17
  210. case 18:
  211. goto st18
  212. case 72:
  213. goto st72
  214. case 73:
  215. goto st73
  216. case 74:
  217. goto st74
  218. case 75:
  219. goto st75
  220. case 76:
  221. goto st76
  222. case 77:
  223. goto st77
  224. case 78:
  225. goto st78
  226. case 79:
  227. goto st79
  228. case 80:
  229. goto st80
  230. case 19:
  231. goto st19
  232. case 20:
  233. goto st20
  234. case 21:
  235. goto st21
  236. case 81:
  237. goto st81
  238. case 22:
  239. goto st22
  240. case 23:
  241. goto st23
  242. case 24:
  243. goto st24
  244. case 82:
  245. goto st82
  246. case 25:
  247. goto st25
  248. case 26:
  249. goto st26
  250. case 83:
  251. goto st83
  252. case 84:
  253. goto st84
  254. case 27:
  255. goto st27
  256. case 28:
  257. goto st28
  258. case 29:
  259. goto st29
  260. case 30:
  261. goto st30
  262. case 31:
  263. goto st31
  264. case 32:
  265. goto st32
  266. case 33:
  267. goto st33
  268. case 34:
  269. goto st34
  270. case 35:
  271. goto st35
  272. case 85:
  273. goto st85
  274. case 38:
  275. goto st38
  276. case 87:
  277. goto st87
  278. case 88:
  279. goto st88
  280. case 39:
  281. goto st39
  282. case 40:
  283. goto st40
  284. case 41:
  285. goto st41
  286. case 42:
  287. goto st42
  288. case 89:
  289. goto st89
  290. case 43:
  291. goto st43
  292. case 90:
  293. goto st90
  294. case 44:
  295. goto st44
  296. case 45:
  297. goto st45
  298. case 46:
  299. goto st46
  300. case 86:
  301. goto st86
  302. case 36:
  303. goto st36
  304. case 37:
  305. goto st37
  306. }
  307. if (m.p)++; (m.p) == (m.pe) {
  308. goto _test_eof
  309. }
  310. _resume:
  311. switch m.cs {
  312. case 47:
  313. goto st_case_47
  314. case 1:
  315. goto st_case_1
  316. case 2:
  317. goto st_case_2
  318. case 3:
  319. goto st_case_3
  320. case 0:
  321. goto st_case_0
  322. case 4:
  323. goto st_case_4
  324. case 5:
  325. goto st_case_5
  326. case 6:
  327. goto st_case_6
  328. case 7:
  329. goto st_case_7
  330. case 48:
  331. goto st_case_48
  332. case 49:
  333. goto st_case_49
  334. case 50:
  335. goto st_case_50
  336. case 8:
  337. goto st_case_8
  338. case 9:
  339. goto st_case_9
  340. case 10:
  341. goto st_case_10
  342. case 11:
  343. goto st_case_11
  344. case 51:
  345. goto st_case_51
  346. case 52:
  347. goto st_case_52
  348. case 53:
  349. goto st_case_53
  350. case 54:
  351. goto st_case_54
  352. case 55:
  353. goto st_case_55
  354. case 56:
  355. goto st_case_56
  356. case 57:
  357. goto st_case_57
  358. case 58:
  359. goto st_case_58
  360. case 59:
  361. goto st_case_59
  362. case 60:
  363. goto st_case_60
  364. case 61:
  365. goto st_case_61
  366. case 62:
  367. goto st_case_62
  368. case 63:
  369. goto st_case_63
  370. case 64:
  371. goto st_case_64
  372. case 65:
  373. goto st_case_65
  374. case 66:
  375. goto st_case_66
  376. case 67:
  377. goto st_case_67
  378. case 68:
  379. goto st_case_68
  380. case 69:
  381. goto st_case_69
  382. case 70:
  383. goto st_case_70
  384. case 12:
  385. goto st_case_12
  386. case 13:
  387. goto st_case_13
  388. case 14:
  389. goto st_case_14
  390. case 15:
  391. goto st_case_15
  392. case 16:
  393. goto st_case_16
  394. case 71:
  395. goto st_case_71
  396. case 17:
  397. goto st_case_17
  398. case 18:
  399. goto st_case_18
  400. case 72:
  401. goto st_case_72
  402. case 73:
  403. goto st_case_73
  404. case 74:
  405. goto st_case_74
  406. case 75:
  407. goto st_case_75
  408. case 76:
  409. goto st_case_76
  410. case 77:
  411. goto st_case_77
  412. case 78:
  413. goto st_case_78
  414. case 79:
  415. goto st_case_79
  416. case 80:
  417. goto st_case_80
  418. case 19:
  419. goto st_case_19
  420. case 20:
  421. goto st_case_20
  422. case 21:
  423. goto st_case_21
  424. case 81:
  425. goto st_case_81
  426. case 22:
  427. goto st_case_22
  428. case 23:
  429. goto st_case_23
  430. case 24:
  431. goto st_case_24
  432. case 82:
  433. goto st_case_82
  434. case 25:
  435. goto st_case_25
  436. case 26:
  437. goto st_case_26
  438. case 83:
  439. goto st_case_83
  440. case 84:
  441. goto st_case_84
  442. case 27:
  443. goto st_case_27
  444. case 28:
  445. goto st_case_28
  446. case 29:
  447. goto st_case_29
  448. case 30:
  449. goto st_case_30
  450. case 31:
  451. goto st_case_31
  452. case 32:
  453. goto st_case_32
  454. case 33:
  455. goto st_case_33
  456. case 34:
  457. goto st_case_34
  458. case 35:
  459. goto st_case_35
  460. case 85:
  461. goto st_case_85
  462. case 38:
  463. goto st_case_38
  464. case 87:
  465. goto st_case_87
  466. case 88:
  467. goto st_case_88
  468. case 39:
  469. goto st_case_39
  470. case 40:
  471. goto st_case_40
  472. case 41:
  473. goto st_case_41
  474. case 42:
  475. goto st_case_42
  476. case 89:
  477. goto st_case_89
  478. case 43:
  479. goto st_case_43
  480. case 90:
  481. goto st_case_90
  482. case 44:
  483. goto st_case_44
  484. case 45:
  485. goto st_case_45
  486. case 46:
  487. goto st_case_46
  488. case 86:
  489. goto st_case_86
  490. case 36:
  491. goto st_case_36
  492. case 37:
  493. goto st_case_37
  494. }
  495. goto st_out
  496. st47:
  497. if (m.p)++; (m.p) == (m.pe) {
  498. goto _test_eof47
  499. }
  500. st_case_47:
  501. switch (m.data)[(m.p)] {
  502. case 10:
  503. goto tr33
  504. case 13:
  505. goto tr33
  506. case 32:
  507. goto tr82
  508. case 35:
  509. goto tr33
  510. case 44:
  511. goto tr33
  512. case 92:
  513. goto tr83
  514. }
  515. if 9 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 12 {
  516. goto tr82
  517. }
  518. goto tr81
  519. tr31:
  520. //line machine.go.rl:20
  521. m.pb = m.p
  522. goto st1
  523. tr81:
  524. //line machine.go.rl:74
  525. m.beginMetric = true
  526. //line machine.go.rl:20
  527. m.pb = m.p
  528. goto st1
  529. st1:
  530. if (m.p)++; (m.p) == (m.pe) {
  531. goto _test_eof1
  532. }
  533. st_case_1:
  534. //line machine.go:586
  535. switch (m.data)[(m.p)] {
  536. case 10:
  537. goto tr2
  538. case 13:
  539. goto tr2
  540. case 32:
  541. goto tr1
  542. case 44:
  543. goto tr3
  544. case 92:
  545. goto st9
  546. }
  547. if 9 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 12 {
  548. goto tr1
  549. }
  550. goto st1
  551. tr1:
  552. (m.cs) = 2
  553. //line machine.go.rl:78
  554. err = m.handler.SetMeasurement(m.text())
  555. if err != nil {
  556. (m.p)--
  557. (m.cs) = 35
  558. {
  559. (m.p)++
  560. goto _out
  561. }
  562. }
  563. goto _again
  564. tr58:
  565. (m.cs) = 2
  566. //line machine.go.rl:91
  567. err = m.handler.AddTag(m.key, m.text())
  568. if err != nil {
  569. (m.p)--
  570. (m.cs) = 35
  571. {
  572. (m.p)++
  573. goto _out
  574. }
  575. }
  576. goto _again
  577. st2:
  578. if (m.p)++; (m.p) == (m.pe) {
  579. goto _test_eof2
  580. }
  581. st_case_2:
  582. //line machine.go:634
  583. switch (m.data)[(m.p)] {
  584. case 10:
  585. goto tr7
  586. case 13:
  587. goto tr7
  588. case 32:
  589. goto st2
  590. case 44:
  591. goto tr7
  592. case 61:
  593. goto tr7
  594. case 92:
  595. goto tr8
  596. }
  597. if 9 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 12 {
  598. goto st2
  599. }
  600. goto tr5
  601. tr5:
  602. //line machine.go.rl:20
  603. m.pb = m.p
  604. goto st3
  605. st3:
  606. if (m.p)++; (m.p) == (m.pe) {
  607. goto _test_eof3
  608. }
  609. st_case_3:
  610. //line machine.go:664
  611. switch (m.data)[(m.p)] {
  612. case 32:
  613. goto tr7
  614. case 44:
  615. goto tr7
  616. case 61:
  617. goto tr10
  618. case 92:
  619. goto st13
  620. }
  621. if 9 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 13 {
  622. goto tr7
  623. }
  624. goto st3
  625. tr2:
  626. (m.cs) = 0
  627. //line machine.go.rl:38
  628. err = ErrTagParse
  629. (m.p)--
  630. (m.cs) = 35
  631. {
  632. (m.p)++
  633. goto _out
  634. }
  635. goto _again
  636. tr7:
  637. (m.cs) = 0
  638. //line machine.go.rl:31
  639. err = ErrFieldParse
  640. (m.p)--
  641. (m.cs) = 35
  642. {
  643. (m.p)++
  644. goto _out
  645. }
  646. goto _again
  647. tr33:
  648. (m.cs) = 0
  649. //line machine.go.rl:24
  650. err = ErrNameParse
  651. (m.p)--
  652. (m.cs) = 35
  653. {
  654. (m.p)++
  655. goto _out
  656. }
  657. goto _again
  658. tr37:
  659. (m.cs) = 0
  660. //line machine.go.rl:45
  661. err = ErrTimestampParse
  662. (m.p)--
  663. (m.cs) = 35
  664. {
  665. (m.p)++
  666. goto _out
  667. }
  668. goto _again
  669. tr84:
  670. (m.cs) = 0
  671. //line machine.go.rl:31
  672. err = ErrFieldParse
  673. (m.p)--
  674. (m.cs) = 35
  675. {
  676. (m.p)++
  677. goto _out
  678. }
  679. //line machine.go.rl:45
  680. err = ErrTimestampParse
  681. (m.p)--
  682. (m.cs) = 35
  683. {
  684. (m.p)++
  685. goto _out
  686. }
  687. goto _again
  688. tr137:
  689. //line machine.go.rl:65
  690. (m.p)--
  691. {
  692. goto st47
  693. }
  694. goto st0
  695. //line machine.go:750
  696. st_case_0:
  697. st0:
  698. (m.cs) = 0
  699. goto _out
  700. tr10:
  701. //line machine.go.rl:100
  702. m.key = m.text()
  703. goto st4
  704. st4:
  705. if (m.p)++; (m.p) == (m.pe) {
  706. goto _test_eof4
  707. }
  708. st_case_4:
  709. //line machine.go:766
  710. switch (m.data)[(m.p)] {
  711. case 34:
  712. goto st5
  713. case 45:
  714. goto tr13
  715. case 46:
  716. goto tr14
  717. case 48:
  718. goto tr15
  719. case 70:
  720. goto tr17
  721. case 84:
  722. goto tr18
  723. case 102:
  724. goto tr19
  725. case 116:
  726. goto tr20
  727. }
  728. if 49 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
  729. goto tr16
  730. }
  731. goto tr7
  732. st5:
  733. if (m.p)++; (m.p) == (m.pe) {
  734. goto _test_eof5
  735. }
  736. st_case_5:
  737. switch (m.data)[(m.p)] {
  738. case 10:
  739. goto tr22
  740. case 12:
  741. goto tr7
  742. case 13:
  743. goto tr23
  744. case 34:
  745. goto tr24
  746. case 92:
  747. goto tr25
  748. }
  749. goto tr21
  750. tr21:
  751. //line machine.go.rl:20
  752. m.pb = m.p
  753. goto st6
  754. tr22:
  755. //line machine.go.rl:20
  756. m.pb = m.p
  757. //line machine.go.rl:158
  758. m.lineno++
  759. m.sol = m.p
  760. m.sol++ // next char will be the first column in the line
  761. goto st6
  762. tr27:
  763. //line machine.go.rl:158
  764. m.lineno++
  765. m.sol = m.p
  766. m.sol++ // next char will be the first column in the line
  767. goto st6
  768. st6:
  769. if (m.p)++; (m.p) == (m.pe) {
  770. goto _test_eof6
  771. }
  772. st_case_6:
  773. //line machine.go:838
  774. switch (m.data)[(m.p)] {
  775. case 10:
  776. goto tr27
  777. case 12:
  778. goto tr7
  779. case 13:
  780. goto st7
  781. case 34:
  782. goto tr29
  783. case 92:
  784. goto st14
  785. }
  786. goto st6
  787. tr23:
  788. //line machine.go.rl:20
  789. m.pb = m.p
  790. goto st7
  791. st7:
  792. if (m.p)++; (m.p) == (m.pe) {
  793. goto _test_eof7
  794. }
  795. st_case_7:
  796. //line machine.go:863
  797. if (m.data)[(m.p)] == 10 {
  798. goto tr27
  799. }
  800. goto tr7
  801. tr24:
  802. (m.cs) = 48
  803. //line machine.go.rl:20
  804. m.pb = m.p
  805. //line machine.go.rl:140
  806. err = m.handler.AddString(m.key, m.text())
  807. if err != nil {
  808. (m.p)--
  809. (m.cs) = 35
  810. {
  811. (m.p)++
  812. goto _out
  813. }
  814. }
  815. goto _again
  816. tr29:
  817. (m.cs) = 48
  818. //line machine.go.rl:140
  819. err = m.handler.AddString(m.key, m.text())
  820. if err != nil {
  821. (m.p)--
  822. (m.cs) = 35
  823. {
  824. (m.p)++
  825. goto _out
  826. }
  827. }
  828. goto _again
  829. st48:
  830. if (m.p)++; (m.p) == (m.pe) {
  831. goto _test_eof48
  832. }
  833. st_case_48:
  834. //line machine.go:903
  835. switch (m.data)[(m.p)] {
  836. case 10:
  837. goto tr36
  838. case 13:
  839. goto st10
  840. case 32:
  841. goto st49
  842. case 44:
  843. goto st12
  844. }
  845. if 9 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 12 {
  846. goto st49
  847. }
  848. goto tr84
  849. tr112:
  850. (m.cs) = 49
  851. //line machine.go.rl:122
  852. err = m.handler.AddFloat(m.key, m.text())
  853. if err != nil {
  854. (m.p)--
  855. (m.cs) = 35
  856. {
  857. (m.p)++
  858. goto _out
  859. }
  860. }
  861. goto _again
  862. tr119:
  863. (m.cs) = 49
  864. //line machine.go.rl:104
  865. err = m.handler.AddInt(m.key, m.text())
  866. if err != nil {
  867. (m.p)--
  868. (m.cs) = 35
  869. {
  870. (m.p)++
  871. goto _out
  872. }
  873. }
  874. goto _again
  875. tr124:
  876. (m.cs) = 49
  877. //line machine.go.rl:113
  878. err = m.handler.AddUint(m.key, m.text())
  879. if err != nil {
  880. (m.p)--
  881. (m.cs) = 35
  882. {
  883. (m.p)++
  884. goto _out
  885. }
  886. }
  887. goto _again
  888. tr129:
  889. (m.cs) = 49
  890. //line machine.go.rl:131
  891. err = m.handler.AddBool(m.key, m.text())
  892. if err != nil {
  893. (m.p)--
  894. (m.cs) = 35
  895. {
  896. (m.p)++
  897. goto _out
  898. }
  899. }
  900. goto _again
  901. st49:
  902. if (m.p)++; (m.p) == (m.pe) {
  903. goto _test_eof49
  904. }
  905. st_case_49:
  906. //line machine.go:975
  907. switch (m.data)[(m.p)] {
  908. case 10:
  909. goto tr36
  910. case 13:
  911. goto st10
  912. case 32:
  913. goto st49
  914. case 45:
  915. goto tr88
  916. }
  917. switch {
  918. case (m.data)[(m.p)] > 12:
  919. if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
  920. goto tr89
  921. }
  922. case (m.data)[(m.p)] >= 9:
  923. goto st49
  924. }
  925. goto tr37
  926. tr36:
  927. //line machine.go.rl:158
  928. m.lineno++
  929. m.sol = m.p
  930. m.sol++ // next char will be the first column in the line
  931. goto st50
  932. tr91:
  933. (m.cs) = 50
  934. //line machine.go.rl:149
  935. err = m.handler.SetTimestamp(m.text())
  936. if err != nil {
  937. (m.p)--
  938. (m.cs) = 35
  939. {
  940. (m.p)++
  941. goto _out
  942. }
  943. }
  944. //line machine.go.rl:158
  945. m.lineno++
  946. m.sol = m.p
  947. m.sol++ // next char will be the first column in the line
  948. goto _again
  949. tr113:
  950. (m.cs) = 50
  951. //line machine.go.rl:122
  952. err = m.handler.AddFloat(m.key, m.text())
  953. if err != nil {
  954. (m.p)--
  955. (m.cs) = 35
  956. {
  957. (m.p)++
  958. goto _out
  959. }
  960. }
  961. //line machine.go.rl:158
  962. m.lineno++
  963. m.sol = m.p
  964. m.sol++ // next char will be the first column in the line
  965. goto _again
  966. tr120:
  967. (m.cs) = 50
  968. //line machine.go.rl:104
  969. err = m.handler.AddInt(m.key, m.text())
  970. if err != nil {
  971. (m.p)--
  972. (m.cs) = 35
  973. {
  974. (m.p)++
  975. goto _out
  976. }
  977. }
  978. //line machine.go.rl:158
  979. m.lineno++
  980. m.sol = m.p
  981. m.sol++ // next char will be the first column in the line
  982. goto _again
  983. tr125:
  984. (m.cs) = 50
  985. //line machine.go.rl:113
  986. err = m.handler.AddUint(m.key, m.text())
  987. if err != nil {
  988. (m.p)--
  989. (m.cs) = 35
  990. {
  991. (m.p)++
  992. goto _out
  993. }
  994. }
  995. //line machine.go.rl:158
  996. m.lineno++
  997. m.sol = m.p
  998. m.sol++ // next char will be the first column in the line
  999. goto _again
  1000. tr130:
  1001. (m.cs) = 50
  1002. //line machine.go.rl:131
  1003. err = m.handler.AddBool(m.key, m.text())
  1004. if err != nil {
  1005. (m.p)--
  1006. (m.cs) = 35
  1007. {
  1008. (m.p)++
  1009. goto _out
  1010. }
  1011. }
  1012. //line machine.go.rl:158
  1013. m.lineno++
  1014. m.sol = m.p
  1015. m.sol++ // next char will be the first column in the line
  1016. goto _again
  1017. st50:
  1018. //line machine.go.rl:164
  1019. m.finishMetric = true
  1020. (m.cs) = 86
  1021. {
  1022. (m.p)++
  1023. goto _out
  1024. }
  1025. if (m.p)++; (m.p) == (m.pe) {
  1026. goto _test_eof50
  1027. }
  1028. st_case_50:
  1029. //line machine.go:1109
  1030. switch (m.data)[(m.p)] {
  1031. case 10:
  1032. goto tr33
  1033. case 13:
  1034. goto tr33
  1035. case 32:
  1036. goto st8
  1037. case 35:
  1038. goto tr33
  1039. case 44:
  1040. goto tr33
  1041. case 92:
  1042. goto tr34
  1043. }
  1044. if 9 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 12 {
  1045. goto st8
  1046. }
  1047. goto tr31
  1048. tr82:
  1049. //line machine.go.rl:74
  1050. m.beginMetric = true
  1051. goto st8
  1052. st8:
  1053. if (m.p)++; (m.p) == (m.pe) {
  1054. goto _test_eof8
  1055. }
  1056. st_case_8:
  1057. //line machine.go:1139
  1058. switch (m.data)[(m.p)] {
  1059. case 10:
  1060. goto tr33
  1061. case 13:
  1062. goto tr33
  1063. case 32:
  1064. goto st8
  1065. case 35:
  1066. goto tr33
  1067. case 44:
  1068. goto tr33
  1069. case 92:
  1070. goto tr34
  1071. }
  1072. if 9 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 12 {
  1073. goto st8
  1074. }
  1075. goto tr31
  1076. tr34:
  1077. //line machine.go.rl:20
  1078. m.pb = m.p
  1079. goto st9
  1080. tr83:
  1081. //line machine.go.rl:74
  1082. m.beginMetric = true
  1083. //line machine.go.rl:20
  1084. m.pb = m.p
  1085. goto st9
  1086. st9:
  1087. if (m.p)++; (m.p) == (m.pe) {
  1088. goto _test_eof9
  1089. }
  1090. st_case_9:
  1091. //line machine.go:1179
  1092. if 9 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 13 {
  1093. goto st0
  1094. }
  1095. goto st1
  1096. tr92:
  1097. (m.cs) = 10
  1098. //line machine.go.rl:149
  1099. err = m.handler.SetTimestamp(m.text())
  1100. if err != nil {
  1101. (m.p)--
  1102. (m.cs) = 35
  1103. {
  1104. (m.p)++
  1105. goto _out
  1106. }
  1107. }
  1108. goto _again
  1109. tr114:
  1110. (m.cs) = 10
  1111. //line machine.go.rl:122
  1112. err = m.handler.AddFloat(m.key, m.text())
  1113. if err != nil {
  1114. (m.p)--
  1115. (m.cs) = 35
  1116. {
  1117. (m.p)++
  1118. goto _out
  1119. }
  1120. }
  1121. goto _again
  1122. tr121:
  1123. (m.cs) = 10
  1124. //line machine.go.rl:104
  1125. err = m.handler.AddInt(m.key, m.text())
  1126. if err != nil {
  1127. (m.p)--
  1128. (m.cs) = 35
  1129. {
  1130. (m.p)++
  1131. goto _out
  1132. }
  1133. }
  1134. goto _again
  1135. tr126:
  1136. (m.cs) = 10
  1137. //line machine.go.rl:113
  1138. err = m.handler.AddUint(m.key, m.text())
  1139. if err != nil {
  1140. (m.p)--
  1141. (m.cs) = 35
  1142. {
  1143. (m.p)++
  1144. goto _out
  1145. }
  1146. }
  1147. goto _again
  1148. tr131:
  1149. (m.cs) = 10
  1150. //line machine.go.rl:131
  1151. err = m.handler.AddBool(m.key, m.text())
  1152. if err != nil {
  1153. (m.p)--
  1154. (m.cs) = 35
  1155. {
  1156. (m.p)++
  1157. goto _out
  1158. }
  1159. }
  1160. goto _again
  1161. st10:
  1162. if (m.p)++; (m.p) == (m.pe) {
  1163. goto _test_eof10
  1164. }
  1165. st_case_10:
  1166. //line machine.go:1254
  1167. if (m.data)[(m.p)] == 10 {
  1168. goto tr36
  1169. }
  1170. goto st0
  1171. tr88:
  1172. //line machine.go.rl:20
  1173. m.pb = m.p
  1174. goto st11
  1175. st11:
  1176. if (m.p)++; (m.p) == (m.pe) {
  1177. goto _test_eof11
  1178. }
  1179. st_case_11:
  1180. //line machine.go:1270
  1181. if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
  1182. goto st51
  1183. }
  1184. goto tr37
  1185. tr89:
  1186. //line machine.go.rl:20
  1187. m.pb = m.p
  1188. goto st51
  1189. st51:
  1190. if (m.p)++; (m.p) == (m.pe) {
  1191. goto _test_eof51
  1192. }
  1193. st_case_51:
  1194. //line machine.go:1286
  1195. switch (m.data)[(m.p)] {
  1196. case 10:
  1197. goto tr91
  1198. case 13:
  1199. goto tr92
  1200. case 32:
  1201. goto tr90
  1202. }
  1203. switch {
  1204. case (m.data)[(m.p)] > 12:
  1205. if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
  1206. goto st53
  1207. }
  1208. case (m.data)[(m.p)] >= 9:
  1209. goto tr90
  1210. }
  1211. goto tr37
  1212. tr90:
  1213. (m.cs) = 52
  1214. //line machine.go.rl:149
  1215. err = m.handler.SetTimestamp(m.text())
  1216. if err != nil {
  1217. (m.p)--
  1218. (m.cs) = 35
  1219. {
  1220. (m.p)++
  1221. goto _out
  1222. }
  1223. }
  1224. goto _again
  1225. st52:
  1226. if (m.p)++; (m.p) == (m.pe) {
  1227. goto _test_eof52
  1228. }
  1229. st_case_52:
  1230. //line machine.go:1322
  1231. switch (m.data)[(m.p)] {
  1232. case 10:
  1233. goto tr36
  1234. case 13:
  1235. goto st10
  1236. case 32:
  1237. goto st52
  1238. }
  1239. if 9 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 12 {
  1240. goto st52
  1241. }
  1242. goto st0
  1243. st53:
  1244. if (m.p)++; (m.p) == (m.pe) {
  1245. goto _test_eof53
  1246. }
  1247. st_case_53:
  1248. switch (m.data)[(m.p)] {
  1249. case 10:
  1250. goto tr91
  1251. case 13:
  1252. goto tr92
  1253. case 32:
  1254. goto tr90
  1255. }
  1256. switch {
  1257. case (m.data)[(m.p)] > 12:
  1258. if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
  1259. goto st54
  1260. }
  1261. case (m.data)[(m.p)] >= 9:
  1262. goto tr90
  1263. }
  1264. goto tr37
  1265. st54:
  1266. if (m.p)++; (m.p) == (m.pe) {
  1267. goto _test_eof54
  1268. }
  1269. st_case_54:
  1270. switch (m.data)[(m.p)] {
  1271. case 10:
  1272. goto tr91
  1273. case 13:
  1274. goto tr92
  1275. case 32:
  1276. goto tr90
  1277. }
  1278. switch {
  1279. case (m.data)[(m.p)] > 12:
  1280. if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
  1281. goto st55
  1282. }
  1283. case (m.data)[(m.p)] >= 9:
  1284. goto tr90
  1285. }
  1286. goto tr37
  1287. st55:
  1288. if (m.p)++; (m.p) == (m.pe) {
  1289. goto _test_eof55
  1290. }
  1291. st_case_55:
  1292. switch (m.data)[(m.p)] {
  1293. case 10:
  1294. goto tr91
  1295. case 13:
  1296. goto tr92
  1297. case 32:
  1298. goto tr90
  1299. }
  1300. switch {
  1301. case (m.data)[(m.p)] > 12:
  1302. if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
  1303. goto st56
  1304. }
  1305. case (m.data)[(m.p)] >= 9:
  1306. goto tr90
  1307. }
  1308. goto tr37
  1309. st56:
  1310. if (m.p)++; (m.p) == (m.pe) {
  1311. goto _test_eof56
  1312. }
  1313. st_case_56:
  1314. switch (m.data)[(m.p)] {
  1315. case 10:
  1316. goto tr91
  1317. case 13:
  1318. goto tr92
  1319. case 32:
  1320. goto tr90
  1321. }
  1322. switch {
  1323. case (m.data)[(m.p)] > 12:
  1324. if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
  1325. goto st57
  1326. }
  1327. case (m.data)[(m.p)] >= 9:
  1328. goto tr90
  1329. }
  1330. goto tr37
  1331. st57:
  1332. if (m.p)++; (m.p) == (m.pe) {
  1333. goto _test_eof57
  1334. }
  1335. st_case_57:
  1336. switch (m.data)[(m.p)] {
  1337. case 10:
  1338. goto tr91
  1339. case 13:
  1340. goto tr92
  1341. case 32:
  1342. goto tr90
  1343. }
  1344. switch {
  1345. case (m.data)[(m.p)] > 12:
  1346. if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
  1347. goto st58
  1348. }
  1349. case (m.data)[(m.p)] >= 9:
  1350. goto tr90
  1351. }
  1352. goto tr37
  1353. st58:
  1354. if (m.p)++; (m.p) == (m.pe) {
  1355. goto _test_eof58
  1356. }
  1357. st_case_58:
  1358. switch (m.data)[(m.p)] {
  1359. case 10:
  1360. goto tr91
  1361. case 13:
  1362. goto tr92
  1363. case 32:
  1364. goto tr90
  1365. }
  1366. switch {
  1367. case (m.data)[(m.p)] > 12:
  1368. if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
  1369. goto st59
  1370. }
  1371. case (m.data)[(m.p)] >= 9:
  1372. goto tr90
  1373. }
  1374. goto tr37
  1375. st59:
  1376. if (m.p)++; (m.p) == (m.pe) {
  1377. goto _test_eof59
  1378. }
  1379. st_case_59:
  1380. switch (m.data)[(m.p)] {
  1381. case 10:
  1382. goto tr91
  1383. case 13:
  1384. goto tr92
  1385. case 32:
  1386. goto tr90
  1387. }
  1388. switch {
  1389. case (m.data)[(m.p)] > 12:
  1390. if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
  1391. goto st60
  1392. }
  1393. case (m.data)[(m.p)] >= 9:
  1394. goto tr90
  1395. }
  1396. goto tr37
  1397. st60:
  1398. if (m.p)++; (m.p) == (m.pe) {
  1399. goto _test_eof60
  1400. }
  1401. st_case_60:
  1402. switch (m.data)[(m.p)] {
  1403. case 10:
  1404. goto tr91
  1405. case 13:
  1406. goto tr92
  1407. case 32:
  1408. goto tr90
  1409. }
  1410. switch {
  1411. case (m.data)[(m.p)] > 12:
  1412. if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
  1413. goto st61
  1414. }
  1415. case (m.data)[(m.p)] >= 9:
  1416. goto tr90
  1417. }
  1418. goto tr37
  1419. st61:
  1420. if (m.p)++; (m.p) == (m.pe) {
  1421. goto _test_eof61
  1422. }
  1423. st_case_61:
  1424. switch (m.data)[(m.p)] {
  1425. case 10:
  1426. goto tr91
  1427. case 13:
  1428. goto tr92
  1429. case 32:
  1430. goto tr90
  1431. }
  1432. switch {
  1433. case (m.data)[(m.p)] > 12:
  1434. if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
  1435. goto st62
  1436. }
  1437. case (m.data)[(m.p)] >= 9:
  1438. goto tr90
  1439. }
  1440. goto tr37
  1441. st62:
  1442. if (m.p)++; (m.p) == (m.pe) {
  1443. goto _test_eof62
  1444. }
  1445. st_case_62:
  1446. switch (m.data)[(m.p)] {
  1447. case 10:
  1448. goto tr91
  1449. case 13:
  1450. goto tr92
  1451. case 32:
  1452. goto tr90
  1453. }
  1454. switch {
  1455. case (m.data)[(m.p)] > 12:
  1456. if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
  1457. goto st63
  1458. }
  1459. case (m.data)[(m.p)] >= 9:
  1460. goto tr90
  1461. }
  1462. goto tr37
  1463. st63:
  1464. if (m.p)++; (m.p) == (m.pe) {
  1465. goto _test_eof63
  1466. }
  1467. st_case_63:
  1468. switch (m.data)[(m.p)] {
  1469. case 10:
  1470. goto tr91
  1471. case 13:
  1472. goto tr92
  1473. case 32:
  1474. goto tr90
  1475. }
  1476. switch {
  1477. case (m.data)[(m.p)] > 12:
  1478. if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
  1479. goto st64
  1480. }
  1481. case (m.data)[(m.p)] >= 9:
  1482. goto tr90
  1483. }
  1484. goto tr37
  1485. st64:
  1486. if (m.p)++; (m.p) == (m.pe) {
  1487. goto _test_eof64
  1488. }
  1489. st_case_64:
  1490. switch (m.data)[(m.p)] {
  1491. case 10:
  1492. goto tr91
  1493. case 13:
  1494. goto tr92
  1495. case 32:
  1496. goto tr90
  1497. }
  1498. switch {
  1499. case (m.data)[(m.p)] > 12:
  1500. if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
  1501. goto st65
  1502. }
  1503. case (m.data)[(m.p)] >= 9:
  1504. goto tr90
  1505. }
  1506. goto tr37
  1507. st65:
  1508. if (m.p)++; (m.p) == (m.pe) {
  1509. goto _test_eof65
  1510. }
  1511. st_case_65:
  1512. switch (m.data)[(m.p)] {
  1513. case 10:
  1514. goto tr91
  1515. case 13:
  1516. goto tr92
  1517. case 32:
  1518. goto tr90
  1519. }
  1520. switch {
  1521. case (m.data)[(m.p)] > 12:
  1522. if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
  1523. goto st66
  1524. }
  1525. case (m.data)[(m.p)] >= 9:
  1526. goto tr90
  1527. }
  1528. goto tr37
  1529. st66:
  1530. if (m.p)++; (m.p) == (m.pe) {
  1531. goto _test_eof66
  1532. }
  1533. st_case_66:
  1534. switch (m.data)[(m.p)] {
  1535. case 10:
  1536. goto tr91
  1537. case 13:
  1538. goto tr92
  1539. case 32:
  1540. goto tr90
  1541. }
  1542. switch {
  1543. case (m.data)[(m.p)] > 12:
  1544. if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
  1545. goto st67
  1546. }
  1547. case (m.data)[(m.p)] >= 9:
  1548. goto tr90
  1549. }
  1550. goto tr37
  1551. st67:
  1552. if (m.p)++; (m.p) == (m.pe) {
  1553. goto _test_eof67
  1554. }
  1555. st_case_67:
  1556. switch (m.data)[(m.p)] {
  1557. case 10:
  1558. goto tr91
  1559. case 13:
  1560. goto tr92
  1561. case 32:
  1562. goto tr90
  1563. }
  1564. switch {
  1565. case (m.data)[(m.p)] > 12:
  1566. if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
  1567. goto st68
  1568. }
  1569. case (m.data)[(m.p)] >= 9:
  1570. goto tr90
  1571. }
  1572. goto tr37
  1573. st68:
  1574. if (m.p)++; (m.p) == (m.pe) {
  1575. goto _test_eof68
  1576. }
  1577. st_case_68:
  1578. switch (m.data)[(m.p)] {
  1579. case 10:
  1580. goto tr91
  1581. case 13:
  1582. goto tr92
  1583. case 32:
  1584. goto tr90
  1585. }
  1586. switch {
  1587. case (m.data)[(m.p)] > 12:
  1588. if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
  1589. goto st69
  1590. }
  1591. case (m.data)[(m.p)] >= 9:
  1592. goto tr90
  1593. }
  1594. goto tr37
  1595. st69:
  1596. if (m.p)++; (m.p) == (m.pe) {
  1597. goto _test_eof69
  1598. }
  1599. st_case_69:
  1600. switch (m.data)[(m.p)] {
  1601. case 10:
  1602. goto tr91
  1603. case 13:
  1604. goto tr92
  1605. case 32:
  1606. goto tr90
  1607. }
  1608. switch {
  1609. case (m.data)[(m.p)] > 12:
  1610. if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
  1611. goto st70
  1612. }
  1613. case (m.data)[(m.p)] >= 9:
  1614. goto tr90
  1615. }
  1616. goto tr37
  1617. st70:
  1618. if (m.p)++; (m.p) == (m.pe) {
  1619. goto _test_eof70
  1620. }
  1621. st_case_70:
  1622. switch (m.data)[(m.p)] {
  1623. case 10:
  1624. goto tr91
  1625. case 13:
  1626. goto tr92
  1627. case 32:
  1628. goto tr90
  1629. }
  1630. if 9 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 12 {
  1631. goto tr90
  1632. }
  1633. goto tr37
  1634. tr115:
  1635. (m.cs) = 12
  1636. //line machine.go.rl:122
  1637. err = m.handler.AddFloat(m.key, m.text())
  1638. if err != nil {
  1639. (m.p)--
  1640. (m.cs) = 35
  1641. {
  1642. (m.p)++
  1643. goto _out
  1644. }
  1645. }
  1646. goto _again
  1647. tr122:
  1648. (m.cs) = 12
  1649. //line machine.go.rl:104
  1650. err = m.handler.AddInt(m.key, m.text())
  1651. if err != nil {
  1652. (m.p)--
  1653. (m.cs) = 35
  1654. {
  1655. (m.p)++
  1656. goto _out
  1657. }
  1658. }
  1659. goto _again
  1660. tr127:
  1661. (m.cs) = 12
  1662. //line machine.go.rl:113
  1663. err = m.handler.AddUint(m.key, m.text())
  1664. if err != nil {
  1665. (m.p)--
  1666. (m.cs) = 35
  1667. {
  1668. (m.p)++
  1669. goto _out
  1670. }
  1671. }
  1672. goto _again
  1673. tr132:
  1674. (m.cs) = 12
  1675. //line machine.go.rl:131
  1676. err = m.handler.AddBool(m.key, m.text())
  1677. if err != nil {
  1678. (m.p)--
  1679. (m.cs) = 35
  1680. {
  1681. (m.p)++
  1682. goto _out
  1683. }
  1684. }
  1685. goto _again
  1686. st12:
  1687. if (m.p)++; (m.p) == (m.pe) {
  1688. goto _test_eof12
  1689. }
  1690. st_case_12:
  1691. //line machine.go:1783
  1692. switch (m.data)[(m.p)] {
  1693. case 32:
  1694. goto tr7
  1695. case 44:
  1696. goto tr7
  1697. case 61:
  1698. goto tr7
  1699. case 92:
  1700. goto tr8
  1701. }
  1702. if 9 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 13 {
  1703. goto tr7
  1704. }
  1705. goto tr5
  1706. tr8:
  1707. //line machine.go.rl:20
  1708. m.pb = m.p
  1709. goto st13
  1710. st13:
  1711. if (m.p)++; (m.p) == (m.pe) {
  1712. goto _test_eof13
  1713. }
  1714. st_case_13:
  1715. //line machine.go:1809
  1716. if 9 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 13 {
  1717. goto tr7
  1718. }
  1719. goto st3
  1720. tr25:
  1721. //line machine.go.rl:20
  1722. m.pb = m.p
  1723. goto st14
  1724. st14:
  1725. if (m.p)++; (m.p) == (m.pe) {
  1726. goto _test_eof14
  1727. }
  1728. st_case_14:
  1729. //line machine.go:1825
  1730. switch (m.data)[(m.p)] {
  1731. case 34:
  1732. goto st6
  1733. case 92:
  1734. goto st6
  1735. }
  1736. goto tr7
  1737. tr13:
  1738. //line machine.go.rl:20
  1739. m.pb = m.p
  1740. goto st15
  1741. st15:
  1742. if (m.p)++; (m.p) == (m.pe) {
  1743. goto _test_eof15
  1744. }
  1745. st_case_15:
  1746. //line machine.go:1844
  1747. switch (m.data)[(m.p)] {
  1748. case 46:
  1749. goto st16
  1750. case 48:
  1751. goto st73
  1752. }
  1753. if 49 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
  1754. goto st76
  1755. }
  1756. goto tr7
  1757. tr14:
  1758. //line machine.go.rl:20
  1759. m.pb = m.p
  1760. goto st16
  1761. st16:
  1762. if (m.p)++; (m.p) == (m.pe) {
  1763. goto _test_eof16
  1764. }
  1765. st_case_16:
  1766. //line machine.go:1866
  1767. if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
  1768. goto st71
  1769. }
  1770. goto tr7
  1771. st71:
  1772. if (m.p)++; (m.p) == (m.pe) {
  1773. goto _test_eof71
  1774. }
  1775. st_case_71:
  1776. switch (m.data)[(m.p)] {
  1777. case 10:
  1778. goto tr113
  1779. case 13:
  1780. goto tr114
  1781. case 32:
  1782. goto tr112
  1783. case 44:
  1784. goto tr115
  1785. case 69:
  1786. goto st17
  1787. case 101:
  1788. goto st17
  1789. }
  1790. switch {
  1791. case (m.data)[(m.p)] > 12:
  1792. if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
  1793. goto st71
  1794. }
  1795. case (m.data)[(m.p)] >= 9:
  1796. goto tr112
  1797. }
  1798. goto tr84
  1799. st17:
  1800. if (m.p)++; (m.p) == (m.pe) {
  1801. goto _test_eof17
  1802. }
  1803. st_case_17:
  1804. switch (m.data)[(m.p)] {
  1805. case 34:
  1806. goto st18
  1807. case 43:
  1808. goto st18
  1809. case 45:
  1810. goto st18
  1811. }
  1812. if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
  1813. goto st72
  1814. }
  1815. goto tr7
  1816. st18:
  1817. if (m.p)++; (m.p) == (m.pe) {
  1818. goto _test_eof18
  1819. }
  1820. st_case_18:
  1821. if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
  1822. goto st72
  1823. }
  1824. goto tr7
  1825. st72:
  1826. if (m.p)++; (m.p) == (m.pe) {
  1827. goto _test_eof72
  1828. }
  1829. st_case_72:
  1830. switch (m.data)[(m.p)] {
  1831. case 10:
  1832. goto tr113
  1833. case 13:
  1834. goto tr114
  1835. case 32:
  1836. goto tr112
  1837. case 44:
  1838. goto tr115
  1839. }
  1840. switch {
  1841. case (m.data)[(m.p)] > 12:
  1842. if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
  1843. goto st72
  1844. }
  1845. case (m.data)[(m.p)] >= 9:
  1846. goto tr112
  1847. }
  1848. goto tr84
  1849. st73:
  1850. if (m.p)++; (m.p) == (m.pe) {
  1851. goto _test_eof73
  1852. }
  1853. st_case_73:
  1854. switch (m.data)[(m.p)] {
  1855. case 10:
  1856. goto tr113
  1857. case 13:
  1858. goto tr114
  1859. case 32:
  1860. goto tr112
  1861. case 44:
  1862. goto tr115
  1863. case 46:
  1864. goto st71
  1865. case 69:
  1866. goto st17
  1867. case 101:
  1868. goto st17
  1869. case 105:
  1870. goto st75
  1871. }
  1872. switch {
  1873. case (m.data)[(m.p)] > 12:
  1874. if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
  1875. goto st74
  1876. }
  1877. case (m.data)[(m.p)] >= 9:
  1878. goto tr112
  1879. }
  1880. goto tr84
  1881. st74:
  1882. if (m.p)++; (m.p) == (m.pe) {
  1883. goto _test_eof74
  1884. }
  1885. st_case_74:
  1886. switch (m.data)[(m.p)] {
  1887. case 10:
  1888. goto tr113
  1889. case 13:
  1890. goto tr114
  1891. case 32:
  1892. goto tr112
  1893. case 44:
  1894. goto tr115
  1895. case 46:
  1896. goto st71
  1897. case 69:
  1898. goto st17
  1899. case 101:
  1900. goto st17
  1901. }
  1902. switch {
  1903. case (m.data)[(m.p)] > 12:
  1904. if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
  1905. goto st74
  1906. }
  1907. case (m.data)[(m.p)] >= 9:
  1908. goto tr112
  1909. }
  1910. goto tr84
  1911. st75:
  1912. if (m.p)++; (m.p) == (m.pe) {
  1913. goto _test_eof75
  1914. }
  1915. st_case_75:
  1916. switch (m.data)[(m.p)] {
  1917. case 10:
  1918. goto tr120
  1919. case 13:
  1920. goto tr121
  1921. case 32:
  1922. goto tr119
  1923. case 44:
  1924. goto tr122
  1925. }
  1926. if 9 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 12 {
  1927. goto tr119
  1928. }
  1929. goto tr84
  1930. st76:
  1931. if (m.p)++; (m.p) == (m.pe) {
  1932. goto _test_eof76
  1933. }
  1934. st_case_76:
  1935. switch (m.data)[(m.p)] {
  1936. case 10:
  1937. goto tr113
  1938. case 13:
  1939. goto tr114
  1940. case 32:
  1941. goto tr112
  1942. case 44:
  1943. goto tr115
  1944. case 46:
  1945. goto st71
  1946. case 69:
  1947. goto st17
  1948. case 101:
  1949. goto st17
  1950. case 105:
  1951. goto st75
  1952. }
  1953. switch {
  1954. case (m.data)[(m.p)] > 12:
  1955. if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
  1956. goto st76
  1957. }
  1958. case (m.data)[(m.p)] >= 9:
  1959. goto tr112
  1960. }
  1961. goto tr84
  1962. tr15:
  1963. //line machine.go.rl:20
  1964. m.pb = m.p
  1965. goto st77
  1966. st77:
  1967. if (m.p)++; (m.p) == (m.pe) {
  1968. goto _test_eof77
  1969. }
  1970. st_case_77:
  1971. //line machine.go:2073
  1972. switch (m.data)[(m.p)] {
  1973. case 10:
  1974. goto tr113
  1975. case 13:
  1976. goto tr114
  1977. case 32:
  1978. goto tr112
  1979. case 44:
  1980. goto tr115
  1981. case 46:
  1982. goto st71
  1983. case 69:
  1984. goto st17
  1985. case 101:
  1986. goto st17
  1987. case 105:
  1988. goto st75
  1989. case 117:
  1990. goto st78
  1991. }
  1992. switch {
  1993. case (m.data)[(m.p)] > 12:
  1994. if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
  1995. goto st74
  1996. }
  1997. case (m.data)[(m.p)] >= 9:
  1998. goto tr112
  1999. }
  2000. goto tr84
  2001. st78:
  2002. if (m.p)++; (m.p) == (m.pe) {
  2003. goto _test_eof78
  2004. }
  2005. st_case_78:
  2006. switch (m.data)[(m.p)] {
  2007. case 10:
  2008. goto tr125
  2009. case 13:
  2010. goto tr126
  2011. case 32:
  2012. goto tr124
  2013. case 44:
  2014. goto tr127
  2015. }
  2016. if 9 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 12 {
  2017. goto tr124
  2018. }
  2019. goto tr84
  2020. tr16:
  2021. //line machine.go.rl:20
  2022. m.pb = m.p
  2023. goto st79
  2024. st79:
  2025. if (m.p)++; (m.p) == (m.pe) {
  2026. goto _test_eof79
  2027. }
  2028. st_case_79:
  2029. //line machine.go:2133
  2030. switch (m.data)[(m.p)] {
  2031. case 10:
  2032. goto tr113
  2033. case 13:
  2034. goto tr114
  2035. case 32:
  2036. goto tr112
  2037. case 44:
  2038. goto tr115
  2039. case 46:
  2040. goto st71
  2041. case 69:
  2042. goto st17
  2043. case 101:
  2044. goto st17
  2045. case 105:
  2046. goto st75
  2047. case 117:
  2048. goto st78
  2049. }
  2050. switch {
  2051. case (m.data)[(m.p)] > 12:
  2052. if 48 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 57 {
  2053. goto st79
  2054. }
  2055. case (m.data)[(m.p)] >= 9:
  2056. goto tr112
  2057. }
  2058. goto tr84
  2059. tr17:
  2060. //line machine.go.rl:20
  2061. m.pb = m.p
  2062. goto st80
  2063. st80:
  2064. if (m.p)++; (m.p) == (m.pe) {
  2065. goto _test_eof80
  2066. }
  2067. st_case_80:
  2068. //line machine.go:2174
  2069. switch (m.data)[(m.p)] {
  2070. case 10:
  2071. goto tr130
  2072. case 13:
  2073. goto tr131
  2074. case 32:
  2075. goto tr129
  2076. case 44:
  2077. goto tr132
  2078. case 65:
  2079. goto st19
  2080. case 97:
  2081. goto st22
  2082. }
  2083. if 9 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 12 {
  2084. goto tr129
  2085. }
  2086. goto tr84
  2087. st19:
  2088. if (m.p)++; (m.p) == (m.pe) {
  2089. goto _test_eof19
  2090. }
  2091. st_case_19:
  2092. if (m.data)[(m.p)] == 76 {
  2093. goto st20
  2094. }
  2095. goto tr7
  2096. st20:
  2097. if (m.p)++; (m.p) == (m.pe) {
  2098. goto _test_eof20
  2099. }
  2100. st_case_20:
  2101. if (m.data)[(m.p)] == 83 {
  2102. goto st21
  2103. }
  2104. goto tr7
  2105. st21:
  2106. if (m.p)++; (m.p) == (m.pe) {
  2107. goto _test_eof21
  2108. }
  2109. st_case_21:
  2110. if (m.data)[(m.p)] == 69 {
  2111. goto st81
  2112. }
  2113. goto tr7
  2114. st81:
  2115. if (m.p)++; (m.p) == (m.pe) {
  2116. goto _test_eof81
  2117. }
  2118. st_case_81:
  2119. switch (m.data)[(m.p)] {
  2120. case 10:
  2121. goto tr130
  2122. case 13:
  2123. goto tr131
  2124. case 32:
  2125. goto tr129
  2126. case 44:
  2127. goto tr132
  2128. }
  2129. if 9 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 12 {
  2130. goto tr129
  2131. }
  2132. goto tr84
  2133. st22:
  2134. if (m.p)++; (m.p) == (m.pe) {
  2135. goto _test_eof22
  2136. }
  2137. st_case_22:
  2138. if (m.data)[(m.p)] == 108 {
  2139. goto st23
  2140. }
  2141. goto tr7
  2142. st23:
  2143. if (m.p)++; (m.p) == (m.pe) {
  2144. goto _test_eof23
  2145. }
  2146. st_case_23:
  2147. if (m.data)[(m.p)] == 115 {
  2148. goto st24
  2149. }
  2150. goto tr7
  2151. st24:
  2152. if (m.p)++; (m.p) == (m.pe) {
  2153. goto _test_eof24
  2154. }
  2155. st_case_24:
  2156. if (m.data)[(m.p)] == 101 {
  2157. goto st81
  2158. }
  2159. goto tr7
  2160. tr18:
  2161. //line machine.go.rl:20
  2162. m.pb = m.p
  2163. goto st82
  2164. st82:
  2165. if (m.p)++; (m.p) == (m.pe) {
  2166. goto _test_eof82
  2167. }
  2168. st_case_82:
  2169. //line machine.go:2277
  2170. switch (m.data)[(m.p)] {
  2171. case 10:
  2172. goto tr130
  2173. case 13:
  2174. goto tr131
  2175. case 32:
  2176. goto tr129
  2177. case 44:
  2178. goto tr132
  2179. case 82:
  2180. goto st25
  2181. case 114:
  2182. goto st26
  2183. }
  2184. if 9 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 12 {
  2185. goto tr129
  2186. }
  2187. goto tr84
  2188. st25:
  2189. if (m.p)++; (m.p) == (m.pe) {
  2190. goto _test_eof25
  2191. }
  2192. st_case_25:
  2193. if (m.data)[(m.p)] == 85 {
  2194. goto st21
  2195. }
  2196. goto tr7
  2197. st26:
  2198. if (m.p)++; (m.p) == (m.pe) {
  2199. goto _test_eof26
  2200. }
  2201. st_case_26:
  2202. if (m.data)[(m.p)] == 117 {
  2203. goto st24
  2204. }
  2205. goto tr7
  2206. tr19:
  2207. //line machine.go.rl:20
  2208. m.pb = m.p
  2209. goto st83
  2210. st83:
  2211. if (m.p)++; (m.p) == (m.pe) {
  2212. goto _test_eof83
  2213. }
  2214. st_case_83:
  2215. //line machine.go:2325
  2216. switch (m.data)[(m.p)] {
  2217. case 10:
  2218. goto tr130
  2219. case 13:
  2220. goto tr131
  2221. case 32:
  2222. goto tr129
  2223. case 44:
  2224. goto tr132
  2225. case 97:
  2226. goto st22
  2227. }
  2228. if 9 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 12 {
  2229. goto tr129
  2230. }
  2231. goto tr84
  2232. tr20:
  2233. //line machine.go.rl:20
  2234. m.pb = m.p
  2235. goto st84
  2236. st84:
  2237. if (m.p)++; (m.p) == (m.pe) {
  2238. goto _test_eof84
  2239. }
  2240. st_case_84:
  2241. //line machine.go:2353
  2242. switch (m.data)[(m.p)] {
  2243. case 10:
  2244. goto tr130
  2245. case 13:
  2246. goto tr131
  2247. case 32:
  2248. goto tr129
  2249. case 44:
  2250. goto tr132
  2251. case 114:
  2252. goto st26
  2253. }
  2254. if 9 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 12 {
  2255. goto tr129
  2256. }
  2257. goto tr84
  2258. tr3:
  2259. (m.cs) = 27
  2260. //line machine.go.rl:78
  2261. err = m.handler.SetMeasurement(m.text())
  2262. if err != nil {
  2263. (m.p)--
  2264. (m.cs) = 35
  2265. {
  2266. (m.p)++
  2267. goto _out
  2268. }
  2269. }
  2270. goto _again
  2271. tr59:
  2272. (m.cs) = 27
  2273. //line machine.go.rl:91
  2274. err = m.handler.AddTag(m.key, m.text())
  2275. if err != nil {
  2276. (m.p)--
  2277. (m.cs) = 35
  2278. {
  2279. (m.p)++
  2280. goto _out
  2281. }
  2282. }
  2283. goto _again
  2284. st27:
  2285. if (m.p)++; (m.p) == (m.pe) {
  2286. goto _test_eof27
  2287. }
  2288. st_case_27:
  2289. //line machine.go:2401
  2290. switch (m.data)[(m.p)] {
  2291. case 32:
  2292. goto tr2
  2293. case 44:
  2294. goto tr2
  2295. case 61:
  2296. goto tr2
  2297. case 92:
  2298. goto tr51
  2299. }
  2300. if 9 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 13 {
  2301. goto tr2
  2302. }
  2303. goto tr50
  2304. tr50:
  2305. //line machine.go.rl:20
  2306. m.pb = m.p
  2307. goto st28
  2308. st28:
  2309. if (m.p)++; (m.p) == (m.pe) {
  2310. goto _test_eof28
  2311. }
  2312. st_case_28:
  2313. //line machine.go:2427
  2314. switch (m.data)[(m.p)] {
  2315. case 32:
  2316. goto tr2
  2317. case 44:
  2318. goto tr2
  2319. case 61:
  2320. goto tr53
  2321. case 92:
  2322. goto st33
  2323. }
  2324. if 9 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 13 {
  2325. goto tr2
  2326. }
  2327. goto st28
  2328. tr53:
  2329. //line machine.go.rl:87
  2330. m.key = m.text()
  2331. goto st29
  2332. st29:
  2333. if (m.p)++; (m.p) == (m.pe) {
  2334. goto _test_eof29
  2335. }
  2336. st_case_29:
  2337. //line machine.go:2453
  2338. switch (m.data)[(m.p)] {
  2339. case 32:
  2340. goto tr2
  2341. case 44:
  2342. goto tr2
  2343. case 61:
  2344. goto tr2
  2345. case 92:
  2346. goto tr56
  2347. }
  2348. if 9 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 13 {
  2349. goto tr2
  2350. }
  2351. goto tr55
  2352. tr55:
  2353. //line machine.go.rl:20
  2354. m.pb = m.p
  2355. goto st30
  2356. st30:
  2357. if (m.p)++; (m.p) == (m.pe) {
  2358. goto _test_eof30
  2359. }
  2360. st_case_30:
  2361. //line machine.go:2479
  2362. switch (m.data)[(m.p)] {
  2363. case 10:
  2364. goto tr2
  2365. case 13:
  2366. goto tr2
  2367. case 32:
  2368. goto tr58
  2369. case 44:
  2370. goto tr59
  2371. case 61:
  2372. goto tr2
  2373. case 92:
  2374. goto st31
  2375. }
  2376. if 9 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 12 {
  2377. goto tr58
  2378. }
  2379. goto st30
  2380. tr56:
  2381. //line machine.go.rl:20
  2382. m.pb = m.p
  2383. goto st31
  2384. st31:
  2385. if (m.p)++; (m.p) == (m.pe) {
  2386. goto _test_eof31
  2387. }
  2388. st_case_31:
  2389. //line machine.go:2509
  2390. if (m.data)[(m.p)] == 92 {
  2391. goto st32
  2392. }
  2393. if 9 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 13 {
  2394. goto tr2
  2395. }
  2396. goto st30
  2397. st32:
  2398. //line machine.go.rl:240
  2399. (m.p)--
  2400. if (m.p)++; (m.p) == (m.pe) {
  2401. goto _test_eof32
  2402. }
  2403. st_case_32:
  2404. //line machine.go:2525
  2405. switch (m.data)[(m.p)] {
  2406. case 10:
  2407. goto tr2
  2408. case 13:
  2409. goto tr2
  2410. case 32:
  2411. goto tr58
  2412. case 44:
  2413. goto tr59
  2414. case 61:
  2415. goto tr2
  2416. case 92:
  2417. goto st31
  2418. }
  2419. if 9 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 12 {
  2420. goto tr58
  2421. }
  2422. goto st30
  2423. tr51:
  2424. //line machine.go.rl:20
  2425. m.pb = m.p
  2426. goto st33
  2427. st33:
  2428. if (m.p)++; (m.p) == (m.pe) {
  2429. goto _test_eof33
  2430. }
  2431. st_case_33:
  2432. //line machine.go:2555
  2433. if (m.data)[(m.p)] == 92 {
  2434. goto st34
  2435. }
  2436. if 9 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 13 {
  2437. goto tr2
  2438. }
  2439. goto st28
  2440. st34:
  2441. //line machine.go.rl:240
  2442. (m.p)--
  2443. if (m.p)++; (m.p) == (m.pe) {
  2444. goto _test_eof34
  2445. }
  2446. st_case_34:
  2447. //line machine.go:2571
  2448. switch (m.data)[(m.p)] {
  2449. case 32:
  2450. goto tr2
  2451. case 44:
  2452. goto tr2
  2453. case 61:
  2454. goto tr53
  2455. case 92:
  2456. goto st33
  2457. }
  2458. if 9 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 13 {
  2459. goto tr2
  2460. }
  2461. goto st28
  2462. st35:
  2463. if (m.p)++; (m.p) == (m.pe) {
  2464. goto _test_eof35
  2465. }
  2466. st_case_35:
  2467. if (m.data)[(m.p)] == 10 {
  2468. goto tr64
  2469. }
  2470. goto st35
  2471. tr64:
  2472. //line machine.go.rl:158
  2473. m.lineno++
  2474. m.sol = m.p
  2475. m.sol++ // next char will be the first column in the line
  2476. //line machine.go.rl:70
  2477. {
  2478. goto st86
  2479. }
  2480. goto st85
  2481. st85:
  2482. if (m.p)++; (m.p) == (m.pe) {
  2483. goto _test_eof85
  2484. }
  2485. st_case_85:
  2486. //line machine.go:2612
  2487. goto st0
  2488. st38:
  2489. if (m.p)++; (m.p) == (m.pe) {
  2490. goto _test_eof38
  2491. }
  2492. st_case_38:
  2493. switch (m.data)[(m.p)] {
  2494. case 32:
  2495. goto tr33
  2496. case 35:
  2497. goto tr33
  2498. case 44:
  2499. goto tr33
  2500. case 92:
  2501. goto tr68
  2502. }
  2503. if 9 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 13 {
  2504. goto tr33
  2505. }
  2506. goto tr67
  2507. tr67:
  2508. //line machine.go.rl:74
  2509. m.beginMetric = true
  2510. //line machine.go.rl:20
  2511. m.pb = m.p
  2512. goto st87
  2513. st87:
  2514. if (m.p)++; (m.p) == (m.pe) {
  2515. goto _test_eof87
  2516. }
  2517. st_case_87:
  2518. //line machine.go:2648
  2519. switch (m.data)[(m.p)] {
  2520. case 10:
  2521. goto tr140
  2522. case 13:
  2523. goto tr141
  2524. case 32:
  2525. goto tr2
  2526. case 44:
  2527. goto tr142
  2528. case 92:
  2529. goto st46
  2530. }
  2531. if 9 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 12 {
  2532. goto tr2
  2533. }
  2534. goto st87
  2535. tr69:
  2536. //line machine.go.rl:158
  2537. m.lineno++
  2538. m.sol = m.p
  2539. m.sol++ // next char will be the first column in the line
  2540. goto st88
  2541. tr140:
  2542. (m.cs) = 88
  2543. //line machine.go.rl:78
  2544. err = m.handler.SetMeasurement(m.text())
  2545. if err != nil {
  2546. (m.p)--
  2547. (m.cs) = 35
  2548. {
  2549. (m.p)++
  2550. goto _out
  2551. }
  2552. }
  2553. //line machine.go.rl:158
  2554. m.lineno++
  2555. m.sol = m.p
  2556. m.sol++ // next char will be the first column in the line
  2557. goto _again
  2558. tr144:
  2559. (m.cs) = 88
  2560. //line machine.go.rl:91
  2561. err = m.handler.AddTag(m.key, m.text())
  2562. if err != nil {
  2563. (m.p)--
  2564. (m.cs) = 35
  2565. {
  2566. (m.p)++
  2567. goto _out
  2568. }
  2569. }
  2570. //line machine.go.rl:158
  2571. m.lineno++
  2572. m.sol = m.p
  2573. m.sol++ // next char will be the first column in the line
  2574. goto _again
  2575. st88:
  2576. //line machine.go.rl:164
  2577. m.finishMetric = true
  2578. (m.cs) = 86
  2579. {
  2580. (m.p)++
  2581. goto _out
  2582. }
  2583. if (m.p)++; (m.p) == (m.pe) {
  2584. goto _test_eof88
  2585. }
  2586. st_case_88:
  2587. //line machine.go:2722
  2588. goto st0
  2589. tr141:
  2590. (m.cs) = 39
  2591. //line machine.go.rl:78
  2592. err = m.handler.SetMeasurement(m.text())
  2593. if err != nil {
  2594. (m.p)--
  2595. (m.cs) = 35
  2596. {
  2597. (m.p)++
  2598. goto _out
  2599. }
  2600. }
  2601. goto _again
  2602. tr145:
  2603. (m.cs) = 39
  2604. //line machine.go.rl:91
  2605. err = m.handler.AddTag(m.key, m.text())
  2606. if err != nil {
  2607. (m.p)--
  2608. (m.cs) = 35
  2609. {
  2610. (m.p)++
  2611. goto _out
  2612. }
  2613. }
  2614. goto _again
  2615. st39:
  2616. if (m.p)++; (m.p) == (m.pe) {
  2617. goto _test_eof39
  2618. }
  2619. st_case_39:
  2620. //line machine.go:2755
  2621. if (m.data)[(m.p)] == 10 {
  2622. goto tr69
  2623. }
  2624. goto st0
  2625. tr142:
  2626. (m.cs) = 40
  2627. //line machine.go.rl:78
  2628. err = m.handler.SetMeasurement(m.text())
  2629. if err != nil {
  2630. (m.p)--
  2631. (m.cs) = 35
  2632. {
  2633. (m.p)++
  2634. goto _out
  2635. }
  2636. }
  2637. goto _again
  2638. tr146:
  2639. (m.cs) = 40
  2640. //line machine.go.rl:91
  2641. err = m.handler.AddTag(m.key, m.text())
  2642. if err != nil {
  2643. (m.p)--
  2644. (m.cs) = 35
  2645. {
  2646. (m.p)++
  2647. goto _out
  2648. }
  2649. }
  2650. goto _again
  2651. st40:
  2652. if (m.p)++; (m.p) == (m.pe) {
  2653. goto _test_eof40
  2654. }
  2655. st_case_40:
  2656. //line machine.go:2791
  2657. switch (m.data)[(m.p)] {
  2658. case 32:
  2659. goto tr2
  2660. case 44:
  2661. goto tr2
  2662. case 61:
  2663. goto tr2
  2664. case 92:
  2665. goto tr71
  2666. }
  2667. if 9 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 13 {
  2668. goto tr2
  2669. }
  2670. goto tr70
  2671. tr70:
  2672. //line machine.go.rl:20
  2673. m.pb = m.p
  2674. goto st41
  2675. st41:
  2676. if (m.p)++; (m.p) == (m.pe) {
  2677. goto _test_eof41
  2678. }
  2679. st_case_41:
  2680. //line machine.go:2817
  2681. switch (m.data)[(m.p)] {
  2682. case 32:
  2683. goto tr2
  2684. case 44:
  2685. goto tr2
  2686. case 61:
  2687. goto tr73
  2688. case 92:
  2689. goto st44
  2690. }
  2691. if 9 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 13 {
  2692. goto tr2
  2693. }
  2694. goto st41
  2695. tr73:
  2696. //line machine.go.rl:87
  2697. m.key = m.text()
  2698. goto st42
  2699. st42:
  2700. if (m.p)++; (m.p) == (m.pe) {
  2701. goto _test_eof42
  2702. }
  2703. st_case_42:
  2704. //line machine.go:2843
  2705. switch (m.data)[(m.p)] {
  2706. case 32:
  2707. goto tr2
  2708. case 44:
  2709. goto tr2
  2710. case 61:
  2711. goto tr2
  2712. case 92:
  2713. goto tr76
  2714. }
  2715. if 9 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 13 {
  2716. goto tr2
  2717. }
  2718. goto tr75
  2719. tr75:
  2720. //line machine.go.rl:20
  2721. m.pb = m.p
  2722. goto st89
  2723. st89:
  2724. if (m.p)++; (m.p) == (m.pe) {
  2725. goto _test_eof89
  2726. }
  2727. st_case_89:
  2728. //line machine.go:2869
  2729. switch (m.data)[(m.p)] {
  2730. case 10:
  2731. goto tr144
  2732. case 13:
  2733. goto tr145
  2734. case 32:
  2735. goto tr2
  2736. case 44:
  2737. goto tr146
  2738. case 61:
  2739. goto tr2
  2740. case 92:
  2741. goto st43
  2742. }
  2743. if 9 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 12 {
  2744. goto tr2
  2745. }
  2746. goto st89
  2747. tr76:
  2748. //line machine.go.rl:20
  2749. m.pb = m.p
  2750. goto st43
  2751. st43:
  2752. if (m.p)++; (m.p) == (m.pe) {
  2753. goto _test_eof43
  2754. }
  2755. st_case_43:
  2756. //line machine.go:2899
  2757. if (m.data)[(m.p)] == 92 {
  2758. goto st90
  2759. }
  2760. if 9 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 13 {
  2761. goto tr2
  2762. }
  2763. goto st89
  2764. st90:
  2765. //line machine.go.rl:240
  2766. (m.p)--
  2767. if (m.p)++; (m.p) == (m.pe) {
  2768. goto _test_eof90
  2769. }
  2770. st_case_90:
  2771. //line machine.go:2915
  2772. switch (m.data)[(m.p)] {
  2773. case 10:
  2774. goto tr144
  2775. case 13:
  2776. goto tr145
  2777. case 32:
  2778. goto tr2
  2779. case 44:
  2780. goto tr146
  2781. case 61:
  2782. goto tr2
  2783. case 92:
  2784. goto st43
  2785. }
  2786. if 9 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 12 {
  2787. goto tr2
  2788. }
  2789. goto st89
  2790. tr71:
  2791. //line machine.go.rl:20
  2792. m.pb = m.p
  2793. goto st44
  2794. st44:
  2795. if (m.p)++; (m.p) == (m.pe) {
  2796. goto _test_eof44
  2797. }
  2798. st_case_44:
  2799. //line machine.go:2945
  2800. if (m.data)[(m.p)] == 92 {
  2801. goto st45
  2802. }
  2803. if 9 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 13 {
  2804. goto tr2
  2805. }
  2806. goto st41
  2807. st45:
  2808. //line machine.go.rl:240
  2809. (m.p)--
  2810. if (m.p)++; (m.p) == (m.pe) {
  2811. goto _test_eof45
  2812. }
  2813. st_case_45:
  2814. //line machine.go:2961
  2815. switch (m.data)[(m.p)] {
  2816. case 32:
  2817. goto tr2
  2818. case 44:
  2819. goto tr2
  2820. case 61:
  2821. goto tr73
  2822. case 92:
  2823. goto st44
  2824. }
  2825. if 9 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 13 {
  2826. goto tr2
  2827. }
  2828. goto st41
  2829. tr68:
  2830. //line machine.go.rl:74
  2831. m.beginMetric = true
  2832. //line machine.go.rl:20
  2833. m.pb = m.p
  2834. goto st46
  2835. st46:
  2836. if (m.p)++; (m.p) == (m.pe) {
  2837. goto _test_eof46
  2838. }
  2839. st_case_46:
  2840. //line machine.go:2991
  2841. if 9 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 13 {
  2842. goto st0
  2843. }
  2844. goto st87
  2845. tr65:
  2846. //line machine.go.rl:158
  2847. m.lineno++
  2848. m.sol = m.p
  2849. m.sol++ // next char will be the first column in the line
  2850. goto st86
  2851. st86:
  2852. if (m.p)++; (m.p) == (m.pe) {
  2853. goto _test_eof86
  2854. }
  2855. st_case_86:
  2856. //line machine.go:3009
  2857. switch (m.data)[(m.p)] {
  2858. case 10:
  2859. goto tr65
  2860. case 13:
  2861. goto st36
  2862. case 32:
  2863. goto st86
  2864. case 35:
  2865. goto st37
  2866. }
  2867. if 9 <= (m.data)[(m.p)] && (m.data)[(m.p)] <= 12 {
  2868. goto st86
  2869. }
  2870. goto tr137
  2871. st36:
  2872. if (m.p)++; (m.p) == (m.pe) {
  2873. goto _test_eof36
  2874. }
  2875. st_case_36:
  2876. if (m.data)[(m.p)] == 10 {
  2877. goto tr65
  2878. }
  2879. goto st0
  2880. st37:
  2881. if (m.p)++; (m.p) == (m.pe) {
  2882. goto _test_eof37
  2883. }
  2884. st_case_37:
  2885. if (m.data)[(m.p)] == 10 {
  2886. goto tr65
  2887. }
  2888. goto st37
  2889. st_out:
  2890. _test_eof47:
  2891. (m.cs) = 47
  2892. goto _test_eof
  2893. _test_eof1:
  2894. (m.cs) = 1
  2895. goto _test_eof
  2896. _test_eof2:
  2897. (m.cs) = 2
  2898. goto _test_eof
  2899. _test_eof3:
  2900. (m.cs) = 3
  2901. goto _test_eof
  2902. _test_eof4:
  2903. (m.cs) = 4
  2904. goto _test_eof
  2905. _test_eof5:
  2906. (m.cs) = 5
  2907. goto _test_eof
  2908. _test_eof6:
  2909. (m.cs) = 6
  2910. goto _test_eof
  2911. _test_eof7:
  2912. (m.cs) = 7
  2913. goto _test_eof
  2914. _test_eof48:
  2915. (m.cs) = 48
  2916. goto _test_eof
  2917. _test_eof49:
  2918. (m.cs) = 49
  2919. goto _test_eof
  2920. _test_eof50:
  2921. (m.cs) = 50
  2922. goto _test_eof
  2923. _test_eof8:
  2924. (m.cs) = 8
  2925. goto _test_eof
  2926. _test_eof9:
  2927. (m.cs) = 9
  2928. goto _test_eof
  2929. _test_eof10:
  2930. (m.cs) = 10
  2931. goto _test_eof
  2932. _test_eof11:
  2933. (m.cs) = 11
  2934. goto _test_eof
  2935. _test_eof51:
  2936. (m.cs) = 51
  2937. goto _test_eof
  2938. _test_eof52:
  2939. (m.cs) = 52
  2940. goto _test_eof
  2941. _test_eof53:
  2942. (m.cs) = 53
  2943. goto _test_eof
  2944. _test_eof54:
  2945. (m.cs) = 54
  2946. goto _test_eof
  2947. _test_eof55:
  2948. (m.cs) = 55
  2949. goto _test_eof
  2950. _test_eof56:
  2951. (m.cs) = 56
  2952. goto _test_eof
  2953. _test_eof57:
  2954. (m.cs) = 57
  2955. goto _test_eof
  2956. _test_eof58:
  2957. (m.cs) = 58
  2958. goto _test_eof
  2959. _test_eof59:
  2960. (m.cs) = 59
  2961. goto _test_eof
  2962. _test_eof60:
  2963. (m.cs) = 60
  2964. goto _test_eof
  2965. _test_eof61:
  2966. (m.cs) = 61
  2967. goto _test_eof
  2968. _test_eof62:
  2969. (m.cs) = 62
  2970. goto _test_eof
  2971. _test_eof63:
  2972. (m.cs) = 63
  2973. goto _test_eof
  2974. _test_eof64:
  2975. (m.cs) = 64
  2976. goto _test_eof
  2977. _test_eof65:
  2978. (m.cs) = 65
  2979. goto _test_eof
  2980. _test_eof66:
  2981. (m.cs) = 66
  2982. goto _test_eof
  2983. _test_eof67:
  2984. (m.cs) = 67
  2985. goto _test_eof
  2986. _test_eof68:
  2987. (m.cs) = 68
  2988. goto _test_eof
  2989. _test_eof69:
  2990. (m.cs) = 69
  2991. goto _test_eof
  2992. _test_eof70:
  2993. (m.cs) = 70
  2994. goto _test_eof
  2995. _test_eof12:
  2996. (m.cs) = 12
  2997. goto _test_eof
  2998. _test_eof13:
  2999. (m.cs) = 13
  3000. goto _test_eof
  3001. _test_eof14:
  3002. (m.cs) = 14
  3003. goto _test_eof
  3004. _test_eof15:
  3005. (m.cs) = 15
  3006. goto _test_eof
  3007. _test_eof16:
  3008. (m.cs) = 16
  3009. goto _test_eof
  3010. _test_eof71:
  3011. (m.cs) = 71
  3012. goto _test_eof
  3013. _test_eof17:
  3014. (m.cs) = 17
  3015. goto _test_eof
  3016. _test_eof18:
  3017. (m.cs) = 18
  3018. goto _test_eof
  3019. _test_eof72:
  3020. (m.cs) = 72
  3021. goto _test_eof
  3022. _test_eof73:
  3023. (m.cs) = 73
  3024. goto _test_eof
  3025. _test_eof74:
  3026. (m.cs) = 74
  3027. goto _test_eof
  3028. _test_eof75:
  3029. (m.cs) = 75
  3030. goto _test_eof
  3031. _test_eof76:
  3032. (m.cs) = 76
  3033. goto _test_eof
  3034. _test_eof77:
  3035. (m.cs) = 77
  3036. goto _test_eof
  3037. _test_eof78:
  3038. (m.cs) = 78
  3039. goto _test_eof
  3040. _test_eof79:
  3041. (m.cs) = 79
  3042. goto _test_eof
  3043. _test_eof80:
  3044. (m.cs) = 80
  3045. goto _test_eof
  3046. _test_eof19:
  3047. (m.cs) = 19
  3048. goto _test_eof
  3049. _test_eof20:
  3050. (m.cs) = 20
  3051. goto _test_eof
  3052. _test_eof21:
  3053. (m.cs) = 21
  3054. goto _test_eof
  3055. _test_eof81:
  3056. (m.cs) = 81
  3057. goto _test_eof
  3058. _test_eof22:
  3059. (m.cs) = 22
  3060. goto _test_eof
  3061. _test_eof23:
  3062. (m.cs) = 23
  3063. goto _test_eof
  3064. _test_eof24:
  3065. (m.cs) = 24
  3066. goto _test_eof
  3067. _test_eof82:
  3068. (m.cs) = 82
  3069. goto _test_eof
  3070. _test_eof25:
  3071. (m.cs) = 25
  3072. goto _test_eof
  3073. _test_eof26:
  3074. (m.cs) = 26
  3075. goto _test_eof
  3076. _test_eof83:
  3077. (m.cs) = 83
  3078. goto _test_eof
  3079. _test_eof84:
  3080. (m.cs) = 84
  3081. goto _test_eof
  3082. _test_eof27:
  3083. (m.cs) = 27
  3084. goto _test_eof
  3085. _test_eof28:
  3086. (m.cs) = 28
  3087. goto _test_eof
  3088. _test_eof29:
  3089. (m.cs) = 29
  3090. goto _test_eof
  3091. _test_eof30:
  3092. (m.cs) = 30
  3093. goto _test_eof
  3094. _test_eof31:
  3095. (m.cs) = 31
  3096. goto _test_eof
  3097. _test_eof32:
  3098. (m.cs) = 32
  3099. goto _test_eof
  3100. _test_eof33:
  3101. (m.cs) = 33
  3102. goto _test_eof
  3103. _test_eof34:
  3104. (m.cs) = 34
  3105. goto _test_eof
  3106. _test_eof35:
  3107. (m.cs) = 35
  3108. goto _test_eof
  3109. _test_eof85:
  3110. (m.cs) = 85
  3111. goto _test_eof
  3112. _test_eof38:
  3113. (m.cs) = 38
  3114. goto _test_eof
  3115. _test_eof87:
  3116. (m.cs) = 87
  3117. goto _test_eof
  3118. _test_eof88:
  3119. (m.cs) = 88
  3120. goto _test_eof
  3121. _test_eof39:
  3122. (m.cs) = 39
  3123. goto _test_eof
  3124. _test_eof40:
  3125. (m.cs) = 40
  3126. goto _test_eof
  3127. _test_eof41:
  3128. (m.cs) = 41
  3129. goto _test_eof
  3130. _test_eof42:
  3131. (m.cs) = 42
  3132. goto _test_eof
  3133. _test_eof89:
  3134. (m.cs) = 89
  3135. goto _test_eof
  3136. _test_eof43:
  3137. (m.cs) = 43
  3138. goto _test_eof
  3139. _test_eof90:
  3140. (m.cs) = 90
  3141. goto _test_eof
  3142. _test_eof44:
  3143. (m.cs) = 44
  3144. goto _test_eof
  3145. _test_eof45:
  3146. (m.cs) = 45
  3147. goto _test_eof
  3148. _test_eof46:
  3149. (m.cs) = 46
  3150. goto _test_eof
  3151. _test_eof86:
  3152. (m.cs) = 86
  3153. goto _test_eof
  3154. _test_eof36:
  3155. (m.cs) = 36
  3156. goto _test_eof
  3157. _test_eof37:
  3158. (m.cs) = 37
  3159. goto _test_eof
  3160. _test_eof:
  3161. {
  3162. }
  3163. if (m.p) == (m.eof) {
  3164. switch m.cs {
  3165. case 8, 38:
  3166. //line machine.go.rl:24
  3167. err = ErrNameParse
  3168. (m.p)--
  3169. (m.cs) = 35
  3170. {
  3171. (m.p)++
  3172. (m.cs) = 0
  3173. goto _out
  3174. }
  3175. case 2, 3, 4, 5, 6, 7, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26:
  3176. //line machine.go.rl:31
  3177. err = ErrFieldParse
  3178. (m.p)--
  3179. (m.cs) = 35
  3180. {
  3181. (m.p)++
  3182. (m.cs) = 0
  3183. goto _out
  3184. }
  3185. case 27, 28, 29, 31, 33, 34, 40, 41, 42, 43, 44, 45:
  3186. //line machine.go.rl:38
  3187. err = ErrTagParse
  3188. (m.p)--
  3189. (m.cs) = 35
  3190. {
  3191. (m.p)++
  3192. (m.cs) = 0
  3193. goto _out
  3194. }
  3195. case 11:
  3196. //line machine.go.rl:45
  3197. err = ErrTimestampParse
  3198. (m.p)--
  3199. (m.cs) = 35
  3200. {
  3201. (m.p)++
  3202. (m.cs) = 0
  3203. goto _out
  3204. }
  3205. case 87:
  3206. //line machine.go.rl:78
  3207. err = m.handler.SetMeasurement(m.text())
  3208. if err != nil {
  3209. (m.p)--
  3210. (m.cs) = 35
  3211. {
  3212. (m.p)++
  3213. (m.cs) = 0
  3214. goto _out
  3215. }
  3216. }
  3217. case 89, 90:
  3218. //line machine.go.rl:91
  3219. err = m.handler.AddTag(m.key, m.text())
  3220. if err != nil {
  3221. (m.p)--
  3222. (m.cs) = 35
  3223. {
  3224. (m.p)++
  3225. (m.cs) = 0
  3226. goto _out
  3227. }
  3228. }
  3229. case 48, 49, 50, 52:
  3230. //line machine.go.rl:170
  3231. m.finishMetric = true
  3232. case 47:
  3233. //line machine.go.rl:74
  3234. m.beginMetric = true
  3235. //line machine.go.rl:170
  3236. m.finishMetric = true
  3237. case 1:
  3238. //line machine.go.rl:78
  3239. err = m.handler.SetMeasurement(m.text())
  3240. if err != nil {
  3241. (m.p)--
  3242. (m.cs) = 35
  3243. {
  3244. (m.p)++
  3245. (m.cs) = 0
  3246. goto _out
  3247. }
  3248. }
  3249. //line machine.go.rl:38
  3250. err = ErrTagParse
  3251. (m.p)--
  3252. (m.cs) = 35
  3253. {
  3254. (m.p)++
  3255. (m.cs) = 0
  3256. goto _out
  3257. }
  3258. case 30, 32:
  3259. //line machine.go.rl:91
  3260. err = m.handler.AddTag(m.key, m.text())
  3261. if err != nil {
  3262. (m.p)--
  3263. (m.cs) = 35
  3264. {
  3265. (m.p)++
  3266. (m.cs) = 0
  3267. goto _out
  3268. }
  3269. }
  3270. //line machine.go.rl:38
  3271. err = ErrTagParse
  3272. (m.p)--
  3273. (m.cs) = 35
  3274. {
  3275. (m.p)++
  3276. (m.cs) = 0
  3277. goto _out
  3278. }
  3279. case 75:
  3280. //line machine.go.rl:104
  3281. err = m.handler.AddInt(m.key, m.text())
  3282. if err != nil {
  3283. (m.p)--
  3284. (m.cs) = 35
  3285. {
  3286. (m.p)++
  3287. (m.cs) = 0
  3288. goto _out
  3289. }
  3290. }
  3291. //line machine.go.rl:170
  3292. m.finishMetric = true
  3293. case 78:
  3294. //line machine.go.rl:113
  3295. err = m.handler.AddUint(m.key, m.text())
  3296. if err != nil {
  3297. (m.p)--
  3298. (m.cs) = 35
  3299. {
  3300. (m.p)++
  3301. (m.cs) = 0
  3302. goto _out
  3303. }
  3304. }
  3305. //line machine.go.rl:170
  3306. m.finishMetric = true
  3307. case 71, 72, 73, 74, 76, 77, 79:
  3308. //line machine.go.rl:122
  3309. err = m.handler.AddFloat(m.key, m.text())
  3310. if err != nil {
  3311. (m.p)--
  3312. (m.cs) = 35
  3313. {
  3314. (m.p)++
  3315. (m.cs) = 0
  3316. goto _out
  3317. }
  3318. }
  3319. //line machine.go.rl:170
  3320. m.finishMetric = true
  3321. case 80, 81, 82, 83, 84:
  3322. //line machine.go.rl:131
  3323. err = m.handler.AddBool(m.key, m.text())
  3324. if err != nil {
  3325. (m.p)--
  3326. (m.cs) = 35
  3327. {
  3328. (m.p)++
  3329. (m.cs) = 0
  3330. goto _out
  3331. }
  3332. }
  3333. //line machine.go.rl:170
  3334. m.finishMetric = true
  3335. case 51, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70:
  3336. //line machine.go.rl:149
  3337. err = m.handler.SetTimestamp(m.text())
  3338. if err != nil {
  3339. (m.p)--
  3340. (m.cs) = 35
  3341. {
  3342. (m.p)++
  3343. (m.cs) = 0
  3344. goto _out
  3345. }
  3346. }
  3347. //line machine.go.rl:170
  3348. m.finishMetric = true
  3349. //line machine.go:3322
  3350. }
  3351. }
  3352. _out:
  3353. {
  3354. }
  3355. }
  3356. //line machine.go.rl:407
  3357. if err != nil {
  3358. return err
  3359. }
  3360. // This would indicate an error in the machine that was reported with a
  3361. // more specific error. We return a generic error but this should
  3362. // possibly be a panic.
  3363. if m.cs == 0 {
  3364. m.cs = LineProtocol_en_discard_line
  3365. return ErrParse
  3366. }
  3367. // If we haven't found a metric line yet and we reached the EOF, report it
  3368. // now. This happens when the data ends with a comment or whitespace.
  3369. //
  3370. // Otherwise we have successfully parsed a metric line, so if we are at
  3371. // the EOF we will report it the next call.
  3372. if !m.beginMetric && m.p == m.pe && m.pe == m.eof {
  3373. return EOF
  3374. }
  3375. return nil
  3376. }
  3377. // Position returns the current byte offset into the data.
  3378. func (m *machine) Position() int {
  3379. return m.p
  3380. }
  3381. // LineOffset returns the byte offset of the current line.
  3382. func (m *machine) LineOffset() int {
  3383. return m.sol
  3384. }
  3385. // LineNumber returns the current line number. Lines are counted based on the
  3386. // regular expression `\r?\n`.
  3387. func (m *machine) LineNumber() int {
  3388. return m.lineno
  3389. }
  3390. // Column returns the current column.
  3391. func (m *machine) Column() int {
  3392. lineOffset := m.p - m.sol
  3393. return lineOffset + 1
  3394. }
  3395. func (m *machine) text() []byte {
  3396. return m.data[m.pb:m.p]
  3397. }
  3398. type streamMachine struct {
  3399. machine *machine
  3400. reader io.Reader
  3401. }
  3402. func NewStreamMachine(r io.Reader, handler Handler) *streamMachine {
  3403. m := &streamMachine{
  3404. machine: NewMachine(handler),
  3405. reader: r,
  3406. }
  3407. m.machine.SetData(make([]byte, 1024))
  3408. m.machine.pe = 0
  3409. m.machine.eof = -1
  3410. return m
  3411. }
  3412. func (m *streamMachine) Next() error {
  3413. // Check if we are already at EOF, this should only happen if called again
  3414. // after already returning EOF.
  3415. if m.machine.p == m.machine.pe && m.machine.pe == m.machine.eof {
  3416. return EOF
  3417. }
  3418. copy(m.machine.data, m.machine.data[m.machine.p:])
  3419. m.machine.pe = m.machine.pe - m.machine.p
  3420. m.machine.sol = m.machine.sol - m.machine.p
  3421. m.machine.pb = 0
  3422. m.machine.p = 0
  3423. m.machine.eof = -1
  3424. m.machine.key = nil
  3425. m.machine.beginMetric = false
  3426. m.machine.finishMetric = false
  3427. for {
  3428. // Expand the buffer if it is full
  3429. if m.machine.pe == len(m.machine.data) {
  3430. expanded := make([]byte, 2*len(m.machine.data))
  3431. copy(expanded, m.machine.data)
  3432. m.machine.data = expanded
  3433. }
  3434. n, err := m.reader.Read(m.machine.data[m.machine.pe:])
  3435. if n == 0 && err == io.EOF {
  3436. m.machine.eof = m.machine.pe
  3437. } else if err != nil && err != io.EOF {
  3438. return err
  3439. }
  3440. m.machine.pe += n
  3441. err = m.machine.exec()
  3442. if err != nil {
  3443. return err
  3444. }
  3445. // If we have successfully parsed a full metric line break out
  3446. if m.machine.finishMetric {
  3447. break
  3448. }
  3449. }
  3450. return nil
  3451. }
  3452. // Position returns the current byte offset into the data.
  3453. func (m *streamMachine) Position() int {
  3454. return m.machine.Position()
  3455. }
  3456. // LineOffset returns the byte offset of the current line.
  3457. func (m *streamMachine) LineOffset() int {
  3458. return m.machine.LineOffset()
  3459. }
  3460. // LineNumber returns the current line number. Lines are counted based on the
  3461. // regular expression `\r?\n`.
  3462. func (m *streamMachine) LineNumber() int {
  3463. return m.machine.LineNumber()
  3464. }
  3465. // Column returns the current column.
  3466. func (m *streamMachine) Column() int {
  3467. return m.machine.Column()
  3468. }
  3469. // LineText returns the text of the current line that has been parsed so far.
  3470. func (m *streamMachine) LineText() string {
  3471. return string(m.machine.data[0:m.machine.p])
  3472. }