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

tangling indentation broken when using tabs #22

Open
goyalyashpal opened this issue Mar 4, 2024 · 0 comments
Open

tangling indentation broken when using tabs #22

goyalyashpal opened this issue Mar 4, 2024 · 0 comments

Comments

@goyalyashpal
Copy link

goyalyashpal commented Mar 4, 2024

mwe:

0. spaces (correct)

input (spaces)

@o src/attempt.py @{
@< att load data @>
@}

@d data schema@{
data_schema = sml.Seq(
    sml.Map({
        "ques": sml.Str(),
    })
)
@}

@d att load data @{
def load_data():
    @< data schema @>
@}

output (spaces)

def load_data():
        
    data_schema = sml.Seq(
        sml.Map({
            "ques": sml.Str(),
        })
    )

faulty ones

1. with tabs:

input (tabs):

@o test.py @{
@< att load data @>
@}

@d data schema@{
data_schema = sml.Seq(
	sml.Map({
		"ques": sml.Str(),
	})
)
@}

@d att load data @{
def load_data():
	@< data schema @>
@}

output (tabs):

notice the space before def

def load_data():
	 
 data_schema = sml.Seq(
 	sml.Map({
 		"ques": sml.Str(),
 	})
 )

Others too (with tabs):

2. -indent

@o test.py @{
@< att load data @>
@}

@d -indent data schema@{
data_schema = sml.Seq(
	sml.Map({
		"ques": sml.Str(),
	})
)
@}

@d att load data @{
def load_data():
	@< data schema @>
@}

notice the space before data_scheme & its corresponding closing parenthesis ) at same indentation

def load_data():
	 
 data_schema = sml.Seq(
 	sml.Map({
 		"ques": sml.Str(),
 	})
 )

3. -noindent

@o test.py @{
@< att load data @>
@}

@d -noindent data schema@{
data_schema = sml.Seq(
	sml.Map({
		"ques": sml.Str(),
	})
)
@}

@d att load data @{
def load_data():
	@< data schema @>
@}

$ pdm run pyweb -xw test.w 
    ...
ERROR:TextCommand:attempt to tangle a text block ('test.w', 6) 'data_schema = sml.Seq( [...]'
ERROR:TangleAction:Problems tangling outputs from WindowsPath('test.w') (tangle files are faulty).
INFO:Application:Load 0 lines from 1 files in 0.000 sec., Tangle 0 lines in 0.000 sec.
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

1 participant