zevv / xpeg

Experimental PEG library for Elixir
30 stars 4 forks source link

Problems using 0.9.0 #10

Closed CharlesIrvineKC closed 4 months ago

CharlesIrvineKC commented 4 months ago

If I create a new Elixir project with:

$ mix new parser

And then invoke "mix compile" I get:

parser % mix deps.get
Resolving Hex dependencies...
Resolution completed in 0.009s
New:
  xpeg 0.9.0
* Getting xpeg (Hex package)
parser % mix compile
==> xpeg
Compiling 6 files (.ex)
     ╭─────────────»────────────╮                                                                
s o──┴─┬─{" ","\t","\r","\n"}─┬─┴──o                                                             
       ╰───────────«──────────╯                                                                  

true o──"true"─»─fn()──o                                                                         

false o──"false"─»─fn()──o                                                                       

null o──"null"─»─fn()──o                                                                         

xdigit o──{"0".."9","a".."f","A".."F"}──o                                                        

unicode_escape o──~c"u"─»─:xdigit─»─:xdigit─»─:xdigit─»─:xdigit──o                               

escape o──~c"\\"─»─┬─{"\"","\\","/","b","f","n","r","t"}──┬──o                                   
                   ╰─:unicode_escape──────────────────────╯                                      

                                 ╭─────────────────────────────»─────────────────────────────╮   
               ╭──────»──────╮   │                                         ╭──────»──────╮   │   
string_body o──┴─┬─:escape─┬─┴─»─┴─┬─┬─!{"\\"}─»─!{"\""}─»─{" ".."\d"}─┬─»─┴─┬─:escape─┬─┴─┬─┴──o
                 ╰────«────╯       │ ╰────────────────«────────────────╯     ╰────«────╯   │     
                                   ╰───────────────────────────«───────────────────────────╯     

string o──~c"\""─»─:string_body─»─~c"\""──o                                                      

minus o──~c"-"──o                                                                                

int_part o──┬─~c"0"────────────────────────────┬──o                                              
            │              ╭────────»───────╮  │                                                 
            ╰─{"1".."9"}─»─┴─┬─{"0".."9"}─┬─┴──╯                                                 
                             ╰──────«─────╯                                                      

fract_part o──"."─»─┬─{"0".."9"}─┬──o                                                            
                    ╰──────«─────╯                                                               

                        ╭─────»─────╮                                                            
exp_part o──{"e","E"}─»─┴─{"+","-"}─┴─»─┬─{"0".."9"}─┬──o                                        
                                        ╰──────«─────╯                                           

          ╭────»───╮               ╭──────»──────╮   ╭─────»─────╮                               
number o──┴─:minus─┴─»─:int_part─»─┴─:fract_part─┴─»─┴─:exp_part─┴──o                            

obj_pair o──:s─»─:string─»─:s─»─":"─»─:value─»─fn()──o                                           

                                       ╭──────────»──────────╮                                   
object o──~c"{"─»─fn()─»─┬─:obj_pair─»─┴─┬─","─»─:obj_pair─┬─┴──┬─»─"}"──o                       
                         │               ╰────────«────────╯    │                                
                         ╰─:s───────────────────────────────────╯                                

array_elem o──:value─»─fn()──o                                                                   

                                      ╭───────────»───────────╮                                  
array o──"["─»─fn()─»─┬─:array_elem─»─┴─┬─","─»─:array_elem─┬─┴──┬─»─"]"─»─fn()──o               
                      │                 ╰─────────«─────────╯    │                               
                      ╰─:s───────────────────────────────────────╯                               

value o──:s─»─┬─:number──┬─»─:s──o                                                               
              ├─:string──┤                                                                       
              ├─:object──┤                                                                       
              ├─:array───┤                                                                       
              ├─true─────┤                                                                       
              ├─false────┤                                                                       
              ╰─:null────╯                                                                       

json o──:value─»─![1]──o                                                                         
dict o──┬─~c"a"──┬──o
        ├─~c"b"──┤   
        ╰─~c"c"──╯   
dict:
  0 :choice 3 7
  1 :chr 97
  2 :commit
  3 :choice 6 7
  4 :chr 98
  5 :commit
  6 :chr 99
  7 :return
  fail :fail
    warning: variable "a" is unused (if the variable is not meant to be used, prefix it with an underscore)
    │
 98 │       IO.inspect(a = 42)
    │                  ~
    │
    └─ lib/test1.ex:98:18: Test1.wop/0

     warning: variable "a" is unused (if the variable is not meant to be used, prefix it with an underscore)
     │
 106 │     a = Poison.decode!(s)
     │     ~
     │
     └─ lib/test1.ex:106:5: Test1.compare/0

     warning: variable "a" is unused (there is a variable with the same name in the context, use the pin operator (^) to match on it or prefix this variable with underscore if it is not meant to be used)
     │
 111 │     a = Jason.decode!(s)
     │     ~
     │
     └─ lib/test1.ex:111:5: Test1.compare/0

    error: undefined variable "self"
    │
 89 │     {:ok, pid} = Task.start(__MODULE__, :dump, [self, %{}])
    │                                                 ^^^^
    │
    └─ lib/test1.ex:89:49: Test1.wap/1

== Compilation error in file lib/test1.ex ==
** (CompileError) lib/test1.ex: cannot compile module Test1 (errors have been logged)

could not compile dependency :xpeg, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile xpeg --force", update it with "mix deps.update xpeg" or clean it with "mix deps.clean xpeg"
zevv commented 4 months ago

Thanks for reporting; it seems I did my hex release from a non-clean directory with some test files lingering around.

I just released 0.9.1 which should fix your issue, sorry for the mess.

CharlesIrvineKC commented 4 months ago

fixed. thanks