Package io.deephaven.lang.parse
Class ParsedDocument
- java.lang.Object
-
- io.deephaven.lang.parse.ParsedDocument
-
public class ParsedDocument extends java.lang.ObjectRepresents a parsed document. For now, we will be re-parsing the entire string document every time, but in the future, we would like to be able to update only ranges of changed code.
-
-
Constructor Summary
Constructors Constructor Description ParsedDocument(ChunkerDocument doc, java.lang.String document)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidextendEnd(io.deephaven.proto.backplane.script.grpc.CompletionItem.Builder item, io.deephaven.proto.backplane.script.grpc.Position requested, Node node)io.deephaven.proto.backplane.script.grpc.Position.BuilderfindEditRange(io.deephaven.proto.backplane.script.grpc.DocumentRange replaceRange)NodefindNode(int p)java.util.Map<java.lang.String,java.util.List<ChunkerAssign>>getAssignments()ChunkerDocumentgetDoc()java.lang.StringgetLastGoodSource()java.lang.StringgetSource()booleanisError()voidlogErrors(io.deephaven.io.logger.Logger log)voidresetFailure()java.lang.StringtoString()ParsedDocumentwithError(java.lang.String src, ParseException e)When a parse fails, we do not throw away our last-good document.
-
-
-
Constructor Detail
-
ParsedDocument
public ParsedDocument(ChunkerDocument doc, java.lang.String document)
-
-
Method Detail
-
findNode
public Node findNode(int p)
-
getDoc
public ChunkerDocument getDoc()
-
withError
public ParsedDocument withError(java.lang.String src, ParseException e)
When a parse fails, we do not throw away our last-good document. We do, however, record the failure information, which you should check viaisError().- Parameters:
src- The source with an errore- The parse exception. May make this any exception type.- Returns:
- this, for chaining. We may need to make copies later, but for now, we'll use it as-is.
-
getSource
public java.lang.String getSource()
-
getLastGoodSource
public java.lang.String getLastGoodSource()
-
isError
public boolean isError()
-
resetFailure
public void resetFailure()
-
logErrors
public void logErrors(io.deephaven.io.logger.Logger log)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
findEditRange
public io.deephaven.proto.backplane.script.grpc.Position.Builder findEditRange(io.deephaven.proto.backplane.script.grpc.DocumentRange replaceRange)
-
extendEnd
public void extendEnd(io.deephaven.proto.backplane.script.grpc.CompletionItem.Builder item, io.deephaven.proto.backplane.script.grpc.Position requested, Node node)
-
getAssignments
public java.util.Map<java.lang.String,java.util.List<ChunkerAssign>> getAssignments()
-
-