Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/EasyCon.Script/Syntax/Lexer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ internal sealed partial class Lexer(SyntaxTree syntaxTree)
[GeneratedRegex(@"(\s*#.*)$")]
private static partial Regex lineRegex();

[GeneratedRegex(@"^\b(print|alert)\b\s+(.*)$", RegexOptions.IgnoreCase, "zh-CN")]
[GeneratedRegex(@"^\b(print|alert)\b\s*(.*)$", RegexOptions.IgnoreCase, "zh-CN")]
private static partial Regex printRex();

[GeneratedRegex(@"^(_|\$)[\d\p{L}_]+$", RegexOptions.IgnoreCase, "zh-CN")]
Expand Down
2 changes: 1 addition & 1 deletion src/EasyCon2/Config/ControllerConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public record ConfigState
public string ChannelToken { get; set; } = string.Empty;
public bool EnableAlertToken { get; set; } = false;
public bool EnableChannelToken { get; set; } = false;
public bool EnableAutoCompletion { get; set; } = true;
public bool EnableAutoCompletion { get; set; } = false;

public bool ChannelControl { get; set; } = false;

Expand Down
11 changes: 10 additions & 1 deletion src/EasyCon2/Resources/ecp.xshd
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
xmlns="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008">
<Color name="Comment" foreground="Green" />
<Color name="String" foreground="#fff99157" />
<Color name="NumberLiteral" foreground="#ff99cc99"/>
<Color name="NumberLiteral" foreground="#ff9966ff"/>
<Color name="Keywords" fontWeight="bold" foreground="Blue" />
<Color name="Funcs" fontWeight="bold" foreground="LightBlue" />
<Color name="GamePadKey" fontWeight="bold" foreground="Red" />
<Color name="Variable" foreground="#ffcc6600" />
<Color name="Constant" foreground="#ff996633" />

<RuleSet name="CommentMarkerSet">
<Keywords fontWeight="bold" foreground="#fff2777a">
Expand All @@ -27,6 +29,13 @@
<End>"</End>
</Span>

<!-- 变量和常量必须在关键字之前匹配 -->
<Rule color="Variable">\$[\w]+</Rule>
<Rule color="Constant">_[\w]+</Rule>

<!-- 数字 -->
<Rule color="NumberLiteral">\b\d+(\.\d+)?([eE][+-]?\d+)?</Rule>

<Keywords color="Keywords">
<Word>IMPORT</Word>
<Word>FOR</Word>
Expand Down