Skip to content

Instantly share code, notes, and snippets.

View edwin0cheng's full-sized avatar
💭
# ^

Edwin Cheng edwin0cheng

💭
# ^
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@edwin0cheng
edwin0cheng / remain_mbg_bugs.log
Created April 29, 2019 12:20
Remain mbe bugs
WARN [ra_hir::ids] fail on macro_parse: (reason: NoMatchingRule) macro call [file: "src/errors.rs"] : single_cause ! {
/// Cannot tell whether an `u16` needs an extra unit,
/// because it's a trailing surrogate itself.
InvalidUtf16FirstUnit = > "is a trailing surrogate"
}
has rules: true
WARN [ra_hir::ids] fail on macro_parse: (reason: NoMatchingRule) macro call [file: "src/errors.rs"] : single_cause ! {
/// Cannot create an `Utf8Char` or `Utf16Char` from the first codepoint of a str,
/// because there are none.
EmptyStrError = > "is empty"
@edwin0cheng
edwin0cheng / RA and Rustc mbe Design.md
Last active June 23, 2021 11:27
RA and rustc macro by examples design

RA

  • ra do not have a TokenStream object
  • ra do not have a SyntaxExtension object
    • SyntaxExtension is a rustc enum, representing the different kinds of syntax extensions.
    • link
  • The current parser implementation about MacroCall:
    • When it see a MACRO_CALL, it just bump all lexer's SyntaxKind to rowan and build a rowan::SyntaxNode
    • Although we have a tt::TokenTree (not confused with syntax::TokenTree), we only generate it during macro parsing and expansion.
@edwin0cheng
edwin0cheng / convert_dds
Created March 22, 2018 01:45
Convert DDS
-#!/bin/bash
-for f in *.png
-do
- convert -format dds -define dds:compression=DXT1 $f ${f%.*}.dds
-done
@edwin0cheng
edwin0cheng / cargo build log
Created March 9, 2018 04:25
cargo web start --example basic --verbose (with CARGO_WEB_LOG=cargo_web=debug)
DEBUG 2018-03-09T04:21:26Z: cargo_web::config: Loading "D:\\sandbox\\rust-root\\unrust\\Web.toml"...
DEBUG 2018-03-09T04:21:26Z: cargo_web::build: `unrust`'s Web.toml requires cargo-web 0.6.8
DEBUG 2018-03-09T04:21:26Z: cargo_web::config: Loading "C:\\Users\\Edwin\\.cargo\\registry\\src\\github.com-1ecc6299db9ec823\\stdweb-0.4.1\\Web.toml"...
DEBUG 2018-03-09T04:21:26Z: cargo_web::build: `stdweb`'s Web.toml requires cargo-web 0.6.8
DEBUG 2018-03-09T04:21:26Z: cargo_web::build: `stdweb`'s Web.toml wants to prepend the following JS files: ["src/webcore/runtime.js", "src/webcore/runtime_wasm.js"]
warning: debug builds on the wasm32-unknown-unknown are currently totally broken
forcing a release build
DEBUG 2018-03-09T04:21:27Z: cargo_web::cargo_shim: Will launch cargo with PATH: "C:\\Users\\Edwin\\.cargo\\bin;C:\\Users\\Edwin\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\bin;C:\\utils\\apitrace-msvc\\x64\\bin;=C:\\utils\\apitrace-msvc\\x86\\bin;=C:\\Program Files\\Docker\\Docker\\Resources\\bin;C