Skip to content

Commit

Permalink
Update syntax for memory and variable instructions.
Browse files Browse the repository at this point in the history
  • Loading branch information
whitequark committed Feb 24, 2023
1 parent ab69ecd commit 6e75655
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions wast.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ variables:
INTERG: '[+-]?(?:0x{{HEXNUM}}|{{DECNUM}}){{IDTERM}}'
INTERO: 'i32\.(?:reinterpret_f32|trunc_f(?:32|64)_[su]|wrap_i64)|i64\.(?:extend_i32_[su]|trunc_f(?:32|64)_[su]|reinterpret[/_]f64)'
MEMOPS: '(?:f(?:32|64)\.(?:load|store)|i(?:32|64)\.(?:load(?:(?:8_|16_)[su])?|store(?:8|16)?)|i64\.(?:load32_[su]|store32)){{IDTERM}}'
MEMOP2: '(memory\.(?:grow|size)|grow_memory|current_memory){{IDTERM}}'
MEMOP2: 'memory\.(?:grow|size){{IDTERM}}'
NCONST: '[fi](?:32|64)\.const{{IDTERM}}'
NUMOPS: '(?:{{FLOATC}}|{{FLOATO}}|{{INTERC}}|{{INTERO}}){{IDTERM}}'
STARTS: '(\(){{WHITES}}*(start){{IDTERM}}'
UINTER: '(?:0x{{HEXNUM}}|{{DECNUM}}){{IDTERM}}'
VALTYP: '[fi](?:32|64){{IDTERM}}'
VAROPS: '(?:[gs]et_(?:glob|loc)al|tee_local)|(?:(?:global|local)\.(?:get|set))|(?:local\.tee){{IDTERM}}'
VAROPS: '(?:(?:global|local)\.(?:get|set))|(?:local\.tee){{IDTERM}}'
WHITES: '[ \n\r\t]'

contexts:
Expand Down Expand Up @@ -80,7 +80,7 @@ contexts:
push: comment_block
constant_expression:
# This is a narrow subset of "expression" permitting only one "constant" or
# "get_global" instruction. There are a few places where the grammar
# "global.get" instruction. There are a few places where the grammar
# indicates "expression" but where this constraint is then enforced at a
# higher level. For simplicity I’ve added this artificial production; even
# though the constraint it describes is technically not syntactic, it
Expand All @@ -97,7 +97,7 @@ contexts:
- - include: constant_expression_instr
- include: constant_expression_instr
constant_expression_instr:
- match: 'get_global{{IDTERM}}'
- match: 'global.get{{IDTERM}}'
scope: support.function.variable.wast
set: reference
- match: '{{NCONST}}'
Expand Down

0 comments on commit 6e75655

Please sign in to comment.