mirror of
https://github.com/luau-lang/luau.git
synced 2025-05-04 10:33:46 +01:00
Add backlash escape sequence
This commit is contained in:
parent
a18e9e9e58
commit
ef2c2f9432
1 changed files with 3 additions and 2 deletions
|
@ -111,8 +111,9 @@ local MyModule = require("/MyLibrary/MyModule")
|
|||
local MyModule = require("C:/MyLibrary/MyModule")
|
||||
|
||||
-- These also work, "\" is internally replaced with "/"
|
||||
local MyModule = require("\MyLibrary\MyModule")
|
||||
local MyModule = require("C:\MyLibrary\MyModule")
|
||||
-- (In a string literal, we must use the escape sequence "\\")
|
||||
local MyModule = require("\\MyLibrary\\MyModule")
|
||||
local MyModule = require("C:\\MyLibrary\\MyModule")
|
||||
```
|
||||
|
||||
Generally, absolute paths should not be used in regular code: if the location of a globally installed package changes, it can be a nuisance to find and change all require statements that reference the old absolute path.
|
||||
|
|
Loading…
Add table
Reference in a new issue