Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difference between foo and #foo in VerSec language? #5

Closed
Pesa opened this issue Sep 22, 2021 · 1 comment
Closed

Difference between foo and #foo in VerSec language? #5

Pesa opened this issue Sep 22, 2021 · 1 comment

Comments

@Pesa
Copy link

Pesa commented Sep 22, 2021

I don't understand the difference between a "regular" identifier (foo) and an identifier prefixed by the # sign (#foo). Could this be explained in the language description document?

@yoursunny
Copy link

yoursunny commented Mar 27, 2022

I tested schemaCompile v5.1.0-1-gab45368 with the following schema:

_site: "a"/"blog"
root: _site/_KEY
article: _site/"article"/category/year/month <= author
admin: _site/"admin"/adminName/_KEY <= root
author: _site/_role/authorName/_KEY & { _role: "author" } <= admin
_KEY: "KEY"/_/_/_

The debug output (with two -v flags) is:

VerSec Schema Compiler Copyright (C) 2020 Pollere Inc., v5.1.0-1-gab45368
Certificate templates:

0 strings, 0 bytes (0 overlaps, 0 bytes in stab)
binary schema  is 20 bytes

Changing article to #article, and then the debug output becomes:

VerSec Schema Compiler Copyright (C) 2020 Pollere Inc., v5.1.0-1-gab45368
Publication #article:
  parameters: category year month
  tags: /"a"/"blog"/"article"/category/year/month
  signing chains:
    chain 0: #article <= author <= admin <= root
  templates:
    /"a"/"blog"/"article"/category/year/month { author }
      [ * ]

Certificate templates:
  cert author: /"a"/"blog"/_role/authorName/"KEY"/_/_/_
  cert admin: /"a"/"blog"/"admin"/adminName/"KEY"/_/_/_
  cert root: /"a"/"blog"/"KEY"/_/_/_

12 strings, 69 bytes (3 overlaps, 56 bytes in stab)
binary schema  is 165 bytes

Changing author to #author (in two places), and the compiler crashes.

Based on the above observations:

  • foo denotes a certificate template.
  • #foo denotes a publication.

@Pesa Pesa closed this as not planned Won't fix, can't repro, duplicate, stale Oct 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants