/// private static NeuPunc NextPunc( this Tokenizer <NeuToken> tokenizer, Char c, NeuPuncType puncType) { var start = tokenizer.Scanner.GetLocation(); /// var next = tokenizer.Scanner.Next(); if (next != c) { throw new Exception(); } /// tokenizer.Scanner.NextWhitespace(); /// return(new NeuPunc( source: next, start: start, end: tokenizer.Scanner.GetLocation(), puncType: puncType)); }
public static NeuPunc?MaybeNextPunc( this Tokenizer <NeuToken> tokenizer, NeuPuncType puncType) { if (tokenizer.Peek() is NeuPunc p && p.PuncType == puncType) { tokenizer.Position++; return(p); } /// return(null); }