Module: RubyLexer::MacroMixin
- Defined in:
- lib/macro.rb
Instance Method Summary collapse
-
#callsite_symbol(x) ⇒ Object
———————————–.
-
#caret(ch) ⇒ Object
———————————–.
-
#keyword_macro(*args) ⇒ Object
def keyword_v(*args,&block) _keyword_funclike(*args,&block) end #was.
-
#keyword_v(str, offset, result) ⇒ Object
———————————–.
-
#method_params? ⇒ Boolean
———————————–.
-
#rubylexer_modules_init ⇒ Object
———————————–.
-
#symbol_or_op(ch) ⇒ Object
———————————–.
Instance Method Details
#callsite_symbol(x) ⇒ Object
901 902 903 904 |
# File 'lib/macro.rb', line 901 def callsite_symbol(x) #is this even needed? return if nextchar==?( super end |
#caret(ch) ⇒ Object
889 890 891 892 893 894 895 896 897 898 |
# File 'lib/macro.rb', line 889 def caret(ch) #match /^=?/ (^ or ^=) (maybe unary ^ too) #is this even needed? if @last_token_maybe_implicit&&@last_token_maybe_implicit.ident=='(' or unary_op_expected?(ch) result=OperatorToken.new(read(1),input_position) result.unary=true result else super end end |
#keyword_macro(*args) ⇒ Object
def keyword_v(*args,&block) _keyword_funclike(*args,&block) end #was
845 846 847 |
# File 'lib/macro.rb', line 845 def keyword_macro(*args) keywords_def(*args) end |
#keyword_v(str, offset, result) ⇒ Object
871 872 873 874 875 |
# File 'lib/macro.rb', line 871 def keyword_v(str,offset,result) result[0]=OperatorToken.new("v",offset) @parsestack<<VContext.new(@linenum) return result end |
#method_params? ⇒ Boolean
850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 |
# File 'lib/macro.rb', line 850 def method_params? lasttok=last_token_maybe_implicit #last_operative_token return super unless lasttok case lasttok.ident when ';' if VContext===@parsestack.last @parsestack.pop true #else super #need this here...? I think not .... end when ')' @moretokens<<KeywordToken.new("<doubled-parens>") @parsestack.pop if VContext===@parsestack.last true when '.' true else super end end |
#rubylexer_modules_init ⇒ Object
835 836 837 838 839 840 841 842 |
# File 'lib/macro.rb', line 835 def rubylexer_modules_init super @unary_or_binary_chars.add '^' @always_binary_chars.remove '^' # @FUNCLIKE_KEYWORDS=FUNCLIKE_KEYWORDS @FUNCLIKE_KEYWORDS unless @FUNCLIKE_KEYWORDS==="v" #was end |
#symbol_or_op(ch) ⇒ Object
878 879 880 881 882 883 884 885 886 |
# File 'lib/macro.rb', line 878 def symbol_or_op(ch) #is this even needed? startpos= input_position if readahead(2)==":(" result= OperatorToken.new(read(1), startpos) result.unary=true return result end super end |