mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-01-08 22:38:28 -05:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
28 lines
628 B
C#
28 lines
628 B
C#
using System.Text.RegularExpressions;
|
|
|
|
namespace Facepunch.InteropGen;
|
|
|
|
public class InlineFunction
|
|
{
|
|
internal static Function Parse( string line )
|
|
{
|
|
Match m = Regex.Match( line.Trim(), @"^inline\s(static)?[\s+]?(.+?)\s+([a-zA-Z0-9_]+?)\(((.+?))?\)( const)?(.+)?", RegexOptions.IgnoreCase );
|
|
if ( !m.Success )
|
|
{
|
|
return null;
|
|
}
|
|
|
|
Function f = new()
|
|
{
|
|
Native = true,
|
|
Static = m.Groups[1].Success,
|
|
Name = m.Groups[3].Value.Trim(),
|
|
Return = Arg.Parse( m.Groups[2].Value + " returnvalue" ),
|
|
Parameters = Arg.ParseMany( m.Groups[4].Value )
|
|
};
|
|
f.AddSpecial( m.Groups[7].Value );
|
|
|
|
return f;
|
|
}
|
|
}
|