- Timestamp:
- Feb 16, 2020, 11:04:38 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 8725c74
- Parents:
- 103c292
- Location:
- tests
- Files:
-
- 1 added
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
tests/userLiterals.cfa
r103c292 rc9f4cf8 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // user _literals.cfa --7 // userLiterals.cfa -- 8 8 // 9 9 // Author : Peter A. Buhr 10 10 // Created On : Wed Sep 6 21:40:50 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Dec 4 22:03:10 201813 // Update Count : 5612 // Last Modified On : Sun Feb 16 22:59:21 2020 13 // Update Count : 72 14 14 // 15 15 … … 24 24 int ?`__thingy_( int x ) { sout | "_thingy_" | x; return x; } 25 25 26 int ?`s( const char * s ) { sout | "s ecs" | s; return 0; }27 int ?`m( const char16_t * m ) { sout | "m ins" | m; return 0;}28 int ?`h( const char32_t * h ) { sout | "h ours" | h; return 0; }26 int ?`s( const char * s ) { sout | "s" | s; return 0; } 27 int ?`m( const char16_t * m ) { sout | "m" | m; return 0;} 28 int ?`h( const char32_t * h ) { sout | "h" | h; return 0; } 29 29 int ?`_A_( const wchar_t * str ) { sout | "_A_" | str; return 0; } 30 30 int ?`__thingy_( const char * str ) { sout | "_thingy_" | str; return 0; } … … 37 37 return (Weight){ l.stones + r.stones }; 38 38 } 39 ofstream & ?|?( ofstream & os, Weight w ) { return os | w.stones; } 39 ofstream & ?|?( ofstream & os, Weight w ) { return os | wd(1,1, w.stones); } 40 void ?|?( ofstream & os, Weight w ) { (ofstream)(os | w); ends( os ); } 40 41 41 42 Weight ?`st( double w ) { return (Weight){ w }; } // backquote for user literals … … 60 61 sout | w; 61 62 62 // 0`secs;63 0`s; 63 64 1`s; 64 65 23`s; … … 82 83 83 84 "abc"`s; 84 //u"abc"`m;85 //U_"abc"`h;86 //L"abc"`_A_;85 u"abc"`m; 86 U_"abc"`h; 87 L"abc"`_A_; 87 88 u8_"abc"`__thingy_; 88 89 } // main … … 90 91 // Local Variables: // 91 92 // tab-width: 4 // 92 // compile-command: "cfa user _literals.cfa" //93 // compile-command: "cfa userLiterals.cfa" // 93 94 // End: //
Note: See TracChangeset
for help on using the changeset viewer.