ParserCommon

dotty.tools.dotc.parsing.Parsers.ParserCommon
abstract class ParserCommon(val source: SourceFile)(using x$2: Context)

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class JavaParser
class Parser
class ScriptParser
Show all

Members list

Value members

Concrete methods

def atSpan[T <: Positioned](span: Span)(t: T): T

Positions tree. If t does not have a span yet, set its span to the given one.

Positions tree. If t does not have a span yet, set its span to the given one.

Attributes

def atSpan[T <: Positioned](start: Offset, point: Offset, end: Offset)(t: T): T
def atSpan[T <: Positioned](start: Offset, point: Offset)(t: T): T

If the last read offset is strictly greater than start, assign tree the span from start to last read offset, with given point. If the last offset is less than or equal to start, the tree t did not consume any source for its construction. In this case, don't assign a span yet, but wait for its span to be determined by setChildSpans when the parent node is positioned.

If the last read offset is strictly greater than start, assign tree the span from start to last read offset, with given point. If the last offset is less than or equal to start, the tree t did not consume any source for its construction. In this case, don't assign a span yet, but wait for its span to be determined by setChildSpans when the parent node is positioned.

Attributes

def atSpan[T <: Positioned](start: Offset)(t: T): T

in.offset, except if this is at a new line, in which case lastOffset is preferred.

in.offset, except if this is at a new line, in which case lastOffset is preferred.

Attributes

def syntaxError(msg: Message, offset: Int): Unit

Issue an error at given offset if beyond last error offset and update lastErrorOffset.

Issue an error at given offset if beyond last error offset and update lastErrorOffset.

Attributes

def syntaxError(msg: Message, span: Span): Unit

Unconditionally issue an error at given span, without updating lastErrorOffset.

Unconditionally issue an error at given span, without updating lastErrorOffset.

Attributes

Abstract fields

Concrete fields

protected var lastErrorOffset: Int

The offset where the last syntax error was reported, or if a skip to a safepoint occurred afterwards, the offset of the safe point.

The offset where the last syntax error was reported, or if a skip to a safepoint occurred afterwards, the offset of the safe point.

Attributes