mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	libsolidity/parsing/Scanner.cpp and libsolidity/parsing/Scanner.h Fix #4627 and PR #5003. - Add multiline comment test - Add upper case hex literal test - Add test for unicode escapes - Add test for strings with escaped newlines - Add test for string escapes - Add test for strings that do not terminate before end of file - Add test for unterminated blocks
		
			
				
	
	
		
			32 lines
		
	
	
		
			785 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			785 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
contract test {
 | 
						|
 | 
						|
    function oneByteUTF8() public pure returns (bytes32) {
 | 
						|
        bytes32 usdollar = "aaa\u0024aaa";
 | 
						|
        return usdollar;
 | 
						|
    }
 | 
						|
 | 
						|
    function twoBytesUTF8() public pure returns (bytes32) {
 | 
						|
        bytes32 cent = "aaa\u00A2aaa";
 | 
						|
        return cent;
 | 
						|
    }
 | 
						|
 | 
						|
    function threeBytesUTF8() public pure returns (bytes32) {
 | 
						|
        bytes32 eur = "aaa\u20ACaaa";
 | 
						|
        return  eur;
 | 
						|
    }
 | 
						|
 | 
						|
    function together() public pure returns (bytes32) {
 | 
						|
        bytes32 res = "\u0024\u00A2\u20AC";
 | 
						|
        return res;
 | 
						|
    }
 | 
						|
 | 
						|
    // this function returns an invalid unicode character
 | 
						|
    function invalidLiteral() public pure returns(bytes32) {
 | 
						|
        bytes32 invalid = "\u00xx";
 | 
						|
        return invalid;
 | 
						|
    }
 | 
						|
 | 
						|
}
 | 
						|
// ----
 | 
						|
// ParserError: (678-681): Expected primary expression.
 |