lua5.2支持中文方法

备注下,以后用到了再直接贴-- llex.c里面修改

      default: {



        if (lislalpha(ls->current)||ls->current == '_'|| ls->current > 0x80) {  /* identifier or reserved word? */

            TString *ts;

            do {

                if(ls->current > 0x80){

                    save_and_next(ls);

                    save_and_next(ls);

                }else

                    save_and_next(ls);

            } while (lislalnum(ls->current)||ls->current == '_'||ls->current > 0x80);



        //修改以下代码以实现支持中文

        //if (lislalpha(ls->current)) {  /* identifier or reserved word? */

        //  TString *ts;

        //  do {

        //    save_and_next(ls);

        //  } while (lislalnum(ls->current));

 

你可能感兴趣的:(lua)