Model lexer: Fix remaining issues
This commit is contained in:
parent
e5e343aeb7
commit
13bc8afa4b
57 changed files with 102 additions and 179 deletions
|
@ -12,7 +12,7 @@ javac *.java
|
||||||
rustc -O verify.rs
|
rustc -O verify.rs
|
||||||
for file in ../*/**.rs; do
|
for file in ../*/**.rs; do
|
||||||
echo $file;
|
echo $file;
|
||||||
grun RustLexer tokens -tokens < $file | ./verify $file RustLexer.tokens || break
|
grun RustLexer tokens -tokens < "$file" | ./verify "$file" RustLexer.tokens || break
|
||||||
done
|
done
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,12 @@
|
||||||
lexer grammar RustLexer;
|
lexer grammar RustLexer;
|
||||||
|
|
||||||
|
@lexer::members {
|
||||||
|
public boolean is_at(int pos) {
|
||||||
|
return _input.index() == pos;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
tokens {
|
tokens {
|
||||||
EQ, LT, LE, EQEQ, NE, GE, GT, ANDAND, OROR, NOT, TILDE, PLUT,
|
EQ, LT, LE, EQEQ, NE, GE, GT, ANDAND, OROR, NOT, TILDE, PLUT,
|
||||||
MINUS, STAR, SLASH, PERCENT, CARET, AND, OR, SHL, SHR, BINOP,
|
MINUS, STAR, SLASH, PERCENT, CARET, AND, OR, SHL, SHR, BINOP,
|
||||||
|
@ -8,7 +15,7 @@ tokens {
|
||||||
LBRACE, RBRACE, POUND, DOLLAR, UNDERSCORE, LIT_CHAR,
|
LBRACE, RBRACE, POUND, DOLLAR, UNDERSCORE, LIT_CHAR,
|
||||||
LIT_INTEGER, LIT_FLOAT, LIT_STR, LIT_STR_RAW, LIT_BINARY,
|
LIT_INTEGER, LIT_FLOAT, LIT_STR, LIT_STR_RAW, LIT_BINARY,
|
||||||
LIT_BINARY_RAW, IDENT, LIFETIME, WHITESPACE, DOC_COMMENT,
|
LIT_BINARY_RAW, IDENT, LIFETIME, WHITESPACE, DOC_COMMENT,
|
||||||
COMMENT
|
COMMENT, SHEBANG
|
||||||
}
|
}
|
||||||
|
|
||||||
import xidstart , xidcontinue;
|
import xidstart , xidcontinue;
|
||||||
|
@ -86,85 +93,54 @@ fragment CHAR_ESCAPE
|
||||||
| [xX] HEXIT HEXIT
|
| [xX] HEXIT HEXIT
|
||||||
| 'u' HEXIT HEXIT HEXIT HEXIT
|
| 'u' HEXIT HEXIT HEXIT HEXIT
|
||||||
| 'U' HEXIT HEXIT HEXIT HEXIT HEXIT HEXIT HEXIT HEXIT
|
| 'U' HEXIT HEXIT HEXIT HEXIT HEXIT HEXIT HEXIT HEXIT
|
||||||
|
| 'u{' HEXIT '}'
|
||||||
|
| 'u{' HEXIT HEXIT '}'
|
||||||
|
| 'u{' HEXIT HEXIT HEXIT '}'
|
||||||
|
| 'u{' HEXIT HEXIT HEXIT HEXIT '}'
|
||||||
|
| 'u{' HEXIT HEXIT HEXIT HEXIT HEXIT '}'
|
||||||
|
| 'u{' HEXIT HEXIT HEXIT HEXIT HEXIT HEXIT '}'
|
||||||
;
|
;
|
||||||
|
|
||||||
fragment SUFFIX
|
fragment SUFFIX
|
||||||
: IDENT
|
: IDENT
|
||||||
;
|
;
|
||||||
|
|
||||||
|
fragment INTEGER_SUFFIX
|
||||||
|
: { _input.LA(1) != 'e' && _input.LA(1) != 'E' }? SUFFIX
|
||||||
|
;
|
||||||
|
|
||||||
LIT_CHAR
|
LIT_CHAR
|
||||||
: '\'' ( '\\' CHAR_ESCAPE | ~[\\'\n\t\r] | '\ud800' .. '\udbff' '\udc00' .. '\udfff' ) '\'' SUFFIX?
|
: '\'' ( '\\' CHAR_ESCAPE
|
||||||
|
| ~[\\'\n\t\r]
|
||||||
|
| '\ud800' .. '\udbff' '\udc00' .. '\udfff'
|
||||||
|
)
|
||||||
|
'\'' SUFFIX?
|
||||||
;
|
;
|
||||||
|
|
||||||
LIT_BYTE
|
LIT_BYTE
|
||||||
: 'b\'' ( '\\' ( [xX] HEXIT HEXIT | [nrt\\'"0] ) | ~[\\'\n\t\r] ) '\'' SUFFIX?
|
: 'b\'' ( '\\' ( [xX] HEXIT HEXIT
|
||||||
|
| [nrt\\'"0] )
|
||||||
|
| ~[\\'\n\t\r] '\udc00'..'\udfff'?
|
||||||
|
)
|
||||||
|
'\'' SUFFIX?
|
||||||
;
|
;
|
||||||
|
|
||||||
LIT_INTEGER
|
LIT_INTEGER
|
||||||
: [0-9][0-9_]* SUFFIX?
|
|
||||||
| '0b' [01][01_]* SUFFIX?
|
: [0-9][0-9_]* INTEGER_SUFFIX?
|
||||||
| '0o' [0-7][0-7_]* SUFFIX?
|
| '0b' [01_]+ INTEGER_SUFFIX?
|
||||||
| '0x' [0-9a-fA-F][0-9a-fA-F_]* SUFFIX?
|
| '0o' [0-7_]+ INTEGER_SUFFIX?
|
||||||
|
| '0x' [0-9a-fA-F_]+ INTEGER_SUFFIX?
|
||||||
;
|
;
|
||||||
|
|
||||||
LIT_FLOAT
|
LIT_FLOAT
|
||||||
: [0-9][0-9_]* ('.' {
|
: [0-9][0-9_]* ('.' {
|
||||||
/* dot followed by another dot is a range, no float */
|
/* dot followed by another dot is a range, not a float */
|
||||||
_input.LA(1) != '.' &&
|
_input.LA(1) != '.' &&
|
||||||
/* dot followed by an identifier is an integer with a function call, no float */
|
/* dot followed by an identifier is an integer with a function call, not a float */
|
||||||
_input.LA(1) != '_' &&
|
_input.LA(1) != '_' &&
|
||||||
_input.LA(1) != 'a' &&
|
!(_input.LA(1) >= 'a' && _input.LA(1) <= 'z') &&
|
||||||
_input.LA(1) != 'b' &&
|
!(_input.LA(1) >= 'A' && _input.LA(1) <= 'Z')
|
||||||
_input.LA(1) != 'c' &&
|
|
||||||
_input.LA(1) != 'd' &&
|
|
||||||
_input.LA(1) != 'e' &&
|
|
||||||
_input.LA(1) != 'f' &&
|
|
||||||
_input.LA(1) != 'g' &&
|
|
||||||
_input.LA(1) != 'h' &&
|
|
||||||
_input.LA(1) != 'i' &&
|
|
||||||
_input.LA(1) != 'j' &&
|
|
||||||
_input.LA(1) != 'k' &&
|
|
||||||
_input.LA(1) != 'l' &&
|
|
||||||
_input.LA(1) != 'm' &&
|
|
||||||
_input.LA(1) != 'n' &&
|
|
||||||
_input.LA(1) != 'o' &&
|
|
||||||
_input.LA(1) != 'p' &&
|
|
||||||
_input.LA(1) != 'q' &&
|
|
||||||
_input.LA(1) != 'r' &&
|
|
||||||
_input.LA(1) != 's' &&
|
|
||||||
_input.LA(1) != 't' &&
|
|
||||||
_input.LA(1) != 'u' &&
|
|
||||||
_input.LA(1) != 'v' &&
|
|
||||||
_input.LA(1) != 'w' &&
|
|
||||||
_input.LA(1) != 'x' &&
|
|
||||||
_input.LA(1) != 'y' &&
|
|
||||||
_input.LA(1) != 'z' &&
|
|
||||||
_input.LA(1) != 'A' &&
|
|
||||||
_input.LA(1) != 'B' &&
|
|
||||||
_input.LA(1) != 'C' &&
|
|
||||||
_input.LA(1) != 'D' &&
|
|
||||||
_input.LA(1) != 'E' &&
|
|
||||||
_input.LA(1) != 'F' &&
|
|
||||||
_input.LA(1) != 'G' &&
|
|
||||||
_input.LA(1) != 'H' &&
|
|
||||||
_input.LA(1) != 'I' &&
|
|
||||||
_input.LA(1) != 'J' &&
|
|
||||||
_input.LA(1) != 'K' &&
|
|
||||||
_input.LA(1) != 'L' &&
|
|
||||||
_input.LA(1) != 'M' &&
|
|
||||||
_input.LA(1) != 'N' &&
|
|
||||||
_input.LA(1) != 'O' &&
|
|
||||||
_input.LA(1) != 'P' &&
|
|
||||||
_input.LA(1) != 'Q' &&
|
|
||||||
_input.LA(1) != 'R' &&
|
|
||||||
_input.LA(1) != 'S' &&
|
|
||||||
_input.LA(1) != 'T' &&
|
|
||||||
_input.LA(1) != 'U' &&
|
|
||||||
_input.LA(1) != 'V' &&
|
|
||||||
_input.LA(1) != 'W' &&
|
|
||||||
_input.LA(1) != 'X' &&
|
|
||||||
_input.LA(1) != 'Y' &&
|
|
||||||
_input.LA(1) != 'Z'
|
|
||||||
}? | ('.' [0-9][0-9_]*)? ([eE] [-+]? [0-9][0-9_]*)? SUFFIX?)
|
}? | ('.' [0-9][0-9_]*)? ([eE] [-+]? [0-9][0-9_]*)? SUFFIX?)
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -172,8 +148,8 @@ LIT_STR
|
||||||
: '"' ('\\\n' | '\\\r\n' | '\\' CHAR_ESCAPE | .)*? '"' SUFFIX?
|
: '"' ('\\\n' | '\\\r\n' | '\\' CHAR_ESCAPE | .)*? '"' SUFFIX?
|
||||||
;
|
;
|
||||||
|
|
||||||
LIT_BINARY : 'b' LIT_STR SUFFIX?;
|
LIT_BINARY : 'b' LIT_STR ;
|
||||||
LIT_BINARY_RAW : 'rb' LIT_STR_RAW SUFFIX?;
|
LIT_BINARY_RAW : 'b' LIT_STR_RAW ;
|
||||||
|
|
||||||
/* this is a bit messy */
|
/* this is a bit messy */
|
||||||
|
|
||||||
|
@ -201,13 +177,19 @@ LIFETIME : '\'' IDENT ;
|
||||||
|
|
||||||
WHITESPACE : [ \r\n\t]+ ;
|
WHITESPACE : [ \r\n\t]+ ;
|
||||||
|
|
||||||
UNDOC_COMMENT : '////' ~[\r\n]* -> type(COMMENT) ;
|
UNDOC_COMMENT : '////' ~[\n]* -> type(COMMENT) ;
|
||||||
YESDOC_COMMENT : '///' ~[\r\n]* -> type(DOC_COMMENT) ;
|
YESDOC_COMMENT : '///' ~[\r\n]* -> type(DOC_COMMENT) ;
|
||||||
OUTER_DOC_COMMENT : '//!' ~[\r\n]* -> type(DOC_COMMENT) ;
|
OUTER_DOC_COMMENT : '//!' ~[\r\n]* -> type(DOC_COMMENT) ;
|
||||||
LINE_COMMENT : '//' ~[\r\n]* -> type(COMMENT) ;
|
LINE_COMMENT : '//' ( ~[/\n] ~[\n]* )? -> type(COMMENT) ;
|
||||||
|
|
||||||
DOC_BLOCK_COMMENT
|
DOC_BLOCK_COMMENT
|
||||||
: ('/**' ~[*] | '/*!') (DOC_BLOCK_COMMENT | .)*? '*/' -> type(DOC_COMMENT)
|
: ('/**' ~[*] | '/*!') (DOC_BLOCK_COMMENT | .)*? '*/' -> type(DOC_COMMENT)
|
||||||
;
|
;
|
||||||
|
|
||||||
BLOCK_COMMENT : '/*' (BLOCK_COMMENT | .)*? '*/' -> type(COMMENT) ;
|
BLOCK_COMMENT : '/*' (BLOCK_COMMENT | .)*? '*/' -> type(COMMENT) ;
|
||||||
|
|
||||||
|
/* these appear at the beginning of a file */
|
||||||
|
|
||||||
|
SHEBANG : '#!' { is_at(2) && _input.LA(1) != '[' }? ~[\r\n]* -> type(SHEBANG) ;
|
||||||
|
|
||||||
|
UTF8_BOM : '\ufeff' { is_at(1) }? -> skip ;
|
||||||
|
|
|
@ -18,13 +18,13 @@ failed=0
|
||||||
skipped=0
|
skipped=0
|
||||||
|
|
||||||
check() {
|
check() {
|
||||||
grep --silent "// ignore-lexer-test" $1;
|
grep --silent "// ignore-lexer-test" "$1";
|
||||||
|
|
||||||
# if it's *not* found...
|
# if it's *not* found...
|
||||||
if [ $? -eq 1 ]; then
|
if [ $? -eq 1 ]; then
|
||||||
cd $2 # This `cd` is so java will pick up RustLexer.class. I couldn't
|
cd $2 # This `cd` is so java will pick up RustLexer.class. I couldn't
|
||||||
# figure out how to wrangle the CLASSPATH, just adding build/grammr didn't
|
# figure out how to wrangle the CLASSPATH, just adding build/grammar
|
||||||
# seem to have anny effect.
|
# didn't seem to have any effect.
|
||||||
if $3 RustLexer tokens -tokens < $1 | $4 $1 $5; then
|
if $3 RustLexer tokens -tokens < $1 | $4 $1 $5; then
|
||||||
echo "pass: $1"
|
echo "pass: $1"
|
||||||
passed=`expr $passed + 1`
|
passed=`expr $passed + 1`
|
||||||
|
@ -39,7 +39,7 @@ check() {
|
||||||
}
|
}
|
||||||
|
|
||||||
for file in $(find $1 -iname '*.rs' ! -path '*/test/compile-fail*'); do
|
for file in $(find $1 -iname '*.rs' ! -path '*/test/compile-fail*'); do
|
||||||
check $file $2 $3 $4 $5
|
check "$file" $2 $3 $4 $5
|
||||||
done
|
done
|
||||||
|
|
||||||
printf "\ntest result: "
|
printf "\ntest result: "
|
||||||
|
|
|
@ -8,9 +8,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(plugin)]
|
#![feature(plugin, rustc_private, str_char, collections)]
|
||||||
|
|
||||||
#![allow(unstable)]
|
|
||||||
|
|
||||||
extern crate syntax;
|
extern crate syntax;
|
||||||
extern crate rustc;
|
extern crate rustc;
|
||||||
|
@ -19,7 +17,10 @@ extern crate rustc;
|
||||||
extern crate log;
|
extern crate log;
|
||||||
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::io::File;
|
use std::env;
|
||||||
|
use std::fs::File;
|
||||||
|
use std::io::{BufRead, Read};
|
||||||
|
use std::path::Path;
|
||||||
|
|
||||||
use syntax::parse;
|
use syntax::parse;
|
||||||
use syntax::parse::lexer;
|
use syntax::parse::lexer;
|
||||||
|
@ -27,6 +28,7 @@ use rustc::session::{self, config};
|
||||||
|
|
||||||
use syntax::ast;
|
use syntax::ast;
|
||||||
use syntax::ast::Name;
|
use syntax::ast::Name;
|
||||||
|
use syntax::codemap;
|
||||||
use syntax::codemap::Pos;
|
use syntax::codemap::Pos;
|
||||||
use syntax::parse::token;
|
use syntax::parse::token;
|
||||||
use syntax::parse::lexer::TokenAndSpan;
|
use syntax::parse::lexer::TokenAndSpan;
|
||||||
|
@ -108,6 +110,7 @@ fn parse_token_list(file: &str) -> HashMap<String, token::Token> {
|
||||||
"LIT_BINARY" => token::Literal(token::Binary(Name(0)), None),
|
"LIT_BINARY" => token::Literal(token::Binary(Name(0)), None),
|
||||||
"LIT_BINARY_RAW" => token::Literal(token::BinaryRaw(Name(0), 0), None),
|
"LIT_BINARY_RAW" => token::Literal(token::BinaryRaw(Name(0), 0), None),
|
||||||
"QUESTION" => token::Question,
|
"QUESTION" => token::Question,
|
||||||
|
"SHEBANG" => token::Shebang(Name(0)),
|
||||||
_ => continue,
|
_ => continue,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -166,24 +169,26 @@ fn count(lit: &str) -> usize {
|
||||||
lit.chars().take_while(|c| *c == '#').count()
|
lit.chars().take_while(|c| *c == '#').count()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn parse_antlr_token(s: &str, tokens: &HashMap<String, token::Token>, surrogate_pairs_pos: &[usize])
|
fn parse_antlr_token(s: &str, tokens: &HashMap<String, token::Token>, surrogate_pairs_pos: &[usize],
|
||||||
|
has_bom: bool)
|
||||||
-> TokenAndSpan {
|
-> TokenAndSpan {
|
||||||
// old regex:
|
// old regex:
|
||||||
// \[@(?P<seq>\d+),(?P<start>\d+):(?P<end>\d+)='(?P<content>.+?)',<(?P<toknum>-?\d+)>,\d+:\d+]
|
// \[@(?P<seq>\d+),(?P<start>\d+):(?P<end>\d+)='(?P<content>.+?)',<(?P<toknum>-?\d+)>,\d+:\d+]
|
||||||
let start = s.find_str("[@").unwrap();
|
let start = s.find("[@").unwrap();
|
||||||
let comma = start + s[start..].find_str(",").unwrap();
|
let comma = start + s[start..].find(",").unwrap();
|
||||||
let colon = comma + s[comma..].find_str(":").unwrap();
|
let colon = comma + s[comma..].find(":").unwrap();
|
||||||
let content_start = colon + s[colon..].find_str("='").unwrap();
|
let content_start = colon + s[colon..].find("='").unwrap();
|
||||||
let content_end = content_start + s[content_start..].find_str("',<").unwrap();
|
// Use rfind instead of find, because we don't want to stop at the content
|
||||||
let toknum_end = content_end + s[content_end..].find_str(">,").unwrap();
|
let content_end = content_start + s[content_start..].rfind("',<").unwrap();
|
||||||
|
let toknum_end = content_end + s[content_end..].find(">,").unwrap();
|
||||||
|
|
||||||
let start = &s[comma + 1 .. colon];
|
let start = &s[comma + 1 .. colon];
|
||||||
let end = &s[colon + 1 .. content_start];
|
let end = &s[colon + 1 .. content_start];
|
||||||
let content = &s[content_start + 2 .. content_end];
|
let content = &s[content_start + 2 .. content_end];
|
||||||
let toknum = &s[content_end + 3 .. toknum_end];
|
let toknum = &s[content_end + 3 .. toknum_end];
|
||||||
|
|
||||||
let proto_tok = tokens.get(toknum).expect(format!("didn't find token {:?} in the map",
|
let not_found = format!("didn't find token {:?} in the map", toknum);
|
||||||
toknum));
|
let proto_tok = tokens.get(toknum).expect(¬_found[..]);
|
||||||
|
|
||||||
let nm = parse::token::intern(content);
|
let nm = parse::token::intern(content);
|
||||||
|
|
||||||
|
@ -209,24 +214,25 @@ fn parse_antlr_token(s: &str, tokens: &HashMap<String, token::Token>, surrogate_
|
||||||
ref t => t.clone()
|
ref t => t.clone()
|
||||||
};
|
};
|
||||||
|
|
||||||
let offset = if real_tok == token::Eof
|
let start_offset = if real_tok == token::Eof {
|
||||||
{
|
|
||||||
1
|
1
|
||||||
} else {
|
} else {
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut lo = start.parse::<u32>().unwrap() - offset;
|
let offset = if has_bom { 1 } else { 0 };
|
||||||
let mut hi = end.parse::<u32>().unwrap() + 1;
|
|
||||||
|
let mut lo = start.parse::<u32>().unwrap() - start_offset - offset;
|
||||||
|
let mut hi = end.parse::<u32>().unwrap() + 1 - offset;
|
||||||
|
|
||||||
// Adjust the span: For each surrogate pair already encountered, subtract one position.
|
// Adjust the span: For each surrogate pair already encountered, subtract one position.
|
||||||
lo -= surrogate_pairs_pos.binary_search(&(lo as usize)).unwrap_or_else(|x| x) as u32;
|
lo -= surrogate_pairs_pos.binary_search(&(lo as usize)).unwrap_or_else(|x| x) as u32;
|
||||||
hi -= surrogate_pairs_pos.binary_search(&(hi as usize)).unwrap_or_else(|x| x) as u32;
|
hi -= surrogate_pairs_pos.binary_search(&(hi as usize)).unwrap_or_else(|x| x) as u32;
|
||||||
|
|
||||||
let sp = syntax::codemap::Span {
|
let sp = codemap::Span {
|
||||||
lo: syntax::codemap::BytePos(lo),
|
lo: codemap::BytePos(lo),
|
||||||
hi: syntax::codemap::BytePos(hi),
|
hi: codemap::BytePos(hi),
|
||||||
expn_id: syntax::codemap::NO_EXPANSION
|
expn_id: codemap::NO_EXPANSION
|
||||||
};
|
};
|
||||||
|
|
||||||
TokenAndSpan {
|
TokenAndSpan {
|
||||||
|
@ -245,10 +251,10 @@ fn tok_cmp(a: &token::Token, b: &token::Token) -> bool {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn span_cmp(antlr_sp: syntax::codemap::Span, rust_sp: syntax::codemap::Span, cm: &syntax::codemap::CodeMap) -> bool {
|
fn span_cmp(antlr_sp: codemap::Span, rust_sp: codemap::Span, cm: &codemap::CodeMap) -> bool {
|
||||||
antlr_sp.expn_id == rust_sp.expn_id &&
|
antlr_sp.expn_id == rust_sp.expn_id &&
|
||||||
antlr_sp.lo.to_uint() == cm.bytepos_to_file_charpos(rust_sp.lo).to_uint() &&
|
antlr_sp.lo.to_usize() == cm.bytepos_to_file_charpos(rust_sp.lo).to_usize() &&
|
||||||
antlr_sp.hi.to_uint() == cm.bytepos_to_file_charpos(rust_sp.hi).to_uint()
|
antlr_sp.hi.to_usize() == cm.bytepos_to_file_charpos(rust_sp.hi).to_usize()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
@ -257,10 +263,15 @@ fn main() {
|
||||||
r.next_token()
|
r.next_token()
|
||||||
}
|
}
|
||||||
|
|
||||||
let args = std::os::args();
|
let mut args = env::args().skip(1);
|
||||||
|
let filename = args.next().unwrap();
|
||||||
|
if filename.find("parse-fail").is_some() {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Rust's lexer
|
// Rust's lexer
|
||||||
let code = File::open(&Path::new(args[1])).unwrap().read_to_string().unwrap();
|
let mut code = String::new();
|
||||||
|
File::open(&Path::new(&filename)).unwrap().read_to_string(&mut code).unwrap();
|
||||||
|
|
||||||
let surrogate_pairs_pos: Vec<usize> = code.chars().enumerate()
|
let surrogate_pairs_pos: Vec<usize> = code.chars().enumerate()
|
||||||
.filter(|&(_, c)| c as usize > 0xFFFF)
|
.filter(|&(_, c)| c as usize > 0xFFFF)
|
||||||
|
@ -269,6 +280,8 @@ fn main() {
|
||||||
.map(|(x, n)| x + n)
|
.map(|(x, n)| x + n)
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
|
let has_bom = code.starts_with("\u{feff}");
|
||||||
|
|
||||||
debug!("Pairs: {:?}", surrogate_pairs_pos);
|
debug!("Pairs: {:?}", surrogate_pairs_pos);
|
||||||
|
|
||||||
let options = config::basic_options();
|
let options = config::basic_options();
|
||||||
|
@ -281,15 +294,18 @@ fn main() {
|
||||||
let ref cm = lexer.span_diagnostic.cm;
|
let ref cm = lexer.span_diagnostic.cm;
|
||||||
|
|
||||||
// ANTLR
|
// ANTLR
|
||||||
let mut token_file = File::open(&Path::new(args[2]));
|
let mut token_file = File::open(&Path::new(&args.next().unwrap())).unwrap();
|
||||||
let token_map = parse_token_list(token_file.read_to_string().unwrap());
|
let mut token_list = String::new();
|
||||||
|
token_file.read_to_string(&mut token_list).unwrap();
|
||||||
|
let token_map = parse_token_list(&token_list[..]);
|
||||||
|
|
||||||
let mut stdin = std::io::stdin();
|
let stdin = std::io::stdin();
|
||||||
let mut lock = stdin.lock();
|
let lock = stdin.lock();
|
||||||
let lines = lock.lines();
|
let lines = lock.lines();
|
||||||
let mut antlr_tokens = lines.map(|l| parse_antlr_token(l.unwrap().trim(),
|
let antlr_tokens = lines.map(|l| parse_antlr_token(l.unwrap().trim(),
|
||||||
&token_map,
|
&token_map,
|
||||||
&surrogate_pairs_pos[]));
|
&surrogate_pairs_pos[..],
|
||||||
|
has_bom));
|
||||||
|
|
||||||
for antlr_tok in antlr_tokens {
|
for antlr_tok in antlr_tokens {
|
||||||
let rustc_tok = next(&mut lexer);
|
let rustc_tok = next(&mut lexer);
|
||||||
|
@ -314,7 +330,7 @@ fn main() {
|
||||||
}
|
}
|
||||||
_ => panic!("{:?} is not {:?}", antlr_tok, rustc_tok)
|
_ => panic!("{:?} is not {:?}", antlr_tok, rustc_tok)
|
||||||
},)*
|
},)*
|
||||||
ref c => assert!(c == &antlr_tok.tok, "{:?} is not {:?}", rustc_tok, antlr_tok)
|
ref c => assert!(c == &antlr_tok.tok, "{:?} is not {:?}", antlr_tok, rustc_tok)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,8 +7,6 @@
|
||||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
//
|
|
||||||
// ignore-lexer-test FIXME #15679
|
|
||||||
|
|
||||||
//! Utilities for formatting and printing strings
|
//! Utilities for formatting and printing strings
|
||||||
//!
|
//!
|
||||||
|
|
|
@ -7,8 +7,6 @@
|
||||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
//
|
|
||||||
// ignore-lexer-test FIXME #15679
|
|
||||||
|
|
||||||
//! Unicode string manipulation (the `str` type).
|
//! Unicode string manipulation (the `str` type).
|
||||||
//!
|
//!
|
||||||
|
|
|
@ -7,8 +7,6 @@
|
||||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
//
|
|
||||||
// ignore-lexer-test FIXME #15679
|
|
||||||
|
|
||||||
//! An owned, growable string that enforces that its contents are valid UTF-8.
|
//! An owned, growable string that enforces that its contents are valid UTF-8.
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,6 @@
|
||||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
//
|
|
||||||
// ignore-lexer-test FIXME #15883
|
|
||||||
|
|
||||||
//! An implementation of SipHash 2-4.
|
//! An implementation of SipHash 2-4.
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,6 @@
|
||||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
//
|
|
||||||
// ignore-lexer-test FIXME #15679
|
|
||||||
|
|
||||||
//! Numeric traits and functions for the built-in numeric types.
|
//! Numeric traits and functions for the built-in numeric types.
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,6 @@
|
||||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
//
|
|
||||||
// ignore-lexer-test FIXME #15679
|
|
||||||
|
|
||||||
//! String manipulation
|
//! String manipulation
|
||||||
//!
|
//!
|
||||||
|
|
|
@ -7,8 +7,6 @@
|
||||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
//
|
|
||||||
// ignore-lexer-test FIXME #15679
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_is_lowercase() {
|
fn test_is_lowercase() {
|
||||||
|
|
|
@ -7,8 +7,6 @@
|
||||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
//
|
|
||||||
// ignore-lexer-test FIXME #15677
|
|
||||||
|
|
||||||
//! Simple getopt alternative.
|
//! Simple getopt alternative.
|
||||||
//!
|
//!
|
||||||
|
|
|
@ -7,8 +7,6 @@
|
||||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
//
|
|
||||||
// ignore-lexer-test FIXME #15679
|
|
||||||
|
|
||||||
//! The Gamma and derived distributions.
|
//! The Gamma and derived distributions.
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,6 @@
|
||||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
//
|
|
||||||
// ignore-lexer-test FIXME #15679
|
|
||||||
|
|
||||||
//! Unicode-intensive string manipulations.
|
//! Unicode-intensive string manipulations.
|
||||||
//!
|
//!
|
||||||
|
|
|
@ -7,8 +7,6 @@
|
||||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
//
|
|
||||||
// ignore-lexer-test FIXME #15679
|
|
||||||
|
|
||||||
//! Hex binary-to-text encoding
|
//! Hex binary-to-text encoding
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,6 @@
|
||||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
//
|
|
||||||
// ignore-lexer-test FIXME #15679
|
|
||||||
|
|
||||||
//! Operations on ASCII strings and characters
|
//! Operations on ASCII strings and characters
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,6 @@
|
||||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
//
|
|
||||||
// ignore-lexer-test FIXME #15883
|
|
||||||
|
|
||||||
use self::Entry::*;
|
use self::Entry::*;
|
||||||
use self::SearchResult::*;
|
use self::SearchResult::*;
|
||||||
|
|
|
@ -7,8 +7,6 @@
|
||||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
//
|
|
||||||
// ignore-lexer-test FIXME #15883
|
|
||||||
|
|
||||||
use borrow::Borrow;
|
use borrow::Borrow;
|
||||||
use clone::Clone;
|
use clone::Clone;
|
||||||
|
|
|
@ -7,8 +7,6 @@
|
||||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
//
|
|
||||||
// ignore-lexer-test FIXME #15883
|
|
||||||
|
|
||||||
use self::BucketState::*;
|
use self::BucketState::*;
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,6 @@
|
||||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
//
|
|
||||||
// ignore-lexer-test FIXME #15883
|
|
||||||
|
|
||||||
//! Buffering wrappers for I/O traits
|
//! Buffering wrappers for I/O traits
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,6 @@
|
||||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
//
|
|
||||||
// ignore-lexer-test FIXME #15679
|
|
||||||
|
|
||||||
#![allow(missing_docs)]
|
#![allow(missing_docs)]
|
||||||
#![allow(deprecated)]
|
#![allow(deprecated)]
|
||||||
|
|
|
@ -7,8 +7,6 @@
|
||||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
//
|
|
||||||
// ignore-lexer-test FIXME #15677
|
|
||||||
|
|
||||||
use io::prelude::*;
|
use io::prelude::*;
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,6 @@
|
||||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
//
|
|
||||||
// ignore-lexer-test FIXME #15679
|
|
||||||
|
|
||||||
//! The CodeMap tracks all the source code used within a single crate, mapping
|
//! The CodeMap tracks all the source code used within a single crate, mapping
|
||||||
//! from integer byte positions to the original source code location. Each bit
|
//! from integer byte positions to the original source code location. Each bit
|
||||||
|
|
|
@ -7,8 +7,6 @@
|
||||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
//
|
|
||||||
// ignore-lexer-test FIXME #15679
|
|
||||||
|
|
||||||
//! This is an Earley-like parser, without support for in-grammar nonterminals,
|
//! This is an Earley-like parser, without support for in-grammar nonterminals,
|
||||||
//! only by calling out to the main rust parser for named nonterminals (which it
|
//! only by calling out to the main rust parser for named nonterminals (which it
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// ignore-lexer-test FIXME #15679
|
|
||||||
// Microbenchmarks for various functions in std and extra
|
// Microbenchmarks for various functions in std and extra
|
||||||
|
|
||||||
#![feature(rand, collections, std_misc)]
|
#![feature(rand, collections, std_misc)]
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
// This also serves as a pipes test, because Arcs are implemented with pipes.
|
// This also serves as a pipes test, because Arcs are implemented with pipes.
|
||||||
|
|
||||||
// no-pretty-expanded FIXME #15189
|
// no-pretty-expanded FIXME #15189
|
||||||
// ignore-lexer-test FIXME #15679
|
|
||||||
|
|
||||||
#![feature(std_misc)]
|
#![feature(std_misc)]
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
|
|
||||||
// Multi-language Perlin noise benchmark.
|
// Multi-language Perlin noise benchmark.
|
||||||
// See https://github.com/nsf/pnoise for timings and alternative implementations.
|
// See https://github.com/nsf/pnoise for timings and alternative implementations.
|
||||||
// ignore-lexer-test FIXME #15679
|
|
||||||
|
|
||||||
#![feature(rand, core)]
|
#![feature(rand, core)]
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
//
|
//
|
||||||
// ignore-lexer-test FIXME #15679
|
|
||||||
|
|
||||||
fn foo<
|
fn foo<
|
||||||
'β, //~ ERROR non-ascii idents are not fully supported
|
'β, //~ ERROR non-ascii idents are not fully supported
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
// ignore-tidy-cr
|
// ignore-tidy-cr
|
||||||
// ignore-tidy-tab
|
// ignore-tidy-tab
|
||||||
// pp-exact:block-comment-wchar.pp
|
// pp-exact:block-comment-wchar.pp
|
||||||
// ignore-lexer-test FIXME #15679
|
|
||||||
fn f() {
|
fn f() {
|
||||||
fn nested() {
|
fn nested() {
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
// ignore-tidy-cr
|
// ignore-tidy-cr
|
||||||
// ignore-tidy-tab
|
// ignore-tidy-tab
|
||||||
// pp-exact:block-comment-wchar.pp
|
// pp-exact:block-comment-wchar.pp
|
||||||
// ignore-lexer-test FIXME #15679
|
|
||||||
fn f() {
|
fn f() {
|
||||||
fn nested() {
|
fn nested() {
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
//
|
//
|
||||||
// ignore-lexer-test FIXME #15883
|
|
||||||
|
|
||||||
|
|
||||||
static FOO: u8 = b'\xF0';
|
static FOO: u8 = b'\xF0';
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
//
|
//
|
||||||
// ignore-lexer-test FIXME #15877
|
|
||||||
|
|
||||||
|
|
||||||
// Tests that we can call a function bounded over a supertrait from
|
// Tests that we can call a function bounded over a supertrait from
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// no-pretty-expanded unnecessary unsafe block generated
|
// no-pretty-expanded unnecessary unsafe block generated
|
||||||
// ignore-lexer-test FIXME #15679
|
|
||||||
|
|
||||||
#![deny(warnings)]
|
#![deny(warnings)]
|
||||||
#![allow(unused_must_use)]
|
#![allow(unused_must_use)]
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
//
|
//
|
||||||
// ignore-lexer-test FIXME #15877
|
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
let x = 1;
|
let x = 1;
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
//
|
//
|
||||||
// ignore-lexer-test FIXME #15877
|
|
||||||
|
|
||||||
// Tests that match expression handles overlapped literal and range
|
// Tests that match expression handles overlapped literal and range
|
||||||
// properly in the presence of guard function.
|
// properly in the presence of guard function.
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
//
|
//
|
||||||
// ignore-lexer-test FIXME #15883
|
|
||||||
|
|
||||||
#![feature(unsafe_destructor, std_misc)]
|
#![feature(unsafe_destructor, std_misc)]
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
//
|
//
|
||||||
// ignore-lexer-test FIXME #15877
|
|
||||||
|
|
||||||
|
|
||||||
trait Foo {
|
trait Foo {
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// pretty-expanded FIXME #23616
|
|
||||||
|
|
||||||
trait U { fn f(self); }
|
trait U { fn f(self); }
|
||||||
impl U for isize { fn f(self) {} }
|
impl U for isize { fn f(self) {} }
|
||||||
pub fn main() { 4.f(); }
|
pub fn main() { 4.f(); }
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
//
|
//
|
||||||
// ignore-lexer-test FIXME #15877
|
|
||||||
|
|
||||||
type FontTableTag = u32;
|
type FontTableTag = u32;
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
//
|
//
|
||||||
// ignore-lexer-test FIXME #15877
|
|
||||||
|
|
||||||
trait Fooable {
|
trait Fooable {
|
||||||
fn yes(self);
|
fn yes(self);
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
// this directory should enforce it.
|
// this directory should enforce it.
|
||||||
|
|
||||||
// ignore-pretty
|
// ignore-pretty
|
||||||
// ignore-lexer-test FIXME #15882
|
|
||||||
|
|
||||||
/// Doc comment that ends in CRLF
|
/// Doc comment that ends in CRLF
|
||||||
pub fn foo() {}
|
pub fn foo() {}
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
//
|
//
|
||||||
// ignore-lexer-test FIXME #15679
|
|
||||||
|
|
||||||
|
|
||||||
#![forbid(non_camel_case_types)]
|
#![forbid(non_camel_case_types)]
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
//
|
//
|
||||||
// ignore-lexer-test FIXME #15877
|
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
match 5_usize {
|
match 5_usize {
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
//
|
//
|
||||||
// ignore-lexer-test FIXME #15679
|
|
||||||
|
|
||||||
// Test that multibyte characters don't crash the compiler
|
// Test that multibyte characters don't crash the compiler
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
|
|
Binary file not shown.
|
@ -11,6 +11,5 @@
|
||||||
|
|
||||||
// ignore-pretty: `expand` adds some preludes before shebang
|
// ignore-pretty: `expand` adds some preludes before shebang
|
||||||
//
|
//
|
||||||
// ignore-lexer-test FIXME #15878
|
|
||||||
|
|
||||||
pub fn main() { println!("Hello World"); }
|
pub fn main() { println!("Hello World"); }
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
//
|
//
|
||||||
// ignore-lexer-test FIXME #15883
|
|
||||||
|
|
||||||
#[derive(Copy, Clone)]
|
#[derive(Copy, Clone)]
|
||||||
pub struct Quad { a: u64, b: u64, c: u64, d: u64 }
|
pub struct Quad { a: u64, b: u64, c: u64, d: u64 }
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
//
|
//
|
||||||
// ignore-lexer-test FIXME #15883
|
|
||||||
|
|
||||||
|
|
||||||
trait to_str {
|
trait to_str {
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
//
|
//
|
||||||
// ignore-lexer-test FIXME #15877
|
|
||||||
|
|
||||||
pub trait Clone2 {
|
pub trait Clone2 {
|
||||||
/// Returns a copy of the value. The contents of owned pointers
|
/// Returns a copy of the value. The contents of owned pointers
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
//
|
//
|
||||||
// ignore-lexer-test FIXME #15877
|
|
||||||
|
|
||||||
|
|
||||||
trait Cat {
|
trait Cat {
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
//
|
//
|
||||||
// ignore-lexer-test FIXME #15877
|
|
||||||
|
|
||||||
|
|
||||||
trait Cat {
|
trait Cat {
|
||||||
|
|
|
@ -10,8 +10,6 @@
|
||||||
|
|
||||||
// Test syntax checks for `?Sized` syntax.
|
// Test syntax checks for `?Sized` syntax.
|
||||||
|
|
||||||
// pretty-expanded FIXME #23616
|
|
||||||
|
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
|
|
||||||
trait T1 { }
|
trait T1 { }
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// pretty-expanded FIXME #23616
|
|
||||||
|
|
||||||
#![allow(unknown_features)]
|
#![allow(unknown_features)]
|
||||||
#![feature(box_syntax)]
|
#![feature(box_syntax)]
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
//
|
//
|
||||||
// ignore-lexer-test FIXME #15679
|
|
||||||
|
|
||||||
// This file has utf-8 BOM, it should be compiled normally without error.
|
// This file has utf-8 BOM, it should be compiled normally without error.
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
//
|
//
|
||||||
// ignore-lexer-test FIXME #15679
|
|
||||||
// no-pretty-expanded FIXME #15189
|
// no-pretty-expanded FIXME #15189
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
//
|
//
|
||||||
// ignore-lexer-test FIXME #15679
|
|
||||||
|
|
||||||
#![feature(collections, core, str_char)]
|
#![feature(collections, core, str_char)]
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
//
|
//
|
||||||
// ignore-lexer-test FIXME #15679
|
|
||||||
|
|
||||||
#![feature(non_ascii_idents)]
|
#![feature(non_ascii_idents)]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue