mirror of
https://github.com/luau-lang/luau.git
synced 2024-12-12 21:10:37 +00:00
e25de95445
* Fixed indexing table intersections using `x["prop"]` syntax: https://github.com/Roblox/luau/pull/971 * Add console output codepage for Windows: https://github.com/Roblox/luau/pull/967 * Added `Frontend::parse` for a fast source graph preparation * luau_load should check GC * Work toward a type-diff system for nicer error messages New Solver * Correctly suppress errors in more cases * Further improvements to typechecking of function calls and return statements * Crash fixes * Propagate refinements drawn from the condition of a while loop into the loop body JIT * Fix accidental bailout for math.frexp/modf/sign in A64 * Work toward bringing type annotation info in * Do not propagate Luau IR constants of wrong type into load instructions * CHECK_SAFEENV exits to VM on failure * Implement error handling in A64 reg allocator * Inline the string.len builtin * Do not enter native code of a function if arguments don’t match --------- Co-authored-by: Arseny Kapoulkine <arseny.kapoulkine@gmail.com> Co-authored-by: Vyacheslav Egorov <vegorov@roblox.com>
49 lines
1.4 KiB
C++
49 lines
1.4 KiB
C++
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
|
|
#pragma once
|
|
|
|
#include <string>
|
|
namespace Luau
|
|
{
|
|
|
|
struct Position
|
|
{
|
|
unsigned int line, column;
|
|
|
|
Position(unsigned int line, unsigned int column);
|
|
|
|
bool operator==(const Position& rhs) const;
|
|
bool operator!=(const Position& rhs) const;
|
|
bool operator<(const Position& rhs) const;
|
|
bool operator>(const Position& rhs) const;
|
|
bool operator<=(const Position& rhs) const;
|
|
bool operator>=(const Position& rhs) const;
|
|
|
|
void shift(const Position& start, const Position& oldEnd, const Position& newEnd);
|
|
};
|
|
|
|
struct Location
|
|
{
|
|
Position begin, end;
|
|
|
|
Location();
|
|
Location(const Position& begin, const Position& end);
|
|
Location(const Position& begin, unsigned int length);
|
|
Location(const Location& begin, const Location& end);
|
|
|
|
bool operator==(const Location& rhs) const;
|
|
bool operator!=(const Location& rhs) const;
|
|
|
|
bool encloses(const Location& l) const;
|
|
bool overlaps(const Location& l) const;
|
|
bool contains(const Position& p) const;
|
|
bool containsClosed(const Position& p) const;
|
|
void extend(const Location& other);
|
|
void shift(const Position& start, const Position& oldEnd, const Position& newEnd);
|
|
|
|
/**
|
|
* Use offset=1 when displaying for the user.
|
|
*/
|
|
std::string toString(int offset = 0, bool useBegin = true) const;
|
|
};
|
|
|
|
} // namespace Luau
|