Skip to content

Commit 05aed84

Browse files
authored
Merge pull request #374 from stride3d/master
Deploy latest website updates to staging
2 parents 2b9f753 + 4a32eb9 commit 05aed84

3 files changed

Lines changed: 13 additions & 27 deletions

File tree

package-lock.json

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
},
2222
"dependencies": {
2323
"@11ty/eleventy-fetch": "^5.1.1",
24-
"@fortawesome/fontawesome-free": "^7.1.0",
24+
"@fortawesome/fontawesome-free": "^7.2.0",
2525
"bootstrap": "^5.3.8",
2626
"lunr": "^2.3.9",
2727
"markdown-it-anchor": "^9.2.0",
2828
"markdown-it-table-of-contents": "^1.1.0",
29-
"sass": "^1.97.1"
29+
"sass": "^1.97.3"
3030
}
3131
}

posts/2025-12-24-investigating-spirv-for-the-shader-system-part-3.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,9 @@ public enum Operators
9393
LeftShift,
9494
RightShift,
9595
//...
96-
9796
}
9897

99-
10098
public class BinaryExpression(Expression left, Operator operator, Expression right, TextLocation location) : Expression(location);
101-
102-
103-
10499
```
105100

106101
### Scanning code
@@ -144,7 +139,6 @@ bool IsDigitValue(char c, int value)
144139

145140
bool IsDigitRange(char c, Range range);
146141

147-
148142
bool ParseIntegerLiteral(ref Scanner scanner, out IntegerLiteral literal)
149143
{
150144
// We keep track of the position before we match anything
@@ -178,7 +172,6 @@ bool ParseIntegerLiteral(ref Scanner scanner, out IntegerLiteral literal)
178172
literal = null!;
179173
return false;
180174
}
181-
182175
```
183176

184177

@@ -209,15 +202,12 @@ bool ParseNumberLiteral(ref Scanner scanner, out NumberLiteral number)
209202
number = null!;
210203
return false;
211204
}
212-
213205
```
214206

215207

216208
We can even go one step higher and use this number parser to create our first binary operation parser :
217209

218210
```csharp
219-
220-
221211
// A utility function that resets the position. We can modify it to catch errors
222212
bool ExitParser<TNode>(ref Scanner scanner, out TNode node, int position) where TNode : ASTNode;
223213

@@ -226,7 +216,6 @@ bool ExitParser<TNode>(ref Scanner scanner, out TNode node, int position) where
226216
227217
bool FollowedByAny(ref Scanner scanner, string chars, out char value, bool withSpaces = false, bool advance = false);
228218

229-
230219
bool Spaces(ref Scanner scanner, int min = 0)
231220
{
232221
var start = scanner.Position;
@@ -273,7 +262,6 @@ bool Mul(ref Scanner scanner, out Expression expression)
273262
return true;
274263
else return ExitParser(ref scanner, result, out expression, position, orError);
275264
}
276-
277265
```
278266

279267
We can also write the addition/subtraction parser, following the operator precedence :
@@ -306,7 +294,6 @@ bool Add(ref Scanner scanner, out Expression expression)
306294
return true;
307295
else return ExitParser(ref scanner, result, out expression, position, orError);
308296
}
309-
310297
```
311298

312299
The sharpest ones will notice I'm not using recursion for everything, i'm using a while loop. This is a small optimisation called [precedence climbing](https://eli.thegreenplace.net/2012/08/02/parsing-expressions-by-precedence-climbing) to avoid to many recursions when parsing long and complex expressions.
@@ -325,7 +312,6 @@ namespace MyNameSpace
325312
{
326313
shader Parent
327314
{
328-
329315
struct MyStruct {
330316
int a;
331317
};

0 commit comments

Comments
 (0)