Skip to content

Commit

Permalink
ilib-tools-common: add common escaping and unescaping routines (#72)
Browse files Browse the repository at this point in the history
- these have been extracted from the various loctool plugins, then fact-checked against the documentation for each programming language, generalized, and fit into a common API
- escaperFactory generates the correct escaper instance for the given programming language
- intended to be used by any of the loctool and ilib-lint plugins eventually
  • Loading branch information
ehoogerbeets authored Mar 5, 2025
1 parent 5e58323 commit c5ee237
Show file tree
Hide file tree
Showing 65 changed files with 14,485 additions and 244 deletions.
15 changes: 15 additions & 0 deletions .changeset/soft-apricots-pull.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
"ilib-tools-common": minor
---

- Added Escaper class to the tools library
- escaperFactory() generates the appropriate escaper instance
for the given programming language/syntax
- Escaper.unescape() takes a string as it would be encoded in
a source file, and transforms it into how it would be
represented in memory while the program is running
- Escaper.escape() does the converse
- original code was extracted from various loctool plugins
- this library is intended to be used with any loctool or ilib-lint
plugin so that we do escaping/unescaping the same way no
matter which plugin we are using
449 changes: 449 additions & 0 deletions packages/ilib-tools-common/docs/CSharpEscaper.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/ilib-tools-common/docs/DirectoryWalk.js.html

Large diffs are not rendered by default.

1,132 changes: 1,132 additions & 0 deletions packages/ilib-tools-common/docs/Escaper.html

Large diffs are not rendered by default.

220 changes: 220 additions & 0 deletions packages/ilib-tools-common/docs/EscaperFactory.js.html

Large diffs are not rendered by default.

450 changes: 450 additions & 0 deletions packages/ilib-tools-common/docs/JavaEscaper.html

Large diffs are not rendered by default.

448 changes: 448 additions & 0 deletions packages/ilib-tools-common/docs/JavascriptEscaper.html

Large diffs are not rendered by default.

363 changes: 363 additions & 0 deletions packages/ilib-tools-common/docs/JsonEscaper.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/ilib-tools-common/docs/Location.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/ilib-tools-common/docs/Location.js.html

Large diffs are not rendered by default.

451 changes: 451 additions & 0 deletions packages/ilib-tools-common/docs/PHPEscaper.html

Large diffs are not rendered by default.

450 changes: 450 additions & 0 deletions packages/ilib-tools-common/docs/PythonEscaper.html

Large diffs are not rendered by default.

447 changes: 447 additions & 0 deletions packages/ilib-tools-common/docs/RegexBasedEscaper.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/ilib-tools-common/docs/Resource.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/ilib-tools-common/docs/Resource.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/ilib-tools-common/docs/ResourceArray.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/ilib-tools-common/docs/ResourceArray.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/ilib-tools-common/docs/ResourceConvert.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/ilib-tools-common/docs/ResourcePlural.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/ilib-tools-common/docs/ResourcePlural.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/ilib-tools-common/docs/ResourceString.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/ilib-tools-common/docs/ResourceString.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/ilib-tools-common/docs/ResourceXliff.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/ilib-tools-common/docs/ResourceXliff.js.html

Large diffs are not rendered by default.

449 changes: 449 additions & 0 deletions packages/ilib-tools-common/docs/SmartyEscaper.html

Large diffs are not rendered by default.

449 changes: 449 additions & 0 deletions packages/ilib-tools-common/docs/SwiftEscaper.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/ilib-tools-common/docs/TranslationSet.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/ilib-tools-common/docs/TranslationSet.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/ilib-tools-common/docs/TranslationUnit.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/ilib-tools-common/docs/TranslationUnit.js.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/ilib-tools-common/docs/TranslationVariant.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/ilib-tools-common/docs/TranslationVariant.js.html

Large diffs are not rendered by default.

366 changes: 366 additions & 0 deletions packages/ilib-tools-common/docs/URIEscaper.html

Large diffs are not rendered by default.

174 changes: 174 additions & 0 deletions packages/ilib-tools-common/docs/escapes_CSharpEscaper.js.html

Large diffs are not rendered by default.

870 changes: 870 additions & 0 deletions packages/ilib-tools-common/docs/escapes_EscapeCommon.js.html

Large diffs are not rendered by default.

175 changes: 175 additions & 0 deletions packages/ilib-tools-common/docs/escapes_Escaper.js.html

Large diffs are not rendered by default.

176 changes: 176 additions & 0 deletions packages/ilib-tools-common/docs/escapes_JavaEscaper.js.html

Large diffs are not rendered by default.

169 changes: 169 additions & 0 deletions packages/ilib-tools-common/docs/escapes_JavascriptEscaper.js.html

Large diffs are not rendered by default.

131 changes: 131 additions & 0 deletions packages/ilib-tools-common/docs/escapes_JsonEscaper.js.html

Large diffs are not rendered by default.

168 changes: 168 additions & 0 deletions packages/ilib-tools-common/docs/escapes_PHPEscaper.js.html

Large diffs are not rendered by default.

167 changes: 167 additions & 0 deletions packages/ilib-tools-common/docs/escapes_PythonEscaper.js.html

Large diffs are not rendered by default.

138 changes: 138 additions & 0 deletions packages/ilib-tools-common/docs/escapes_RegexBasedEscaper.js.html

Large diffs are not rendered by default.

163 changes: 163 additions & 0 deletions packages/ilib-tools-common/docs/escapes_SmartyEscaper.js.html

Large diffs are not rendered by default.

158 changes: 158 additions & 0 deletions packages/ilib-tools-common/docs/escapes_SwiftEscaper.js.html

Large diffs are not rendered by default.

124 changes: 124 additions & 0 deletions packages/ilib-tools-common/docs/escapes_URIEscaper.js.html

Large diffs are not rendered by default.

2,751 changes: 2,608 additions & 143 deletions packages/ilib-tools-common/docs/global.html

Large diffs are not rendered by default.

Loading

0 comments on commit c5ee237

Please sign in to comment.