var R={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,I){var _=t.location;t.location=_==R.PRE_SUBJECT&&I=="<"?R.WRITING_SUB_URI:_==R.PRE_SUBJECT&&I=="_"?R.WRITING_BNODE_URI:_==R.PRE_PRED&&I=="<"?R.WRITING_PRED_URI:_==R.PRE_OBJ&&I=="<"?R.WRITING_OBJ_URI:_==R.PRE_OBJ&&I=="_"?R.WRITING_OBJ_BNODE:_==R.PRE_OBJ&&I=='"'?R.WRITING_OBJ_LITERAL:_==R.WRITING_SUB_URI&&I==">"||_==R.WRITING_BNODE_URI&&I==" "?R.PRE_PRED:_==R.WRITING_PRED_URI&&I==">"?R.PRE_OBJ:_==R.WRITING_OBJ_URI&&I==">"||_==R.WRITING_OBJ_BNODE&&I==" "||_==R.WRITING_OBJ_LITERAL&&I=='"'||_==R.WRITING_LIT_LANG&&I==" "||_==R.WRITING_LIT_TYPE&&I==">"?R.POST_OBJ:_==R.WRITING_OBJ_LITERAL&&I=="@"?R.WRITING_LIT_LANG:_==R.WRITING_OBJ_LITERAL&&I=="^"?R.WRITING_LIT_TYPE:I==" "&&(_==R.PRE_SUBJECT||_==R.PRE_PRED||_==R.PRE_OBJ||_==R.POST_OBJ)?_:_==R.POST_OBJ&&I=="."?R.PRE_SUBJECT:R.ERROR}const O={name:"ntriples",startState:function(){return{location:R.PRE_SUBJECT,uris:[],anchors:[],bnodes:[],langs:[],types:[]}},token:function(t,I){var _=t.next();if(_=="<"){T(I,_);var E="";return t.eatWhile(function(r){return r!="#"&&r!=">"?(E+=r,!0):!1}),I.uris.push(E),t.match("#",!1)||(t.next(),T(I,">")),"variable"}if(_=="#"){var i="";return t.eatWhile(function(r){return r!=">"&&r!=" "?(i+=r,!0):!1}),I.anchors.push(i),"url"}if(_==">")return T(I,">"),"variable";if(_=="_"){T(I,_);var B="";return t.eatWhile(function(r){return r==" "?!1:(B+=r,!0)}),I.bnodes.push(B),t.next(),T(I," "),"builtin"}if(_=='"')return T(I,_),t.eatWhile(function(r){return r!='"'}),t.next(),t.peek()!="@"&&t.peek()!="^"&&T(I,'"'),"string";if(_=="@"){T(I,"@");var N="";return t.eatWhile(function(r){return r==" "?!1:(N+=r,!0)}),I.langs.push(N),t.next(),T(I," "),"string.special"}if(_=="^"){t.next(),T(I,"^");var a="";return t.eatWhile(function(r){return r==">"?!1:(a+=r,!0)}),I.types.push(a),t.next(),T(I,">"),"variable"}_==" "&&T(I,_),_=="."&&T(I,_)}};export{O as t};
