Skip to content

Commit b548656

Browse files
committed
Template out node creation functions
Only arena-aware not parser-aware. static inline inside of the header so we don't have to pay the lack of LTO cost just for these functions. Leaving parsing-specific logic inside prism.c, effectively wrapping every one of these functions.
1 parent 5d80bc5 commit b548656

6 files changed

Lines changed: 1665 additions & 1636 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ out.svg
3232
/gemfiles/typecheck/bin/
3333
/include/prism/ast.h
3434
/include/prism/diagnostic.h
35+
/include/prism/node_new.h
3536
/javascript/node_modules/
3637
/javascript/package-lock.json
3738
/javascript/src/deserialize.js

docs/configuration.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ A lot of code in prism's repository is templated from a single configuration fil
55
* `ext/prism/api_node.c` - for defining how to build Ruby objects for the nodes out of C structs
66
* `include/prism/ast.h` - for defining the C structs that represent the nodes
77
* `include/prism/diagnostic.h` - for defining the diagnostics
8+
* `include/prism/node_new.h` - for defining the functions that create the nodes in C
89
* `javascript/src/deserialize.js` - for defining how to deserialize the nodes in JavaScript
910
* `javascript/src/nodes.js` - for defining the nodes in JavaScript
1011
* `java/org/ruby_lang/prism/AbstractNodeVisitor.java` - for defining the visitor interface for the nodes in Java

prism.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ Gem::Specification.new do |spec|
5252
"include/prism/diagnostic.h",
5353
"include/prism/encoding.h",
5454
"include/prism/node.h",
55+
"include/prism/node_new.h",
5556
"include/prism/options.h",
5657
"include/prism/parser.h",
5758
"include/prism/prettyprint.h",

0 commit comments

Comments
 (0)