Skip to content

Commit 7a1e34d

Browse files
authored
Minor misc. updates (#353)
* clarified doc comments. * corrected typos in comments * update test sample `mandel.kls` to include comments added to the sample assembly
1 parent 7f26cd7 commit 7a1e34d

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

src/Samples/Kaleidoscope/.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ vsspell_section_id = 1566b770c5af48b08aa5b43b10ffef28
44
vsspell_ignored_words_1566b770c5af48b08aa5b43b10ffef28 = File:IgnoredWords.dic|def
55

66
[*.kls]
7-
# VSSPELL: DIsable everything for the sample languages
7+
# VSSPELL: Disable everything for the sample languages
88
vsspell_section_id = 257c51e4a39d462090397bebd5922176
99
vsspell_spell_check_as_you_type = false
1010
vsspell_include_in_project_spell_check = false

src/Samples/Kaleidoscope/Kaleidoscope.Grammar/KaleidoscopeUserOperatorListener.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ public KaleidoscopeUserOperatorListener( DynamicRuntimeState state )
1919
/// <summary>Handles successfully parsed function definitions</summary>
2020
/// <param name="context">Context parse node for the parsed function</param>
2121
/// <remarks>
22-
/// Upon successful parse of a function definition this check if it is a user defined operator
23-
/// and updates the RuntimeState accordingly, if it is.
22+
/// Upon successful parse of a function definition this checks if it is a user defined operator
23+
/// and updates the RuntimeState accordingly, if it is. This is used for support of user defined
24+
/// operators providing user defined precedence.
2425
/// </remarks>
2526
public override void ExitFunctionDefinition( KaleidoscopeParser.FunctionDefinitionContext context )
2627
{

src/Samples/Kaleidoscope/mandel.kls

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
1+
# unary operator to perform a logical NOT
12
def unary!(v)
23
if v then
34
0
45
else
56
1;
67

8+
# unary operator to perform a mathematical negation
79
def unary-(v)
810
0-v;
911

12+
# Comparison operator
1013
def binary> 10 (LHS RHS)
1114
RHS < LHS;
1215

16+
# Logical OR operator
1317
def binary| 5 (LHS RHS)
1418
if LHS then
1519
1
@@ -18,17 +22,21 @@ def binary| 5 (LHS RHS)
1822
else
1923
0;
2024

25+
# Logical AND operator
2126
def binary& 6 (LHS RHS)
2227
if !LHS then
2328
0
2429
else
2530
!!RHS;
2631

32+
# arithmatic equality test
2733
def binary== 9 (LHS RHS)
2834
!(LHS < RHS | LHS > RHS);
2935

36+
# selector operator
3037
def binary : 1 (x y) y;
3138

39+
# declare access to built-in function
3240
extern putchard(char);
3341

3442
def printdensity(d)

0 commit comments

Comments
 (0)