Skip to content

Commit

Permalink
Correct access modifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
adams85 committed Mar 24, 2024
1 parent 7e6f2f4 commit 54d58e6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/Acornima/Parser.ParseUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ private bool CanInsertSemicolon()
|| Tokenizer.ContainsLineBreak(_tokenizer._input.SliceBetween(_tokenizer._lastTokenEnd, _tokenizer._start));
}

public bool InsertSemicolon()
private bool InsertSemicolon()
{
// https://github.com/acornjs/acorn/blob/8.11.3/acorn/src/parseutil.js > `pp.insertSemicolon = function`

Expand All @@ -89,7 +89,7 @@ public bool InsertSemicolon()
// Consume a semicolon, or, failing that, see if we are allowed to
// pretend that there is a semicolon at this position.
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Semicolon()
private void Semicolon()
{
// https://github.com/acornjs/acorn/blob/8.11.3/acorn/src/parseutil.js > `pp.semicolon = function`

Expand Down
20 changes: 10 additions & 10 deletions src/Acornima/Parser.State.cs
Original file line number Diff line number Diff line change
Expand Up @@ -222,30 +222,30 @@ private ref Scope CurrentThisScope(out int index)
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool InFunction()
private bool InFunction()
{
// https://github.com/acornjs/acorn/blob/8.11.3/acorn/src/state.js > `get inFunction`

return (CurrentVarScope(out _).Flags & ScopeFlags.Function) != 0;
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool InGenerator()
private bool InGenerator()
{
// https://github.com/acornjs/acorn/blob/8.11.3/acorn/src/state.js > `get inGenerator`

return (CurrentVarScope(out _).Flags & (ScopeFlags.Generator | ScopeFlags.InClassFieldInit)) == ScopeFlags.Generator;
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool InAsync()
private bool InAsync()
{
// https://github.com/acornjs/acorn/blob/8.11.3/acorn/src/state.js > `get inAsync`

return (CurrentVarScope(out _).Flags & (ScopeFlags.Async | ScopeFlags.InClassFieldInit)) == ScopeFlags.Async;
}

public bool CanAwait()
private bool CanAwait()
{
// https://github.com/acornjs/acorn/blob/8.11.3/acorn/src/state.js > `get canAwait`

Expand All @@ -268,23 +268,23 @@ public bool CanAwait()
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool AllowSuper()
private bool AllowSuper()
{
// https://github.com/acornjs/acorn/blob/8.11.3/acorn/src/state.js > `get allowSuper`

return _options._allowSuperOutsideMethod || (CurrentThisScope(out _).Flags & (ScopeFlags.Super | ScopeFlags.InClassFieldInit)) != 0;
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool AllowDirectSuper()
private bool AllowDirectSuper()
{
// https://github.com/acornjs/acorn/blob/8.11.3/acorn/src/state.js > `get allowDirectSuper`

return (CurrentThisScope(out _).Flags & ScopeFlags.DirectSuper) != 0;
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool TreatFunctionsAsVar()
private bool TreatFunctionsAsVar()
{
// https://github.com/acornjs/acorn/blob/8.11.3/acorn/src/state.js > `get treatFunctionsAsVar`
// https://github.com/acornjs/acorn/blob/8.11.3/acorn/src/scope.js > `pp.treatFunctionsAsVarInScope = function`
Expand All @@ -296,23 +296,23 @@ public bool TreatFunctionsAsVar()
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool AllowNewDotTarget()
private bool AllowNewDotTarget()
{
// https://github.com/acornjs/acorn/blob/8.11.3/acorn/src/state.js > `get allowNewDotTarget`

return (CurrentThisScope(out _).Flags & (ScopeFlags.Function | ScopeFlags.ClassStaticBlock | ScopeFlags.InClassFieldInit)) != 0;
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool InClassStaticBlock()
private bool InClassStaticBlock()
{
// https://github.com/acornjs/acorn/blob/8.11.3/acorn/src/state.js > `get inClassStaticBlock`

return (CurrentVarScope(out _).Flags & ScopeFlags.ClassStaticBlock) != 0;
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool InClassFieldInit()
private bool InClassFieldInit()
{
return (CurrentThisScope(out _).Flags & ScopeFlags.InClassFieldInit) != 0;
}
Expand Down

0 comments on commit 54d58e6

Please sign in to comment.