Uses 5262K of libraries. Click here for Pure Java version (605L/4K/15K).
1 | !752 |
2 | |
3 | lib 1004739 // (latest?) aibo |
4 | |
5 | import org.luaj.vm2.parser.LuaParserTokenManager; |
6 | import org.luaj.vm2.parser.LuaParserConstants; |
7 | import org.luaj.vm2.parser.Token; |
8 | import org.luaj.vm2.parser.SimpleCharStream; |
9 | |
10 | p {
|
11 | S lua = [[ |
12 | function entry0 (o) |
13 | N=N + 1 |
14 | local title = o.title or '(no title)' |
15 | fwrite('<LI><A HREF="#%d">%s</A>\n', N, title)
|
16 | end |
17 | ]]; |
18 | |
19 | SimpleCharStream scs = new SimpleCharStream(new StringReader(lua)); |
20 | LuaParserTokenManager tm = new LuaParserTokenManager(scs); |
21 | |
22 | Token t; |
23 | while (licensed() && (t = tm.getNextToken()).kind != LuaParserConstants.EOF) {
|
24 | S kindName = get(LuaParserConstants.tokenImage, t.kind); |
25 | print("Token: " + quote(t.image) + " (kind: " + t.kind + " / " + kindName + ")");
|
26 | } |
27 | } |
Began life as a copy of #1004741
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1004872 |
| Snippet name: | Test Lua Tokenizer [WORKS] |
| Eternal ID of this version: | #1004872/1 |
| Text MD5: | 297f717b78ce37972665abaed197eab3 |
| Transpilation MD5: | 86d34cf6d4b2b0330583957d882dc95c |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX source code |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2016-09-11 18:18:21 |
| Source code size: | 787 bytes / 27 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 775 / 883 |
| Referenced in: | [show references] |