calcoph / hexpat-lsp Goto Github PK
View Code? Open in Web Editor NEWLanguage Server Provider for ImHex's pattern language.
License: GNU General Public License v2.0
Language Server Provider for ImHex's pattern language.
License: GNU General Public License v2.0
The following pattern will print the first 4 bytes in imhex.
The language server will give an error: 'Missing ; [Ln5, Col 22]'
Below is a failing test for this behavior.
#include <std/io.pat>
#include <std/string.pat>
fn with_var() {
u32 placementVar @ 0x00;
std::print("variable {}", placementVar);
};
with_var();
#[test]
fn test_pattern_at_in_function() {
let test_str = "
fn func_with_at() {
u32 contents @ 0x00;
}
";
let expected_output = Expr::ExprList {
list: vec![
(
Expr::Func {
name: (String::from("func_with_at"), 0..0),
args: (vec![], 0..0),
body: spanbox!(Expr::ExprList {
list: vec![(
Expr::Definition {
value_type: (
HexTypeDef {
endianness: Endianness::Unkown,
name: (HexType::V(ValueType::U32), 0..0),
},
0..0,
),
name: blocal!("contents"),
body: bnum!(),
},
0..0,
)]
})
},
0..0,
)
],
};
let includeable_folders = vec![
String::from("~/.local/share/imhex"),
String::from("/usr/share/imhex"),
String::from("%localappdata%/imhex"),
String::from("%programfiles%/imhex"),
];
let ((ex, _), _, _) = parse(test_str, &includeable_folders);
expr_comparer(&ex, &expected_output).unwrap()
}
#include
s from the standard library display a "File not found" error. minimal reproduction:
#include "std/mem.pat"
If I write a patten like:
Foo<Bar<u8>> x@$;
Foo<Bar<Baz<u8,u16>>> y@$;
then imhex will happily accept it, but this tool treats it as a syntax error.
the following 3 errors are generated:
Missing ;
Expected } or valid struct expression
Missing ;
minimal reproduction:
struct Struct {
u8 value = 0;
};
thank u for working on this btw, sooo much nicer than editing in the ImHex editor!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.