lexer_kit 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Cargo.lock +265 -0
- data/Cargo.toml +37 -0
- data/README.md +7 -3
- data/crates/lexer_kit_core/Cargo.toml +17 -0
- data/crates/lexer_kit_core/src/dfa.rs +437 -0
- data/crates/lexer_kit_core/src/format.rs +599 -0
- data/crates/lexer_kit_core/src/lib.rs +18 -0
- data/{ext/lexer_kit_rust → crates/lexer_kit_core}/src/opcodes.rs +375 -1
- data/{ext/lexer_kit_rust → crates/lexer_kit_core}/src/safety_test.rs +21 -16
- data/crates/lexer_kit_core/src/token_buffer.rs +130 -0
- data/{ext/lexer_kit_rust → crates/lexer_kit_core}/src/trie.rs +37 -1
- data/{ext/lexer_kit_rust → crates/lexer_kit_core}/src/types.rs +1 -1
- data/{ext/lexer_kit_rust → crates/lexer_kit_core}/src/vm.rs +165 -2
- data/ext/lexer_kit_rust/Cargo.toml +7 -3
- data/ext/lexer_kit_rust/src/fast_stream.rs +101 -438
- data/ext/lexer_kit_rust/src/lib.rs +200 -215
- data/lib/lexer_kit/builder/compiler.rb +50 -15
- data/lib/lexer_kit/builder/conflict_detector.rb +18 -20
- data/lib/lexer_kit/builder/validator.rb +45 -0
- data/lib/lexer_kit/builder.rb +34 -7
- data/lib/lexer_kit/cli/commands.rb +17 -7
- data/lib/lexer_kit/core/source.rb +3 -2
- data/lib/lexer_kit/debug/disassembler.rb +0 -2
- data/lib/lexer_kit/dfa/dfa_builder.rb +1 -1
- data/lib/lexer_kit/dfa/dfa_minimizer.rb +2 -2
- data/lib/lexer_kit/dfa/regex_ast.rb +4 -0
- data/lib/lexer_kit/dfa/regex_parser.rb +41 -8
- data/lib/lexer_kit/errors.rb +2 -2
- data/lib/lexer_kit/format/lkb1.rb +3 -3
- data/lib/lexer_kit/format/lkt1.rb +3 -1
- data/lib/lexer_kit/format.rb +4 -4
- data/lib/lexer_kit/ir/compiled_program.rb +39 -26
- data/lib/lexer_kit/ir/constant_pool.rb +33 -11
- data/lib/lexer_kit/ir/dfa_table.rb +9 -19
- data/lib/lexer_kit/ir/instruction.rb +3 -0
- data/lib/lexer_kit/ir/jump_table.rb +3 -13
- data/lib/lexer_kit/ir/keyword_table.rb +0 -9
- data/lib/lexer_kit/ir/limits.rb +48 -0
- data/lib/lexer_kit/ir/serializer.rb +69 -30
- data/lib/lexer_kit/ir.rb +1 -0
- data/lib/lexer_kit/trie.rb +1 -1
- data/lib/lexer_kit/version.rb +1 -1
- data/lib/lexer_kit.rb +20 -2
- data/vendor/nupur/Cargo.toml +24 -0
- data/vendor/nupur/LICENSE +176 -0
- data/vendor/nupur/NOTICE +64 -0
- data/vendor/nupur/README.ja.md +150 -0
- data/vendor/nupur/README.md +257 -0
- data/vendor/nupur/src/abi.rs +143 -0
- data/vendor/nupur/src/args.rs +318 -0
- data/vendor/nupur/src/build.rs +101 -0
- data/vendor/nupur/src/caught.rs +171 -0
- data/vendor/nupur/src/cname.rs +37 -0
- data/vendor/nupur/src/describe.rs +175 -0
- data/vendor/nupur/src/encoding.rs +240 -0
- data/vendor/nupur/src/gvl.rs +181 -0
- data/vendor/nupur/src/hash.rs +52 -0
- data/vendor/nupur/src/inject.rs +20 -0
- data/vendor/nupur/src/lib.rs +280 -0
- data/vendor/nupur/src/lint_probe.rs +142 -0
- data/vendor/nupur/src/msg.rs +193 -0
- data/vendor/nupur/src/no_unwind.rs +39 -0
- data/vendor/nupur/src/raw/check.rs +71 -0
- data/vendor/nupur/src/raw/data.rs +28 -0
- data/vendor/nupur/src/raw/define.rs +215 -0
- data/vendor/nupur/src/raw/exception.rs +69 -0
- data/vendor/nupur/src/raw/iterate.rs +115 -0
- data/vendor/nupur/src/raw/mod.rs +105 -0
- data/vendor/nupur/src/raw/protect.rs +144 -0
- data/vendor/nupur/src/raw/string.rs +148 -0
- data/vendor/nupur/src/raw/symbol.rs +38 -0
- data/vendor/nupur/src/raw/values.rs +293 -0
- data/vendor/nupur/src/rb/call.rs +118 -0
- data/vendor/nupur/src/rb/class.rs +170 -0
- data/vendor/nupur/src/rb/convert.rs +134 -0
- data/vendor/nupur/src/rb/error.rs +355 -0
- data/vendor/nupur/src/rb/global.rs +141 -0
- data/vendor/nupur/src/rb/kept.rs +55 -0
- data/vendor/nupur/src/rb/method/frame.rs +81 -0
- data/vendor/nupur/src/rb/method.rs +468 -0
- data/vendor/nupur/src/rb/mod.rs +40 -0
- data/vendor/nupur/src/rb/object.rs +66 -0
- data/vendor/nupur/src/rb/ruby.rs +107 -0
- data/vendor/nupur/src/rb/value/header.rs +65 -0
- data/vendor/nupur/src/rb/value/id.rs +61 -0
- data/vendor/nupur/src/rb/value/integer.rs +132 -0
- data/vendor/nupur/src/rb/value.rs +454 -0
- data/vendor/nupur/src/stack.rs +32 -0
- data/vendor/nupur/src/string/make.rs +234 -0
- data/vendor/nupur/src/string/mod.rs +24 -0
- data/vendor/nupur/src/string/read.rs +411 -0
- data/vendor/nupur/src/table.rs +58 -0
- data/vendor/nupur/src/typed/callbacks.rs +125 -0
- data/vendor/nupur/src/typed/data_type.rs +132 -0
- data/vendor/nupur/src/typed/embedded.rs +103 -0
- data/vendor/nupur/src/typed/external.rs +76 -0
- data/vendor/nupur/src/typed/hidden.rs +95 -0
- data/vendor/nupur/src/typed/mod.rs +373 -0
- data/vendor/nupur/src/utf8_copy.rs +262 -0
- data/vendor/nupur/sys/Cargo.toml +29 -0
- data/vendor/nupur/sys/src/data_type.rs +213 -0
- data/vendor/nupur/sys/src/int.rs +248 -0
- data/vendor/nupur/sys/src/lib.rs +61 -0
- data/vendor/nupur/sys/src/lint_probe.rs +93 -0
- data/vendor/nupur/sys/src/no_unwind.rs +99 -0
- data/vendor/nupur/sys/src/non_raising.rs +585 -0
- data/vendor/nupur/sys/src/protect.rs +349 -0
- data/vendor/nupur/sys/src/raising.rs +257 -0
- data/vendor/nupur/sys/src/value.rs +279 -0
- data/vendor/nupur.sha256 +68 -0
- metadata +102 -8
- data/ext/lexer_kit_rust/src/deserializer.rs +0 -213
- data/ext/lexer_kit_rust/src/dfa.rs +0 -217
|
@@ -44,7 +44,7 @@ fn read_u16(bytes: &[u8]) -> u16 {
|
|
|
44
44
|
///
|
|
45
45
|
/// Returns None if no match, Some(TrieMatch) on match.
|
|
46
46
|
pub fn run(trie: &[u8], input: &[u8]) -> Option<TrieMatch> {
|
|
47
|
-
//
|
|
47
|
+
// The header is 8 bytes; each node read below is bounds-checked
|
|
48
48
|
if trie.len() < 8 {
|
|
49
49
|
return None;
|
|
50
50
|
}
|
|
@@ -123,6 +123,42 @@ pub fn run(trie: &[u8], input: &[u8]) -> Option<TrieMatch> {
|
|
|
123
123
|
best
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
+
// Kani proof: verify trie::run is memory-safe on arbitrary (malformed) trie
|
|
127
|
+
// bytes. The sister of DfaTable::run's memory-safety proof; the functional
|
|
128
|
+
// longest-match / first-wins property stays in formal/tla/TrieRun.tla.
|
|
129
|
+
// Run with: cargo kani
|
|
130
|
+
#[cfg(kani)]
|
|
131
|
+
mod kani_proofs {
|
|
132
|
+
use super::*;
|
|
133
|
+
|
|
134
|
+
/// trie::run never panics or indexes out of bounds for any trie byte buffer
|
|
135
|
+
/// and any input (the header, node and edge offsets are all bounds-checked),
|
|
136
|
+
/// and any returned match length is within the input.
|
|
137
|
+
#[kani::proof]
|
|
138
|
+
#[kani::unwind(6)]
|
|
139
|
+
fn run_is_memory_safe() {
|
|
140
|
+
const TN: usize = 20; // symbolic trie bytes (header + one node)
|
|
141
|
+
const IN: usize = 2; // symbolic input bytes
|
|
142
|
+
|
|
143
|
+
// Whole arrays are symbolic (no init loop, so the unwind bound only has
|
|
144
|
+
// to cover trie::run's own loops).
|
|
145
|
+
let trie_buf: [u8; TN] = kani::any();
|
|
146
|
+
let tlen: usize = kani::any();
|
|
147
|
+
kani::assume(tlen <= TN);
|
|
148
|
+
let trie = &trie_buf[..tlen];
|
|
149
|
+
|
|
150
|
+
let in_buf: [u8; IN] = kani::any();
|
|
151
|
+
let ilen: usize = kani::any();
|
|
152
|
+
kani::assume(ilen <= IN);
|
|
153
|
+
let input = &in_buf[..ilen];
|
|
154
|
+
|
|
155
|
+
// Kani checks panic/OOB automatically; assert the match stays in bounds.
|
|
156
|
+
if let Some(m) = run(trie, input) {
|
|
157
|
+
assert!(m.length <= input.len());
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
126
162
|
#[cfg(test)]
|
|
127
163
|
mod tests {
|
|
128
164
|
use super::*;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//! Core data structures for the LexerKit Rust VM
|
|
2
2
|
//!
|
|
3
|
-
//!
|
|
3
|
+
//! The tables are the in-memory forms of what `format::decode_program` reads (docs/ir-spec.md 4.7).
|
|
4
4
|
|
|
5
5
|
/// DFA special values
|
|
6
6
|
pub const DFA_DEAD_STATE: u16 = 0;
|
|
@@ -32,6 +32,11 @@ pub enum StepResult {
|
|
|
32
32
|
/// Execute one token step of the VM
|
|
33
33
|
///
|
|
34
34
|
/// This function executes instructions until a token is emitted or the VM halts.
|
|
35
|
+
/// `HALT` and running off the end of the instructions end normally; every other halt sets
|
|
36
|
+
/// `vm.error`.
|
|
37
|
+
///
|
|
38
|
+
/// The step budget counts instructions since input was last consumed: a skipped token
|
|
39
|
+
/// moves `mark` and starts a new budget, so a long run of skipped tokens is not cut short.
|
|
35
40
|
pub fn step(vm: &mut VmState) -> StepResult {
|
|
36
41
|
let mut step_count = 0u32;
|
|
37
42
|
|
|
@@ -42,6 +47,8 @@ pub fn step(vm: &mut VmState) -> StepResult {
|
|
|
42
47
|
|
|
43
48
|
step_count += 1;
|
|
44
49
|
if step_count > MAX_STEPS_PER_TOKEN {
|
|
50
|
+
vm.error =
|
|
51
|
+
Some("step limit exceeded: the program ran too long without consuming input");
|
|
45
52
|
return StepResult::Halt;
|
|
46
53
|
}
|
|
47
54
|
|
|
@@ -50,6 +57,7 @@ pub fn step(vm: &mut VmState) -> StepResult {
|
|
|
50
57
|
return StepResult::Halt;
|
|
51
58
|
}
|
|
52
59
|
|
|
60
|
+
let mark = vm.mark;
|
|
53
61
|
let (result, emit) = opcodes::execute(vm, opcode, arg);
|
|
54
62
|
|
|
55
63
|
match result {
|
|
@@ -59,9 +67,19 @@ pub fn step(vm: &mut VmState) -> StepResult {
|
|
|
59
67
|
}
|
|
60
68
|
}
|
|
61
69
|
VmResult::Halt => {
|
|
70
|
+
if vm.error.is_none() {
|
|
71
|
+
vm.error = Some("invalid program: unknown opcode or jump target out of range");
|
|
72
|
+
}
|
|
62
73
|
return StepResult::Halt;
|
|
63
74
|
}
|
|
64
|
-
VmResult::Continue => {
|
|
75
|
+
VmResult::Continue => {
|
|
76
|
+
// Only a mark that moved forward inside the input starts a new budget: a
|
|
77
|
+
// malformed program can move it past the end (COMMIT_BEST of a stale best
|
|
78
|
+
// match) without reading input, and must not loop forever.
|
|
79
|
+
if vm.mark > mark && vm.mark <= vm.bytes.len() {
|
|
80
|
+
step_count = 0;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
65
83
|
}
|
|
66
84
|
}
|
|
67
85
|
|
|
@@ -72,6 +90,12 @@ pub fn step(vm: &mut VmState) -> StepResult {
|
|
|
72
90
|
///
|
|
73
91
|
/// This is the batch collection function that avoids Ruby boundary crossings.
|
|
74
92
|
/// Returns Err with error message if VM encounters a runtime error.
|
|
93
|
+
///
|
|
94
|
+
/// 形式仕様: 実行ループ全体の性質は多ステップ・統合のため Kani では扱えず、
|
|
95
|
+
/// TLA+ が担保する — formal/tla/Progress.tla (停止性), ModeEmit.tla (モード x EMIT),
|
|
96
|
+
/// EndToEnd.tla (トークン列全体)。加えて spec/formal_conformance_spec.rb が
|
|
97
|
+
/// EndToEnd.tla の具体例を実パイプラインで検証する。この走査ループの意味を
|
|
98
|
+
/// 変える場合は上記を見直すこと。
|
|
75
99
|
pub fn collect_tokens(
|
|
76
100
|
prog: &CompiledProgram,
|
|
77
101
|
bytes: &[u8],
|
|
@@ -150,7 +174,7 @@ impl<'a> Iterator for TokenIterator<'a> {
|
|
|
150
174
|
#[cfg(test)]
|
|
151
175
|
mod tests {
|
|
152
176
|
use super::*;
|
|
153
|
-
use crate::types::{DfaTable, Instruction, Mode};
|
|
177
|
+
use crate::types::{DfaTable, Instruction, KeywordEntry, KeywordTable, Mode};
|
|
154
178
|
|
|
155
179
|
fn create_simple_program() -> CompiledProgram {
|
|
156
180
|
// Create a simple program that matches "a" and emits token 1
|
|
@@ -246,6 +270,145 @@ mod tests {
|
|
|
246
270
|
assert_eq!(tokens.len(), 0);
|
|
247
271
|
}
|
|
248
272
|
|
|
273
|
+
fn ins(opcode: u8, arg: u32) -> Instruction {
|
|
274
|
+
Instruction {
|
|
275
|
+
opcode,
|
|
276
|
+
arg_hi: (arg >> 16) as u8,
|
|
277
|
+
arg_mid: (arg >> 8) as u8,
|
|
278
|
+
arg_lo: arg as u8,
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/// `dfa=upper, fail=lower` for the packed opcodes.
|
|
283
|
+
fn packed(upper: u32, lower: u32) -> u32 {
|
|
284
|
+
(upper << 14) | lower
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/// A DFA that matches one `byte`, or with `plus` a run of them.
|
|
288
|
+
fn dfa_byte(byte: u8, plus: bool) -> DfaTable {
|
|
289
|
+
let mut dfa = DfaTable::new();
|
|
290
|
+
dfa.state_count = 3;
|
|
291
|
+
dfa.class_count = 2;
|
|
292
|
+
dfa.byte_class = vec![0; 256];
|
|
293
|
+
dfa.byte_class[byte as usize] = 1;
|
|
294
|
+
dfa.transitions = vec![0, 0, 0, 2, 0, if plus { 2 } else { 0 }];
|
|
295
|
+
dfa.accept_tokens = vec![0xFFFF, 0xFFFF, 1];
|
|
296
|
+
dfa
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/// Skips each `a` as its own token, emits runs of `b` as token 8, and halts on anything else.
|
|
300
|
+
/// With `keywords`, a keyword lookup runs before the skip, as the compiler emits it.
|
|
301
|
+
fn skip_a_emit_b(keywords: bool) -> CompiledProgram {
|
|
302
|
+
let mut prog = CompiledProgram::new();
|
|
303
|
+
prog.dfa_tables.push(dfa_byte(b'a', false));
|
|
304
|
+
prog.dfa_tables.push(dfa_byte(b'b', true));
|
|
305
|
+
let mut kt = KeywordTable::new(9);
|
|
306
|
+
kt.entries.push(KeywordEntry {
|
|
307
|
+
keyword: b"a".to_vec(),
|
|
308
|
+
token_id: 10,
|
|
309
|
+
});
|
|
310
|
+
prog.keyword_tables.push(kt);
|
|
311
|
+
let lookup = if keywords {
|
|
312
|
+
ins(opcodes::OP_KEYWORD_LOOKUP, 0)
|
|
313
|
+
} else {
|
|
314
|
+
ins(opcodes::OP_JUMP, 4)
|
|
315
|
+
};
|
|
316
|
+
prog.instructions = vec![
|
|
317
|
+
ins(opcodes::OP_JUMP_IF_EOF, 8), // 0
|
|
318
|
+
ins(opcodes::OP_MARK, 0), // 1
|
|
319
|
+
ins(opcodes::OP_DFA_RUN_IF_MATCH, packed(0, 5)), // 2
|
|
320
|
+
lookup, // 3
|
|
321
|
+
ins(opcodes::OP_EMIT_SKIP_AND_JUMP, 0), // 4
|
|
322
|
+
ins(opcodes::OP_DFA_RUN_IF_MATCH, packed(1, 8)), // 5
|
|
323
|
+
ins(opcodes::OP_EMIT, 8), // 6
|
|
324
|
+
ins(opcodes::OP_JUMP, 0), // 7
|
|
325
|
+
ins(opcodes::OP_HALT, 0), // 8
|
|
326
|
+
];
|
|
327
|
+
prog.modes.push(Mode { start_offset: 0 });
|
|
328
|
+
prog
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
#[test]
|
|
332
|
+
fn test_many_skipped_tokens_keep_the_rest_of_the_input() {
|
|
333
|
+
let prog = skip_a_emit_b(false);
|
|
334
|
+
let input = "a".repeat(20_000) + "bb";
|
|
335
|
+
let tokens = collect_tokens(&prog, input.as_bytes()).unwrap();
|
|
336
|
+
assert_eq!(tokens, vec![(8, 20_000, 2)]);
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
#[test]
|
|
340
|
+
fn test_skipped_keyword_does_not_rename_the_next_token() {
|
|
341
|
+
let prog = skip_a_emit_b(true);
|
|
342
|
+
let tokens = collect_tokens(&prog, b"ab").unwrap();
|
|
343
|
+
assert_eq!(tokens, vec![(8, 1, 1)]);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
#[test]
|
|
347
|
+
fn test_loop_without_progress_is_an_error() {
|
|
348
|
+
let mut prog = CompiledProgram::new();
|
|
349
|
+
prog.instructions = vec![ins(opcodes::OP_JUMP, 0)];
|
|
350
|
+
prog.modes.push(Mode { start_offset: 0 });
|
|
351
|
+
assert!(collect_tokens(&prog, b"x").is_err());
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
#[test]
|
|
355
|
+
fn test_zero_length_tokens_forever_is_an_error() {
|
|
356
|
+
let mut prog = CompiledProgram::new();
|
|
357
|
+
prog.instructions = vec![ins(opcodes::OP_EMIT, 8), ins(opcodes::OP_JUMP, 0)];
|
|
358
|
+
prog.modes.push(Mode { start_offset: 0 });
|
|
359
|
+
assert!(collect_tokens(&prog, b"x").is_err());
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
#[test]
|
|
363
|
+
fn test_bad_jump_target_is_an_error() {
|
|
364
|
+
let mut prog = CompiledProgram::new();
|
|
365
|
+
prog.instructions = vec![ins(opcodes::OP_JUMP, 99)];
|
|
366
|
+
prog.modes.push(Mode { start_offset: 0 });
|
|
367
|
+
assert!(collect_tokens(&prog, b"x").is_err());
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
#[test]
|
|
371
|
+
fn test_unknown_opcode_is_an_error() {
|
|
372
|
+
let mut prog = CompiledProgram::new();
|
|
373
|
+
prog.instructions = vec![ins(0xEE, 0)];
|
|
374
|
+
prog.modes.push(Mode { start_offset: 0 });
|
|
375
|
+
assert!(collect_tokens(&prog, b"x").is_err());
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
/// A stale best match committed again and again moves `mark` past the input without
|
|
379
|
+
/// reading it: the step budget must still end the loop.
|
|
380
|
+
#[test]
|
|
381
|
+
fn test_commit_past_the_input_is_an_error() {
|
|
382
|
+
let mut prog = CompiledProgram::new();
|
|
383
|
+
prog.dfa_tables.push(dfa_byte(b'a', false));
|
|
384
|
+
prog.instructions = vec![
|
|
385
|
+
ins(opcodes::OP_MARK, 0), // 0
|
|
386
|
+
ins(opcodes::OP_DFA_RUN, 0), // 1
|
|
387
|
+
ins(opcodes::OP_SET_MATCH, packed(0, 3)), // 2
|
|
388
|
+
ins(opcodes::OP_MARK, 0), // 3
|
|
389
|
+
ins(opcodes::OP_COMMIT_BEST, 3), // 4
|
|
390
|
+
];
|
|
391
|
+
prog.modes.push(Mode { start_offset: 0 });
|
|
392
|
+
assert!(collect_tokens(&prog, b"a").is_err());
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
/// A commit of a best match that ends past the input stops instead of moving `pos` there.
|
|
396
|
+
#[test]
|
|
397
|
+
fn test_commit_beyond_the_input_is_an_error() {
|
|
398
|
+
let mut prog = CompiledProgram::new();
|
|
399
|
+
prog.dfa_tables.push(dfa_byte(b'a', false));
|
|
400
|
+
prog.instructions = vec![
|
|
401
|
+
ins(opcodes::OP_MARK, 0), // 0
|
|
402
|
+
ins(opcodes::OP_DFA_RUN, 0), // 1
|
|
403
|
+
ins(opcodes::OP_SET_MATCH, packed(0, 4)), // 2
|
|
404
|
+
ins(opcodes::OP_COMMIT_BEST, 4), // 3
|
|
405
|
+
ins(opcodes::OP_EMIT, 8), // 4
|
|
406
|
+
ins(opcodes::OP_JUMP, 3), // 5
|
|
407
|
+
];
|
|
408
|
+
prog.modes.push(Mode { start_offset: 0 });
|
|
409
|
+
assert!(collect_tokens(&prog, b"a").is_err());
|
|
410
|
+
}
|
|
411
|
+
|
|
249
412
|
#[test]
|
|
250
413
|
fn test_token_iterator() {
|
|
251
414
|
let prog = create_simple_program();
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
name = "lexer_kit_rust"
|
|
3
3
|
version = "0.1.0"
|
|
4
4
|
edition = "2021"
|
|
5
|
+
rust-version = "1.95"
|
|
5
6
|
authors = ["LexerKit Authors"]
|
|
6
7
|
license = "MIT"
|
|
7
8
|
publish = false
|
|
@@ -9,9 +10,12 @@ publish = false
|
|
|
9
10
|
[lib]
|
|
10
11
|
crate-type = ["cdylib"]
|
|
11
12
|
|
|
13
|
+
[lints]
|
|
14
|
+
workspace = true
|
|
15
|
+
|
|
12
16
|
[dependencies]
|
|
13
|
-
|
|
14
|
-
rb-sys
|
|
15
|
-
|
|
17
|
+
lexer_kit_core = { path = "../../crates/lexer_kit_core" }
|
|
18
|
+
# Everything that touches Ruby goes through Nupur: this crate names neither rb-sys nor magnus.
|
|
19
|
+
nupur = { path = "../../vendor/nupur" }
|
|
16
20
|
|
|
17
21
|
# Profile settings are in workspace root Cargo.toml
|