Skip to content

Commit ee64cce

Browse files
authored
Upgrade Prism to v1.8.0 (#1067)
Prism 1.8.0 (ruby/prism#3827) changed how the `closing_loc` is populated for unclosed blocks. Previously it was `NULL` for unclosed blocks, but now it's always set (pointing to body content). This broke our detection logic that relied on checking if `closing_loc` was empty. https://github.com/ruby/prism/releases/tag/v1.8.0
1 parent a08f1e3 commit ee64cce

17 files changed

Lines changed: 70 additions & 39 deletions

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ If you encounter any issues when following along with this file please don't hes
1212
- [**Clang 21**](https://clang.llvm.org): The compiler used to build this project.
1313
- [**Clang Format 21**](https://clang.llvm.org/docs/ClangFormat.html): For formatting the project.
1414
- [**Clang Tidy 21**](https://clang.llvm.org/extra/clang-tidy/): For linting the project.
15-
- [**Prism Ruby Parser v1.7.0**](https://github.com/ruby/prism/releases/tag/v1.7.0): We use Prism for Parsing the Ruby Source Code in the HTML+ERB files.
15+
- [**Prism Ruby Parser v1.8.0**](https://github.com/ruby/prism/releases/tag/v1.8.0): We use Prism for Parsing the Ruby Source Code in the HTML+ERB files.
1616
- [**Ruby**](https://www.ruby-lang.org/en/): We need Ruby as a dependency for `bundler`.
1717
- [**Bundler**](https://bundler.io): We are using `bundler` to build [`prism`](https://github.com/ruby/prism) from source so we can build `herb` against it.
1818
- [**Emscripten**](https://emscripten.org): For the WebAssembly build of `libherb` so it can be used in the browser using the [`@herb-tools/browser`](https://github.com/marcoroth/herb/blob/main/javascript/packages/browser) package.

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ source "https://rubygems.org"
44

55
gemspec
66

7-
gem "prism", github: "ruby/prism", tag: "v1.7.0"
7+
gem "prism", github: "ruby/prism", tag: "v1.8.0"
88

99
gem "actionview", "~> 8.0"
1010
gem "digest", "~> 3.2"

Gemfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
GIT
22
remote: https://github.com/ruby/prism.git
3-
revision: df554035afb63c754b9edbe531ff48e6569eaf07
4-
tag: v1.7.0
3+
revision: 90c05789e4f90dec600d7748a002058046852370
4+
tag: v1.8.0
55
specs:
6-
prism (1.7.0)
6+
prism (1.8.0)
77

88
PATH
99
remote: .
@@ -110,7 +110,7 @@ GEM
110110
psych (5.3.1)
111111
date
112112
stringio
113-
racc (1.8.1)
113+
racc (1.8.0)
114114
rails-dom-testing (2.3.0)
115115
activesupport (>= 5.0.0)
116116
minitest

docs/docs/bindings/java/reference.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ Returns the full version information including Herb, Prism, and JNI details:
185185
import org.herb.Herb;
186186

187187
System.out.println(Herb.version());
188-
// Output: "herb java v0.8.7, libprism v1.7.0, libherb v0.8.7 (Java JNI)"
188+
// Output: "herb java v0.8.7, libprism v1.8.0, libherb v0.8.7 (Java JNI)"
189189
```
190190
:::
191191

@@ -211,7 +211,7 @@ Returns the Prism parser version:
211211
import org.herb.Herb;
212212

213213
System.out.println(Herb.prismVersion());
214-
// Output: "1.7.0"
214+
// Output: "1.8.0"
215215
```
216216
:::
217217

docs/docs/bindings/rust/reference.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ Returns the full version information including Herb, Prism, and FFI details:
229229
use herb::version;
230230

231231
println!("{}", version());
232-
// Output: "herb rust v0.8.7, libprism v1.7.0, libherb v0.8.7 (Rust FFI)"
232+
// Output: "herb rust v0.8.7, libprism v1.8.0, libherb v0.8.7 (Rust FFI)"
233233
```
234234
:::
235235

@@ -255,7 +255,7 @@ Returns the Prism parser version:
255255
use herb::prism_version;
256256

257257
println!("{}", prism_version());
258-
// Output: "1.7.0"
258+
// Output: "1.8.0"
259259
```
260260
:::
261261

javascript/packages/browser/test/browser.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe("@herb-tools/browser", () => {
1717
test("version() returns a string", async () => {
1818
const version = Herb.version
1919
expect(typeof version).toBe("string")
20-
expect(version).toBe("@herb-tools/browser@0.8.7, @herb-tools/core@0.8.7, libprism@1.7.0, libherb@0.8.7 (WebAssembly)")
20+
expect(version).toBe("@herb-tools/browser@0.8.7, @herb-tools/core@0.8.7, libprism@1.8.0, libherb@0.8.7 (WebAssembly)")
2121
})
2222

2323
test("parse() can process a simple template", async () => {

javascript/packages/node-wasm/test/node-wasm.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe("@herb-tools/node-wasm", () => {
1717
test("version() returns a string", async () => {
1818
const version = Herb.version
1919
expect(typeof version).toBe("string")
20-
expect(version).toBe("@herb-tools/node-wasm@0.8.7, @herb-tools/core@0.8.7, libprism@1.7.0, libherb@0.8.7 (WebAssembly)")
20+
expect(version).toBe("@herb-tools/node-wasm@0.8.7, @herb-tools/core@0.8.7, libprism@1.8.0, libherb@0.8.7 (WebAssembly)")
2121
})
2222

2323
test("parse() can process a simple template", async () => {

javascript/packages/node/test/node.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe("@herb-tools/node", () => {
1717
test("version() returns a string", async () => {
1818
const version = Herb.version
1919
expect(typeof version).toBe("string")
20-
expect(version).toBe("@herb-tools/node@0.8.7, @herb-tools/core@0.8.7, libprism@1.7.0, libherb@0.8.7 (Node.js C++ native extension)")
20+
expect(version).toBe("@herb-tools/node@0.8.7, @herb-tools/core@0.8.7, libprism@1.8.0, libherb@0.8.7 (Node.js C++ native extension)")
2121
})
2222

2323
test("parse() can process a simple template", async () => {

rust/tests/cli_commands_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use herb::{extract_html, extract_ruby, version};
44
fn test_version_functions() {
55
assert_eq!(
66
version(),
7-
"herb rust v0.8.7, libprism v1.7.0, libherb v0.8.7 (Rust FFI)"
7+
"herb rust v0.8.7, libprism v1.8.0, libherb v0.8.7 (Rust FFI)"
88
);
99
}
1010

rust/tests/snapshots/snapshot_test__prism_version_output.snap

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)