Lines Matching refs:sy

54     if s.sy == 'IDENT':
63 while s.sy == 'IDENT':
66 if s.sy != ',':
79 op = s.sy
85 while s.sy in ops:
99 # s.sy == 'lambda'
102 if s.sy == ':':
126 if s.sy == 'lambda':
130 if s.sy == 'if':
142 if s.sy == 'lambda':
154 if s.sy in ops:
156 op = s.sy
171 if s.sy == 'not':
183 if s.sy in comparison_ops:
189 if s.sy in comparison_ops:
194 if s.sy == '*':
201 if s.sy == '*':
217 if s.sy in comparison_ops:
222 if s.sy == 'not':
226 elif s.sy == 'is':
228 if s.sy == 'not':
234 op = s.sy
282 sy = s.sy
283 if sy in ('+', '-', '~'):
284 op = s.sy
289 if sy == '&':
294 elif sy == "<":
296 elif sy == 'IDENT' and s.systring == "sizeof":
301 # s.sy == "<"
312 if s.sy == '?':
330 # s.sy == ident "sizeof"
349 # s.sy == "yield"
353 if s.sy == 'from':
356 if s.sy != ')' and s.sy not in statement_terminators:
369 # s.sy == "yield"
379 while s.sy in ('(', '[', '.'):
381 if s.sy == '**':
399 if s.sy == '(':
401 elif s.sy == '[':
403 else: # s.sy == '.'
413 # s.sy == '('
420 while s.sy not in ('**', ')'):
421 if s.sy == '*':
429 if s.sy == '=':
447 if s.sy != ',':
451 if s.sy == 'for':
454 elif s.sy == '**':
457 if s.sy == ',':
491 # s.sy == '('
514 # s.sy == '['
536 while s.sy == ',':
539 if s.sy == ']':
552 if s.sy != ':':
556 if s.sy != ':':
565 if s.sy not in follow_set:
602 sy = s.sy
603 if sy == '(':
605 if s.sy == ')':
607 elif s.sy == 'yield':
613 elif sy == '[':
615 elif sy == '{':
617 elif sy == '`':
619 elif sy == '.':
622 elif sy == 'INT':
624 elif sy == 'FLOAT':
628 elif sy == 'IMAG':
632 elif sy == 'BEGIN_STRING':
642 elif sy == 'IDENT':
736 if kind == 'c' or s.sy != 'BEGIN_STRING':
740 while s.sy == 'BEGIN_STRING':
761 if s.sy == 'BEGIN_STRING':
786 # s.sy == 'BEGIN_STRING'
818 sy = s.sy
820 #print "p_string_literal: sy =", sy, repr(s.systring) ###
821 if sy == 'CHARS':
825 elif sy == 'ESCAPE':
871 elif sy == 'NEWLINE':
873 elif sy == 'END_STRING':
875 elif sy == 'EOF':
879 (sy, s.systring))
904 # s.sy == '['
907 if s.sy == ']':
911 if s.sy == 'for':
920 if s.sy == ',':
929 if s.sy == 'for':
931 elif s.sy == 'if':
938 # s.sy == 'for'
946 # s.sy == 'if'
958 # s.sy == '{'
961 if s.sy == '}':
965 if s.sy == ',' or s.sy == '}':
968 while s.sy == ',':
970 if s.sy == '}':
975 elif s.sy == 'for':
983 elif s.sy == ':':
988 if s.sy == 'for':
999 while s.sy == ',':
1001 if s.sy == '}':
1017 # s.sy == '`'
1021 while s.sy == ',':
1033 while s.sy not in expr_terminators:
1035 if s.sy != ',':
1042 while s.sy not in expr_terminators:
1044 if s.sy != ',':
1055 if s.sy == ',':
1067 if s.sy == ',':
1079 if s.sy == ',':
1083 elif s.sy == 'for':
1089 # s.sy == 'for'
1104 # assume s.sy == 'global'
1118 if s.sy == '=' and expr_list[0].is_starred:
1124 while s.sy == '=':
1126 if s.sy == 'yield':
1132 if re.match(r"([+*/\%^\&|-]|<<|>>|\*\*|//)=", s.sy):
1142 operator = s.sy[:-1]
1144 if s.sy == 'yield':
1161 # s.sy == 'print'
1165 if s.sy == '>>':
1168 if s.sy == ',':
1170 ends_with_comma = s.sy in ('NEWLINE', 'EOF')
1174 if s.sy not in ('NEWLINE', 'EOF'):
1176 while s.sy == ',':
1178 if s.sy in ('NEWLINE', 'EOF'):
1188 # s.sy == 'exec'
1203 if s.sy == 'in':
1209 if s.sy == ',':
1215 # s.sy == 'del'
1230 # s.sy == 'break'
1236 # s.sy == 'continue'
1242 # s.sy == 'return'
1245 if s.sy not in statement_terminators:
1252 # s.sy == 'raise'
1259 if s.sy not in statement_terminators:
1261 if s.sy == ',':
1264 if s.sy == ',':
1267 elif s.sy == 'from':
1280 # s.sy in ('import', 'cimport')
1282 kind = s.sy
1285 while s.sy == ',':
1313 # s.sy == 'from'
1316 if s.sy == '.':
1319 while s.sy == '.':
1322 if s.sy == 'cimport':
1326 if level is not None and s.sy == 'import':
1329 elif level is not None and s.sy == 'cimport':
1335 if s.sy in ('import', 'cimport'):
1336 kind = s.sy
1343 if s.sy == '*':
1347 if s.sy == '(':
1351 while s.sy == ',':
1353 if is_parenthesized and s.sy == ')':
1419 while s.sy == '.':
1427 if s.sy == 'IDENT' and s.systring == 'as':
1434 # s.sy == 'assert'
1438 if s.sy == ',':
1448 # s.sy == 'if'
1452 while s.sy == 'elif':
1467 if s.sy == 'else':
1474 # s.sy == 'while'
1485 # s.sy == 'for'
1496 if s.sy == 'in':
1501 if s.sy == 'from':
1538 if s.sy in inequality_relations:
1539 op = s.sy
1546 if s.sy == 'IDENT' and s.systring == 'by':
1558 if s.sy == ',':
1561 while s.sy != terminator:
1563 if s.sy != ',':
1582 # s.sy == 'try'
1588 if s.sy in ('except', 'else'):
1589 while s.sy == 'except':
1591 if s.sy == 'else':
1597 if s.sy != 'finally':
1600 if s.sy == 'finally':
1609 # s.sy == 'except'
1615 if s.sy != ':':
1622 if s.sy == ',' or (s.sy == 'IDENT' and s.systring == 'as'
1626 elif s.sy == 'IDENT' and s.systring == 'as':
1671 if not s.in_python_file and s.sy == 'IDENT' and s.systring in ('nogil', 'gil'):
1674 if s.sy == ',':
1683 if s.sy == 'IDENT' and s.systring == 'as':
1686 if s.sy == ',':
1706 if s.sy == ':':
1719 #print "p_simple_statement:", s.sy, s.systring ###
1720 if s.sy == 'global':
1722 elif s.sy == 'nonlocal':
1724 elif s.sy == 'print':
1726 elif s.sy == 'exec':
1728 elif s.sy == 'del':
1730 elif s.sy == 'break':
1732 elif s.sy == 'continue':
1734 elif s.sy == 'return':
1736 elif s.sy == 'raise':
1738 elif s.sy in ('import', 'cimport'):
1740 elif s.sy == 'from':
1742 elif s.sy == 'yield':
1744 elif s.sy == 'assert':
1746 elif s.sy == 'pass':
1760 while s.sy == ';':
1763 if s.sy in ('NEWLINE', 'EOF'):
1814 if s.sy != 'ELIF':
1816 if s.sy == 'ELSE':
1830 if s.sy == 'ctypedef':
1836 elif s.sy == 'DEF':
1838 elif s.sy == 'IF':
1840 elif s.sy == 'DECORATOR':
1846 if not ctx.allow_struct_enum_decorator and s.sy not in bad_toks:
1848 elif s.sy == 'pass' and cdef_flag:
1853 if s.sy == 'cdef':
1856 elif s.sy == 'cpdef':
1876 elif s.sy == 'def':
1883 elif s.sy == 'class':
1887 elif s.sy == 'include':
1891 elif ctx.level == 'c_class' and s.sy == 'IDENT' and s.systring == 'property':
1893 elif s.sy == 'pass' and ctx.level != 'property':
1901 if s.sy == 'if':
1903 elif s.sy == 'while':
1905 elif s.sy == 'for':
1907 elif s.sy == 'try':
1909 elif s.sy == 'with':
1919 while s.sy not in ('DEDENT', 'EOF'):
1940 if s.sy == 'NEWLINE':
1963 should contain any s.sy that terminate the argument list.
1972 while s.sy not in end_sy_set:
1973 if s.sy == '*' or s.sy == '**':
1977 if s.sy == 'IDENT' and s.peek()[0] == '=':
1979 s.next() # s.sy is '='
2009 if s.sy != ',':
2010 if s.sy not in end_sy_set:
2020 if s.sy == '(':
2026 if s.sy == 'IDENT' and s.systring in calling_convention_words:
2037 # s.sy == '('
2045 if s.sy == '[':
2061 if not s.sy == 'IDENT':
2062 error(pos, "Expected an identifier, found '%s'" % s.sy)
2071 if s.sy == 'IDENT' and s.systring in special_basic_c_types:
2077 if s.sy == 'IDENT' and s.systring in basic_c_type_names:
2082 if s.sy == 'IDENT' and s.systring == 'complex':
2089 while s.sy == '.':
2096 if nonempty and s.sy != 'IDENT':
2098 if s.sy == '(':
2100 if (s.sy == '*' or s.sy == '**' or s.sy == '&'
2101 or (s.sy == 'IDENT' and s.systring in calling_convention_words)):
2107 elif s.sy not in ('*', '**', '[', '&'):
2118 if s.sy == '[':
2124 if s.sy == '.':
2132 # s.sy == '['
2142 if s.sy == '[':
2157 # s.sy == '['
2178 # s.sy == '['
2182 saved = [(s.sy, s.systring)]
2187 elif s.sy == 'INT':
2188 saved.append((s.sy, s.systring))
2190 if s.sy == ':':
2199 # s.sy == '['
2215 return s.sy == 'IDENT' and not s.systring in calling_convention_words
2220 elif s.sy == 'IDENT':
2226 while s.sy == '.':
2231 saved = s.sy, s.systring
2232 if s.sy == 'IDENT':
2234 elif s.sy == '*' or s.sy == '**':
2236 is_type = s.sy in (')', ']')
2238 elif s.sy == '(':
2240 is_type = s.sy == '*'
2242 elif s.sy == '[':
2244 is_type = s.sy == ']'
2258 #print "looking_at_base_type?", s.sy, s.systring, s.position()
2259 return s.sy == 'IDENT' and s.systring in base_type_start_words
2262 if s.sy == 'IDENT':
2265 result = s.sy == '.'
2310 while s.sy == 'IDENT' and s.systring in sign_and_longness_words:
2339 if s.sy == '(':
2341 if s.sy == ')' or looking_at_name(s):
2353 if not calling_convention_allowed and result.calling_convention and s.sy != '(':
2356 while s.sy in ('[', '('):
2358 if s.sy == '[':
2360 else: # sy == '('
2369 if s.sy != ']':
2401 if s.sy == '*':
2418 elif s.sy == '**': # scanner returns this as a single token
2426 elif s.sy == '&':
2434 if s.sy == 'IDENT':
2440 if name != 'operator' and s.sy == '=' and assignable:
2451 op = s.sy
2461 elif op in ('-', '+', '|', '&') and s.sy == op:
2464 elif s.sy == '=':
2465 op += s.sy # +=, -=, ...
2477 if s.sy == 'IDENT' and s.systring == 'nogil':
2484 if s.sy == 'with':
2494 if s.sy == 'except':
2496 if s.sy == '*':
2499 elif s.sy == '+':
2502 if s.sy == 'IDENT':
2507 if s.sy == '?':
2521 while s.sy not in c_arg_list_terminators:
2525 if s.sy != ',':
2532 if s.sy == '.':
2554 if s.sy in ('not', 'or') and not s.in_python_file:
2555 kind = s.sy
2557 if s.sy == 'IDENT' and s.systring == 'None':
2565 if annotated and s.sy == ':':
2568 if s.sy == '=':
2571 if s.sy not in ['*', '?']:
2587 if s.sy == 'IDENT' and s.systring == 'api':
2600 if (ctx.visibility == 'extern') and s.sy == 'from':
2602 elif s.sy == 'import':
2610 elif s.sy == ':':
2614 elif s.sy == 'class':
2620 elif s.sy == 'IDENT' and s.systring == 'cppclass':
2622 elif s.sy == 'IDENT' and s.systring in struct_enum_union:
2628 elif s.sy == 'IDENT' and s.systring == 'fused':
2641 if s.sy == '*':
2658 # s.sy == ident 'enum'
2660 if s.sy == 'IDENT':
2672 if s.sy != 'NEWLINE':
2677 while s.sy not in ('DEDENT', 'EOF'):
2686 if s.sy != 'pass':
2688 while s.sy == ',':
2690 if s.sy in ('NEWLINE', 'EOF'):
2704 if s.sy == '=':
2715 if s.sy != 'IDENT' or s.systring != 'struct':
2717 # s.sy == ident 'struct' or 'union'
2725 if s.sy == ':':
2731 while s.sy != 'DEDENT':
2732 if s.sy != 'pass':
2764 while s.sy != 'DEDENT':
2765 if s.sy != 'pass':
2789 if s.sy == 'IDENT' and s.systring in ('extern', 'public', 'readonly'):
2798 if s.sy == 'IDENT' and s.systring in ('inline',):
2811 if s.sy == 'IDENT' and s.systring == 'const' and ctx.level == 'cpp_class':
2816 if s.sy == ':':
2836 while s.sy == ',':
2838 if s.sy == 'NEWLINE':
2861 # s.sy == 'ctypedef'
2869 if s.sy == 'class':
2871 elif s.sy == 'IDENT' and s.systring in struct_enum_union:
2873 elif s.sy == 'IDENT' and s.systring == 'fused':
2887 while s.sy == 'DECORATOR':
2897 if s.sy == '(':
2904 # s.sy == 'def'
2914 if s.sy == '->':
2928 if s.sy == '*':
2930 if s.sy == 'IDENT':
2932 if s.sy == ',':
2936 elif s.sy != terminator:
2938 if s.sy == '**':
2947 if annotated and s.sy == ':':
2953 # s.sy == 'class'
2961 if s.sy == '(':
2979 # s.sy == 'class'
2983 while s.sy == '.':
2989 if module_path and s.sy == 'IDENT' and s.systring == 'as':
2998 if s.sy == '(':
3001 while s.sy == '.':
3004 if s.sy == ',':
3009 if s.sy == '[':
3013 if s.sy == ':':
3061 if s.sy != 'IDENT':
3069 if s.sy != ',':
3089 if s.sy == 'BEGIN_STRING':
3092 if s.sy != 'EOF':
3099 if s.sy == 'BEGIN_STRING':
3102 if s.sy != 'EOF':
3149 if s.sy != 'EOF':
3151 repr(s.sy), repr(s.systring)))
3159 while s.sy == 'commentline':
3187 if s.sy != 'EOF':
3189 repr(s.sy), repr(s.systring)))
3195 # s.sy == 'cppclass'
3202 if s.sy == '.':
3204 if s.sy == '[':
3207 while s.sy == ',':
3213 if s.sy == '(':
3216 while s.sy == ',':
3222 if s.sy == '[':
3225 if s.sy == ':':
3232 while s.sy != 'DEDENT':
3236 elif s.sy != 'pass':