File | File | |
| ||
1 |
| |
2 |
| |
3 |
| |
4 |
| |
5 |
| |
6 |
| |
7 |
I'm following the Go style for commit messages, which chooses to do:
(From https://go.dev/doc/contribute#first_line and emphasis mine.) | |
8 |
| |
9 |
|
File | File | |
| ||
1 |
| |
2 |
Go fuzzing support is out of beta and no longer uses this build constraint. It should be replaced with Done in PS 3. | |
3 |
| |
4 |
| |
5 |
| |
6 |
| |
7 |
| |
8 |
| |
9 |
| |
10 |
| |
11 |
| |
12 |
| |
13 |
| |
14 |
| |
15 |
| |
16 |
| |
17 |
| |
18 |
| |
19 |
| |
20 |
| |
21 |
| |
22 |
| |
23 |
| |
24 |
| |
25 |
| |
26 |
| |
27 |
| |
28 |
| |
29 |
| |
30 |
| |
31 |
| |
32 |
| |
33 |
| |
34 |
| |
35 |
| |
36 |
| |
37 |
| |
38 |
| |
39 |
| |
40 |
| |
41 |
| |
42 |
|
File | File | |
| ||
1 |
| |
1 |
| |
2 | 2 |
|
3 | 3 |
|
4 | 4 |
Shortened 'golang.org' to 'go.dev' here, and on line 24. |
5 | 5 |
|
6 | 6 |
|
7 |
| |
7 |
| |
8 |
| |
8 | 9 |
|
9 | 10 |
|
10 | 11 |
|
11 |
| |
12 |
| |
13 |
| |
12 |
| |
14 | 13 |
|
15 | 14 |
|
16 | 15 |
|
17 | 16 |
|
18 | 17 |
|
19 | 18 |
|
20 | 19 |
|
21 | 20 |
|
22 | 21 |
|
23 |
| |
24 |
| |
25 |
| |
22 |
| |
23 |
| |
26 | 24 |
|
27 | 25 |
|
28 |
| |
29 |
| |
26 |
| |
27 |
| |
28 |
| |
30 | 29 |
|
31 | 30 |
|
32 | 31 |
|
33 |
| |
34 |
| |
35 |
| |
36 |
| |
37 |
| |
32 |
| |
33 |
| |
38 | 34 |
|
39 | 35 |
|
36 |
| |
40 | 37 |
|
41 | 38 |
|
42 | 39 |
|
43 |
| |
40 |
| |
44 | 41 |
|
45 | 42 |
|
46 | 43 |
|
47 | 44 |
|
48 | 45 |
|
49 | 46 |
|
50 | 47 |
|
51 | 48 |
|
52 |
| |
49 |
| |
53 | 50 |
|
51 |
| |
52 |
| |
54 | 53 |
|
55 | 54 |
|
56 | 55 |
|
57 | 56 |
|
58 |
| |
57 |
| |
58 |
| |
59 |
I know what you mean, but I find the wording confusing. To be honest I'd probably not use a pointer and instead return the new state of inBlock. I replaced the confusing description here with a better comment for When writing this code originally, I started with returning the new
inBlock value. It got awkward because containsNonComment already returns a bool , so it started needing named result parameters, but inBlock couldn't be reused, and another name becomes confusing. Similarly, dealing with two results in the caller made it clunky.I also explored making containsNonComment a method, so it could just update its field, but that added more verbosity compared to just making this one bool a pointer. So, I don't like using a pointer either, but not using it didn't end up working out better.Ultimately, there's not much point for Parse to break input into lines via ReadLines('\n') and process them separately. By now it makes more sense to just do everything in one pass, reading byte-by-byte, while keeping track of /* */ and // style comments, until the first non-comment byte. When that optimization happens, the pointer will go away. | |
60 |
| |
61 |
| |
62 |
| |
63 |
| |
64 |
| |
65 |
| |
66 |
| |
67 |
| |
68 |
| |
69 |
| |
70 |
| |
71 |
| |
72 |
| |
73 |
| |
74 |
| |
75 |
| |
76 |
| |
77 |
| |
78 |
| |
79 |
| |
80 |
| |
81 |
| |
82 |
| |
83 |
| |
84 |
| |
85 |
| |
86 |
| |
87 |
| |
88 |
| |
89 |
| |
90 |
| |
91 |
| |
92 |
| |
93 |
| |
94 |
| |
95 |
| |
96 |
| |
97 |
| |
98 |
| |
99 |
| |
100 |
| |
101 |
| |
102 |
| |
103 |
| |
104 |
| |
105 |
| |
106 |
| |
107 |
| |
108 |
| |
109 |
| |
110 |
| |
111 |
| |
112 |
| |
59 | 113 |
|
60 |
| |
114 |
| |
61 | 115 |
|
62 | 116 |
|
63 | 117 |
|
64 | 118 |
|
65 | 119 |
|
File | File | |
| ||
24 | 24 |
|
25 | 25 |
|
26 | 26 |
|
27 | 27 |
|
28 | 28 |
|
29 |
| |
30 |
| |
31 | 29 |
|
32 | 30 |
|
33 | 31 |
|
34 | 32 |
|
35 | 33 |
|
36 | 34 |
|
35 |
| |
36 |
| |
37 |
| |
38 |
| |
39 |
| |
40 |
| |
37 | 41 |
|
38 | 42 |
|
39 | 43 |
|
40 | 44 |
|
41 | 45 |
|
File | File | |
| ||
57 | 57 |
|
58 | 58 |
|
59 | 59 |
|
60 | 60 |
|
61 | 61 |
|
62 |
|
File | File | |
| ||
1 | 1 |
|
2 | 2 |
|
3 | 3 |
|
4 |
| |
4 |
| |
5 | 5 |
|
6 | 6 |
|
7 | 7 |
|
8 | 8 |
|
Should capitalize sentence :P