diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..ec60271 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,12 @@ +name: Build spec + +on: [pull_request, push] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: ljharb/actions/node/install@main + - run: npm run build diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..0bb1859 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,20 @@ +name: Deploy gh-pages + +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: ljharb/actions/node/install@main + - run: npm run build + - uses: JamesIves/github-pages-deploy-action@v4.3.3 + with: + branch: gh-pages + folder: build + clean: true diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d3cae16 --- /dev/null +++ b/.gitignore @@ -0,0 +1,46 @@ +# Logs +logs +*.log +npm-debug.log* + +# Runtime data +pids +*.pid +*.seed + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules +jspm_packages + +# Optional npm cache directory +.npm + +# Optional REPL history +.node_repl_history + +# Only apps should have lockfiles +yarn.lock +package-lock.json +npm-shrinkwrap.json +pnpm-lock.yaml + +# Build directory +build diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..43c97e7 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +package-lock=false diff --git a/package.json b/package.json new file mode 100644 index 0000000..23a25ba --- /dev/null +++ b/package.json @@ -0,0 +1,23 @@ +{ + "private": true, + "name": "proposal-regex-escaping", + "description": "Proposal for investigating RegExp escaping for the ECMAScript standard", + "scripts": { + "start": "npm run build-loose -- --watch", + "build": "npm run build-loose -- --strict", + "build-loose": "node -e 'fs.mkdirSync(\"build\", { recursive: true })' && ecmarkup --load-biblio @tc39/ecma262-biblio --verbose spec.emu build/index.html --lint-spec" + }, + "homepage": "https://github.com/tc39/proposal-regex-escaping#readme", + "repository": { + "type": "git", + "url": "git+https://github.com/tc39/proposal-regex-escaping.git" + }, + "license": "MIT", + "devDependencies": { + "@tc39/ecma262-biblio": "^2.1.2632", + "ecmarkup": "^17.1.1" + }, + "engines": { + "node": ">= 12" + } +} diff --git a/spec-ecmarkup.html b/spec-ecmarkup.html deleted file mode 100644 index 18494f8..0000000 --- a/spec-ecmarkup.html +++ /dev/null @@ -1,32 +0,0 @@ - - -
`escape` takes a string S and returns a version of it with all control characters escaped. It escapes characters that would otherwise be treated by the regular expressions engine as special meta characters such as `^ $ \ . * + ? ( ) [ ] { } |` using an escape sequence character.
- - -When the `escape` function is called with an argument _S_ the following steps are taken:
- -The `length` property of the `escape` method is *1*.
- -`escape` takes a string and escapes it so it can be literally represented as a pattern. In contrast EscapeRegExpPattern (as the name implies) takes a pattern and escapes it so that it can be represented as a string. While the two are related they do not share the same character escape set or perform similar actions.
-+title: RegExp.escape +stage: 1 +contributors: Jordan Harband ++ +
This method takes a string and returns a version of it with all control characters escaped. It escapes characters that would otherwise be treated by the regular expressions engine as special meta characters using an escape sequence character.
+It performs the following steps when called:
++ The phrase "the ASCII punctuators that need escaping" + denotes the following String value, which consists of every ASCII punctuator except U+005F (LOW LINE): + *"(){}[]|,.?\*+-^$=<>\/#&!%:;@~'"`"*. +
+ +`escape` takes a string and escapes it so it can be literally represented as a pattern. In contrast EscapeRegExpPattern (as the name implies) takes a pattern and escapes it so that it can be represented as a string. While the two are related, they do not share the same character escape set or perform similar actions.
+