Commit bb45e17
Improve string generation in Java
Summary:
Remove all the code for dealing with escape sequences from Java codegens. It is no longer needed because escape sequences are now handled in the lexer/parser. Instead add previously missing escaping of control characters.
In particular, this fixes handling of multiline strings.
Before:
```
public static final String multi_line_string = "This
is a
multi line string.
";
```
After:
```
public static final String multi_line_string = "This\nis a\nmulti line string.\n";
```
Reviewed By: bahadird
Differential Revision: D44559991
fbshipit-source-id: c079aad9ba69d08fd0576bd14d73bd2ea93b51471 parent 17bd0f7 commit bb45e17
File tree
4 files changed
+30
-79
lines changed- thrift/compiler
- generate
- lib/java
- test/fixtures/constants
- gen-android
- gen-java/test/fixtures/constants
4 files changed
+30
-79
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
422 | 422 | | |
423 | 423 | | |
424 | 424 | | |
425 | | - | |
| 425 | + | |
426 | 426 | | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | | - | |
439 | | - | |
440 | | - | |
441 | | - | |
442 | | - | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | | - | |
464 | | - | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
465 | 431 | | |
466 | | - | |
467 | 432 | | |
468 | | - | |
469 | | - | |
| 433 | + | |
| 434 | + | |
470 | 435 | | |
471 | | - | |
472 | | - | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
473 | 442 | | |
474 | 443 | | |
475 | 444 | | |
476 | 445 | | |
477 | 446 | | |
478 | 447 | | |
479 | 448 | | |
480 | | - | |
481 | 449 | | |
482 | 450 | | |
483 | 451 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
96 | 87 | | |
97 | | - | |
98 | 88 | | |
99 | | - | |
100 | | - | |
| 89 | + | |
101 | 90 | | |
102 | 91 | | |
103 | | - | |
104 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
105 | 95 | | |
106 | 96 | | |
107 | | - | |
| 97 | + | |
108 | 98 | | |
109 | | - | |
110 | 99 | | |
111 | 100 | | |
112 | 101 | | |
| |||
Lines changed: 4 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 4 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments