~eda-qa/leaflang/cpp

« back to all changes in this revision

Viewing changes to src/parser/node_parser.cpp

  • Committer: edA-qa mort-ora-y
  • Date: 2017-06-03 05:03:54 UTC
  • mfrom: (98.1.18 typefixes)
  • Revision ID: eda-qa@disemia.com-20170603050354-6hfg5huvq56zjs66
merging typefixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
582
582
        }
583
583
 
584
584
        //requires special identification to avoid a trailing () to be identified as a function call
585
 
        static boost::regex re_decl( "(return|var|defn|multi|ignore|new|class)" EXCLUDE_SYMBOL_REGEX_CHAR );
 
585
        static boost::regex re_decl( "(return|var|defn|multi|ignore|new|class|service)" EXCLUDE_SYMBOL_REGEX_CHAR );
586
586
        
587
587
        if( src.match( leaf_parse::re_bool ) ) { //must be before symbol
588
588
                auto ex = make_shared<node>( node::f_literal_boolean, src.cur_location());
594
594
                
595
595
                //special parsing
596
596
                if( flags & first_token ) {
597
 
                        if( symbol == "class" ) {
598
 
                                parse_class( src );
 
597
                        if( symbol == "class" || symbol == "service" ) {
 
598
                                parse_class( symbol, src );
599
599
                                return false;
600
600
                        }
601
601
                }
780
780
        return "not reached";
781
781
}
782
782
 
783
 
void node_parser::parse_class( source & src ) {
 
783
void node_parser::parse_class( std::string style, source & src ) {
784
784
        auto csym = make_shared<node>( node::f_symbol, src.cur_location() );
785
 
        csym->text = "class";
 
785
        csym->text = style;
786
786
        push_out(csym);
787
787
        
788
788
        if( !src.has_next() || !src.match( leaf_parse::re_symbol ) ) {