Sfoglia il codice sorgente

Fix parsing of `SimpleName`s

`name_string` is one of those combinators that doesn't parse nicely if it
comes across something it doesn't fit. This is unfortunate, but comes up
when a parser has to accept so much. Anyway, we should parse the easy
Locals and Args first, then fall back to NameString if neither work.
Isaac Woods 4 anni fa
parent
commit
f8e4124bd5
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      aml/src/name_object.rs

+ 2 - 2
aml/src/name_object.rs

@@ -45,9 +45,9 @@ where
         DebugVerbosity::AllScopes,
         "SimpleName",
         choice!(
-            name_string().map(move |name| Ok(Target::Name(name))),
             arg_obj().map(|arg_num| Ok(Target::Arg(arg_num))),
-            local_obj().map(|local_num| Ok(Target::Local(local_num)))
+            local_obj().map(|local_num| Ok(Target::Local(local_num))),
+            name_string().map(move |name| Ok(Target::Name(name)))
         ),
     )
 }