Skip to content

Commit 2f845c6

Browse files
committed
Added "LessThanEqualsToken".
Small changes to comments/code.
1 parent 5daeb76 commit 2f845c6

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

CSharpToJavaScript/CSTOJS.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public StringBuilder GenerateOneFromString(string csstring, List<MetadataReferen
127127

128128
Assembly assembly = Assembly.GetEntryAssembly();
129129

130-
SyntaxTree? _tree = CSharpSyntaxTree.ParseText(csstring.Normalize());
130+
SyntaxTree? _tree = CSharpSyntaxTree.ParseText(csstring);
131131

132132
if(references != null)
133133
Generate(_tree, assembly, references);
@@ -409,7 +409,7 @@ public void Log(string message, [CallerFilePath] string? file = null, [CallerMem
409409
}
410410

411411

412-
Trace.WriteLine($"({line}):{Path.GetFileName(file)} {member}: {message}");
412+
Trace.WriteLine($"({line}):{Path.GetFileName(file.Replace("\\", "/"))} {member}: {message}");
413413

414414
if (Options.DisableConsoleColors == false)
415415
Console.ResetColor();

CSharpToJavaScript/CSTOJSOptions.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System;
1+
using CSharpToJavaScript.Utils;
2+
using System;
23
using System.Collections.Generic;
34
using System.IO;
45
using System.Text;
@@ -36,10 +37,10 @@ public class CSTOJSOptions
3637
public bool DisableConsoleOutput { get; set; } = false;
3738

3839
/// <summary>
39-
/// Output path for javascript file.
40+
/// Output path for javascript file/files.
4041
/// </summary>
4142
/// <value>
42-
/// Default: <c>Directory.GetCurrentDirectory()</c>
43+
/// Default: <see cref="Directory.GetCurrentDirectory()" />
4344
/// </value>
4445
public string OutPutPath { get; set; } = Directory.GetCurrentDirectory();
4546

@@ -53,34 +54,33 @@ public class CSTOJSOptions
5354

5455
/// <summary>
5556
/// List of custom names to convert.
56-
/// Example: new("Console","console").
57-
/// Will convert "Console" to "console".
5857
/// </summary>
58+
/// <remarks>Example: <c>new List&lt;Tuple&lt;string, string&gt;&gt;(){new Tuple&lt;string, string&gt;("Console", "console")}</c>. Will convert "Console" to "console".</remarks>
5959
/// <value>
6060
/// Default: <c>new()</c>
6161
/// </value>
6262
public List<Tuple<string, string>> CustomCSNamesToJS { get; set; } = new();
6363
/// <summary>
6464
/// List of types to convert.
65-
/// Example: Similar to CustomCSNamesToJS, but convers the type. You need to use <c>ToAttribute</c>
6665
/// </summary>
66+
/// <remarks>Example: Similar to <see cref="CSTOJSOptions.CustomCSNamesToJS" />, but convers the type. You need to use <see cref="ToAttribute" />.</remarks>
6767
/// <value>
6868
/// Default: <c>new()</c>
6969
/// </value>
7070
public List<Type> CustomCSTypesToJS { get; set; } = new();
7171

7272
/// <summary>
73-
/// Add a <c>StringBuilder</c> to the front of a javascript file.
73+
/// Add a <see cref="StringBuilder" /> to the front of a javascript file.
7474
/// </summary>
75-
/// <remarks>When using "GenerateManyAsync" applies to every file!</remarks>
75+
/// <remarks>Note! When passing a folder path to <see cref="CSTOJS.GenerateOneAsync(string, string?)" /> applies to every file!</remarks>
7676
/// <value>
7777
/// Default: <c>new()</c>
7878
/// </value>
7979
public StringBuilder AddSBInFront { get; set; } = new();
8080
/// <summary>
81-
/// Add a <c>StringBuilder</c> to the end of a javascript file.
81+
/// Add a <see cref="StringBuilder" /> to the end of a javascript file.
8282
/// </summary>
83-
/// <remarks>When using "GenerateManyAsync" applies to every file!</remarks>
83+
/// <remarks>Note! When passing a folder path to <see cref="CSTOJS.GenerateOneAsync(string, string?)" /> applies to every file!</remarks>
8484
/// <value>
8585
/// Default: <c>new()</c>
8686
/// </value>

CSharpToJavaScript/Walker.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public override void VisitTrivia(SyntaxTrivia trivia)
5353
return;
5454
}
5555
default:
56-
_CSTOJS.Log($"{syntaxKind}");
56+
_CSTOJS.Log($"ERROR Trivia : {syntaxKind}");
5757
break;
5858
}
5959

@@ -120,6 +120,7 @@ public override void VisitToken(SyntaxToken token)
120120
case SyntaxKind.WhileKeyword:
121121
case SyntaxKind.InterpolatedStringTextToken:
122122
case SyntaxKind.QuestionToken:
123+
case SyntaxKind.LessThanEqualsToken:
123124
case SyntaxKind.EndOfFileToken:
124125
{
125126
VisitLeadingTrivia(token);
@@ -130,7 +131,7 @@ public override void VisitToken(SyntaxToken token)
130131
return;
131132
}
132133
default:
133-
_CSTOJS.Log($"{syntaxKind}");
134+
_CSTOJS.Log($"ERROR Token : {syntaxKind}");
134135
break;
135136
}
136137

0 commit comments

Comments
 (0)