1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 11:38:21 +02:00

Add BfParser_GetIndexAtLine

This commit is contained in:
MineGame159 2022-08-23 20:00:48 +02:00
parent 24b03fa5aa
commit 46fbca7668
2 changed files with 13 additions and 0 deletions

View file

@ -181,6 +181,9 @@ namespace IDE.Compiler
[CallingConvention(.Stdcall), CLink] [CallingConvention(.Stdcall), CLink]
static extern void BfParser_GetLineCharAtIdx(void* bfParser, int32 idx, int32* line, int32* lineChar); static extern void BfParser_GetLineCharAtIdx(void* bfParser, int32 idx, int32* line, int32* lineChar);
[CallingConvention(.Stdcall), CLink]
static extern int32 BfParser_GetIndexAtLine(void* bfParser, int32 line);
public BfSystem mSystem; public BfSystem mSystem;
public void* mNativeBfParser; public void* mNativeBfParser;
public bool mIsUsed; public bool mIsUsed;
@ -442,5 +445,10 @@ namespace IDE.Compiler
return (line, char); return (line, char);
} }
public int GetIndexAtLine(int line)
{
return BfParser_GetIndexAtLine(mNativeBfParser, (.) line);
}
} }
} }

View file

@ -4200,4 +4200,9 @@ BF_EXPORT void BF_CALLTYPE BfParser_GetLineCharAtIdx(BfParser* bfParser, int idx
*line = _line; *line = _line;
*lineChar = _lineChar; *lineChar = _lineChar;
}
BF_EXPORT int BF_CALLTYPE BfParser_GetIndexAtLine(BfParser* bfParser, int line)
{
return bfParser->GetIndexAtLine(line);
} }