Skip to content

Commit

Permalink
IA5Strings
Browse files Browse the repository at this point in the history
  • Loading branch information
usr3-1415 committed Jan 3, 2023
1 parent 4e6a707 commit bce7c8d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ RUN wget -O gnat-2021-20210519-x86_64-linux-bin https://community.download.adaco
&& git clone https://github.com/AdaCore/gnat_community_install_script.git \
&& chmod +x gnat_community_install_script/install_package.sh \
&& chmod +x gnat-2021-20210519-x86_64-linux-bin \
&& gnat_community_install_script/install_package.sh ./gnat-2021-20210519-x86_64-linux-bin /opt/GNAT/gnat-x86-2021
&& gnat_community_install_script/install_package.sh ./gnat-2021-20210519-x86_64-linux-bin /opt/GNAT/gnat-x86-2021 \
&& cd \
&& rm -rf /gnat_tmp/ \
&& sed -i 's/# alias l=/alias l=/' ~/.bashrc \
&& sed -i 's/# export LS_OPTIONS/export LS_OPTIONS/' ~/.bashrc

WORKDIR /app/

RUN rm -rf /gnat_tmp/ \
&& sed -i 's/# alias l=/alias l=/' ~/.bashrc \
&& sed -i 's/# export LS_OPTIONS/export LS_OPTIONS/' ~/.bashrc

ENV PATH="/opt/GNAT/gnat-x86-2021/bin:${PATH}"
#ENTRYPOINT ["/bin/bash"]
11 changes: 9 additions & 2 deletions FrontEndAst/CheckAsn1.fs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ let rec AreAsn1ValuesEqual (v1:Asn1Value) (v2:Asn1Value) (isOfEnumType:bool) ast
| IntegerValue(a1), RealValue(a2) -> a1.Value = BigInteger(a2.Value)
| RealValue(a1), IntegerValue(a2) -> BigInteger(a1.Value) = a2.Value
| RealValue(a1), RealValue(a2) -> a1 = a2
| StringValue(a1), StringValue(a2) -> a1 = a2
| StringValue(a1,_), StringValue(a2,_) -> a1 = a2
| BooleanValue(a1), BooleanValue(a2) -> a1 = a2
| BitStringValue(a1), BitStringValue(a2) -> a1 = a2
| OctetStringValue(a1), OctetStringValue(a2) -> a1 = a2
Expand Down Expand Up @@ -219,7 +219,14 @@ let rec IsValueAllowed (c:Asn1Constraint) (v:Asn1Value) (isOfEnumType:bool) (bit
sValue.ToCharArray() |> Seq.forall(fun c -> setvals.Contains c)
| _ -> false
| _ ->
sValue.ToCharArray() |> Seq.forall(fun c -> IsValueAllowed ac (CreateDummyValueByKind (StringValue([CStringValue (c.ToString())], emptyLocation ) )) isOfEnumType bitOrOctSrt ast)
let sDummyVal (c:char) = CreateDummyValueByKind (StringValue([CStringValue (c.ToString())], emptyLocation ) )
sValue.ToCharArray() |>
Seq.forall(fun c ->
let ret = IsValueAllowed ac (sDummyVal c) isOfEnumType bitOrOctSrt ast
if not ret then
printfn "Character '%c' is not allowed." c
ret
)
| RefValue(modName,vasName) -> IsAlphabetConstraintOK (GetBaseValue modName vasName ast) ac
| _ -> raise (BugErrorException(""))
IsAlphabetConstraintOK v ac
Expand Down
2 changes: 1 addition & 1 deletion run-local-build-using-docker-image.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
#docker build -t asn1scc .
docker run -ti --rm -v $(pwd):/app -v asn1scc_workdir:/workdir asn1scc bash -c "./local-build.sh $1"
docker run -ti --rm -v $(pwd):/app -v asn1scc_workdir:/workdir asn1scc bash -c "./local-build.sh $(git rev-parse --abbrev-ref HEAD)"

0 comments on commit bce7c8d

Please sign in to comment.