var e={PRE_SUBJECT:0,WRITING_SUB_URI:1,WRITING_BNODE_URI:2,PRE_PRED:3,WRITING_PRED_URI:4,PRE_OBJ:5,WRITING_OBJ_URI:6,WRITING_OBJ_BNODE:7,WRITING_OBJ_LITERAL:8,WRITING_LIT_LANG:9,WRITING_LIT_TYPE:10,POST_OBJ:11,ERROR:12};function t(t,n){var r=t.location;t.location=r==e.PRE_SUBJECT&&n==`<`?e.WRITING_SUB_URI:r==e.PRE_SUBJECT&&n==`_`?e.WRITING_BNODE_URI:r==e.PRE_PRED&&n==`<`?e.WRITING_PRED_URI:r==e.PRE_OBJ&&n==`<`?e.WRITING_OBJ_URI:r==e.PRE_OBJ&&n==`_`?e.WRITING_OBJ_BNODE:r==e.PRE_OBJ&&n==`"`?e.WRITING_OBJ_LITERAL:r==e.WRITING_SUB_URI&&n==`>`||r==e.WRITING_BNODE_URI&&n==` `?e.PRE_PRED:r==e.WRITING_PRED_URI&&n==`>`?e.PRE_OBJ:r==e.WRITING_OBJ_URI&&n==`>`||r==e.WRITING_OBJ_BNODE&&n==` `||r==e.WRITING_OBJ_LITERAL&&n==`"`||r==e.WRITING_LIT_LANG&&n==` `||r==e.WRITING_LIT_TYPE&&n==`>`?e.POST_OBJ:r==e.WRITING_OBJ_LITERAL&&n==`@`?e.WRITING_LIT_LANG:r==e.WRITING_OBJ_LITERAL&&n==`^`?e.WRITING_LIT_TYPE:n==` `&&(r==e.PRE_SUBJECT||r==e.PRE_PRED||r==e.PRE_OBJ||r==e.POST_OBJ)?r:r==e.POST_OBJ&&n==`.`?e.PRE_SUBJECT:e.ERROR}const n={name:`ntriples`,startState:function(){return{location:e.PRE_SUBJECT,uris:[],anchors:[],bnodes:[],langs:[],types:[]}},token:function(e,n){var r=e.next();if(r==`<`){t(n,r);var i=``;return e.eatWhile(function(e){return e!=`#`&&e!=`>`?(i+=e,!0):!1}),n.uris.push(i),e.match(`#`,!1)?`variable`:(e.next(),t(n,`>`),`variable`)}if(r==`#`){var a=``;return e.eatWhile(function(e){return e!=`>`&&e!=` `?(a+=e,!0):!1}),n.anchors.push(a),`url`}if(r==`>`)return t(n,`>`),`variable`;if(r==`_`){t(n,r);var o=``;return e.eatWhile(function(e){return e==` `?!1:(o+=e,!0)}),n.bnodes.push(o),e.next(),t(n,` `),`builtin`}if(r==`"`)return t(n,r),e.eatWhile(function(e){return e!=`"`}),e.next(),e.peek()!=`@`&&e.peek()!=`^`&&t(n,`"`),`string`;if(r==`@`){t(n,`@`);var s=``;return e.eatWhile(function(e){return e==` `?!1:(s+=e,!0)}),n.langs.push(s),e.next(),t(n,` `),`string.special`}if(r==`^`){e.next(),t(n,`^`);var c=``;return e.eatWhile(function(e){return e==`>`?!1:(c+=e,!0)}),n.types.push(c),e.next(),t(n,`>`),`variable`}r==` `&&t(n,r),r==`.`&&t(n,r)}};export{n as ntriples};