mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-19 21:19:31 +02:00
[PATCH 141/188] parsing offset and align
From 828b36f3bc1b812aef0edde11a10e914a5432feb Mon Sep 17 00:00:00 2001 From: Dmitry Boyarintsev <skalogryz.lists@gmail.com> Date: Wed, 25 Mar 2020 10:43:19 -0400 git-svn-id: branches/wasm@46137 -
This commit is contained in:
parent
f6c2e6d8b8
commit
e31e57ceb1
@ -77,7 +77,8 @@ type
|
||||
operandIdx : string;
|
||||
operandNum : integer; // for "call_indirect" this is table index
|
||||
// for "if", "loop", "block" - it's type
|
||||
operandText : string;
|
||||
operandText : string; // it's "offset" for load operations
|
||||
operandText2: string; // it's "align" for load operations
|
||||
insttype : TWasmFuncType; // used by call_indirect only
|
||||
|
||||
jumplabel : string; // the label is used only for "loop", "block" and "if"
|
||||
|
@ -30,7 +30,7 @@ const
|
||||
'f32', 'f64',
|
||||
'type',
|
||||
'import', 'global', 'table', 'memory', 'local', 'export',
|
||||
'elem', 'data', 'offset','align'
|
||||
'elem', 'data', 'offset','align','='
|
||||
);
|
||||
|
||||
WasmTypeTokens = [wei32, wei64, wef32, wef64];
|
||||
@ -261,6 +261,23 @@ begin
|
||||
ipLeb:
|
||||
ParseNumOrIdx(sc, ci.operandNum, ci.operandIdx);
|
||||
|
||||
ipOfsAlign: begin
|
||||
if sc.token = weOffset then begin
|
||||
sc.Next;
|
||||
ConsumeToken(sc, weEqual);
|
||||
if sc.token<>weNumber then ErrorExpectButFound(sc, 'number');
|
||||
ci.operandText := sc.resText;
|
||||
sc.Next;
|
||||
end;
|
||||
if sc.token = weAlign then begin
|
||||
sc.Next;
|
||||
ConsumeToken(sc, weEqual);
|
||||
if sc.token<>weNumber then ErrorExpectButFound(sc, 'number');
|
||||
ci.operandText2 := sc.resText;
|
||||
sc.Next;
|
||||
end;
|
||||
end;
|
||||
|
||||
ipi32,ipi64,ipf32,ipf64,ipi32OrFunc:
|
||||
begin
|
||||
if (INST_FLAGS[ci.code].Param = ipi32OrFunc) and (sc.token = weIdent) then
|
||||
|
Loading…
Reference in New Issue
Block a user