"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/libponyc/ast/parser.c" between
ponyc-0.33.1.tar.gz and ponyc-0.33.2.tar.gz

About: Pony is an object-oriented, actor-model, capabilities-secure, high performance programming language.

parser.c  (ponyc-0.33.1):parser.c  (ponyc-0.33.2)
skipping to change at line 32 skipping to change at line 32
DECL(jump); DECL(jump);
DECL(assignment); DECL(assignment);
DECL(term); DECL(term);
DECL(infix); DECL(infix);
DECL(postfix); DECL(postfix);
DECL(parampattern); DECL(parampattern);
DECL(pattern); DECL(pattern);
DECL(idseq_in_seq); DECL(idseq_in_seq);
DECL(members); DECL(members);
DECL(thisliteral); DECL(thisliteral);
DECL(cond);
DECL(whileloop);
DECL(forloop);
DECL(caseatom);
DECL(caseparampattern);
/* Precedence /* Precedence
* *
* We do not support precedence of infix operators, since that leads to many * We do not support precedence of infix operators, since that leads to many
* bugs. Instead we require the use of parentheses to disambiguiate operator * bugs. Instead we require the use of parentheses to disambiguiate operator
* interactions. This is checked in the parse fix pass, so we treat all infix * interactions. This is checked in the parse fix pass, so we treat all infix
* operators as having the same precedence during parsing. * operators as having the same precedence during parsing.
* *
* Overall, the precedences built into the below grammar are as follows. * Overall, the precedences built into the below grammar are as follows.
* *
skipping to change at line 519 skipping to change at line 524
MAP_ID(TK_AT, TK_FFICALL); MAP_ID(TK_AT, TK_FFICALL);
TOKEN("ffi name", TK_ID, TK_STRING); TOKEN("ffi name", TK_ID, TK_STRING);
OPT RULE("return type", typeargs); OPT RULE("return type", typeargs);
SKIP(NULL, TK_LPAREN, TK_LPAREN_NEW); SKIP(NULL, TK_LPAREN, TK_LPAREN_NEW);
OPT RULE("ffi arguments", positional); OPT RULE("ffi arguments", positional);
OPT RULE("ffi arguments", named); OPT RULE("ffi arguments", named);
TERMINATE("ffi arguments", TK_RPAREN); TERMINATE("ffi arguments", TK_RPAREN);
OPT TOKEN(NULL, TK_QUESTION); OPT TOKEN(NULL, TK_QUESTION);
DONE(); DONE();
// ref | this | literal | tuple | array | object | lambda | barelambda | ffi | // atom
// ref | this | literal | tuple | array | object | lambda | barelambda | ffi | c
ond | whileloop | forloop
// location // location
DEF(atom); DEF(atom);
RULE("value", ref, thisliteral, literal, groupedexpr, array, object, lambda, RULE("value", ref, thisliteral, literal, groupedexpr, array, object, lambda,
barelambda, ffi, location); barelambda, ffi, location, cond, whileloop, forloop);
DONE(); DONE();
// ref | this | literal | tuple | array | object | lambda | barelambda| ffi | // caseatom:
// ref | this | literal | tuple | array | object | lambda | barelambda | ffi | w
hileloop | forloop
// location
DEF(caseatom);
RULE("value", ref, thisliteral, literal, groupedexpr, array, object, lambda,
barelambda, ffi, location, whileloop, forloop);
DONE();
// ref | this | literal | tuple | array | object | lambda | barelambda| ffi | co
nd | whileloop | forloop
// location // location
DEF(nextatom); DEF(nextatom);
RULE("value", ref, thisliteral, literal, nextgroupedexpr, nextarray, object, RULE("value", ref, thisliteral, literal, nextgroupedexpr, nextarray, object,
lambda, barelambda, ffi, location); lambda, barelambda, ffi, location, cond, whileloop, forloop);
DONE(); DONE();
// DOT ID // DOT ID
DEF(dot); DEF(dot);
INFIX_BUILD(); INFIX_BUILD();
TOKEN(NULL, TK_DOT); TOKEN(NULL, TK_DOT);
TOKEN("member name", TK_ID); TOKEN("member name", TK_ID);
DONE(); DONE();
// TILDE ID // TILDE ID
skipping to change at line 579 skipping to change at line 593
OPT TOKEN(NULL, TK_QUESTION); OPT TOKEN(NULL, TK_QUESTION);
DONE(); DONE();
// atom {dot | tilde | chain | qualify | call} // atom {dot | tilde | chain | qualify | call}
DEF(postfix); DEF(postfix);
RULE("value", atom); RULE("value", atom);
SEQ("postfix expression", dot, tilde, chain, qualify, call); SEQ("postfix expression", dot, tilde, chain, qualify, call);
DONE(); DONE();
// atom {dot | tilde | chain | qualify | call} // atom {dot | tilde | chain | qualify | call}
DEF(casepostfix);
RULE("value", caseatom);
SEQ("postfix expression", dot, tilde, chain, qualify, call);
DONE();
// atom {dot | tilde | chain | qualify | call}
DEF(nextpostfix); DEF(nextpostfix);
RULE("value", nextatom); RULE("value", nextatom);
SEQ("postfix expression", dot, tilde, chain, qualify, call); SEQ("postfix expression", dot, tilde, chain, qualify, call);
DONE(); DONE();
// (VAR | LET | EMBED | $LET) ID [COLON type] // (VAR | LET | EMBED | $LET) ID [COLON type]
DEF(local); DEF(local);
PRINT_INLINE(); PRINT_INLINE();
TOKEN(NULL, TK_VAR, TK_LET, TK_EMBED, TK_MATCH_CAPTURE); TOKEN(NULL, TK_VAR, TK_LET, TK_EMBED, TK_MATCH_CAPTURE);
TOKEN("variable name", TK_ID); TOKEN("variable name", TK_ID);
skipping to change at line 605 skipping to change at line 625
PRINT_INLINE(); PRINT_INLINE();
TOKEN("prefix", TK_NOT, TK_ADDRESS, TK_MINUS, TK_MINUS_TILDE, TK_MINUS_NEW, TOKEN("prefix", TK_NOT, TK_ADDRESS, TK_MINUS, TK_MINUS_TILDE, TK_MINUS_NEW,
TK_MINUS_TILDE_NEW, TK_DIGESTOF); TK_MINUS_TILDE_NEW, TK_DIGESTOF);
MAP_ID(TK_MINUS, TK_UNARY_MINUS); MAP_ID(TK_MINUS, TK_UNARY_MINUS);
MAP_ID(TK_MINUS_TILDE, TK_UNARY_MINUS_TILDE); MAP_ID(TK_MINUS_TILDE, TK_UNARY_MINUS_TILDE);
MAP_ID(TK_MINUS_NEW, TK_UNARY_MINUS); MAP_ID(TK_MINUS_NEW, TK_UNARY_MINUS);
MAP_ID(TK_MINUS_TILDE_NEW, TK_UNARY_MINUS_TILDE); MAP_ID(TK_MINUS_TILDE_NEW, TK_UNARY_MINUS_TILDE);
RULE("expression", parampattern); RULE("expression", parampattern);
DONE(); DONE();
// (NOT | AMP | MINUS | MINUS_TILDE | MINUS_NEW | MINUS_TILDE_NEW | DIGESTOF)
// casepattern
DEF(caseprefix);
PRINT_INLINE();
TOKEN("prefix", TK_NOT, TK_ADDRESS, TK_MINUS, TK_MINUS_TILDE, TK_MINUS_NEW,
TK_MINUS_TILDE_NEW, TK_DIGESTOF);
MAP_ID(TK_MINUS, TK_UNARY_MINUS);
MAP_ID(TK_MINUS_TILDE, TK_UNARY_MINUS_TILDE);
MAP_ID(TK_MINUS_NEW, TK_UNARY_MINUS);
MAP_ID(TK_MINUS_TILDE_NEW, TK_UNARY_MINUS_TILDE);
RULE("expression", caseparampattern);
DONE();
// (NOT | AMP | MINUS_NEW | MINUS_TILDE_NEW | DIGESTOF) pattern // (NOT | AMP | MINUS_NEW | MINUS_TILDE_NEW | DIGESTOF) pattern
DEF(nextprefix); DEF(nextprefix);
PRINT_INLINE(); PRINT_INLINE();
TOKEN("prefix", TK_NOT, TK_ADDRESS, TK_MINUS_NEW, TK_MINUS_TILDE_NEW, TOKEN("prefix", TK_NOT, TK_ADDRESS, TK_MINUS_NEW, TK_MINUS_TILDE_NEW,
TK_DIGESTOF); TK_DIGESTOF);
MAP_ID(TK_MINUS_NEW, TK_UNARY_MINUS); MAP_ID(TK_MINUS_NEW, TK_UNARY_MINUS);
MAP_ID(TK_MINUS_TILDE_NEW, TK_UNARY_MINUS_TILDE); MAP_ID(TK_MINUS_TILDE_NEW, TK_UNARY_MINUS_TILDE);
RULE("expression", parampattern); RULE("expression", parampattern);
DONE(); DONE();
// (prefix | postfix) // (prefix | postfix)
DEF(parampattern); DEF(parampattern);
RULE("pattern", prefix, postfix); RULE("pattern", prefix, postfix);
DONE(); DONE();
// (caseprefix | casepostfix)
DEF(caseparampattern);
RULE("pattern", caseprefix, casepostfix);
DONE();
// (prefix | postfix) // (prefix | postfix)
DEF(nextparampattern); DEF(nextparampattern);
RULE("pattern", nextprefix, nextpostfix); RULE("pattern", nextprefix, nextpostfix);
DONE(); DONE();
// (local | prefix | postfix) // (local | prefix | postfix)
DEF(pattern); DEF(pattern);
RULE("pattern", local, parampattern); RULE("pattern", local, parampattern);
DONE();
// (local | prefix | postfix)
DEF(casepattern);
RULE("pattern", local, caseparampattern);
DONE(); DONE();
// (local | prefix | postfix) // (local | prefix | postfix)
DEF(nextpattern); DEF(nextpattern);
RULE("pattern", local, nextparampattern); RULE("pattern", local, nextparampattern);
DONE(); DONE();
// (LPAREN | LPAREN_NEW) idseq {COMMA idseq} RPAREN // (LPAREN | LPAREN_NEW) idseq {COMMA idseq} RPAREN
DEF(idseqmulti); DEF(idseqmulti);
PRINT_INLINE(); PRINT_INLINE();
skipping to change at line 763 skipping to change at line 806
DEF(iftypeset); DEF(iftypeset);
PRINT_INLINE(); PRINT_INLINE();
TOKEN(NULL, TK_IFTYPE_SET); TOKEN(NULL, TK_IFTYPE_SET);
SCOPE(); SCOPE();
ANNOTATE(annotations); ANNOTATE(annotations);
RULE("iftype clause", iftype); RULE("iftype clause", iftype);
OPT RULE("else clause", elseiftype, elseclause); OPT RULE("else clause", elseiftype, elseclause);
TERMINATE("iftype expression", TK_END); TERMINATE("iftype expression", TK_END);
DONE(); DONE();
// PIPE [annotations] [infix] [WHERE rawseq] [ARROW rawseq] // PIPE [annotations] [infix] [IF rawseq] [ARROW rawseq]
DEF(caseexpr); DEF(caseexpr);
AST_NODE(TK_CASE); AST_NODE(TK_CASE);
SCOPE(); SCOPE();
SKIP(NULL, TK_PIPE); SKIP(NULL, TK_PIPE);
ANNOTATE(annotations); ANNOTATE(annotations);
OPT RULE("case pattern", pattern); OPT RULE("case pattern", casepattern);
IF(TK_IF, RULE("guard expression", rawseq)); IF(TK_IF, RULE("guard expression", rawseq));
IF(TK_DBLARROW, RULE("case body", rawseq)); IF(TK_DBLARROW, RULE("case body", rawseq));
DONE(); DONE();
// {caseexpr} // {caseexpr}
DEF(cases); DEF(cases);
PRINT_INLINE(); PRINT_INLINE();
AST_NODE(TK_CASES); AST_NODE(TK_CASES);
SCOPE(); // Cases a scope to simplify branch consolidation. SCOPE(); // Cases a scope to simplify branch consolidation.
SEQ("cases", caseexpr); SEQ("cases", caseexpr);
 End of changes. 11 change blocks. 
7 lines changed or deleted 53 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)