pike.git / src / cpp.cmod

version» Context lines:

pike.git/src/cpp.cmod:729:    *! @example    *! @code    *! #if !constant(Yp)    *! #error Support for NIS not available.    *! #endif    *! @endcode    *!    *! @seealso    *! @[#warning]    */ +  PIKEFUN string(0..0) directive_error(int flags, string line) +  { +  struct CPP_struct *this = THIS;    -  +  if (OUTP()) { +  cpp_error_sprintf(this, "%O", Pike_sp - 1); +  } +  push_empty_string(); +  } +    /*! @directive #warning    *!    *! Generate a warning during preprocessing.    *!    *! This directive causes a cpp warning, it can be used to notify    *! the user that certain functions are missing and similar things.    *!    *! @example    *! @code    *! #if !constant(Yp)    *! #warning Support for NIS not available. Some features may not work.    *! #endif    *! @endcode    *!    *! @seealso    *! @[#error]    */ -  +  PIKEFUN string(0..0) directive_warning(int flags, string line) +  { +  struct CPP_struct *this = THIS;    -  +  if (OUTP()) { +  cpp_warning(this, "%O", Pike_sp - 1); +  } +  push_empty_string(); +  } +    /*! @directive #include    *!    *! @[#include] is used to insert the contents of another file into    *! the processed file at the place of the include directive.    *!    *! Files can be referenced either by absolute or relative path from the    *! source file, or searched for in the include paths.    *!    *! To include a file with absolute or relative path, use double quotes,    *! e.g. @tt{#include "constants.pike"@} or @tt{#include "../debug.h"@}.
pike.git/src/cpp.cmod:2095:   static const char line_[] = { 'l', 'i', 'n', 'e' };   static const char string_[] = { 's', 't', 'r', 'i', 'n', 'g' };   static const char include_[] = { 'i', 'n', 'c', 'l', 'u', 'd', 'e' };   static const char if_[] = { 'i', 'f' };   static const char ifdef_[] = { 'i', 'f', 'd', 'e', 'f' };   static const char ifndef_[] = { 'i', 'f', 'n', 'd', 'e', 'f' };   static const char endif_[] = { 'e', 'n', 'd', 'i', 'f' };   static const char else_[] = { 'e', 'l', 's', 'e' };   static const char elseif_[] = { 'e', 'l', 's', 'e', 'i', 'f' };   static const char elif_[] = { 'e', 'l', 'i', 'f' }; - static const char error_[] = { 'e', 'r', 'r', 'o', 'r' }; +    static const char define_[] = { 'd', 'e', 'f', 'i', 'n', 'e' };   static const char undef_[] = { 'u', 'n', 'd', 'e', 'f' };   static const char undefine_[] = { 'u', 'n', 'd', 'e', 'f', 'i', 'n', 'e' };   static const char charset_[] = { 'c', 'h', 'a', 'r', 's', 'e', 't' };   static const char pragma_[] = { 'p', 'r', 'a', 'g', 'm', 'a' };   static const char pike_[] = { 'p', 'i', 'k', 'e' };   static const char require_[] = { 'r', 'e', 'q', 'u', 'i', 'r', 'e' }; - static const char warning_[] = { 'w', 'a', 'r', 'n', 'i', 'n', 'g' }; +    static const char lsh_[] = { '<', '<' };   static const char rsh_[] = { '>', '>' };      static int begins_with( const char *prefix, const PCHARP stack, int len, int remain, int whole )   {    int i;    if( len > remain )    return 0;       for( i=0; i<len; i++ )
pike.git/src/cpp.cmod:3746:    calc(this,MKPCHARP_STR(tmp.s),tmp.s->len,0,0);    free_string_builder(&tmp);    if(!SAFE_IS_ZERO(Pike_sp-1)) flags&=~CPP_NO_OUTPUT;    pop_stack();    } else {    FIND_EOL();    flags |= CPP_NO_OUTPUT | CPP_REALLY_NO_OUTPUT;    }    break;    } -  -  if(GOBBLE_WORD(error_)) -  { -  ptrdiff_t foo; -  -  SKIPSPACE(); -  foo=pos; -  FIND_EOL(); -  if(OUTP()) -  { -  push_string(make_shared_binary_pcharp(ADD_PCHARP(data,foo), pos-foo)); -  cpp_error_sprintf(this, "%O", Pike_sp-1); +     } -  break; -  } -  } +     goto unknown_preprocessor_directive;       case 'd': /* define */    {       if(GOBBLE_WORD(define_))    {    struct string_builder str;    INT32 argno=-1;    ptrdiff_t tmp3;
pike.git/src/cpp.cmod:4170:       calc(this,MKPCHARP_STR(tmp.s),tmp.s->len,0,0);    if(SAFE_IS_ZERO(Pike_sp-1)) this->dependencies_fail=1;    pop_stack();    free_string_builder(&tmp);    if(this->dependencies_fail) return pos;    break;    }    goto unknown_preprocessor_directive;    } -  case 'w': /* warning */ -  { -  if(GOBBLE_WORD(warning_)) -  { -  ptrdiff_t foo; -  -  SKIPSPACE(); -  foo=pos; -  FIND_EOL(); -  if(OUTP()) -  { -  push_string(make_shared_binary_pcharp(ADD_PCHARP(data,foo), pos-foo)); -  cpp_warning(this, "%O", Pike_sp-1); -  } -  break; -  } -  goto unknown_preprocessor_directive; -  } +     default:    unknown_preprocessor_directive:    {    struct pike_string *directive = GOBBLE_IDENTIFIER();    if (directive) {    struct svalue *fun = NULL;    struct svalue sv;    struct pike_string *directive_string =    add_shared_strings(MK_STRING("directive_"), directive);    int id = find_shared_string_identifier(directive_string,