Comments (6)
What about Lua5.3-compatible \u{XXX}
where XXX
is a sequence of 1 or more hexadecimal digits representing the character code point?
from luajit.
Maybe in addition. And, yes, I think this is just another pointless and stupid Lua 5.3 weirdness. Why should one be bothered to enter raw UTF-8 as hex values with \u{abcd}?!? This can already be entered as \xab\xcd -- that proprietary \u{} syntax doesn't help at all.
The point is to be able to enter or cut'n'paste a hex code point literally, not having to convert it to UTF-8 by hand. What an ill-conceived 'feature'.
Following the lead of Python, Java, Javascript etc. and implementing \u and \U just makes so much more sense.
from luajit.
I've already implemented this lexer extension in TvmJIT
see https://github.com/fperrad/tvmjit/blob/master/src/tj_lex.c#L171
from luajit.
This can already be entered as \xab\xcd -- that proprietary \u{} syntax doesn't help at all.
"\u{ABCD}" == "\xEA\xAF\x8D", NOT "\xAB\xCD".
Also "\u{0}" == "\0" and "\u{10301}" == "\xF0\x90\x8C\x81". It's variable-length so you don't need to have to handle \u and \U separately, you can just handle both.
The point is to be able to enter or cut'n'paste a hex code point literally, not having to convert it to UTF-8 by hand.
Exactly. Lua 5.3 also removes the need to add padding π
from luajit.
Rust also uses the "\u{ABCD}"-style escapes. These have the advantages mentioned above.
I am going to try this.
from luajit.
Thanks! Applied to my git master (with modifications).
from luajit.
Related Issues (20)
- 0018 CRASH detected in recff_rawget due to a fault at or near 0x00000020dfff807f leading to SIGSEGV HOT 2
- 0019 CRASH detected in recff_rawset due to a fault at or near 0x00000020dfff807f leading to SIGSEGV HOT 2
- 0020 CRASH detected in release_unused_segments due to a fault at or near 0x0000000000000017 leading to SIGSEGV HOT 2
- 0021 CRASH detected in setgcVraw due to a fault at or near 0x00007ffff74a5048 leading to SIGSEGV HOT 2
- 0022 CRASH detected in str due to a fault at or near 0x00005555557f4920 leading to SIGSEGV HOT 2
- 0023 CRASH detected in gc_sweep due to a fault at or near 0x0000000000000000 leading to SIGSEGV HOT 2
- 0004 CRASH detected in 0x0000555516f9d63c due to a fault at or near 0x0000000000000008 leading to SIGSEGV HOT 2
- LJ_TRERR_LLEAVE exit
- FFI floats comparison HOT 3
- msvcbuild.bat script fatal error C1083: βluajit.hβ: No such file or directory HOT 1
- would you like to add support of Emscripten? HOT 1
- Broken link on String Buffer page HOT 1
- Disabling tail calls for easier debugging of stack traces
- -Wl,-E is unrecognized by Apple linker
- LuaJIT segmentation fault (possibly internal state corruption) HOT 1
- Typo in src/jit/bcsave.lua
- Uninitialized `cts->L` in `recff_cdata_arith` HOT 3
- Dirty reads from `FuncState`
- C Callback crashing wxLua app
- Back to back if statements using the same condition variable both execute under certain conditions. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from luajit.