mirror of
https://github.com/luau-lang/luau.git
synced 2025-05-04 10:33:46 +01:00
Lexer: add offset getter (#1688)
Added a getter for the Lexer's private `offset` to track its cursor position in the buffer. This helps me index tokens by buffer address in a project where I'm rendering Luau code with [Dear ImGui](https://github.com/ocornut/imgui). Would love this merged so I can use official Luau releases again! Co-authored-by: Adrian Duermael <adrien@cu.bzh>
This commit is contained in:
parent
c1e2f650db
commit
6a21dba682
1 changed files with 5 additions and 0 deletions
|
@ -187,6 +187,11 @@ public:
|
|||
static bool fixupQuotedString(std::string& data);
|
||||
static void fixupMultilineString(std::string& data);
|
||||
|
||||
unsigned int getOffset() const
|
||||
{
|
||||
return offset;
|
||||
}
|
||||
|
||||
private:
|
||||
char peekch() const;
|
||||
char peekch(unsigned int lookahead) const;
|
||||
|
|
Loading…
Add table
Reference in a new issue