Menu

JWasm v2.08pre

Greenhorn
2012-08-05
2013-04-20
  • Greenhorn

    Greenhorn - 2012-08-05

    Hi Japhet,

    I get with JWasm v2.08pre(08/05/2012) an error "Error A2062: Too many tokens in a line" for this code:

    _CUSTCOL struct
        cr      COLORREF    ?
        szName  LPTSTR  ?
    _CUSTCOL ends
    CUSTCOL _CUSTCOL    { RGB(255, 255, 255),   cstrAutomatic },
                    { RGB(  0,   0,   0),   cstrBlack },
                    { RGB(255, 255, 255),   cstrWhite },
                    { RGB(128,   0,   0),   cstrMaroon },
                    { RGB(  0, 128,   0),   cstrDarkGreen },
                    { RGB(128, 128,   0),   cstrOlive },
                    { RGB(  0,   0, 128),   cstrAquamarine },
                    { RGB(128,   0, 128),   cstrPurple },
                    { RGB(  0, 128, 128),   cstrDarkBlue },
                    { RGB(196, 196, 196),   cstrLightGrey },
                    { RGB(128, 128, 128),   cstrDarkGrey },
                    { RGB(255,   0,   0),   cstrRed },
                    { RGB(  0, 255,   0),   cstrGreen },
                    { RGB(255, 255,   0),   cstrYellow },
                    { RGB(  0,   0, 255),   cstrBlue },
                    { RGB(255,   0, 255),   cstrMagenta },
                    { RGB(  0, 255, 255),   cstrCyan }
    

    Listing:

    00000000                        _CUSTCOL struct
    00000000                            cr      COLORREF    ?
    00000008                            szName  LPTSTR  ?
    00000010                        _CUSTCOL ends
    00000038                        CUSTCOL _CUSTCOL    { RGB(255, 255, 255),   cstrAutomatic },  { RGB(  0,   0,   0), cstrBlack },  { RGB(255, 255, 255), cstrWhite },  { RGB(128,   0,   0), cstrMaroon },  { RGB(  0, 128,   0),    cstrDarkGreen },  { RGB(128, 128,   0), cstrOlive },  { RGB(  0,   0, 128), cstrAquamarine },  { RGB(128,   0, 128),    cstrPurple },  { RGB(  0, 128, 128),    cstrDarkBlue },  { RGB(196, 196, 196),  cstrLightGrey },  { RGB(128, 128, 128), cstrDarkGrey },  { RGB(255,   0,   0),  cstrRed }, \
                               Error A2062: Too many tokens in a line
    00000038                                        { ( ( ( ( 0 )  or  ( ( ( 255 ) )  shl  8 ) )  or  ( ( ( 0 ) )  shl  16 ) ) ) ,  cstrGreen },  { ( ( ( ( 255 )  or  ( ( ( 255 ) )  shl  8 ) )  or  ( ( ( 0 ) )  shl  16 ) ) ) ,  cstrYellow },  { ( ( ( ( 0 )  or  ( ( ( 0 ) )  shl  8 ) )  or  ( ( ( 255 ) )  shl  16 ) ) ) ,   cstrBlue },  { ( ( ( ( 255 )  or  ( ( ( 0 ) )  shl  8 ) )  or  ( ( ( 255 ) )  shl  16 ) ) ) ,   cstrMagenta },  { ( ( ( ( 0 )  or  ( ( ( 255 ) )  shl  8 ) )  or  ( ( ( 255 ) )  shl  16 ) ) ) ,    cstrCyan }
                               Error A2062: Too many tokens in a line
                               Error A2209: Syntax error:
    

    Regards
    Greenhorn

     
  • Greenhorn

    Greenhorn - 2012-08-05

    Here's the rest of repuired data for testing (incl. tchar.inc) …

    cstrAutomatic   TCHAR   _T("Automatisch"), 00h
    cstrBlack       TCHAR   _T("Schwarz"), 00h
    cstrWhite       TCHAR   _T("Weiß"), 00h
    cstrMaroon  TCHAR   _T("Dunkelrot"), 00h
    cstrDarkGreen   TCHAR   _T("Grün"), 00h
    cstrOlive       TCHAR   _T("Oliv"), 00h
    cstrAquamarine  TCHAR   _T("Marineblau"), 00h
    cstrPurple  TCHAR   _T("Violett"), 00h
    cstrDarkBlue    TCHAR   _T("Blaugrün"), 00h
    cstrLightGrey   TCHAR   _T("Hellgrau"), 00h
    cstrDarkGrey    TCHAR   _T("Grau"), 00h
    cstrRed     TCHAR   _T("Rot"), 00h
    cstrGreen       TCHAR   _T("Gelbgrün"), 00h
    cstrYellow  TCHAR   _T("Gelb"), 00h
    cstrBlue        TCHAR   _T("Blau"), 00h
    cstrMagenta TCHAR   _T("Magenta"), 00h
    cstrCyan        TCHAR   _T("Zyan"), 00h
    
     
  • japheth

    japheth - 2012-08-05

    I'm afraid this is "expected behavior" due to an intended change. The {} will no longer define a literal ( like the <> ), but just enclose a "set of tokens". Since the number of tokens in a line is limited to 150 currently, your line exceeds the limit by far.

    The change in the semantics was done because the previous implementation was not quite Masm-compatible ( Masm also won't accept your line! ).

    You'll have to modify your source. The easiest workaround is to use <> instead of {}:

    < RGB( 0, 0, 0), cstrBlack >,
    < RGB(255, 255, 255), cstrWhite >,

    { RGB(255, 255, 255), cstrWhite },

     
  • japheth

    japheth - 2012-08-06

    a bit more investigation did convince me that I'll have to revert the change and restore the {}-literals again.

     
  • Greenhorn

    Greenhorn - 2012-08-07

    Thanks for the quick reply and fix, japheth.

    But now I get an "A2168: General Failure" wich points to the last line of the structure array.
    The listing file looks fine without any error messages.

    Used JWasm RC1.

    Greenhorn

     
  • japheth

    japheth - 2012-08-08

    > But now I get an "A2168: General Failure" wich points to the last line of the structure array.

    You'll have to provide a full test case then. Because for me there is no such error, using exactly the same version.
    Here's the full source that I feed to jwasm, I managed to reconstruct this from your first test case snippets:

        .386
        .model flat
        .data
    TCHAR typedef BYTE
    _T macro x:vararg
        exitm <x>
    endm
    cstrAutomatic TCHAR _T("Automatisch"),00h
    cstrBlack TCHAR _T("Schwarz"), 00h
    cstrWhite TCHAR _T("Weiß"), 00h
    cstrMaroon TCHAR _T("Dunkelrot"), 00h
    cstrDarkGreen TCHAR _T("Grün"), 00h
    cstrOlive TCHAR _T("Oliv"), 00h
    cstrAquamarine TCHAR _T("Marineblau"), 00h
    cstrPurple TCHAR _T("Violett"), 00h
    cstrDarkBlue TCHAR _T("Blaugrün"), 00h
    cstrLightGrey TCHAR _T("Hellgrau"), 00h
    cstrDarkGrey TCHAR _T("Grau"), 00h
    cstrRed TCHAR _T("Rot"), 00h
    cstrGreen TCHAR _T("Gelbgrün"), 00h
    cstrYellow TCHAR _T("Gelb"), 00h
    cstrBlue TCHAR _T("Blau"), 00h
    cstrMagenta TCHAR _T("Magenta"), 00h
    cstrCyan TCHAR _T("Zyan"), 00h 
    COLORREF  typedef DWORD
    LPTSTR    typedef ptr WORD
    _CUSTCOL struct
    cr COLORREF ?
    szName LPTSTR ?
    _CUSTCOL ends 
    RGB macro r,g,b
        exitm <( ( ( ( r )  or  ( ( ( g ) )  shl  8 ) )  or  ( ( ( b ) )  shl  16 ) ) )>
        endm
    CUSTCOL _CUSTCOL { RGB(255, 255, 255), cstrAutomatic },
                     { RGB( 0, 0, 0), cstrBlack }, 
                     { RGB(255, 255, 255), cstrWhite }, 
                     { RGB(128, 0, 0), cstrMaroon }, 
                     { RGB( 0, 128, 0), cstrDarkGreen }, 
                     { RGB(128, 128, 0), cstrOlive }, 
                     { RGB( 0, 0, 128), cstrAquamarine }, 
                     { RGB(128, 0, 128), cstrPurple },
                     { RGB( 0, 128, 128), cstrDarkBlue },
                     { RGB(196, 196, 196), cstrLightGrey },
                     { RGB(128, 128, 128), cstrDarkGrey },
                     { RGB(255, 0, 0), cstrRed },
                     { RGB( 0, 255, 0), cstrGreen },
                     { RGB(255, 255, 0), cstrYellow }, 
                     { RGB( 0, 0, 255), cstrBlue }, 
                     { RGB(255, 0, 255), cstrMagenta }, 
                     { RGB( 0, 255, 255), cstrCyan } 
    end
    
     
  • Greenhorn

    Greenhorn - 2012-08-08

    I made a Bug Tracker and attached the corresponding file.

     

Log in to post a comment.