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

Conditions can have spaces as block attributes, but not as phrase attributes #206

Open
0x8000-0000 opened this issue Feb 10, 2020 · 6 comments

Comments

@0x8000-0000
Copy link

This text:

$ cat tc.sam 
!annotation-lookup: case insensitive
!smart-quotes: on

example: Title

    section:(?when=some time)
        {Lorem ipsum dolor sit amet, consectetur adipiscing elit.}(?when=other time) {Cras lobortis erat leo, eu tincidunt leo efficitur vel.}(?when=always)

Is rendered to XML as:

<?xml version="1.0" encoding="UTF-8"?>
<example>
<title>Title</title>

<section conditions="when=some time">
<p><phrase>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</phrase>(?when=other time) <phrase conditions="when=always">Cras lobortis erat leo, eu tincidunt leo efficitur vel.</phrase></p>
</section>
</example>
@0x8000-0000
Copy link
Author

It seems from the language spec that the intent is to have multiple conditions, leaving it up to the semantic layer to interpret them. Which is fine, but should the semantic layer always "and" the conditions or always "or" the conditions?

How do we express that something applies to apples and oranges, and that something else does not apply to cats nor dogs?

@mbakeranalecta
Copy link
Owner

mbakeranalecta commented Feb 10, 2020 via email

@mbakeranalecta
Copy link
Owner

mbakeranalecta commented Feb 10, 2020 via email

@0x8000-0000
Copy link
Author

Really, the parser should be rewritten by some one with the skill set to write a proper recursive descent parser with full error checking. (Which would also involve a more mathematically robust specification to define what is an error, since lightweight markup by it's nature often treats broken markup as plain text.)

I was contemplating that yesterday.

@0x8000-0000
Copy link
Author

And. The intent was not to support complex conditional logic at the markup level. It causes too much grief. The intent was the language should be primarily be used for declarative semantics, not for implementing logic in the markup (which most writers do not understand). These is a fair bit in the book about this.

I understand. However... ​

How do we express that something applies to apples and oranges, and that something else does not apply to cats nor dogs?

This is a problem for my use case. I need to be able to express both situations, succinctly.

@mbakeranalecta
Copy link
Owner

mbakeranalecta commented Feb 10, 2020 via email

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