mirror of
https://github.com/swc-project/swc.git
synced 2024-12-20 04:01:39 +03:00
e949c40517
- Parser and lexer for lastest ecma spec https://tc39.github.io/ecma262 - Lexer is currently very inefficient - Use https://github.com/tc39/test262-parser-tests/ for testing. - Implement proc-macro based ast folder and assert_eq_ignore_span! based on it. - Some utilities for proc macro at /macros/common
41 lines
954 B
Bash
Executable File
41 lines
954 B
Bash
Executable File
#!/bin/bash
|
|
set -eu
|
|
|
|
crate_name() {
|
|
POSITIONAL=()
|
|
while [[ $# -gt 0 ]]
|
|
do
|
|
key="$1"
|
|
|
|
case $key in
|
|
--crate-name)
|
|
CRATE_NAME="$2"
|
|
shift # past argument
|
|
shift # past value
|
|
;;
|
|
*) # unknown option
|
|
POSITIONAL+=("$1") # save it in an array for later
|
|
shift # past argument
|
|
;;
|
|
esac
|
|
done
|
|
set -- "${POSITIONAL[@]}" # restore positional parameters
|
|
|
|
echo "$CRATE_NAME"
|
|
}
|
|
|
|
cr=$(crate_name "$@")
|
|
if [[ $cr == swc* ]]; then
|
|
# We use this instead of --document-private-items to
|
|
# make output simillar to usage from outside.
|
|
#
|
|
# e.g. this inlines self::stmt::*, and when we're using ecmascript::ast,
|
|
# we can't use ecmascript::ast::stmt because it's private.
|
|
# rustdoc --passes strip-hidden,unindent-comments,\
|
|
# collapse-docs,strip-priv-imports,propagate-doc-cfg $@
|
|
rustdoc --document-private-items $@
|
|
else
|
|
rustdoc $@
|
|
fi
|
|
|