Skip to content

Commit

Permalink
Unified syntax by default (PolymerLabs#4102)
Browse files Browse the repository at this point in the history
* Switch unified syntax on by default

* Fixes for particles only used in Wasm
  • Loading branch information
Cypher1 authored Nov 21, 2019
1 parent a80b0be commit adcb1cb
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
32 changes: 16 additions & 16 deletions particles/Native/Wasm/Harness.arcs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
schema Data
Number num
Text txt
URL lnk
Boolean flg
num: Number
txt: Text
lnk: URL
flg: Boolean

resource DataResource
start
Expand All @@ -13,8 +13,8 @@ store DataStore of Data in DataResource


schema Info
Text for
Number val
for: Text
val: Number

resource InfoResource
start
Expand All @@ -27,18 +27,18 @@ store InfoStore of [Info] in InfoResource


particle TestParticle in 'test_particle.wasm'
consume root
inout Data data
out Data res
inout [Info] info
root: consumes Slot
data: reads writes Data
res: writes Data
info: reads writes [Info]

recipe KotlinTestRecipe
copy DataStore as h1
create as h2
copy InfoStore as h3
h1: copy DataStore
h2: create
h3: copy InfoStore
TestParticle
data <- h1
res -> h2
info = h3
data: reads h1
res: writes h2
info: h3

description `Wasm Test Harness`
2 changes: 1 addition & 1 deletion src/runtime/flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class FlagDefaults {
static parseBothSyntaxes = true;
// Use pre slandles syntax for parsing and toString by default.
// If parseBothSyntaxes is off, this will set which syntax is enabled.
static defaultToPreSlandlesSyntax = true;
static defaultToPreSlandlesSyntax = false;
}

export class Flags extends FlagDefaults {
Expand Down
3 changes: 2 additions & 1 deletion src/runtime/manifest-parser.peg
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ Manifest
});
checkNormal(result);
if (preSlandlesSyntaxLocations.length > 0 && !Flags.defaultToPreSlandlesSyntax) {
if (typeof global !== 'undefined' && !global['testFlags'].quiet) {
const hasTestFlags = typeof global !== 'undefined' && global['testFlags'];
if (!hasTestFlags || !global['testFlags'].quiet) {
console.warn('WARNING: Pre-Slandles Syntax is deprecated. Contact [email protected] for more information.');
console.warn(`WARNING: Used in \n ${
preSlandlesSyntaxLocations.map(loc => `line ${loc.start.line} column ${loc.start.column}`).join("\n ")
Expand Down

0 comments on commit adcb1cb

Please sign in to comment.