Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #267 from wledfor2/caseoptions
Added Options to control "fuzzy" matching of userdata methods, etc
- Loading branch information
Showing
11 changed files
with
109 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/MoonSharp.Interpreter/Options/FuzzySymbolMatchingBehavior.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System; | ||
|
||
namespace MoonSharp.Interpreter { | ||
|
||
/// <summary> | ||
/// A flag that controls if/how symbols (method, property, userdata) are fuzzily matched when they do not exist. Flags can be combined for multiple checks. | ||
/// </summary> | ||
[Flags] | ||
public enum FuzzySymbolMatchingBehavior { | ||
|
||
/// <summary>No fuzzy matching is performed.</summary> | ||
None = 0, | ||
|
||
/// <summary>The first letter of a symbol will be uppercased (to check for common C# naming conventions). For example, testMethod() becomes TestMethod()</summary> | ||
UpperFirstLetter = 1, | ||
|
||
/// <summary>Underscores in symbols are converted to camelcase. For example, test_method() becomes testMethod()</summary> | ||
Camelify = 2, | ||
|
||
/// <summary> | ||
/// Converts a symbol to pascal case. For example, test_Method_two() becomes TestMethodTwo() | ||
/// </summary> | ||
PascalCase = 4 | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...preter/_Projects/MoonSharp.Interpreter.netcore/src/Options/FuzzySymbolMatchingBehavior.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System; | ||
|
||
namespace MoonSharp.Interpreter { | ||
|
||
/// <summary> | ||
/// A flag that controls if/how symbols (method, property, userdata) are fuzzily matched when they do not exist. Flags can be combined for multiple checks. | ||
/// </summary> | ||
[Flags] | ||
public enum FuzzySymbolMatchingBehavior { | ||
|
||
/// <summary>No fuzzy matching is performed.</summary> | ||
None = 0, | ||
|
||
/// <summary>The first letter of a symbol will be uppercased (to check for common C# naming conventions). For example, testMethod() becomes TestMethod()</summary> | ||
UpperFirstLetter = 1, | ||
|
||
/// <summary>Underscores in symbols are converted to camelcase. For example, test_method() becomes testMethod()</summary> | ||
Camelify = 2, | ||
|
||
/// <summary> | ||
/// Converts a symbol to pascal case. For example, test_Method_two() becomes TestMethodTwo() | ||
/// </summary> | ||
PascalCase = 4 | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters