ソースを参照

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 年 前
コミット
f8e4124bd5
1 ファイル変更2 行追加2 行削除
  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)))
         ),
     )
 }