Hi, I am unsure of what to put here so i'll try to put as much information as i can.
Context
I'm currently using the pip library.
The problem
Using accents create an offest in the AST.
I can't stop using them because I have user feedback (not in this code, but in general in my software)
Using accents
The Csharp script
Details
using System.Text.RegularExpressions;
namespace HUBLoader.Types;
public class TypeArret
{
private readonly string bits;
public TypeArret(string rawBits)
{
if (rawBits.Length != 20)
throw new ArgumentException($"TypeArret doit contenir exactement 20 caractères (reçu {rawBits.Length})");
if (!Regex.IsMatch(rawBits, "^[ON]{20}$", RegexOptions.IgnoreCase))
throw new ArgumentException("TypeArret ne doit contenir que des caractères 'O' ou 'N'.");
bits = rawBits.ToUpperInvariant();
}
public bool EstActif(TypeArretFlag flag)
{
return bits[(int)flag] == 'O';
}
public override string ToString()
{
return bits;
}
}
AST to JSON
Too long for github
Without accents
Csharp script
Details
using System.Text.RegularExpressions;
namespace HUBLoader.Types;
public class TypeArret
{
private readonly string bits;
public TypeArret(string rawBits)
{
if (rawBits.Length != 20)
throw new ArgumentException($"TypeArret doit contenir exactement 20 caracteres (recu {rawBits.Length})");
if (!Regex.IsMatch(rawBits, "^[ON]{20}$", RegexOptions.IgnoreCase))
throw new ArgumentException("TypeArret ne doit contenir que des caracteres 'O' ou 'N'.");
bits = rawBits.ToUpperInvariant();
}
public bool EstActif(TypeArretFlag flag)
{
return bits[(int)flag] == 'O';
}
public override string ToString()
{
return bits;
}
}
AST to JSON
Too long for github
Hi, I am unsure of what to put here so i'll try to put as much information as i can.
Context
I'm currently using the pip library.
The problem
Using accents create an offest in the AST.
I can't stop using them because I have user feedback (not in this code, but in general in my software)
Using accents
The Csharp script
Details
AST to JSON
Too long for github
Without accents
Csharp script
Details
AST to JSON
Too long for github