diff options
| author | Mike Buland <mike@xagasoft.com> | 2026-06-13 00:21:12 -0700 |
|---|---|---|
| committer | Mike Buland <mike@xagasoft.com> | 2026-06-13 00:21:12 -0700 |
| commit | 6188fa4c32160846908e4ff7654c4ff7bc177797 (patch) | |
| tree | dcd14f050f579809ac5c05116759c2e764ac9448 /src/parser.rs | |
| parent | 3c9a65f0a576397024c76bcc33950796ec3297ec (diff) | |
| download | crimtag-6188fa4c32160846908e4ff7654c4ff7bc177797.tar.gz crimtag-6188fa4c32160846908e4ff7654c4ff7bc177797.tar.bz2 crimtag-6188fa4c32160846908e4ff7654c4ff7bc177797.tar.xz crimtag-6188fa4c32160846908e4ff7654c4ff7bc177797.zip | |
Adding root access in identifiers.
There's an issue, it doesn't compile yet.
Diffstat (limited to 'src/parser.rs')
| -rw-r--r-- | src/parser.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/parser.rs b/src/parser.rs index fff00b1..d1fe4d7 100644 --- a/src/parser.rs +++ b/src/parser.rs | |||
| @@ -360,7 +360,7 @@ impl Parser { | |||
| 360 | tb.add_param( ParamValue::Literal(s.to_string()) ); | 360 | tb.add_param( ParamValue::Literal(s.to_string()) ); |
| 361 | ctx.next(); | 361 | ctx.next(); |
| 362 | } | 362 | } |
| 363 | SymbolType::Token(_) => { | 363 | SymbolType::Token(_) | SymbolType::Sharp => { |
| 364 | if ctx.peek().is("tag data", |s| *s == SymbolType::Equals)? { | 364 | if ctx.peek().is("tag data", |s| *s == SymbolType::Equals)? { |
| 365 | break; | 365 | break; |
| 366 | } | 366 | } |
| @@ -377,6 +377,10 @@ impl Parser { | |||
| 377 | fn parse_identifier(&self, ctx: &mut Context ) -> CrimResult<ParamValue> { | 377 | fn parse_identifier(&self, ctx: &mut Context ) -> CrimResult<ParamValue> { |
| 378 | let mut id = Identifier::new(); | 378 | let mut id = Identifier::new(); |
| 379 | 379 | ||
| 380 | if ctx.cur().is("identifier",|s| matches!( s, SymbolType::Sharp))? { | ||
| 381 | id.push( IdentifierValue::Root ); | ||
| 382 | ctx.next(); | ||
| 383 | } | ||
| 380 | loop { | 384 | loop { |
| 381 | if ctx.cur().is("identifier",|s| matches!( s, SymbolType::Token(_) ))? { | 385 | if ctx.cur().is("identifier",|s| matches!( s, SymbolType::Token(_) ))? { |
| 382 | if let SymbolType::Token(s) = ctx.cur().unwrap().symbol() { | 386 | if let SymbolType::Token(s) = ctx.cur().unwrap().symbol() { |
