harden test case to avoid parsing failure when name is keyword
refactor out common logic between various statSeq-s in parser

Partial functions are left outside of the call to statSeq to allow
re-use and overriding capabilities for quasiquotes.
refactor out range position utility constructors

This will help to re-use same logic for creating range positions even
if atPos isn't used to assign position to the tree.
SI-6841 SI-6657 add support for packages into quasiquotes and toolbox

In order to implement this a new parser entry point
`parseStatsOrPackages` that augments current parseStats with ability
to parse "package name { ... }" syntax.
minor changes due to typos
use regular macro expansion logic for unapply quasiquotes

Previously due to limited support for expansion in apply position
quasiquotes had to use a compiler hook for deconstruction. Now with
recent changes in pattern matcher it's possible to remove that special
case.
advanced fresh name reification

During parsing some names are generated artificially using freshTermName & freshTypeName (e.g. `x$1`). Such names should be reified in a different way because they are assumed to be always fresh and non-overlapping with the environment. So `x$1` should reify down to equivalent of `freshTermName("x$")` rather than `TermName("x$1")`.

But this is not enough. One name can be used more than once in a tree. E.g. `q"_ + 1"` desugars into `q"x$1 => x$1 + 1"`. So we need to ensure that every place where `x$1` is used gets the same fresh name. Hence the need for `withFreshTermName` that lets q"_ + 1" quasiquote desugare into equivalent of `withFreshTermName("x$") { freshx => q"$freshx => $freshx + 1" }`.

For pattern quasiquotes it's a bit different. Due to the fact that end-result must be a pattern we need to represent fresh names as patterns too. A natural way to express that something is fresh is to represent it as a free variable (e.g. any name will do in that place). But due to possible use of the same name in multiple places we need to make sure that all such places have the same values by adding a sequence of guards to the pattern.

Previously such names were reified naively and it could have caused name collision problems and inability to properly much on trees that contain such names.
make q"f(..$xs)" deconstruction symmetrical to q"f[..$xs]"
better name for isCaseDefStart

As it was pointed out by @paulp current isCaseDefStart method's name
doesn't really correspond to one of it's primary usages: checking if
the block within case has reached it's end.
fix minor regression in quasiquote reification

emptyValDef should always be reified as emptyValDef. After the the
introduction of SyntacticValDef this ceased to be true.
rename selfdef into selfType

For sake of consistency with noSelfType.
move fresh name creator into scala.reflect.internal.util
decrease duplication of fresh* function definitions

This commit extracts out freshTermName and freshTypeName to the top-level
with implicit fresh name creator argument. This will let to refactor out
more methods out of tree builder into treegen that are dependent on fresh
name generator. We also save quite a bit of boilerplate by not having to
redefined fresh functions all over the place.
eliminate isCaseDefEnd override by moving the logic into stock parser
use NameTransformer.encode for fresh name prefix sanitization
re-wire fresh name creator to currentUnit.fresh at compile-time
use concurrent hash map with atomic integers

This should ensure that concurrent access to the
fresh name creator is properly synchronized.
use more descriptive types instead of ints in the parser and scanner
annotate return type of the implicit fresh name creator
Merge pull request #3007 from densh/pull/fresh-name-and-package-support

Add support for packages into quasiquotes and toolbox, improve handling of fresh names, unhardcode quasiquote expansion logic