Package org.jruby.parser
Class ParserConfiguration
java.lang.Object
org.jruby.parser.ParserConfiguration
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate int[]private org.jcodings.Encodingprivate static final int[]private DynamicScopeprivate booleanprivate booleanprivate booleanprivate booleanprivate intprivate final Rubyprivate boolean -
Constructor Summary
ConstructorsConstructorDescriptionParserConfiguration(Ruby runtime, int lineNumber, boolean inlineSource, boolean isFileParse, boolean saveData) ParserConfiguration(Ruby runtime, int lineNumber, boolean inlineSource, boolean isFileParse, boolean saveData, RubyInstanceConfig config) ParserConfiguration(Ruby runtime, int lineNumber, boolean inlineSource, boolean isFileParse, RubyInstanceConfig config) -
Method Summary
Modifier and TypeMethodDescriptionvoidcoverLine(int i) Zero out coverable lines as they're encounteredfinishCoverage(String file, int lines) At end of a parse if coverage is enabled we will do final processing of the primitive coverage array and make sure runtimes coverage data has been updated with this new data.int[]Deprecated.org.jcodings.EncodinggetKCode()intThis method returns the appropriate first scope for the parser.voidgrowCoverageLines(int i) Called by coverLine to grow it large enough to add new covered line.booleanbooleanisDebug()booleanIs the requested parse for an eval()?booleanbooleanAre we parsing source provided as part of the '-e' option to Ruby.booleanGet whether we are saving the DATA contents of the file.voidparseAsBlock(DynamicScope existingScope) If we are performing an eval we should pass existing scope in.voidsetDefaultEncoding(org.jcodings.Encoding encoding) voidsetFrozenStringLiteral(boolean frozenStringLiteral)
-
Field Details
-
existingScope
-
asBlock
private boolean asBlock -
lineNumber
private int lineNumber -
inlineSource
private boolean inlineSource -
isEvalParse
private boolean isEvalParse -
isDebug
private boolean isDebug -
saveData
private boolean saveData -
frozenStringLiteral
private boolean frozenStringLiteral -
defaultEncoding
private org.jcodings.Encoding defaultEncoding -
runtime
-
coverage
private int[] coverage -
EMPTY_COVERAGE
private static final int[] EMPTY_COVERAGE
-
-
Constructor Details
-
ParserConfiguration
public ParserConfiguration(Ruby runtime, int lineNumber, boolean inlineSource, boolean isFileParse, boolean saveData) -
ParserConfiguration
public ParserConfiguration(Ruby runtime, int lineNumber, boolean inlineSource, boolean isFileParse, RubyInstanceConfig config) -
ParserConfiguration
public ParserConfiguration(Ruby runtime, int lineNumber, boolean inlineSource, boolean isFileParse, boolean saveData, RubyInstanceConfig config)
-
-
Method Details
-
setFrozenStringLiteral
public void setFrozenStringLiteral(boolean frozenStringLiteral) -
isFrozenStringLiteral
public boolean isFrozenStringLiteral() -
setDefaultEncoding
public void setDefaultEncoding(org.jcodings.Encoding encoding) -
getDefaultEncoding
public org.jcodings.Encoding getDefaultEncoding() -
getEncodingService
-
isDebug
public boolean isDebug() -
isEvalParse
public boolean isEvalParse()Is the requested parse for an eval()?- Returns:
- true if for eval
-
getKCode
-
getLineNumber
public int getLineNumber() -
parseAsBlock
If we are performing an eval we should pass existing scope in. Calling this lets the parser know we need to do this.- Parameters:
existingScope- is the scope that captures new vars, etc...
-
getRuntime
-
getScope
This method returns the appropriate first scope for the parser.- Returns:
- correct top scope for source to be parsed
-
isCoverageEnabled
public boolean isCoverageEnabled() -
isSaveData
public boolean isSaveData()Get whether we are saving the DATA contents of the file. -
isInlineSource
public boolean isInlineSource()Are we parsing source provided as part of the '-e' option to Ruby.- Returns:
- true if source is from -e option
-
coverLine
public void coverLine(int i) Zero out coverable lines as they're encountered -
growCoverageLines
public void growCoverageLines(int i) Called by coverLine to grow it large enough to add new covered line. Also called at end up parse to pick up any extra non-code lines which should be marked -1 for not valid code lines. -
finishCoverage
At end of a parse if coverage is enabled we will do final processing of the primitive coverage array and make sure runtimes coverage data has been updated with this new data. -
getCoverage
Deprecated.Get the coverage array, indicating all coverable lines
-