]> gitweb.factorcode.org Git - factor.git/commitdiff
Merge branch 'master' of http://factorcode.org/git/factor into native-image-loader
authorJoe Groff <arcata@gmail.com>
Wed, 7 Jul 2010 20:09:41 +0000 (13:09 -0700)
committerJoe Groff <arcata@gmail.com>
Wed, 7 Jul 2010 20:09:41 +0000 (13:09 -0700)
1  2 
basis/alien/parser/parser.factor

index baca25e07836896904fb678f4a48a1e6075627db,7d7244281978c972c992fa5f171e0481217d7fca..68d476ff29972e31b2f3206f034c686e0b23478f
@@@ -4,7 -4,7 +4,7 @@@ USING: accessors alien alien.c-types al
  assocs classes combinators combinators.short-circuit
  compiler.units effects grouping kernel parser sequences
  splitting words fry locals lexer namespaces summary math
 -vocabs.parser words.constant ;
 +vocabs.parser words.constant alien.enums ;
  IN: alien.parser
  
  SYMBOL: current-library
@@@ -32,7 -32,7 +32,7 @@@
      (parse-c-type) dup valid-c-type? [ no-c-type ] unless ;
  
  : scan-c-type ( -- c-type )
-     scan {
+     scan-token {
          { [ dup "{" = ] [ drop \ } parse-until >array ] }
          { [ dup "pointer:" = ] [ drop scan-c-type <pointer> ] }
          [ parse-c-type ]
@@@ -75,12 -75,8 +75,12 @@@ M: pointer return-type-name to>> return
      "*" ?head
      [ [ <pointer> ] dip parse-pointers ] when ;
  
 +: define-enum-value ( class value -- )
 +    enum>number "enum-value" set-word-prop ;
 +
  : next-enum-member ( members name value -- members value' )
 -    [ 2array suffix! ] [ 1 + ] bi ;
 +    [ define-enum-value ]
 +    [ [ 2array suffix! ] [ enum>number 1 + ] bi ] 2bi ;
  
  : parse-enum-name ( -- name )
      scan (CREATE-C-TYPE) dup save-location ;