Skip to content

Commit 5a13c26

Browse files
committed
Revise the name processing docs
1 parent de11ee5 commit 5a13c26

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

docs/for-contributors/Generator/name-processing.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ and the `NameSplitterTests` test cases.
111111
Numbers are always split out as their own individual token. This is because this is easier to work with and consistent
112112
than special casing when numbers should "stick" to preceding or proceeding tokens.
113113

114+
Note: The codebase is inconsistent when referring to tokens, usually calling them "words" or "fragments" instead.
115+
114116
For example:
115117
- `2D` is split as `2_D`
116118
- `R32` is split as `R_32`
@@ -145,8 +147,6 @@ processed.
145147
For specifics on how this process works and the exact behaviors, it is best to refer to the `NamePrettifier` source code
146148
and the `NamePrettifierTests` test cases.
147149

148-
(TODO: Explain how prettification works alongside name splitting. Explain how acronyms are handled. Explain why number fragments are merged to preceding letter fragments and how this affects acronyms and pascal casing.)
149-
150150
### Name Prettification - Notable Decisions
151151

152152
#### Output of Fully Capitalized Names
@@ -170,7 +170,7 @@ Where this behavior matters is in the following case:
170170
capitalized by default. This means `RG` is actually output as `Rg`.
171171
- `RG32` is split as `RG_32`. Because this is an acronym of length 4, it is output as `Rg32`.
172172

173-
Notably, means that `RG` and `RG32` are consistently output as `Rg-`.
173+
Notably, this means that `RG` and `RG32` are consistently output as `Rg-`.
174174

175175
In the code, this is implemented by merging number tokens with preceding letter tokens.
176176

@@ -179,7 +179,7 @@ For example:
179179
- `RG_32` is merged as `RG32`.
180180

181181
This can be argued to be a hack, but simplifies acronym length calculations and continues to work with the code that
182-
handles pascal casing.
182+
handles pascal casing, which simply uppercases the first character and lowercases the rest for each token.
183183

184184
#### Acronym Indeterminate Inputs
185185

0 commit comments

Comments
 (0)