Skip to content

Commit 6c7a4c7

Browse files
committed
---
yaml --- r: 154078 b: refs/heads/try2 c: cbdae97 h: refs/heads/master v: v3
1 parent 20c7607 commit 6c7a4c7

File tree

35 files changed

+875
-144
lines changed

35 files changed

+875
-144
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: d0bd10b891e89cde8a1fb7c11495a8ccb051b7b5
8+
refs/heads/try2: cbdae976898f252852439239fcbcabc6b5f3e454
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/doc/guide.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2565,9 +2565,9 @@ It gives an error:
25652565

25662566
```{notrust,ignore}
25672567
Compiling modules v0.1.0 (file:/home/you/projects/modules)
2568-
src/modules.rs:2:5: 2:23 error: function `print_hello` is private
2569-
src/modules.rs:2 hello::print_hello();
2570-
^~~~~~~~~~~~~~~~~~
2568+
src/main.rs:2:5: 2:23 error: function `print_hello` is private
2569+
src/main.rs:2 hello::print_hello();
2570+
^~~~~~~~~~~~~~~~~~
25712571
```
25722572

25732573
To make it public, we use the `pub` keyword:

branches/try2/src/doc/rust.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,7 @@ production. See [tokens](#tokens) for more information.
112112

113113
## Input format
114114

115-
Rust input is interpreted as a sequence of Unicode codepoints encoded in UTF-8,
116-
normalized to Unicode normalization form NFKC.
115+
Rust input is interpreted as a sequence of Unicode codepoints encoded in UTF-8.
117116
Most Rust grammar rules are defined in terms of printable ASCII-range codepoints,
118117
but a small number are defined in terms of Unicode properties or explicit
119118
codepoint lists. [^inputformat]

branches/try2/src/etc/gedit/share/gtksourceview-3.0/language-specs/rust.lang

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
<style id="number" _name="Number" map-to="def:number"/>
2323
<style id="scope" _name="Scope" map-to="def:preprocessor"/>
2424
<style id="attribute" _name="Attribute" map-to="def:preprocessor"/>
25+
<style id="macro" _name="Macro" map-to="def:preprocessor"/>
2526
</styles>
2627

2728
<definitions>
@@ -251,6 +252,12 @@
251252
</match>
252253
</context>
253254

255+
<context id="macro" style-ref="macro">
256+
<match extended="true">
257+
\%{ident}!
258+
</match>
259+
</context>
260+
254261
<context id="lifetime" style-ref="keyword">
255262
<match extended="true">
256263
'\%{ident}
@@ -308,6 +315,7 @@
308315
<context ref="types"/>
309316
<context ref="ctypes"/>
310317
<context ref="self"/>
318+
<context ref="macro"/>
311319
<context ref="constants"/>
312320
<context ref="cconstants"/>
313321
<context ref="line-comment"/>

branches/try2/src/etc/unicode.py

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,13 +464,26 @@ def emit_charwidth_module(f, width_table):
464464
pfun=lambda x: "(%s,%s,%s,%s)" % (escape_char(x[0]), escape_char(x[1]), x[2], x[3]))
465465
f.write("}\n\n")
466466

467-
def emit_norm_module(f, canon, compat, combine):
467+
def emit_norm_module(f, canon, compat, combine, norm_props):
468468
canon_keys = canon.keys()
469469
canon_keys.sort()
470470

471471
compat_keys = compat.keys()
472472
compat_keys.sort()
473473

474+
canon_comp = {}
475+
comp_exclusions = norm_props["Full_Composition_Exclusion"]
476+
for char in canon_keys:
477+
if True in map(lambda (lo, hi): lo <= char <= hi, comp_exclusions):
478+
continue
479+
decomp = canon[char]
480+
if len(decomp) == 2:
481+
if not canon_comp.has_key(decomp[0]):
482+
canon_comp[decomp[0]] = []
483+
canon_comp[decomp[0]].append( (decomp[1], char) )
484+
canon_comp_keys = canon_comp.keys()
485+
canon_comp_keys.sort()
486+
474487
f.write("pub mod normalization {\n")
475488

476489
def mkdata_fun(table):
@@ -494,6 +507,22 @@ def f(char):
494507
emit_table(f, "compatibility_table", compat_keys, "&'static [(char, &'static [char])]",
495508
pfun=mkdata_fun(compat))
496509

510+
def comp_pfun(char):
511+
data = "(%s,&[" % escape_char(char)
512+
canon_comp[char].sort(lambda x, y: x[0] - y[0])
513+
first = True
514+
for pair in canon_comp[char]:
515+
if not first:
516+
data += ","
517+
first = False
518+
data += "(%s,%s)" % (escape_char(pair[0]), escape_char(pair[1]))
519+
data += "])"
520+
return data
521+
522+
f.write(" // Canonical compositions\n")
523+
emit_table(f, "composition_table", canon_comp_keys,
524+
"&'static [(char, &'static [(char, char)])]", pfun=comp_pfun)
525+
497526
f.write("""
498527
fn bsearch_range_value_table(c: char, r: &'static [(char, char, u8)]) -> u8 {
499528
use core::option::{Some, None};
@@ -579,6 +608,8 @@ def optimize_width_table(wtable):
579608
scripts = load_properties("Scripts.txt", [])
580609
props = load_properties("PropList.txt",
581610
["White_Space", "Join_Control", "Noncharacter_Code_Point"])
611+
norm_props = load_properties("DerivedNormalizationProps.txt",
612+
["Full_Composition_Exclusion"])
582613

583614
# grapheme cluster category from DerivedCoreProperties
584615
# the rest are defined below
@@ -612,7 +643,7 @@ def optimize_width_table(wtable):
612643
emit_regex_module(rf, allcats, perl_words)
613644

614645
# normalizations and conversions module
615-
emit_norm_module(rf, canon_decomp, compat_decomp, combines)
646+
emit_norm_module(rf, canon_decomp, compat_decomp, combines, norm_props)
616647
emit_conversions_module(rf, lowerupper, upperlower)
617648

618649
### character width module

branches/try2/src/liballoc/heap.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ mod imp {
136136
use libc::{c_char, c_int, c_void, size_t};
137137

138138
#[link(name = "jemalloc", kind = "static")]
139+
#[cfg(not(test))]
140+
extern {}
141+
139142
extern {
140143
fn je_mallocx(size: size_t, flags: c_int) -> *mut c_void;
141144
fn je_rallocx(ptr: *mut c_void, size: size_t,

0 commit comments

Comments
 (0)