mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2026-12-01 20:59:26 -06:00
This does fix #7019, but unfortunately in IR lines like - ``` %2 = mul nsw i32 %0, %0 ``` Monaco assigns both the `mul` and `nsw` tokens with type 'operators.llvm-ir' (handled as asm keyword by this PR) and requests the backend for their docs. Only `mul` is an actual documented keyword - `nsw` is just a modifier and the request fails with errors like `GET http://localhost:10240/api/asm/llvm/nsw 404 (Not Found)` thrown at [getAssemblyDocumentation](https://github.com/compiler-explorer/compiler-explorer/blob/63dd5e35a5856bcd1670b7b1cf21ffd854928ef7/static/api/api.ts#L50-L51). This draft PR is meant for discussion. Would it be enough eg to wrap the request in `getAssemblyDocumentation` in a try-catch? Maybe the right thing to do would be to intervene in the monarch parsing for llvm-ir? Other ideas that I'm missing? --------- Co-authored-by: Mats Jun <mats@jun.codes>