pax_global_header00006660000000000000000000000064143254766720014532gustar00rootroot0000000000000052 comment=972934ed5620a1d174dda48139c94afed3969dcf lang-cpp-6.0.2/000077500000000000000000000000001432547667200132405ustar00rootroot00000000000000lang-cpp-6.0.2/.github/000077500000000000000000000000001432547667200146005ustar00rootroot00000000000000lang-cpp-6.0.2/.github/workflows/000077500000000000000000000000001432547667200166355ustar00rootroot00000000000000lang-cpp-6.0.2/.github/workflows/dispatch.yml000066400000000000000000000006371432547667200211650ustar00rootroot00000000000000name: Trigger CI on: push jobs: build: name: Dispatch to main repo runs-on: ubuntu-latest steps: - name: Emit repository_dispatch uses: mvasigh/dispatch-action@main with: # You should create a personal access token and store it in your repository token: ${{ secrets.DISPATCH_AUTH }} repo: dev owner: codemirror event_type: push lang-cpp-6.0.2/.gitignore000066400000000000000000000001271432547667200152300ustar00rootroot00000000000000/node_modules package-lock.json /dist /test/*.js /test/*.d.ts /test/*.d.ts.map .tern-* lang-cpp-6.0.2/.npmignore000066400000000000000000000001001432547667200152260ustar00rootroot00000000000000/src /test /node_modules .tern-* rollup.config.js tsconfig.json lang-cpp-6.0.2/CHANGELOG.md000066400000000000000000000014441432547667200150540ustar00rootroot00000000000000## 6.0.2 (2022-10-24) ### Bug fixes Fix (non-)auto indentation in template strings and comments. Allow prefixed strings to be closed by `closeBrackets`. ## 6.0.1 (2022-06-17) ### Bug fixes Add the appropriate indentation metadata for blocks. ## 6.0.0 (2022-06-08) ### Breaking changes Update dependencies to 6.0.0 ## 0.20.0 (2022-04-20) ### Breaking changes Update dependencies to 0.20.0 ## 0.19.1 (2021-08-11) ### Bug fixes Fix incorrect versions for @lezer dependencies. ## 0.19.0 (2021-08-11) ### Breaking changes Update dependencies to 0.19.0 ## 0.18.0 (2021-03-03) ### Breaking changes Update dependencies to 0.18. ## 0.17.1 (2021-01-06) ### New features The package now also exports a CommonJS module. ## 0.17.0 (2020-12-29) ### Breaking changes First numbered release. lang-cpp-6.0.2/LICENSE000066400000000000000000000021301432547667200142410ustar00rootroot00000000000000MIT License Copyright (C) 2018-2021 by Marijn Haverbeke and others Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. lang-cpp-6.0.2/README.md000066400000000000000000000032171432547667200145220ustar00rootroot00000000000000 # @codemirror/lang-cpp [![NPM version](https://img.shields.io/npm/v/@codemirror/lang-cpp.svg)](https://www.npmjs.org/package/@codemirror/lang-cpp) [ [**WEBSITE**](https://codemirror.net/) | [**ISSUES**](https://github.com/codemirror/dev/issues) | [**FORUM**](https://discuss.codemirror.net/c/next/) | [**CHANGELOG**](https://github.com/codemirror/lang-cpp/blob/main/CHANGELOG.md) ] This package implements C++ language support for the [CodeMirror](https://codemirror.net/) code editor. The [project page](https://codemirror.net/) has more information, a number of [examples](https://codemirror.net/examples/) and the [documentation](https://codemirror.net/docs/). This code is released under an [MIT license](https://github.com/codemirror/lang-cpp/tree/main/LICENSE). We aim to be an inclusive, welcoming community. To make that explicit, we have a [code of conduct](http://contributor-covenant.org/version/1/1/0/) that applies to communication around the project. ## API Reference
cpp() → LanguageSupport

Language support for C++.

cppLanguage: LezerLanguage

A language provider based on the Lezer C++ parser, extended with highlighting and indentation information.

lang-cpp-6.0.2/package.json000066400000000000000000000015651432547667200155350ustar00rootroot00000000000000{ "name": "@codemirror/lang-cpp", "version": "6.0.2", "description": "C++ language support for the CodeMirror code editor", "scripts": { "test": "cm-runtests", "prepare": "cm-buildhelper src/cpp.ts" }, "keywords": [ "editor", "code" ], "author": { "name": "Marijn Haverbeke", "email": "marijnh@gmail.com", "url": "http://marijnhaverbeke.nl" }, "type": "module", "main": "dist/index.cjs", "exports": { "import": "./dist/index.js", "require": "./dist/index.cjs" }, "types": "dist/index.d.ts", "module": "dist/index.js", "sideEffects": false, "license": "MIT", "dependencies": { "@codemirror/language": "^6.0.0", "@lezer/cpp": "^1.0.0" }, "devDependencies": { "@codemirror/buildhelper": "^0.1.0" }, "repository": { "type": "git", "url": "https://github.com/codemirror/lang-cpp.git" } } lang-cpp-6.0.2/src/000077500000000000000000000000001432547667200140275ustar00rootroot00000000000000lang-cpp-6.0.2/src/README.md000066400000000000000000000020641432547667200153100ustar00rootroot00000000000000 # @codemirror/lang-cpp [![NPM version](https://img.shields.io/npm/v/@codemirror/lang-cpp.svg)](https://www.npmjs.org/package/@codemirror/lang-cpp) [ [**WEBSITE**](https://codemirror.net/6/) | [**ISSUES**](https://github.com/codemirror/dev/issues) | [**FORUM**](https://discuss.codemirror.net/c/next/) | [**CHANGELOG**](https://github.com/codemirror/lang-cpp/blob/main/CHANGELOG.md) ] This package implements C++ language support for the [CodeMirror](https://codemirror.net/6/) code editor. The [project page](https://codemirror.net/6/) has more information, a number of [examples](https://codemirror.net/6/examples/) and the [documentation](https://codemirror.net/6/docs/). This code is released under an [MIT license](https://github.com/codemirror/lang-cpp/tree/main/LICENSE). We aim to be an inclusive, welcoming community. To make that explicit, we have a [code of conduct](http://contributor-covenant.org/version/1/1/0/) that applies to communication around the project. ## API Reference @cpp @cppLanguage lang-cpp-6.0.2/src/cpp.ts000066400000000000000000000026551432547667200151710ustar00rootroot00000000000000import {parser} from "@lezer/cpp" import {flatIndent, continuedIndent, delimitedIndent, indentNodeProp, foldNodeProp, foldInside, LRLanguage, LanguageSupport} from "@codemirror/language" /// A language provider based on the [Lezer C++ /// parser](https://github.com/lezer-parser/cpp), extended with /// highlighting and indentation information. export const cppLanguage = LRLanguage.define({ name: "cpp", parser: parser.configure({ props: [ indentNodeProp.add({ IfStatement: continuedIndent({except: /^\s*({|else\b)/}), TryStatement: continuedIndent({except: /^\s*({|catch)\b/}), LabeledStatement: flatIndent, CaseStatement: context => context.baseIndent + context.unit, BlockComment: () => null, CompoundStatement: delimitedIndent({closing: "}"}), Statement: continuedIndent({except: /^{/}) }), foldNodeProp.add({ "DeclarationList CompoundStatement EnumeratorList FieldDeclarationList InitializerList": foldInside, BlockComment(tree) { return {from: tree.from + 2, to: tree.to - 2} } }) ] }), languageData: { commentTokens: {line: "//", block: {open: "/*", close: "*/"}}, indentOnInput: /^\s*(?:case |default:|\{|\})$/, closeBrackets: {stringPrefixes: ["L", "u", "U", "u8", "LR", "UR", "uR", "u8R", "R"]} } }) /// Language support for C++. export function cpp() { return new LanguageSupport(cppLanguage) }