Skip to content

Commit

Permalink
Merge pull request #248 from fgsch/patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor committed Feb 17, 2022
2 parents 82f9492 + 8adb234 commit 55826a9
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions README.md
Expand Up @@ -85,15 +85,18 @@ fn main() {
let path = Path::new(&env::var("OUT_DIR").unwrap()).join("codegen.rs");
let mut file = BufWriter::new(File::create(&path).unwrap());

write!(&mut file, "static KEYWORDS: phf::Map<&'static str, Keyword> = ").unwrap();
phf_codegen::Map::new()
.entry("loop", "Keyword::Loop")
.entry("continue", "Keyword::Continue")
.entry("break", "Keyword::Break")
.entry("fn", "Keyword::Fn")
.entry("extern", "Keyword::Extern")
.build(&mut file)
.unwrap();
write!(
&mut file,
"static KEYWORDS: phf::Map<&'static str, Keyword> = {}",
phf_codegen::Map::new()
.entry("loop", "Keyword::Loop")
.entry("continue", "Keyword::Continue")
.entry("break", "Keyword::Break")
.entry("fn", "Keyword::Fn")
.entry("extern", "Keyword::Extern")
.build()
)
.unwrap();
write!(&mut file, ";\n").unwrap();
}
```
Expand Down

0 comments on commit 55826a9

Please sign in to comment.